Skip to content

Commit d76a651

Browse files
committed
Different DataDescriptions for TOF-TPC and TOF-Global match outputs
1 parent 70f8320 commit d76a651

File tree

10 files changed

+77
-60
lines changed

10 files changed

+77
-60
lines changed

Detectors/GlobalTrackingWorkflow/tofworkflow/include/TOFWorkflow/CalibInfoReaderSpec.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace tof
3131
class CalibInfoReader : public Task
3232
{
3333
public:
34-
CalibInfoReader(int instance, int ninstances, const char* filename) : mInstance(instance), mNinstances(ninstances), mFileName(filename) {}
34+
CalibInfoReader(int instance, int ninstances, const char* filename, bool toftpc = false) : mInstance(instance), mNinstances(ninstances), mFileName(filename), mTOFTPC(toftpc) {}
3535
~CalibInfoReader() override = default;
3636
void init(InitContext& ic) final;
3737
void run(ProcessingContext& pc) final;
@@ -43,14 +43,15 @@ class CalibInfoReader : public Task
4343
const char* mFileName = nullptr;
4444
FILE* mFile = nullptr;
4545
TTree* mTree = nullptr;
46+
bool mTOFTPC = false;
4647
int mCurrentEntry = 0;
4748
int mGlobalEntry = 0;
4849
std::vector<o2::dataformats::CalibInfoTOF> mVect, *mPvect = &mVect;
4950
};
5051

5152
/// create a processor spec
5253
/// read simulated TOF digits from a root file
53-
framework::DataProcessorSpec getCalibInfoReaderSpec(int instance, int ninstances, const char* filename);
54+
framework::DataProcessorSpec getCalibInfoReaderSpec(int instance, int ninstances, const char* filename, bool toftpc = false);
5455

5556
} // namespace tof
5657
} // namespace o2

Detectors/GlobalTrackingWorkflow/tofworkflow/include/TOFWorkflow/TOFCalibWriterSpec.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace tof
2424

2525
/// create a processor spec
2626
/// write TOF calbi info in a root file
27-
o2::framework::DataProcessorSpec getTOFCalibWriterSpec(const char* outdef = "o2calib_tof.root");
27+
o2::framework::DataProcessorSpec getTOFCalibWriterSpec(const char* outdef = "o2calib_tof.root", bool toftpc = false);
2828

2929
} // namespace tof
3030
} // namespace o2

Detectors/GlobalTrackingWorkflow/tofworkflow/src/CalibInfoReaderSpec.cxx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ namespace o2
2929
namespace tof
3030
{
3131

32+
constexpr o2::header::DataDescription ddCalib{"CALIBDATA"}, ddCalib_tpc{"CALIBDATA_TPC"};
33+
3234
void CalibInfoReader::init(InitContext& ic)
3335
{
3436
LOG(INFO) << "Init CalibInfo reader!";
@@ -59,7 +61,7 @@ void CalibInfoReader::run(ProcessingContext& pc)
5961
if ((mGlobalEntry % mNinstances) == mInstance) {
6062
mTree->GetEvent(mCurrentEntry);
6163
LOG(INFO) << "Send " << mVect.size() << " calib infos";
62-
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "CALIBDATA", 0, Lifetime::Timeframe}, mVect);
64+
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, mTOFTPC ? ddCalib_tpc : ddCalib, 0, Lifetime::Timeframe}, mVect);
6365
usleep(10000);
6466
}
6567
mGlobalEntry++;
@@ -71,16 +73,17 @@ void CalibInfoReader::run(ProcessingContext& pc)
7173
return;
7274
}
7375

74-
DataProcessorSpec getCalibInfoReaderSpec(int instance, int ninstances, const char* filename)
76+
DataProcessorSpec getCalibInfoReaderSpec(int instance, int ninstances, const char* filename, bool toftpc)
7577
{
7678
std::vector<OutputSpec> outputs;
77-
outputs.emplace_back(o2::header::gDataOriginTOF, "CALIBDATA", 0, Lifetime::Timeframe);
79+
outputs.emplace_back(o2::header::gDataOriginTOF, toftpc ? ddCalib_tpc : ddCalib, 0, Lifetime::Timeframe);
7880

79-
const char* nameSpec;
80-
if (ninstances == 1) {
81-
nameSpec = "tof-calibinfo-reader";
82-
} else {
83-
nameSpec = Form("tof-calibinfo-reader-%d", instance);
81+
std::string nameSpec = "tof-calibinfo-reader";
82+
if (toftpc) {
83+
nameSpec += "-tpc";
84+
}
85+
if (ninstances > 1) {
86+
nameSpec += fmt::format("-{:d}", instance);
8487
}
8588

8689
return DataProcessorSpec{

Detectors/GlobalTrackingWorkflow/tofworkflow/src/RecoWorkflowSpec.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ class TOFDPLRecoWorkflowTask
123123
// send matching-info
124124
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MATCHINFOS", 0, Lifetime::Timeframe}, mMatcher.getMatchedTrackVector());
125125
if (mUseMC) {
126-
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MATCHTOFINFOSMC", 0, Lifetime::Timeframe}, mMatcher.getMatchedTOFLabelsVector());
127-
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MATCHTPCINFOSMC", 0, Lifetime::Timeframe}, mMatcher.getMatchedTPCLabelsVector());
128-
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MATCHITSINFOSMC", 0, Lifetime::Timeframe}, mMatcher.getMatchedITSLabelsVector());
126+
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MCMATCHTOF", 0, Lifetime::Timeframe}, mMatcher.getMatchedTOFLabelsVector());
127+
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MCMATCHTPC", 0, Lifetime::Timeframe}, mMatcher.getMatchedTPCLabelsVector());
128+
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MCMATCHITS", 0, Lifetime::Timeframe}, mMatcher.getMatchedITSLabelsVector());
129129
}
130130
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "CALIBDATA", 0, Lifetime::Timeframe}, mMatcher.getCalibVector());
131131
mTimer.Stop();
@@ -160,9 +160,9 @@ o2::framework::DataProcessorSpec getTOFRecoWorkflowSpec(bool useMC, bool useFIT)
160160

161161
outputs.emplace_back(o2::header::gDataOriginTOF, "MATCHINFOS", 0, Lifetime::Timeframe);
162162
if (useMC) {
163-
outputs.emplace_back(o2::header::gDataOriginTOF, "MATCHTOFINFOSMC", 0, Lifetime::Timeframe);
164-
outputs.emplace_back(o2::header::gDataOriginTOF, "MATCHTPCINFOSMC", 0, Lifetime::Timeframe);
165-
outputs.emplace_back(o2::header::gDataOriginTOF, "MATCHITSINFOSMC", 0, Lifetime::Timeframe);
163+
outputs.emplace_back(o2::header::gDataOriginTOF, "MCMATCHTOF", 0, Lifetime::Timeframe);
164+
outputs.emplace_back(o2::header::gDataOriginTOF, "MCMATCHTPC", 0, Lifetime::Timeframe);
165+
outputs.emplace_back(o2::header::gDataOriginTOF, "MCMATCHITS", 0, Lifetime::Timeframe);
166166
}
167167
outputs.emplace_back(o2::header::gDataOriginTOF, "CALIBDATA", 0, Lifetime::Timeframe);
168168

Detectors/GlobalTrackingWorkflow/tofworkflow/src/RecoWorkflowWithTPCSpec.cxx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,13 @@ class TOFDPLRecoWorkflowWithTPCTask
123123
// << " DIGITS TO " << mClustersArray.size() << " CLUSTERS";
124124

125125
// send matching-info
126-
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MATCHINFOS", 0, Lifetime::Timeframe}, mMatcher.getMatchedTrackVector());
126+
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MATCHINFOS_TPC", 0, Lifetime::Timeframe}, mMatcher.getMatchedTrackVector());
127127
if (mUseMC) {
128-
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MATCHTOFINFOSMC", 0, Lifetime::Timeframe}, mMatcher.getMatchedTOFLabelsVector());
129-
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MATCHTPCINFOSMC", 0, Lifetime::Timeframe}, mMatcher.getMatchedTPCLabelsVector());
130-
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MATCHITSINFOSMC", 0, Lifetime::Timeframe}, mMatcher.getMatchedITSLabelsVector());
128+
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MCMATCHTOF_TPC", 0, Lifetime::Timeframe}, mMatcher.getMatchedTOFLabelsVector());
129+
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MCMATCHTPC_TPC", 0, Lifetime::Timeframe}, mMatcher.getMatchedTPCLabelsVector());
130+
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MCMATCHITS_TPC", 0, Lifetime::Timeframe}, mMatcher.getMatchedITSLabelsVector());
131131
}
132-
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "CALIBDATA", 0, Lifetime::Timeframe}, mMatcher.getCalibVector());
132+
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "CALIBDATA_TPC", 0, Lifetime::Timeframe}, mMatcher.getCalibVector());
133133
mTimer.Stop();
134134
}
135135

@@ -164,15 +164,15 @@ o2::framework::DataProcessorSpec getTOFRecoWorkflowWithTPCSpec(bool useMC, bool
164164
inputs.emplace_back("fitrecpoints", o2::header::gDataOriginFT0, "RECPOINTS", 0, Lifetime::Timeframe);
165165
}
166166

167-
outputs.emplace_back(o2::header::gDataOriginTOF, "MATCHINFOS", 0, Lifetime::Timeframe);
168-
outputs.emplace_back(OutputLabel{"tpctofTracks"}, o2::header::gDataOriginTOF, "TPCTOFTRACKS", 0, Lifetime::Timeframe);
167+
outputs.emplace_back(o2::header::gDataOriginTOF, "MATCHINFOS_TPC", 0, Lifetime::Timeframe);
168+
outputs.emplace_back(OutputLabel{"tpctofTracks"}, o2::header::gDataOriginTOF, "TOFTRACKS_TPC", 0, Lifetime::Timeframe);
169169

170170
if (useMC) {
171-
outputs.emplace_back(o2::header::gDataOriginTOF, "MATCHTOFINFOSMC", 0, Lifetime::Timeframe);
172-
outputs.emplace_back(o2::header::gDataOriginTOF, "MATCHTPCINFOSMC", 0, Lifetime::Timeframe);
173-
outputs.emplace_back(o2::header::gDataOriginTOF, "MATCHITSINFOSMC", 0, Lifetime::Timeframe);
171+
outputs.emplace_back(o2::header::gDataOriginTOF, "MCMATCHTOF_TPC", 0, Lifetime::Timeframe);
172+
outputs.emplace_back(o2::header::gDataOriginTOF, "MCMATCHTPC_TPC", 0, Lifetime::Timeframe);
173+
outputs.emplace_back(o2::header::gDataOriginTOF, "MCMATCHITS_TPC", 0, Lifetime::Timeframe);
174174
}
175-
outputs.emplace_back(o2::header::gDataOriginTOF, "CALIBDATA", 0, Lifetime::Timeframe);
175+
outputs.emplace_back(o2::header::gDataOriginTOF, "CALIBDATA_TPC", 0, Lifetime::Timeframe);
176176

177177
return DataProcessorSpec{
178178
"TOFRecoWorkflowWithTPC",

Detectors/GlobalTrackingWorkflow/tofworkflow/src/TOFCalibWriterSpec.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,17 @@ namespace tof
3434
template <typename T>
3535
using BranchDefinition = MakeRootTreeWriterSpec::BranchDefinition<T>;
3636
using CalibInfosType = std::vector<o2::dataformats::CalibInfoTOF>;
37-
DataProcessorSpec getTOFCalibWriterSpec(const char* outdef)
37+
DataProcessorSpec getTOFCalibWriterSpec(const char* outdef, bool toftpc)
3838
{
3939
// A spectator for logging
4040
auto logger = [](CalibInfosType const& indata) {
4141
LOG(INFO) << "RECEIVED MATCHED SIZE " << indata.size();
4242
};
43+
o2::header::DataDescription ddCalib{"CALIBDATA"}, ddCalib_tpc{"CALIBDATA_TPC"};
4344
return MakeRootTreeWriterSpec("TOFCalibWriter",
4445
outdef,
4546
"calibTOF",
46-
BranchDefinition<CalibInfosType>{InputSpec{"input", o2::header::gDataOriginTOF, "CALIBDATA", 0},
47+
BranchDefinition<CalibInfosType>{InputSpec{"input", o2::header::gDataOriginTOF, toftpc ? ddCalib_tpc : ddCalib, 0},
4748
"TOFCalibInfo",
4849
"calibinfo-branch-name",
4950
1,

Detectors/GlobalTrackingWorkflow/tofworkflow/src/TOFMatchedReaderSpec.cxx

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,18 @@
2222
#include "SimulationDataFormat/MCCompLabel.h"
2323
#include "SimulationDataFormat/MCTruthContainer.h"
2424
#include "ReconstructionDataFormats/MatchInfoTOF.h"
25+
#include "CommonUtils/StringUtils.h"
2526

2627
using namespace o2::framework;
2728

2829
namespace o2
2930
{
3031
namespace tof
3132
{
33+
o2::header::DataDescription ddMatchInfo{"MATCHINFOS"}, ddMatchInfo_tpc{"MATCHINFOS_TPC"},
34+
ddMCMatchTOF{"MCMATCHTOF"}, ddMCMatchTOF_tpc{"MCMATCHTOF_TPC"},
35+
ddMCMatchTPC{"MCMATCHTPC"}, ddMCMatchTPC_tpc{"MCMATCHTPC_TPC"},
36+
ddMCMatchITS{"MCMATCHITS"}, ddMCMatchITS_tpc{"MCMATCHITS_TPC"};
3237

3338
void TOFMatchedReader::init(InitContext& ic)
3439
{
@@ -51,7 +56,7 @@ void TOFMatchedReader::connectTree(const std::string& filename)
5156
if (!mTree->GetBranch("TPCTOFTracks")) {
5257
throw std::runtime_error("TPC-TOF tracks are requested but not found in the tree");
5358
}
54-
mTree->SetBranchAddress("TPCTOFTracks", &mMatchesPtr);
59+
mTree->SetBranchAddress("TPCTOFTracks", &mTracksPtr);
5560
}
5661
if (mUseMC) {
5762
mTree->SetBranchAddress("MatchTOFMCTruth", &mLabelTOFPtr);
@@ -68,14 +73,14 @@ void TOFMatchedReader::run(ProcessingContext& pc)
6873
mTree->GetEntry(currEntry);
6974
LOG(INFO) << "Pushing " << mMatches.size() << " TOF matchings at entry " << currEntry;
7075

71-
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MATCHINFOS", 0, Lifetime::Timeframe}, mMatches);
72-
if (mReadTracks) {
73-
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "TPCTOFTRACKS", 0, Lifetime::Timeframe}, mTracks);
76+
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, mTPCMatch ? ddMatchInfo_tpc : ddMatchInfo, 0, Lifetime::Timeframe}, mMatches);
77+
if (mReadTracks && mTPCMatch) {
78+
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "TOFTRACKS_TPC", 0, Lifetime::Timeframe}, mTracks);
7479
}
7580
if (mUseMC) {
76-
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MATCHTOFINFOSMC", 0, Lifetime::Timeframe}, mLabelTOF);
77-
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MATCHTPCINFOSMC", 0, Lifetime::Timeframe}, mLabelTPC);
78-
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "MATCHITSINFOSMC", 0, Lifetime::Timeframe}, mLabelITS);
81+
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, mTPCMatch ? ddMCMatchTOF_tpc : ddMCMatchTOF, 0, Lifetime::Timeframe}, mLabelTOF);
82+
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, mTPCMatch ? ddMCMatchTPC_tpc : ddMCMatchTPC, 0, Lifetime::Timeframe}, mLabelTPC);
83+
pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, mTPCMatch ? ddMCMatchITS_tpc : ddMCMatchITS, 0, Lifetime::Timeframe}, mLabelITS);
7984
}
8085

8186
if (mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
@@ -84,26 +89,27 @@ void TOFMatchedReader::run(ProcessingContext& pc)
8489
}
8590
}
8691

87-
DataProcessorSpec getTOFMatchedReaderSpec(bool useMC, bool readTracks)
92+
DataProcessorSpec getTOFMatchedReaderSpec(bool useMC, bool tpcmatch, bool readTracks)
8893
{
8994
std::vector<OutputSpec> outputs;
90-
outputs.emplace_back(o2::header::gDataOriginTOF, "MATCHINFOS", 0, Lifetime::Timeframe);
91-
if (readTracks) {
92-
outputs.emplace_back(o2::header::gDataOriginTOF, "TPCTOFTRACKS", 0, Lifetime::Timeframe);
95+
96+
outputs.emplace_back(o2::header::gDataOriginTOF, tpcmatch ? ddMatchInfo_tpc : ddMatchInfo, 0, Lifetime::Timeframe);
97+
if (tpcmatch && readTracks) {
98+
outputs.emplace_back(o2::header::gDataOriginTOF, "TOFTRACKS_TPC", 0, Lifetime::Timeframe);
9399
}
94100
if (useMC) {
95-
outputs.emplace_back(o2::header::gDataOriginTOF, "MATCHTOFINFOSMC", 0, Lifetime::Timeframe);
96-
outputs.emplace_back(o2::header::gDataOriginTOF, "MATCHTPCINFOSMC", 0, Lifetime::Timeframe);
97-
outputs.emplace_back(o2::header::gDataOriginTOF, "MATCHITSINFOSMC", 0, Lifetime::Timeframe);
101+
outputs.emplace_back(o2::header::gDataOriginTOF, tpcmatch ? ddMCMatchTOF_tpc : ddMCMatchTOF, 0, Lifetime::Timeframe);
102+
outputs.emplace_back(o2::header::gDataOriginTOF, tpcmatch ? ddMCMatchTPC_tpc : ddMCMatchTPC, 0, Lifetime::Timeframe);
103+
outputs.emplace_back(o2::header::gDataOriginTOF, tpcmatch ? ddMCMatchITS_tpc : ddMCMatchITS, 0, Lifetime::Timeframe);
98104
}
99105

100106
return DataProcessorSpec{
101-
"TOFMatchedReader",
107+
o2::utils::concat_string("TOFMatchedReader_", tpcmatch ? "tpc" : "glo"),
102108
Inputs{},
103109
outputs,
104-
AlgorithmSpec{adaptFromTask<TOFMatchedReader>(useMC, readTracks)},
110+
AlgorithmSpec{adaptFromTask<TOFMatchedReader>(useMC, tpcmatch, readTracks)},
105111
Options{
106-
{"tof-matched-infile", VariantType::String, "o2match_tof.root", {"Name of the input file"}},
112+
{"tof-matched-infile", VariantType::String, tpcmatch ? "o2match_toftpc.root" : "o2match_tof.root", {"Name of the input file"}},
107113
{"treename", VariantType::String, "matchTOF", {"Name of top-level TTree"}},
108114
}};
109115
}

Detectors/GlobalTrackingWorkflow/tofworkflow/src/TOFMatchedWriterSpec.cxx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ using TrackInfo = std::vector<o2::dataformats::TrackTPCTOF>;
3737
using LabelsType = std::vector<o2::MCCompLabel>;
3838
using namespace o2::header;
3939

40-
DataProcessorSpec getTOFMatchedWriterSpec(bool useMC, const char* outdef, bool writeTracks)
40+
DataProcessorSpec getTOFMatchedWriterSpec(bool useMC, const char* outdef, bool writeTOFTPC)
4141
{
4242
// spectators for logging
4343
auto loggerMatched = [](MatchInfo const& indata) {
@@ -55,30 +55,34 @@ DataProcessorSpec getTOFMatchedWriterSpec(bool useMC, const char* outdef, bool w
5555
// TODO: there was a comment in the original implementation:
5656
// RS why do we need to repeat ITS/TPC labels ?
5757
// They can be extracted from TPC-ITS matches
58+
o2::header::DataDescription ddMatchInfo{"MATCHINFOS"}, ddMatchInfo_tpc{"MATCHINFOS_TPC"},
59+
ddMCMatchTOF{"MCMATCHTOF"}, ddMCMatchTOF_tpc{"MCMATCHTOF_TPC"},
60+
ddMCMatchTPC{"MCMATCHTPC"}, ddMCMatchTPC_tpc{"MCMATCHTPC_TPC"},
61+
ddMCMatchITS{"MCMATCHITS"}, ddMCMatchITS_tpc{"MCMATCHITS_TPC"};
5862

59-
return MakeRootTreeWriterSpec("TOFMatchedWriter",
63+
return MakeRootTreeWriterSpec(writeTOFTPC ? "TOFMatchedWriter_TPC" : "TOFMatchedWriter",
6064
outdef,
6165
"matchTOF",
62-
BranchDefinition<MatchInfo>{InputSpec{"tofmatching", gDataOriginTOF, "MATCHINFOS", 0},
66+
BranchDefinition<MatchInfo>{InputSpec{"tofmatching", gDataOriginTOF, writeTOFTPC ? ddMatchInfo_tpc : ddMatchInfo, 0},
6367
"TOFMatchInfo",
6468
"TOFMatchInfo-branch-name",
6569
1,
6670
loggerMatched},
67-
BranchDefinition<TrackInfo>{InputSpec{"tpctofTracks", gDataOriginTOF, "TPCTOFTRACKS", 0},
71+
BranchDefinition<TrackInfo>{InputSpec{"tpctofTracks", gDataOriginTOF, "TOFTRACKS_TPC", 0},
6872
"TPCTOFTracks",
6973
"TPCTOFTracks-branch-name",
70-
writeTracks},
71-
BranchDefinition<LabelsType>{InputSpec{"matchtoflabels", gDataOriginTOF, "MATCHTOFINFOSMC", 0},
74+
writeTOFTPC},
75+
BranchDefinition<LabelsType>{InputSpec{"matchtoflabels", gDataOriginTOF, writeTOFTPC ? ddMCMatchTOF_tpc : ddMCMatchTOF, 0},
7276
"MatchTOFMCTruth",
7377
"MatchTOFMCTruth-branch-name",
7478
(useMC ? 1 : 0), // one branch if mc labels enabled
7579
loggerTofLabels},
76-
BranchDefinition<LabelsType>{InputSpec{"matchtpclabels", gDataOriginTOF, "MATCHTPCINFOSMC", 0},
80+
BranchDefinition<LabelsType>{InputSpec{"matchtpclabels", gDataOriginTOF, writeTOFTPC ? ddMCMatchTPC_tpc : ddMCMatchTPC, 0},
7781
"MatchTPCMCTruth",
7882
"MatchTPCMCTruth-branch-name",
7983
(useMC ? 1 : 0), // one branch if mc labels enabled
8084
loggerTpcLabels},
81-
BranchDefinition<LabelsType>{InputSpec{"matchitslabels", gDataOriginTOF, "MATCHITSINFOSMC", 0},
85+
BranchDefinition<LabelsType>{InputSpec{"matchitslabels", gDataOriginTOF, writeTOFTPC ? ddMCMatchITS_tpc : ddMCMatchITS, 0},
8286
"MatchITSMCTruth",
8387
"MatchITSMCTruth-branch-name",
8488
(useMC ? 1 : 0), // one branch if mc labels enabled

Detectors/GlobalTrackingWorkflow/tofworkflow/src/tof-calibinfo-reader.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
3434
{
3535
workflowOptions.push_back(ConfigParamSpec{"collection-infile", o2::framework::VariantType::String, "list-calibfile", {"Name of the collection input file"}});
3636
workflowOptions.push_back(ConfigParamSpec{"ninstances", o2::framework::VariantType::Int, 1, {"Number of reader instances"}});
37+
workflowOptions.push_back(ConfigParamSpec{"tpc-matches", o2::framework::VariantType::Bool, false, {"Made from TOF-TPC matches"}});
3738
workflowOptions.push_back(ConfigParamSpec{"configKeyValues", o2::framework::VariantType::String, "", {"Semicolon separated key=value strings ..."}});
3839
}
3940

@@ -65,6 +66,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
6566

6667
int ninstances = cfgc.options().get<int>("ninstances");
6768
auto listname = cfgc.options().get<std::string>("collection-infile");
69+
auto toftpc = cfgc.options().get<bool>("tpc-matches");
6870

6971
char* stringTBP = new char[listname.size()];
7072
sprintf(stringTBP, "%s", listname.c_str());
@@ -74,7 +76,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
7476
// std::vector<int> laneConfiguration = tofSectors;
7577

7678
for (int i = 0; i < ninstances; i++) {
77-
specs.emplace_back(o2::tof::getCalibInfoReaderSpec(i, ninstances, stringTBP));
79+
specs.emplace_back(o2::tof::getCalibInfoReaderSpec(i, ninstances, stringTBP, toftpc));
7880
}
7981

8082
LOG(INFO) << "Number of active devices = " << specs.size();

0 commit comments

Comments
 (0)