@@ -102,33 +102,32 @@ class FDDDPLDigitizerTask
102102 auto & eventParts = context->getEventParts ();
103103 std::vector<o2::fdd::Digit> digitsAccum; // accumulator for digits
104104 o2::dataformats::MCTruthContainer<o2::fdd::MCLabel> labelsAccum;
105-
105+ o2::dataformats::MCTruthContainer<o2::fdd::MCLabel> labels;
106+ mDigitizer ->setMCLabels (&labels);
106107 // loop over all composite collisions given from context
107108 // (aka loop over all the interaction records)
108109 for (int collID = 0 ; collID < irecords.size (); ++collID) {
109110 mDigitizer ->SetEventTime (irecords[collID].timeNS );
110111 mDigitizer ->SetInteractionRecord (irecords[collID]);
111-
112+ o2::fdd::Digit digit; // digits which get filled
112113 // for each collision, loop over the constituents event and source IDs
113114 // (background signal merging is basically taking place here)
114115 for (auto & part : eventParts[collID]) {
115116 mDigitizer ->SetEventID (part.entryID );
116117 mDigitizer ->SetSrcID (part.sourceID );
118+ labels.clear ();
117119
118120 // get the hits for this event and this source
119121 std::vector<o2::fdd::Hit> hits;
120122 retrieveHits (mSimChains , " FDDHit" , part.sourceID , part.entryID , &hits);
121123 LOG (INFO) << " For collision " << collID << " eventID " << part.entryID << " found FDD " << hits.size () << " hits " ;
122124
123- o2::fdd::Digit digit; // digits which get filled
124- o2::dataformats::MCTruthContainer<o2::fdd::MCLabel> labels;
125125 mDigitizer ->process (&hits, &digit);
126- // std::copy(digits.begin(), digits.end(), std::back_inserter(digitsAccum));
127126 labelsAccum.mergeAtBack (labels);
128- mDigitizer ->SetTriggers (&digit);
129- digitsAccum.push_back (digit); // we should move it there actually
130- LOG (INFO) << " Have " << digitsAccum.back ().GetChannelData ().size () << " fired channels " ;
131127 }
128+ mDigitizer ->SetTriggers (&digit);
129+ digitsAccum.push_back (digit);
130+ LOG (INFO) << " Have " << digitsAccum.back ().GetChannelData ().size () << " fired channels " ;
132131 }
133132
134133 LOG (INFO) << " FDD: Sending " << digitsAccum.size () << " digits" ;
0 commit comments