@@ -27,7 +27,7 @@ using RP = o2::fv0::RecPoints;
2727
2828RP BaseRecoTask::process (o2::fv0::Digit const & bcd,
2929 gsl::span<const o2::fv0::ChannelData> inChData,
30- gsl::span <o2::fv0::ChannelDataFloat> outChData)
30+ std::vector <o2::fv0::ChannelDataFloat>& outChData)
3131{
3232 LOG (debug) << " Running reconstruction on new event" ;
3333
@@ -44,27 +44,27 @@ RP BaseRecoTask::process(o2::fv0::Digit const& bcd,
4444 int nch = inChData.size ();
4545 for (int ich = 0 ; ich < nch; ich++) {
4646 LOG (debug) << " channel " << ich << " / " << nch;
47- int offsetChannel = getOffset (int (inChData[ich].ChId ));
48- if (mDeadChannelMap && !mDeadChannelMap ->isChannelAlive (ich)) {
47+ if (mDeadChannelMap && !mDeadChannelMap ->isChannelAlive (inChData[ich].ChId )) {
4948 LOG (debug) << " Channel " << ich << " is dead - discarding data" ;
50- outChData[ich] = o2::fv0::ChannelDataFloat{inChData[ich].ChId , 0.0 , 0.0 , 0 };
5149 continue ;
5250 }
53- outChData[ich] = o2::fv0::ChannelDataFloat{inChData[ich].ChId ,
54- (inChData[ich].CFDTime - offsetChannel) * DigitizationConstant::TIME_PER_TDCCHANNEL,
55- (float )inChData[ich].QTCAmpl ,
56- inChData[ich].ChainQTC };
51+ int offsetChannel = getOffset (int (inChData[ich].ChId ));
52+ outChData.emplace_back (o2::fv0::ChannelDataFloat{inChData[ich].ChId ,
53+ (inChData[ich].CFDTime - offsetChannel) * DigitizationConstant::TIME_PER_TDCCHANNEL,
54+ (float )inChData[ich].QTCAmpl ,
55+ inChData[ich].ChainQTC });
56+ const auto & currentOutCh = outChData.back ();
5757
5858 // Conditions for reconstructing collision time (3 variants: first, average-relaxed and average-tight)
59- if (outChData[ich] .charge > FV0DigParam::Instance ().chargeThrForMeanTime ) {
60- sideAtimeFirst = std::min (static_cast <Double_t>(sideAtimeFirst), outChData[ich] .time );
59+ if (currentOutCh .charge > FV0DigParam::Instance ().chargeThrForMeanTime ) {
60+ sideAtimeFirst = std::min (static_cast <Double_t>(sideAtimeFirst), currentOutCh .time );
6161 if (inChData[ich].areAllFlagsGood ()) {
62- if (std::abs (outChData[ich] .time ) < FV0DigParam::Instance ().mTimeThresholdForReco ) {
63- sideAtimeAvg += outChData[ich] .time ;
62+ if (std::abs (currentOutCh .time ) < FV0DigParam::Instance ().mTimeThresholdForReco ) {
63+ sideAtimeAvg += currentOutCh .time ;
6464 ndigitsA++;
6565 }
66- if (outChData[ich] .charge > FV0DigParam::Instance ().mAmpThresholdForReco && std::abs (outChData[ich] .time ) < FV0DigParam::Instance ().mTimeThresholdForReco ) {
67- sideAtimeAvgSelected += outChData[ich] .time ;
66+ if (currentOutCh .charge > FV0DigParam::Instance ().mAmpThresholdForReco && std::abs (currentOutCh .time ) < FV0DigParam::Instance ().mTimeThresholdForReco ) {
67+ sideAtimeAvgSelected += currentOutCh .time ;
6868 ndigitsASelected++;
6969 }
7070 }
0 commit comments