Skip to content

Commit 79fec19

Browse files
[ALICE3] TF3: fix labels filling in digitization (#15537)
* added mc label * remove accum + fix labels filling --------- Co-authored-by: GiorgioAlbertoLucia <giogioalberto@gmail.com>
1 parent 0366e66 commit 79fec19

4 files changed

Lines changed: 5 additions & 7 deletions

File tree

Detectors/Upgrades/ALICE3/IOTOF/simulation/include/IOTOFSimulation/Chip.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class Chip
7676
/// reset points container
7777
o2::iotof::LabeledDigit* findDigit(ULong64_t key);
7878

79-
void addDigit(UShort_t row, UShort_t col, Int_t charge, double time);
79+
void addDigit(UShort_t row, UShort_t col, Int_t charge, double time, o2::MCCompLabel label);
8080

8181
protected:
8282
Int_t mChipIndex = -1; ///< Chip ID

Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Chip.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ Chip::Chip(Int_t index)
3232
{
3333
}
3434
//_______________________________________________________________________
35-
void Chip::addDigit(UShort_t row, UShort_t col, Int_t charge, double time)
35+
void Chip::addDigit(UShort_t row, UShort_t col, Int_t charge, double time, o2::MCCompLabel label)
3636
{
3737
ULong64_t key = Digit::getOrderingKey(mChipIndex, row, col);
38-
mDigits.emplace(std::make_pair(key, LabeledDigit(mChipIndex, row, col, charge, time)));
38+
mDigits.emplace(std::make_pair(key, LabeledDigit(mChipIndex, row, col, charge, time, label)));
3939
}

Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ void Digitizer::registerDigits(Chip& chip, uint32_t roFrame, float timeInitROF,
242242
o2::iotof::LabeledDigit* existingDigit = chip.findDigit(key);
243243
if (!existingDigit) {
244244
// No existing digit, create a new one
245-
chip.addDigit(row, col, nElectrons, timeInitROF); // Last one should really just be time
245+
chip.addDigit(row, col, nElectrons, timeInitROF, label); // Last one should really just be time
246246
} else {
247247
// Digit already exists, update charge and labels
248248
const int storedCharge = existingDigit->getCharge();

Steer/DigitizerWorkflow/src/IOTOFDigitizerSpec.cxx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,9 @@ class IOTOFDPLDigitizerTask : o2::base::BaseDPLDigitizer
139139
pc.outputs().snapshot(Output{mOrigin, "DIGITSROF", 0}, mROFRecords);
140140
if (mWithMCTruth) {
141141
auto& sharedlabels = pc.outputs().make<o2::dataformats::ConstMCTruthContainer<o2::MCCompLabel>>(Output{mOrigin, "DIGITSMCTR", 0});
142-
mLabelsAccum.flatten_to(sharedlabels);
142+
mLabels.flatten_to(sharedlabels);
143143
// free space of existing label containers
144144
mLabels.clear_andfreememory();
145-
mLabelsAccum.clear_andfreememory();
146145

147146
// write dummy MC2ROF vector to keep writer/readers backward compatible
148147
// NOTE: Steer/DigitizerWorkflow/src/ITSMFTDigitizerSpec.cxx also uses dummy MC2ROF
@@ -172,7 +171,6 @@ class IOTOFDPLDigitizerTask : o2::base::BaseDPLDigitizer
172171
std::vector<o2::itsmft::Hit> mHits{};
173172
std::vector<o2::itsmft::Hit>* mHitsP{&mHits};
174173
o2::dataformats::MCTruthContainer<o2::MCCompLabel> mLabels{};
175-
o2::dataformats::MCTruthContainer<o2::MCCompLabel> mLabelsAccum{};
176174
std::vector<TChain*> mSimChains{};
177175
o2::parameters::GRPObject::ROMode mROMode = o2::parameters::GRPObject::PRESENT; // readout mode
178176
};

0 commit comments

Comments
 (0)