Skip to content

Commit 598089e

Browse files
[PWGLF] Fix processRecMC stops after certain iterations (#8364)
1 parent faf17f1 commit 598089e

File tree

1 file changed

+6
-22
lines changed

1 file changed

+6
-22
lines changed

PWGLF/Tasks/Strangeness/lambdak0sflattenicity.cxx

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ struct lambdak0sflattenicity {
106106
"Accept events that pass sel8 selection"};
107107
Configurable<float> cutzvertex{"cutzvertex", 10.0f,
108108
"Accepted z-vertex range (cm)"};
109-
Configurable<bool> applyEvSelMCGen{"applyEvSelGen", true,
110-
"Apply event selection to MCGen"};
111109
Configurable<bool> IsINELgt0{"isINELgt0", true, "is INEL gt 0"};
112110
Configurable<bool> IsNoTimeFrameBorder{
113111
"IsNoTimeFrameBorder", true,
@@ -228,6 +226,8 @@ struct lambdak0sflattenicity {
228226
if (doprocessRecMC) {
229227
rEventSelection.add("hFlattenicityDistributionMCGen_Rec", "hFlattenicityDistributionMCGen_Rec",
230228
{HistType::kTH1F, {flatAxis}});
229+
rEventSelection.add("hFlattenicity_Corr_Gen_vs_Rec", "hFlattenicity_Corr_Gen_vs_Rec",
230+
{HistType::kTH2F, {flatAxis, flatAxis}});
231231
}
232232
if (doprocessGenMC) {
233233
rEventSelection.add("hVertexZGen", "hVertexZGen",
@@ -1329,7 +1329,7 @@ struct lambdak0sflattenicity {
13291329
if (applyEvSel &&
13301330
!(isEventSelected(collision))) { // Checking if the event passes the
13311331
// selection criteria
1332-
return;
1332+
continue;
13331333
}
13341334

13351335
auto vtxZ = collision.posZ();
@@ -1349,19 +1349,13 @@ struct lambdak0sflattenicity {
13491349
const auto& posDaughterTrack = v0.posTrack_as<TrackCandidatesMC>();
13501350
const auto& negDaughterTrack = v0.negTrack_as<TrackCandidatesMC>();
13511351

1352-
// if (!posDaughterTrack.has_mcParticle() ||
1353-
// !negDaughterTrack.has_mcParticle()) {
1354-
// continue;
1355-
// }
13561352
if (TMath::Abs(posDaughterTrack.eta()) > cfgTrkEtaCut ||
13571353
TMath::Abs(negDaughterTrack.eta()) > cfgTrkEtaCut ||
13581354
negDaughterTrack.pt() < cfgTrkLowPtCut ||
13591355
posDaughterTrack.pt() < cfgTrkLowPtCut) {
13601356
continue;
13611357
}
13621358

1363-
// auto mcnegtrack = negDaughterTrack.mcParticle_as<aod::McParticles>();
1364-
// auto mcpostrack = posDaughterTrack.mcParticle_as<aod::McParticles>();
13651359
if (!v0.has_mcParticle()) {
13661360
continue;
13671361
}
@@ -1389,15 +1383,6 @@ struct lambdak0sflattenicity {
13891383
auto v0mcParticle = v0.mcParticle();
13901384
// Cut on dynamic columns for K0s
13911385

1392-
// for (auto& particleMotherOfNeg :
1393-
// mcnegtrack.mothers_as<aod::McParticles>()) {
1394-
// for (auto& particleMotherOfPos :
1395-
// mcpostrack.mothers_as<aod::McParticles>()) {
1396-
// if (particleMotherOfNeg == particleMotherOfPos &&
1397-
// (particleMotherOfNeg.pdgCode() == 3122 || particleMotherOfNeg.pdgCode()
1398-
// == -3122 || particleMotherOfNeg.pdgCode() == 310) &&
1399-
// particleMotherOfNeg.isPhysicalPrimary()) {
1400-
14011386
if (v0mcParticle.pdgCode() == 310 && v0.v0cosPA() >= v0setting_cospaK0s &&
14021387
v0.v0radius() >= v0setting_radiusK0s &&
14031388
TMath::Abs(posDaughterTrack.tpcNSigmaPi()) <= NSigmaTPCPion &&
@@ -1489,14 +1474,13 @@ struct lambdak0sflattenicity {
14891474
negDaughterTrack.tpcInnerParam());
14901475
}
14911476
}
1492-
// }
1493-
// }
1494-
// }
14951477
}
14961478

14971479
const auto particlesInCollision = mcParticles.sliceByCached(aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache1);
14981480
float flattenicityMCGen = EstimateFlattenicityFV0MC(particlesInCollision);
14991481
rEventSelection.fill(HIST("hFlattenicityDistributionMCGen_Rec"), flattenicityMCGen);
1482+
rEventSelection.fill(HIST("hFlattenicity_Corr_Gen_vs_Rec"), flattenicityMCGen, flattenicity);
1483+
15001484
for (auto& mcParticle : particlesInCollision) {
15011485
if (!mcParticle.isPhysicalPrimary()) {
15021486
continue;
@@ -1590,7 +1574,7 @@ struct lambdak0sflattenicity {
15901574
//=====================================
15911575

15921576
rEventSelection.fill(HIST("hNEventsMCReco"), 0.5);
1593-
if (!isEventSelected(collision)) {
1577+
if (applyEvSel && !isEventSelected(collision)) {
15941578
continue;
15951579
}
15961580
rEventSelection.fill(HIST("hEventsSelected"), 10.5);

0 commit comments

Comments
 (0)