Skip to content

Commit 79e4aff

Browse files
diana0x0fDiana Krupova
andauthored
[PWGUD] Add more selection bits to UPCCandidateProducer (#10207)
Co-authored-by: Diana Krupova <diana@Dianas-MacBook-Pro.local>
1 parent 27c6b04 commit 79e4aff

File tree

1 file changed

+40
-6
lines changed

1 file changed

+40
-6
lines changed

PWGUD/TableProducer/UPCCandidateProducer.cxx

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ struct UpcCandProducer {
9898
Configurable<float> fMinEtaMFT{"minEtaMFT", -3.6, "Minimum eta for MFT tracks"};
9999
Configurable<float> fMaxEtaMFT{"maxEtaMFT", -2.5, "Maximum eta for MFT tracks"};
100100

101+
Configurable<bool> fRequireNoTimeFrameBorder{"requireNoTimeFrameBorder", true, "Require kNoTimeFrameBorder selection bit"};
102+
Configurable<bool> fRequireNoITSROFrameBorder{"requireNoITSROFrameBorder", true, "Require kNoITSROFrameBorder selection bit"};
103+
101104
// QA histograms
102105
HistogramRegistry histRegistry{"HistRegistry", {}, OutputObjHandlingPolicy::AnalysisObject};
103106

@@ -701,7 +704,10 @@ struct UpcCandProducer {
701704
o2::aod::Collisions const& /*collisions*/,
702705
ForwardTracks const& fwdTracks,
703706
o2::aod::AmbiguousFwdTracks const& /*ambFwdTracks*/,
704-
std::unordered_map<int64_t, uint64_t>& ambFwdTrBCs)
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)
705711
{
706712
for (const auto& trk : fwdTracks) {
707713
if (trk.trackType() != typeFilter)
@@ -711,14 +717,32 @@ struct UpcCandProducer {
711717
int64_t trkId = trk.globalIndex();
712718
int32_t nContrib = -1;
713719
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
714723
auto ambIter = ambFwdTrBCs.find(trkId);
715724
if (ambIter == ambFwdTrBCs.end()) {
716725
const auto& col = trk.collision();
717726
nContrib = col.numContrib();
718727
trackBC = col.bc_as<TBCs>().globalBC();
719-
if (!(col.bc_as<TBCs>().selection_bit(o2::aod::evsel::kNoTimeFrameBorder) &&
720-
col.bc_as<TBCs>().selection_bit(o2::aod::evsel::kNoITSROFrameBorder))) {
721-
continue; // skip this track if both selection bits are not set
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
722746
}
723747
} else {
724748
trackBC = ambIter->second;
@@ -1545,6 +1569,11 @@ struct UpcCandProducer {
15451569
std::vector<BCTracksPair> bcsMatchedTrIdsMCH;
15461570
std::vector<BCTracksPair> bcsMatchedTrIdsGlobal;
15471571

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+
15481577
// trackID -> index in amb. track table
15491578
std::unordered_map<int64_t, uint64_t> ambFwdTrBCs;
15501579
collectAmbTrackBCs<1, BCsWithBcSels>(ambFwdTrBCs, ambFwdTracks);
@@ -1562,7 +1591,8 @@ struct UpcCandProducer {
15621591
collectForwardGlobalTracks(bcsMatchedTrIdsGlobal,
15631592
o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack,
15641593
bcs, collisions,
1565-
fwdTracks, ambFwdTracks, ambFwdTrBCs);
1594+
fwdTracks, ambFwdTracks, ambFwdTrBCs,
1595+
bcTRS, bcTROFS, bcHMPR);
15661596

15671597
std::sort(bcsMatchedTrIdsMID.begin(), bcsMatchedTrIdsMID.end(),
15681598
[](const auto& left, const auto& right) { return left.first < right.first; });
@@ -1805,7 +1835,11 @@ struct UpcCandProducer {
18051835
fitInfo.BBFT0Apf, fitInfo.BBFT0Cpf, fitInfo.BGFT0Apf, fitInfo.BGFT0Cpf,
18061836
fitInfo.BBFV0Apf, fitInfo.BGFV0Apf,
18071837
fitInfo.BBFDDApf, fitInfo.BBFDDCpf, fitInfo.BGFDDApf, fitInfo.BGFDDCpf);
1808-
eventCandidatesSelExtras(chFT0A, chFT0C, chFDDA, chFDDC, chFV0A, 0, 0, 0, 0, 0);
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);
18091843
eventCandidatesSelsFwd(fitInfo.distClosestBcV0A,
18101844
fitInfo.distClosestBcT0A,
18111845
amplitudesT0A,

0 commit comments

Comments
 (0)