Skip to content

Commit c2fb078

Browse files
commit 1: all forseen branches available in the TF3 tree. Still preliminary approach to fill the Digits in the Digitizer class
1 parent 71b45ac commit c2fb078

2 files changed

Lines changed: 19 additions & 24 deletions

File tree

Detectors/Upgrades/ALICE3/IOTOF/workflow/src/DigitWriterSpec.cxx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,21 +85,20 @@ DataProcessorSpec getDigitWriterSpec(bool mctruth, bool dec, bool calib, o2::hea
8585
MakeRootTreeWriterSpec::TreeAttributes{"o2sim", "Digits tree"},
8686
MakeRootTreeWriterSpec::CustomClose(finishWriting),
8787
// in case of labels we first read them as std::vector<char> and process them correctly in the fillLabels hook
88-
//BranchDefinition<std::vector<char>>{InputSpec{"digitsMCTR", detOrig, "DIGITSMCTR", 0},
88+
// BranchDefinition<std::vector<char>>{InputSpec{"digitsMCTR", detOrig, "DIGITSMCTR", 0},
8989
// (detStr + "DigitMCTruth").c_str(),
9090
// (mctruth ? 1 : 0), fillLabels},
91-
//BranchDefinition<std::vector<itsmft::MC2ROFRecord>>{InputSpec{"digitsMC2ROF", detOrig, "DIGITSMC2ROF", 0},
92-
// (detStr + "DigitMC2ROF").c_str(),
93-
// (mctruth ? 1 : 0)},
91+
BranchDefinition<std::vector<itsmft::MC2ROFRecord>>{InputSpec{"digitsMC2ROF", detOrig, "DIGITSMC2ROF", 0},
92+
(detStr + "DigitMC2ROF").c_str(),
93+
(mctruth ? 1 : 0)},
9494
BranchDefinition<std::vector<iotof::Digit>>{InputSpec{"digits", detOrig, "DIGITS", 0},
95-
(detStr + "Digit").c_str(),
96-
logger} //,
95+
(detStr + "Digit").c_str(),
96+
logger},
9797
// BranchDefinition<std::vector<itsmft::GBTCalibData>>{InputSpec{"calib", detOrig, "GBTCALIB", 0},
9898
// (detStr + "Calib").c_str(),
9999
// (calib ? 1 : 0)},
100-
//BranchDefinition<std::vector<itsmft::ROFRecord>>{InputSpec{"digitsROF", detOrig, "DIGITSROF", 0},
101-
// (detStr + "DigitROF").c_str()}
102-
)();
100+
BranchDefinition<std::vector<itsmft::ROFRecord>>{InputSpec{"digitsROF", detOrig, "DIGITSROF", 0},
101+
(detStr + "DigitROF").c_str()})();
103102
}
104103

105104
DataProcessorSpec getIOTOFDigitWriterSpec(bool mctruth, bool dec, bool calib)

Steer/DigitizerWorkflow/src/IOTOFDigitizerSpec.cxx

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class IOTOFDPLDigitizerTask : o2::base::BaseDPLDigitizer
5454
void initDigitizerTask(framework::InitContext& ic) override
5555
{
5656
mDisableQED = ic.options().get<bool>("disable-qed");
57-
57+
5858
auto geom = GeometryTGeo::Instance();
5959
geom->fillMatrixCache(o2::math_utils::bit2Mask(o2::math_utils::TransformType::L2G)); // make sure L2G matrices are loaded
6060

@@ -112,9 +112,9 @@ class IOTOFDPLDigitizerTask : o2::base::BaseDPLDigitizer
112112
context->retrieveHits(mSimChains, o2::detectors::SimTraits::DETECTORBRANCHNAMES[mID][0].c_str(), part.sourceID, part.entryID, &mHits);
113113

114114
if (mHits.size() > 0) {
115-
//mDigits.clear();
115+
// mDigits.clear();
116116
if (mWithMCTruth) {
117-
mLabels.clear();
117+
// mLabels.clear();
118118
}
119119

120120
LOG(debug) << "For collision " << collID << " eventID " << part.entryID << " found " << mHits.size() << " hits ";
@@ -123,29 +123,25 @@ class IOTOFDPLDigitizerTask : o2::base::BaseDPLDigitizer
123123
}
124124
}
125125
if (mDigitizer.isContinuous()) {
126-
//mDigits.clear();
126+
// mDigits.clear();
127127
if (mWithMCTruth) {
128-
mLabels.clear();
128+
// mLabels.clear();
129129
}
130130
mDigitizer.fillOutputContainer();
131131
}
132132

133-
for (int iDigit = 0; iDigit < mDigits.size(); iDigit++) {
134-
mROFRecords.emplace_back();
135-
}
136-
137133
// here we have all digits and we can send them to consumer (aka snapshot it onto output)
138-
139134
LOG(debug) << "Digitization finished with " << mDigits.size() << " digits and " << mROFRecords.size() << " ROF records";
140135
pc.outputs().snapshot(Output{mOrigin, "DIGITS", 0}, mDigits);
141-
//pc.outputs().snapshot(Output{mOrigin, "DIGITSROF", 0}, mROFRecords);
136+
pc.outputs().snapshot(Output{mOrigin, "DIGITSROF", 0}, mROFRecords);
142137
if (mWithMCTruth) {
143-
//
138+
pc.outputs().make<o2::dataformats::ConstMCTruthContainer<o2::MCCompLabel>>(Output{mOrigin, "DIGITSMCTR", 0});
139+
// write dummy MC2ROF vector to keep writer/readers backward compatible
140+
// NOTE: Steer/DigitizerWorkflow/src/ITSMFTDigitizerSpec.cxx also uses dummy MC2ROF
141+
static std::vector<o2::itsmft::MC2ROFRecord> dummyMC2ROF;
142+
pc.outputs().snapshot(Output{mOrigin, "DIGITSMC2ROF", 0}, dummyMC2ROF);
144143
}
145144

146-
LOG(info) << mID.getName() << ": Sending ROMode= " << mROMode << " to GRPUpdater";
147-
//pc.outputs().snapshot(Output{mOrigin, "ROMode", 0}, mROMode);
148-
149145
timer.Stop();
150146
LOG(info) << "Digitization took " << timer.CpuTime() << "s";
151147

0 commit comments

Comments
 (0)