Skip to content

Commit 423a43b

Browse files
committed
ITSMFT: ensure backward comptability for MC2ROF
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 8a51b17 commit 423a43b

7 files changed

Lines changed: 28 additions & 1 deletion

File tree

Detectors/ITSMFT/common/workflow/src/ClusterReaderSpec.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ void ClusterReader<N>::run(ProcessingContext& pc)
6969
}
7070
if (mUseMC) {
7171
pc.outputs().snapshot(Output{Origin, "CLUSTERSMCTR", iLayer}, *mClusterMCTruth[iLayer]);
72+
// read dummy MC2ROF vector to keep writer/readers backward compatible
73+
static std::vector<o2::itsmft::MC2ROFRecord> dummyMC2ROF;
74+
pc.outputs().snapshot(Output{Origin, "CLUSTERSMC2ROF", iLayer}, dummyMC2ROF);
7275
}
7376
}
7477
if (mTriggerOut) {
@@ -141,6 +144,7 @@ std::vector<OutputSpec> makeOutChannels(o2::header::DataOrigin detOrig, bool mct
141144
}
142145
if (mctruth) {
143146
outputs.emplace_back(detOrig, "CLUSTERSMCTR", iLayer, Lifetime::Timeframe);
147+
outputs.emplace_back(detOrig, "CLUSTERSMC2ROF", iLayer, Lifetime::Timeframe);
144148
}
145149
}
146150
if (triggerOut) {

Detectors/ITSMFT/common/workflow/src/ClusterWriterSpec.cxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ using CompClusType = std::vector<o2::itsmft::CompClusterExt>;
3737
using PatternsType = std::vector<unsigned char>;
3838
using ROFrameRType = std::vector<o2::itsmft::ROFRecord>;
3939
using LabelsType = o2::dataformats::MCTruthContainer<o2::MCCompLabel>;
40+
using ROFRecLblT = std::vector<o2::itsmft::MC2ROFRecord>;
4041
using namespace o2::header;
4142

4243
template <int N>
@@ -105,6 +106,11 @@ DataProcessorSpec getClusterWriterSpec(bool useMC, bool doStag)
105106
(detName + "ClusterMCTruth").c_str(), "cluster-label-branch",
106107
(useMC ? nLayers : 0),
107108
getIndex,
109+
getName},
110+
BranchDefinition<ROFRecLblT>{InputSpec{"MC2ROframes", ConcreteDataTypeMatcher{Origin, "CLUSTERSMC2ROF"}},
111+
(detName + "ClustersMC2ROF").c_str(), "cluster-mc2rof-branch",
112+
(useMC ? nLayers : 0),
113+
getIndex,
108114
getName})();
109115
}
110116

Detectors/ITSMFT/common/workflow/src/ClustererSpec.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ void ClustererDPL<N>::run(ProcessingContext& pc)
190190

191191
if (mUseMC) {
192192
pc.outputs().snapshot(Output{Origin, "CLUSTERSMCTR", iLayer}, *clusterLabels); // at the moment requires snapshot
193+
// write dummy MC2ROF vector to keep writer/readers backward compatible
194+
static std::vector<o2::itsmft::MC2ROFRecord> dummyMC2ROF;
195+
pc.outputs().snapshot(Output{Origin, "CLUSTERSMC2ROF", iLayer}, dummyMC2ROF);
193196
}
194197
reader.reset();
195198

@@ -306,6 +309,7 @@ DataProcessorSpec getClustererSpec(bool useMC, bool doStag)
306309
outputs.emplace_back(Origin, "CLUSTERSROF", iLayer, Lifetime::Timeframe);
307310
if (useMC) {
308311
outputs.emplace_back(Origin, "CLUSTERSMCTR", iLayer, Lifetime::Timeframe);
312+
outputs.emplace_back(Origin, "CLUSTERSMC2ROF", iLayer, Lifetime::Timeframe);
309313
}
310314
}
311315
return DataProcessorSpec{

Detectors/ITSMFT/common/workflow/src/DigitReaderSpec.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ void DigitReader<N>::run(ProcessingContext& pc)
112112
mPLabels[iLayer]->copyandflatten(sharedlabels);
113113
delete mPLabels[iLayer];
114114
mPLabels[iLayer] = nullptr;
115+
// read dummy MC2ROF vector to keep writer/readers backward compatible
116+
static std::vector<o2::itsmft::MC2ROFRecord> dummyMC2ROF;
117+
pc.outputs().snapshot(Output{Origin, "DIGITSMC2ROF", iLayer}, dummyMC2ROF);
115118
}
116119
}
117120
if (mUseCalib) {
@@ -267,6 +270,7 @@ std::vector<OutputSpec> makeOutChannels(bool mctruth, bool doStag, bool useCalib
267270
outputs.emplace_back(Origin, "DIGITS", iLayer, Lifetime::Timeframe);
268271
outputs.emplace_back(Origin, "DIGITSROF", iLayer, Lifetime::Timeframe);
269272
if (mctruth) {
273+
outputs.emplace_back(Origin, "DIGITSMC2ROF", iLayer, Lifetime::Timeframe);
270274
outputs.emplace_back(Origin, "DIGITSMCTR", iLayer, Lifetime::Timeframe);
271275
}
272276
}

Detectors/ITSMFT/common/workflow/src/DigitWriterSpec.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ DataProcessorSpec getDigitWriterSpec(bool mctruth, bool doStag, bool dec, bool c
141141
fillLabels,
142142
getIndex,
143143
getName},
144+
BranchDefinition<std::vector<itsmft::MC2ROFRecord>>{InputSpec{detStr + "_digitsMC2ROF", ConcreteDataTypeMatcher{Origin, "DIGITSMC2ROF"}},
145+
detStr + "DigitMC2ROF", "digit-mc2rof-branch",
146+
(mctruth ? mLayers : 0),
147+
getIndex,
148+
getName},
144149
BranchDefinition<std::vector<itsmft::GBTCalibData>>{InputSpec{detStr + "calib", ConcreteDataTypeMatcher{Origin, "GBTCALIB"}},
145150
detStr + "Calib", "digit-calib-branch",
146151
(calib ? 1 : 0)})();

Detectors/ITSMFT/common/workflow/src/digit-reader-workflow.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
5757
bool doStag = o2::itsmft::DPLAlpideParamInitializer::isMFTStaggeringEnabled(cfgc);
5858
wf.emplace_back(o2::itsmft::getMFTDigitReaderSpec(useMC, doStag, calib, withTriggers));
5959
} else {
60-
bool doStag = o2::itsmft::DPLAlpideParamInitializer::isMFTStaggeringEnabled(cfgc);
60+
bool doStag = o2::itsmft::DPLAlpideParamInitializer::isITSStaggeringEnabled(cfgc);
6161
wf.emplace_back(o2::itsmft::getITSDigitReaderSpec(useMC, doStag, calib, withTriggers));
6262
}
6363
o2::raw::HBFUtilsInitializer hbfIni(cfgc, wf);

Steer/DigitizerWorkflow/src/ITSMFTDigitizerSpec.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@ class ITSMFTDPLDigitizerTask : BaseDPLDigitizer
228228
// free space of existing label containers
229229
mLabels[iLayer].clear_andfreememory();
230230
mLabelsAccum[iLayer].clear_andfreememory();
231+
// write dummy MC2ROF vector to keep writer/readers backward compatible
232+
static std::vector<o2::itsmft::MC2ROFRecord> dummyMC2ROF;
233+
pc.outputs().snapshot(Output{Origin, "DIGITSMC2ROF", iLayer}, dummyMC2ROF);
231234
}
232235
}
233236

@@ -404,6 +407,7 @@ std::vector<OutputSpec> makeOutChannels(o2::header::DataOrigin detOrig, bool mct
404407
outputs.emplace_back(detOrig, "DIGITS", iLayer, Lifetime::Timeframe);
405408
outputs.emplace_back(detOrig, "DIGITSROF", iLayer, Lifetime::Timeframe);
406409
if (mctruth) {
410+
outputs.emplace_back(detOrig, "DIGITSMC2ROF", iLayer, Lifetime::Timeframe);
407411
outputs.emplace_back(detOrig, "DIGITSMCTR", iLayer, Lifetime::Timeframe);
408412
}
409413
}

0 commit comments

Comments
 (0)