@@ -704,10 +704,7 @@ struct UpcCandProducer {
704704 o2::aod::Collisions const & /* collisions*/ ,
705705 ForwardTracks const & fwdTracks,
706706 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)
707+ std::unordered_map<int64_t , uint64_t >& ambFwdTrBCs)
711708 {
712709 for (const auto & trk : fwdTracks) {
713710 if (trk.trackType () != typeFilter)
@@ -717,27 +714,12 @@ struct UpcCandProducer {
717714 int64_t trkId = trk.globalIndex ();
718715 int32_t nContrib = -1 ;
719716 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
723717 auto ambIter = ambFwdTrBCs.find (trkId);
724718 if (ambIter == ambFwdTrBCs.end ()) {
725719 const auto & col = trk.collision ();
726720 nContrib = col.numContrib ();
727721 trackBC = col.bc_as <TBCs>().globalBC ();
728722 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;
741723 if (fRequireNoTimeFrameBorder && !bc.selection_bit (o2::aod::evsel::kNoTimeFrameBorder )) {
742724 continue ; // skip this track if the kNoTimeFrameBorder bit is required but not set
743725 }
@@ -1530,7 +1512,7 @@ struct UpcCandProducer {
15301512 fitInfo.BBFT0Apf , fitInfo.BBFT0Cpf , fitInfo.BGFT0Apf , fitInfo.BGFT0Cpf ,
15311513 fitInfo.BBFV0Apf , fitInfo.BGFV0Apf ,
15321514 fitInfo.BBFDDApf , fitInfo.BBFDDCpf , fitInfo.BGFDDApf , fitInfo.BGFDDCpf );
1533- eventCandidatesSelExtras (chFT0A, chFT0C, chFDDA, chFDDC, chFV0A, 0 , 0 , 0 , 0 , 0 );
1515+ eventCandidatesSelExtras (chFT0A, chFT0C, chFDDA, chFDDC, chFV0A, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 );
15341516 eventCandidatesSelsFwd (fitInfo.distClosestBcV0A ,
15351517 fitInfo.distClosestBcT0A ,
15361518 amplitudesT0A,
@@ -1569,11 +1551,6 @@ struct UpcCandProducer {
15691551 std::vector<BCTracksPair> bcsMatchedTrIdsMCH;
15701552 std::vector<BCTracksPair> bcsMatchedTrIdsGlobal;
15711553
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-
15771554 // trackID -> index in amb. track table
15781555 std::unordered_map<int64_t , uint64_t > ambFwdTrBCs;
15791556 collectAmbTrackBCs<1 , BCsWithBcSels>(ambFwdTrBCs, ambFwdTracks);
@@ -1591,8 +1568,7 @@ struct UpcCandProducer {
15911568 collectForwardGlobalTracks (bcsMatchedTrIdsGlobal,
15921569 o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack,
15931570 bcs, collisions,
1594- fwdTracks, ambFwdTracks, ambFwdTrBCs,
1595- bcTRS, bcTROFS, bcHMPR);
1571+ fwdTracks, ambFwdTracks, ambFwdTrBCs);
15961572
15971573 std::sort (bcsMatchedTrIdsMID.begin (), bcsMatchedTrIdsMID.end (),
15981574 [](const auto & left, const auto & right) { return left.first < right.first ; });
@@ -1747,6 +1723,14 @@ struct UpcCandProducer {
17471723 std::vector<int8_t > relBCsV0A{};
17481724 uint8_t chFT0A = 0 ;
17491725 uint8_t chFT0C = 0 ;
1726+ int trs = 0 ;
1727+ int trofs = 0 ;
1728+ int hmpr = 0 ;
1729+ int tfb = 0 ;
1730+ int itsROFb = 0 ;
1731+ int sbp = 0 ;
1732+ int zVtxFT0vPv = 0 ;
1733+ int vtxITSTPC = 0 ;
17501734 if (nFT0s > 0 ) {
17511735 uint64_t closestBcT0A = findClosestBC (globalBC, mapGlobalBcWithT0A);
17521736 int64_t distClosestBcT0A = globalBC - static_cast <int64_t >(closestBcT0A);
@@ -1763,6 +1747,15 @@ struct UpcCandProducer {
17631747 fitInfo.ampFT0C = std::accumulate (t0AmpsC.begin (), t0AmpsC.end (), 0 .f );
17641748 chFT0A = ft0.amplitudeA ().size ();
17651749 chFT0C = ft0.amplitudeC ().size ();
1750+ // get selection flags per BC
1751+ trs = ft0.bc_as <TBCs>().selection_bit (o2::aod::evsel::kNoCollInTimeRangeStandard ) ? 1 : 0 ;
1752+ trofs = ft0.bc_as <TBCs>().selection_bit (o2::aod::evsel::kNoCollInRofStandard ) ? 1 : 0 ;
1753+ hmpr = ft0.bc_as <TBCs>().selection_bit (o2::aod::evsel::kNoHighMultCollInPrevRof ) ? 1 : 0 ;
1754+ tfb = ft0.bc_as <TBCs>().selection_bit (o2::aod::evsel::kNoTimeFrameBorder ) ? 1 : 0 ;
1755+ itsROFb = ft0.bc_as <TBCs>().selection_bit (o2::aod::evsel::kNoITSROFrameBorder ) ? 1 : 0 ;
1756+ sbp = ft0.bc_as <TBCs>().selection_bit (o2::aod::evsel::kNoSameBunchPileup ) ? 1 : 0 ;
1757+ zVtxFT0vPv = ft0.bc_as <TBCs>().selection_bit (o2::aod::evsel::kIsGoodZvtxFT0vsPV ) ? 1 : 0 ;
1758+ vtxITSTPC = ft0.bc_as <TBCs>().selection_bit (o2::aod::evsel::kIsVertexITSTPC ) ? 1 : 0 ;
17661759 fillAmplitudes (ft0s, mapGlobalBcWithT0A, amplitudesT0A, relBCsT0A, globalBC);
17671760 }
17681761 uint8_t chFV0A = 0 ;
@@ -1835,11 +1828,7 @@ struct UpcCandProducer {
18351828 fitInfo.BBFT0Apf , fitInfo.BBFT0Cpf , fitInfo.BGFT0Apf , fitInfo.BGFT0Cpf ,
18361829 fitInfo.BBFV0Apf , fitInfo.BGFV0Apf ,
18371830 fitInfo.BBFDDApf , fitInfo.BBFDDCpf , fitInfo.BGFDDApf , fitInfo.BGFDDCpf );
1838- // get selection flags per BC
1839- int trsVal = bcTRS.count (globalBC) ? bcTRS[globalBC] : 0 ;
1840- int trofsVal = bcTROFS.count (globalBC) ? bcTROFS[globalBC] : 0 ;
1841- int hmprVal = bcHMPR.count (globalBC) ? bcHMPR[globalBC] : 0 ;
1842- eventCandidatesSelExtras (chFT0A, chFT0C, chFDDA, chFDDC, chFV0A, 0 , 0 , trsVal, trofsVal, hmprVal);
1831+ eventCandidatesSelExtras (chFT0A, chFT0C, chFDDA, chFDDC, chFV0A, 0 , 0 , trs, trofs, hmpr, tfb, itsROFb, sbp, zVtxFT0vPv, vtxITSTPC);
18431832 eventCandidatesSelsFwd (fitInfo.distClosestBcV0A ,
18441833 fitInfo.distClosestBcT0A ,
18451834 amplitudesT0A,
0 commit comments