Skip to content

Commit 4d048a9

Browse files
authored
[PWGLF] Fix inelgt0 criteria (#17568)
1 parent e2f684f commit 4d048a9

1 file changed

Lines changed: 29 additions & 9 deletions

File tree

PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,10 @@ struct StudyPnch {
171171
}
172172
if (doprocessEvtLossSigLossMC) {
173173
histos.add("MCEventHist", "MCEventHist", kTH1F, {axisEvent}, false);
174-
auto hstat = histos.get<TH1>(HIST("MCEventHist"));
175-
auto* x = hstat->GetXaxis();
176-
x->SetBinLabel(1, "All MC events");
177-
x->SetBinLabel(2, "MC events with atleast one reco event");
174+
auto hstatevloss = histos.get<TH1>(HIST("MCEventHist"));
175+
auto* xevloss = hstatevloss->GetXaxis();
176+
xevloss->SetBinLabel(1, "All MC events");
177+
xevloss->SetBinLabel(2, "MC events with atleast one reco event");
178178
histos.add("hMultiplicityMCgenAll", "hMultiplicityMCgenAll", kTH1F, {axisMult}, true);
179179
histos.add("hMultiplicityMCgenSel", "hMultiplicityMCgenSel", kTH1F, {axisMult}, true);
180180
}
@@ -401,7 +401,11 @@ struct StudyPnch {
401401
return;
402402
}
403403
auto mult = countNTracks(tracks);
404-
if (mult > 0) {
404+
if (isApplyInelgt0 && etaRange == 1.0f) {
405+
if (mult > 0) {
406+
histos.fill(HIST("hMultiplicityData"), mult);
407+
}
408+
} else {
405409
histos.fill(HIST("hMultiplicityData"), mult);
406410
}
407411
}
@@ -438,14 +442,22 @@ struct StudyPnch {
438442
}
439443
auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex());
440444
auto multrec = countNTracksMcCol(recTracksPart, RecCol);
441-
histos.fill(HIST("hMultiplicityMCrec"), multrec);
442445
float multgen = countGenTracks(GenParticles, RecCol);
446+
float nTrkPtCut = countTracksPtCut(GenParticles, RecCol);
447+
if (isApplyInelgt0 && etaRange == 1.0f) {
448+
if (multrec == 0 || multgen == 0) {
449+
if (nTrkPtCut == 0) {
450+
continue;
451+
}
452+
continue;
453+
}
454+
}
455+
histos.fill(HIST("hMultiplicityMCrec"), multrec);
443456
if (cPrint) {
444457
LOG(info) << "Generated Particles with standard pT:" << multgen;
445458
}
446459
histos.fill(HIST("hMultiplicityMCgen"), multgen);
447460
histos.fill(HIST("hResponseMatrix"), multrec, multgen);
448-
float nTrkPtCut = countTracksPtCut(GenParticles, RecCol);
449461
nTrkPtCut = multgen + nTrkPtCut;
450462
if (cPrint) {
451463
LOG(info) << "After Counting low pT: " << nTrkPtCut;
@@ -481,7 +493,11 @@ struct StudyPnch {
481493
}
482494
nTrk_multAll++;
483495
}
484-
if (nTrk_multAll > 0) {
496+
if (isApplyInelgt0 && etaRange == 1.0f) {
497+
if (nTrk_multAll > 0) {
498+
histos.fill(HIST("hMultiplicityMCgenAll"), nTrk_multAll);
499+
}
500+
} else {
485501
histos.fill(HIST("hMultiplicityMCgenAll"), nTrk_multAll);
486502
}
487503

@@ -508,7 +524,11 @@ struct StudyPnch {
508524
}
509525
nTrk_multSel++;
510526
}
511-
if (nTrk_multSel > 0) {
527+
if (isApplyInelgt0 && etaRange == 1.0f) {
528+
if (nTrk_multSel > 0) {
529+
histos.fill(HIST("hMultiplicityMCgenSel"), nTrk_multSel);
530+
}
531+
} else {
512532
histos.fill(HIST("hMultiplicityMCgenSel"), nTrk_multSel);
513533
}
514534
}

0 commit comments

Comments
 (0)