Skip to content

Commit ee95e63

Browse files
blacwoviealibuild
andauthored
[PWGCF] safer ME and QA for pi-d (#13238)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 4c1f9b2 commit ee95e63

File tree

1 file changed

+32
-14
lines changed

1 file changed

+32
-14
lines changed

PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,16 @@ struct PiNucleiFemto {
164164
Configurable<float> settingCutEta{"settingCutEta", 0.8f, "Eta cut on daughter track"};
165165
Configurable<float> settingCutChi2tpcLow{"settingCutChi2tpcLow", 0.0f, "Low cut on TPC chi2"};
166166
Configurable<float> settingCutChi2tpcHigh{"settingCutChi2tpcHigh", 999.f, "High cut on TPC chi2"};
167+
Configurable<float> settingCutChi2tpcLowPion{"settingCutChi2tpcLowPion", 0.5f, "Low cut on TPC chi2 only for pion"};
168+
Configurable<float> settingCutChi2tpcHighPion{"settingCutChi2tpcHighPion", 4.f, "High cut on TPC chi2 only for pion"};
167169
Configurable<float> settingCutInvMass{"settingCutInvMass", 0.0f, "Invariant mass upper limit"};
168170
Configurable<float> settingCutPtMinDePi{"settingCutPtMinDePi", 0.0f, "Minimum PT cut on DePi4"};
169171
Configurable<float> settingCutClSizeItsDe{"settingCutClSizeItsDe", 4.0f, "Minimum ITS cluster size for De"};
170172
Configurable<float> settingCutNCls{"settingCutNCls", 5.0f, "Minimum ITS Ncluster for tracks"};
171173
Configurable<float> settingCutTPCChi2He{"settingCutTPCChi2He", 0.0f, "Minimum tpcChi2He for Hyper He3"};
172174
Configurable<float> settingCutAverClsSizeHe{"settingCutAverClsSizeHe", 0.0f, "Minimum averClusSizeHe for Hyper He3"};
173175
Configurable<float> settingCutChi2NClITS{"settingCutChi2NClITS", 999.f, "Maximum ITS Chi2 for tracks"};
176+
Configurable<float> settingCutChi2NClITSPion{"settingCutChi2NClITSPion", 36.f, "Maximum ITS Chi2 for tracks only for pion"};
174177
Configurable<float> settingCutNsigmaTPCPi{"settingCutNsigmaTPCPi", 3.0f, "Value of the TPC Nsigma cut on Pi"};
175178
Configurable<float> settingCutNsigmaTPCDe{"settingCutNsigmaTPCDe", 2.5f, "Value of the TPC Nsigma cut on De"};
176179
Configurable<float> settingCutNsigmaITSDe{"settingCutNsigmaITSDe", 2.5f, "Value of the ITD Nsigma cut on De"};
@@ -180,6 +183,7 @@ struct PiNucleiFemto {
180183
Configurable<float> settingCutNsigmaTOFTPCPi{"settingCutNsigmaTOFTPCPi", 3.0f, "Value of the Pion TOF TPC Nsigma cut"};
181184
Configurable<int> settingNoMixedEvents{"settingNoMixedEvents", 5, "Number of mixed events per event"};
182185
Configurable<bool> settingEnableBkgUS{"settingEnableBkgUS", false, "Enable US background"};
186+
Configurable<bool> settingSaferME{"settingSaferME", false, "For Safer ME"};
183187

184188
Configurable<bool> settingFillTable{"settingFillTable", false, "Enable table filling"};
185189
Configurable<float> settingCutPiptMin{"settingCutPiptMin", 0.14f, "Minimum PT cut on Pi"};
@@ -283,6 +287,7 @@ struct PiNucleiFemto {
283287
{"hkStaVsmTVsCent_US_M", ";kStar (GeV/c);mT (GeV/#it{c}^{2});Centrality", {HistType::kTH3F, {{300, 0.0f, 3.0f}, {100, 0.2f, 3.2f}, {100, 0.0f, 100.0f}}}},
284288
{"hkStaVsmTVsCent_US_A", ";kStar (GeV/c);mT (GeV/#it{c}^{2});Centrality", {HistType::kTH3F, {{300, 0.0f, 3.0f}, {100, 0.2f, 3.2f}, {100, 0.0f, 100.0f}}}},
285289
{"hCollIDVsCentEachPion", ";CollisionID;Centrality", {HistType::kTH2F, {{4000, 0.0f, 4000.0f}, {100, 0.0f, 100.0f}}}},
290+
{"hCollIDVsCentEachDe", ";CollisionID;Centrality", {HistType::kTH2F, {{4000, 0.0f, 4000.0f}, {100, 0.0f, 100.0f}}}},
286291
{"hNHypsPerPrevColl", "Number of V0Hypers in previous collision used for mixing;N_{V0Hypers};Entries", {HistType::kTH2F, {{4000, 0.0f, 4000.0f}, {50, -0.5, 49.5}}}},
287292
{"hkStar_LS_M", ";kStar (GeV/c)", {HistType::kTH1F, {{300, 0.0f, 3.0f}}}},
288293
{"hkStar_LS_A", ";kStar (GeV/c)", {HistType::kTH1F, {{300, 0.0f, 3.0f}}}},
@@ -302,7 +307,7 @@ struct PiNucleiFemto {
302307
float Vz_step = (Vz_high - Vz_low) / numOfVertexZBins;
303308

304309
struct EventRef {
305-
int64_t collisionId;
310+
uint64_t collisionId;
306311
};
307312

308313
struct PoolBin {
@@ -477,6 +482,8 @@ struct PiNucleiFemto {
477482
template <typename Ttrack>
478483
bool selectionPIDPion(const Ttrack& candidate)
479484
{
485+
if (candidate.tpcChi2NCl() > settingCutChi2tpcHighPion || candidate.tpcChi2NCl() < settingCutChi2tpcLowPion || candidate.itsChi2NCl() > settingCutChi2NClITSPion)
486+
return false;
480487
if (abs(candidate.dcaXY()) > settingCutPiDCAxyMin || abs(candidate.dcaZ()) > settingCutPiDCAzMin)
481488
return false;
482489

@@ -625,9 +632,11 @@ struct PiNucleiFemto {
625632
nCand = mFitter.process(trackCovDe, trackCovPi);
626633
} catch (...) {
627634
LOG(error) << "Exception caught in DCA fitter process call!";
635+
mQaRegistry.fill(HIST("hSkipReasons"), 0);
628636
return false;
629637
}
630638
if (nCand == 0) {
639+
mQaRegistry.fill(HIST("hSkipReasons"), 1);
631640
return false;
632641
}
633642

@@ -650,6 +659,7 @@ struct PiNucleiFemto {
650659
}
651660

652661
if (!mGoodCollisions[collIdxMin]) {
662+
mQaRegistry.fill(HIST("hSkipReasons"), 2);
653663
return false;
654664
}
655665
piNucand.collisionID = collIdxMin;
@@ -662,10 +672,12 @@ struct PiNucleiFemto {
662672
float invMass = 0;
663673
invMass = RecoDecay::m(std::array{piNucand.momNu, piNucand.momPi}, std::array{o2::constants::physics::MassDeuteron, o2::constants::physics::MassPiPlus});
664674
if (settingCutInvMass > 0 && invMass > settingCutInvMass) {
675+
mQaRegistry.fill(HIST("hSkipReasons"), 3);
665676
return false;
666677
}
667678
float ptDePi = std::hypot(piNucand.momNu[0] + piNucand.momPi[0], piNucand.momNu[1] + piNucand.momPi[1]);
668679
if (ptDePi < settingCutPtMinDePi) {
680+
mQaRegistry.fill(HIST("hSkipReasons"), 4);
669681
return false;
670682
}
671683

@@ -816,6 +828,7 @@ struct PiNucleiFemto {
816828
}
817829
mQaRegistry.fill(HIST("hTrackSel"), Selections::kPID);
818830
mQaRegistry.fill(HIST("hSingleNuPt"), track0.pt() * track0.sign());
831+
mQaRegistry.fill(HIST("hCollIDVsCentEachDe"), track0.collisionId(), cent);
819832

820833
for (const auto& track1 : tracks) {
821834
if (track0 == track1) {
@@ -1220,50 +1233,55 @@ PROCESS_SWITCH(PiNucleiFemto, processMixedEventHyper, "Process Mixed event", fal
12201233
LOG(info) << "Initialized event pool with size = " << All_Event_pool.size();
12211234
}
12221235
for (auto const& collision : collisions) {
1236+
if (!collision.sel8()) {
1237+
mQaRegistry.fill(HIST("hSkipReasons"), 0);
1238+
continue;
1239+
}
12231240
mQaRegistry.fill(HIST("hNcontributor"), collision.numContrib());
12241241
mQaRegistry.fill(HIST("hCentrality"), collision.centFT0C());
12251242
mQaRegistry.fill(HIST("hVtxZ"), collision.posZ());
1226-
int poolIndexPi = where_pool(collision.posZ(), collision.centFT0C());
12271243

1244+
int poolIndexPi = where_pool(collision.posZ(), collision.centFT0C());
12281245
if (poolIndexPi < 0 || static_cast<size_t>(poolIndexPi) >= All_Event_pool.size()) {
12291246
continue;
12301247
}
12311248
auto& pool = All_Event_pool[poolIndexPi];
12321249

1250+
const uint64_t collIdxPi = collision.globalIndex();
1251+
auto trackTableThisCollision = pitracks.sliceBy(mPerCol, collIdxPi);
1252+
trackTableThisCollision.bindExternalIndices(&pitracks);
1253+
12331254
for (auto const& storedEvent : pool.events) {
1234-
const auto& c2 = collisions.iteratorAt(storedEvent.collisionId);
1235-
if (!collision.sel8() || !c2.sel8()) {
1236-
mQaRegistry.fill(HIST("hSkipReasons"), 0);
1237-
continue;
1255+
const uint64_t collIdxHyp = storedEvent.collisionId;
1256+
if (settingSaferME) {
1257+
if (static_cast<int64_t>(collIdxHyp) > collisions.size()) {
1258+
mQaRegistry.fill(HIST("hSkipReasons"), 4);
1259+
continue;
1260+
}
12381261
}
12391262

1240-
auto hypdTablepreviousCollision = V0Hypers.sliceBy(hypPerCol, c2.globalIndex());
1263+
auto hypdTablepreviousCollision = V0Hypers.sliceBy(hypPerCol, collIdxHyp);
12411264
hypdTablepreviousCollision.bindExternalIndices(&V0Hypers);
1242-
12431265
if (hypdTablepreviousCollision.size() == 0) {
12441266
mQaRegistry.fill(HIST("hSkipReasons"), 1);
12451267
continue;
12461268
}
12471269

12481270
auto firstHyp = hypdTablepreviousCollision.iteratorAt(0);
12491271
int poolIndexHyp = where_pool(firstHyp.zPrimVtx(), firstHyp.centralityFT0C());
1250-
12511272
if (poolIndexHyp != poolIndexPi) {
12521273
mQaRegistry.fill(HIST("hSkipReasons"), 2);
12531274
continue;
12541275
}
1276+
mQaRegistry.fill(HIST("hNHypsPerPrevColl"), collIdxHyp, hypdTablepreviousCollision.size());
12551277

1256-
auto trackTableThisCollision = pitracks.sliceBy(mPerCol, collision.globalIndex());
1257-
trackTableThisCollision.bindExternalIndices(&pitracks);
1258-
1259-
mQaRegistry.fill(HIST("hNHypsPerPrevColl"), c2.globalIndex(), hypdTablepreviousCollision.size());
12601278
pairHyperEventMixing(trackTableThisCollision, hypdTablepreviousCollision);
12611279
}
12621280

12631281
if (static_cast<int>(pool.events.size()) >= settingNoMixedEvents) {
12641282
pool.events.pop_front();
12651283
}
1266-
pool.events.push_back({collision.globalIndex()});
1284+
pool.events.push_back({collIdxPi});
12671285
}
12681286
fillPairsHyper(collisions, pitracks, V0Hypers, /*isMixedEvent*/ true);
12691287
}

0 commit comments

Comments
 (0)