@@ -697,63 +697,47 @@ struct UpcCandProducer {
697697 }
698698 }
699699
700- template <typename TBCs>
701- void collectForwardGlobalTracks (std::vector<BCTracksPair>& bcsMatchedTrIds,
702- int typeFilter,
703- TBCs const & /* bcs*/ ,
704- o2::aod::Collisions const & /* collisions*/ ,
705- ForwardTracks const & fwdTracks,
706- o2::aod::AmbiguousFwdTracks const & /* ambFwdTracks*/ ,
707- std::unordered_map<int64_t , uint64_t >& ambFwdTrBCs,
708- std::unordered_map<uint64_t , int64_t >& bcTRS,
709- std::unordered_map<uint64_t , int64_t >& bcTROFS,
710- std::unordered_map<uint64_t , int64_t >& bcHMPR)
711- {
712- for (const auto & trk : fwdTracks) {
713- if (trk.trackType () != typeFilter)
714- continue ;
715- if (!applyFwdCuts (trk))
716- continue ;
717- int64_t trkId = trk.globalIndex ();
718- int32_t nContrib = -1 ;
719- uint64_t trackBC = 0 ;
720- int64_t trs = 0 ; // for kNoCollInTimeRangeStandard
721- int64_t trofs = 0 ; // for kNoCollInRofStandard
722- int64_t hmpr = 0 ; // for kNoHighMultCollInPrevRof
723- auto ambIter = ambFwdTrBCs.find (trkId);
724- if (ambIter == ambFwdTrBCs.end ()) {
725- const auto & col = trk.collision ();
726- nContrib = col.numContrib ();
727- trackBC = col.bc_as <TBCs>().globalBC ();
728- const auto & bc = col.bc_as <TBCs>();
729- if (bc.selection_bit (o2::aod::evsel::kNoCollInTimeRangeStandard )) {
730- trs = 1 ;
731- }
732- if (bc.selection_bit (o2::aod::evsel::kNoCollInRofStandard )) {
733- trofs = 1 ;
734- }
735- if (bc.selection_bit (o2::aod::evsel::kNoHighMultCollInPrevRof )) {
736- hmpr = 1 ;
737- }
738- bcTRS[trackBC] = trs;
739- bcTROFS[trackBC] = trofs;
740- bcHMPR[trackBC] = hmpr;
741- if (fRequireNoTimeFrameBorder && !bc.selection_bit (o2::aod::evsel::kNoTimeFrameBorder )) {
742- continue ; // skip this track if the kNoTimeFrameBorder bit is required but not set
743- }
744- if (fRequireNoITSROFrameBorder && !bc.selection_bit (o2::aod::evsel::kNoITSROFrameBorder )) {
745- continue ; // skip this track if the kNoITSROFrameBorder bit is required but not set
700+
701+ template <typename TBCs>
702+ void collectForwardGlobalTracks (std::vector<BCTracksPair>& bcsMatchedTrIds,
703+ int typeFilter,
704+ TBCs const & /* bcs*/ ,
705+ o2::aod::Collisions const & /* collisions*/ ,
706+ ForwardTracks const & fwdTracks,
707+ o2::aod::AmbiguousFwdTracks const & /* ambFwdTracks*/ ,
708+ std::unordered_map<int64_t , uint64_t >& ambFwdTrBCs)
709+ {
710+ for (const auto & trk : fwdTracks) {
711+ if (trk.trackType () != typeFilter)
712+ continue ;
713+ if (!applyFwdCuts (trk))
714+ continue ;
715+ int64_t trkId = trk.globalIndex ();
716+ int32_t nContrib = -1 ;
717+ uint64_t trackBC = 0 ;
718+ auto ambIter = ambFwdTrBCs.find (trkId);
719+ if (ambIter == ambFwdTrBCs.end ()) {
720+ const auto & col = trk.collision ();
721+ nContrib = col.numContrib ();
722+ trackBC = col.bc_as <TBCs>().globalBC ();
723+ const auto & bc = col.bc_as <TBCs>();
724+ if (fRequireNoTimeFrameBorder && !bc.selection_bit (o2::aod::evsel::kNoTimeFrameBorder )) {
725+ continue ; // skip this track if the kNoTimeFrameBorder bit is required but not set
726+ }
727+ if (fRequireNoITSROFrameBorder && !bc.selection_bit (o2::aod::evsel::kNoITSROFrameBorder )) {
728+ continue ; // skip this track if the kNoITSROFrameBorder bit is required but not set
729+ }
730+ } else {
731+ trackBC = ambIter->second ;
746732 }
747- } else {
748- trackBC = ambIter->second ;
733+ int64_t tint = TMath::FloorNint (trk.trackTime () / o2::constants::lhc::LHCBunchSpacingNS + static_cast <float >(fMuonTrackTShift ));
734+ uint64_t bc = trackBC + tint;
735+ if (nContrib > upcCuts.getMaxNContrib ())
736+ continue ;
737+ addTrack (bcsMatchedTrIds, bc, trkId);
749738 }
750- int64_t tint = TMath::FloorNint (trk.trackTime () / o2::constants::lhc::LHCBunchSpacingNS + static_cast <float >(fMuonTrackTShift ));
751- uint64_t bc = trackBC + tint;
752- if (nContrib > upcCuts.getMaxNContrib ())
753- continue ;
754- addTrack (bcsMatchedTrIds, bc, trkId);
755739 }
756- }
740+
757741
758742 int32_t searchTracks (uint64_t midbc, uint64_t range, uint32_t tracksToFind,
759743 std::vector<int64_t >& tracks,
@@ -1569,11 +1553,6 @@ struct UpcCandProducer {
15691553 std::vector<BCTracksPair> bcsMatchedTrIdsMCH;
15701554 std::vector<BCTracksPair> bcsMatchedTrIdsGlobal;
15711555
1572- // to store selection bits
1573- std::unordered_map<uint64_t , int64_t > bcTRS;
1574- std::unordered_map<uint64_t , int64_t > bcTROFS;
1575- std::unordered_map<uint64_t , int64_t > bcHMPR;
1576-
15771556 // trackID -> index in amb. track table
15781557 std::unordered_map<int64_t , uint64_t > ambFwdTrBCs;
15791558 collectAmbTrackBCs<1 , BCsWithBcSels>(ambFwdTrBCs, ambFwdTracks);
@@ -1591,8 +1570,7 @@ struct UpcCandProducer {
15911570 collectForwardGlobalTracks (bcsMatchedTrIdsGlobal,
15921571 o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack,
15931572 bcs, collisions,
1594- fwdTracks, ambFwdTracks, ambFwdTrBCs,
1595- bcTRS, bcTROFS, bcHMPR);
1573+ fwdTracks, ambFwdTracks, ambFwdTrBCs);
15961574
15971575 std::sort (bcsMatchedTrIdsMID.begin (), bcsMatchedTrIdsMID.end (),
15981576 [](const auto & left, const auto & right) { return left.first < right.first ; });
0 commit comments