Skip to content

Commit fbb0d78

Browse files
authored
[PWGLF] Adds selection based on <Nch> and sigma (#11166)
1 parent 180568f commit fbb0d78

File tree

1 file changed

+48
-12
lines changed

1 file changed

+48
-12
lines changed

PWGLF/Tasks/GlobalEventProperties/uccZdc.cxx

Lines changed: 48 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ struct UccZdc {
244244
registry.add("EtaVsPhi", ";#eta;#varphi", kTH2F, {{{axisEta}, {100, -0.1 * PI, +2.1 * PI}}});
245245
registry.add("sigma1Pt", ";;#sigma(p_{T})/p_{T};", kTProfile, {axisPt});
246246
registry.add("dcaXYvspT", ";DCA_{xy} (cm);;", kTH2F, {{{50, -1., 1.}, {axisPt}}});
247+
registry.add("RejectedEvtsVsFT0M", ";T0A+T0C (#times 1/100, -3.3 < #eta < -2.1 and 3.5 < #eta < 4.9);Entries;", kTH1F, {{nBinsAmpFT0, 0., 3000.}});
248+
registry.add("RejectedEvtsVsNch", ";#it{N}_{ch} (|#eta|<0.8);Entries;", kTH1F, {{300, 0., 3000.}});
247249

248250
registry.add("Nch", ";#it{N}_{ch} (|#eta| < 0.8, Corrected);", kTH1F, {{nBinsNch, minNch, maxNch}});
249251
registry.add("NchVsPt", ";#it{N}_{ch} (|#eta| < 0.8, Corrected);;", kTH2F, {{{nBinsNch, minNch, maxNch}, {axisPt}}});
@@ -531,10 +533,10 @@ struct UccZdc {
531533
float znC{zdc.amplitudeZNC()};
532534
float zpA{zdc.amplitudeZPA()};
533535
float zpC{zdc.amplitudeZPC()};
534-
znA /= 2.81;
535-
znC /= 2.81;
536-
zpA /= 2.81;
537-
zpC /= 2.81;
536+
znA /= 2.68;
537+
znC /= 2.68;
538+
zpA /= 2.68;
539+
zpC /= 2.68;
538540

539541
float tZEM1{zdc.timeZEM1()};
540542
float tZEM2{zdc.timeZEM2()};
@@ -579,10 +581,10 @@ struct UccZdc {
579581
registry.fill(HIST("zPos"), collision.posZ());
580582
registry.fill(HIST("T0Ccent"), collision.centFT0C());
581583

582-
registry.fill(HIST("ZNCcvsZNCsum"), sumZNC / 2.81, zdc.energyCommonZNC() / 2.81);
583-
registry.fill(HIST("ZNAcvsZNAsum"), sumZNA / 2.81, zdc.energyCommonZNA() / 2.81);
584-
registry.fill(HIST("ZPCcvsZPCsum"), sumZPC / 2.81, zdc.energyCommonZPC() / 2.81);
585-
registry.fill(HIST("ZPAcvsZPAsum"), sumZPA / 2.81, zdc.energyCommonZPA() / 2.81);
584+
registry.fill(HIST("ZNCcvsZNCsum"), sumZNC / 2.68, zdc.energyCommonZNC() / 2.68);
585+
registry.fill(HIST("ZNAcvsZNAsum"), sumZNA / 2.68, zdc.energyCommonZNA() / 2.68);
586+
registry.fill(HIST("ZPCcvsZPCsum"), sumZPC / 2.68, zdc.energyCommonZPC() / 2.68);
587+
registry.fill(HIST("ZPAcvsZPAsum"), sumZPA / 2.68, zdc.energyCommonZPA() / 2.68);
586588

587589
registry.fill(HIST("ZNA"), znA);
588590
registry.fill(HIST("ZNC"), znC);
@@ -636,9 +638,21 @@ struct UccZdc {
636638
// LOGF(info, "Getting object %s for run number %i from timestamp=%llu", paTH.value.data(), foundBC.runNumber(), foundBC.timestamp());
637639

638640
auto efficiency = ccdb->getForTimeStamp<TH1F>(paTH.value, foundBC.timestamp());
639-
// auto efficiency = ccdb->getForRun<TH1F>(paTH.value, foundBC.runNumber());
640641
if (!efficiency) {
641642
LOGF(fatal, "Efficiency object not found!");
643+
return;
644+
}
645+
646+
auto fitMeanNch = ccdb->getForTimeStamp<TF1>(paTHmeanNch.value, foundBC.timestamp());
647+
if (!fitMeanNch) {
648+
LOGF(fatal, "fitMeanNch object not found!");
649+
return;
650+
}
651+
652+
auto fitSigmaNch = ccdb->getForTimeStamp<TF1>(paTHsigmaNch.value, foundBC.timestamp());
653+
if (!fitSigmaNch) {
654+
LOGF(fatal, "fitSigmaNch object not found!");
655+
return;
642656
}
643657

644658
// has ZDC?
@@ -647,7 +661,16 @@ struct UccZdc {
647661
}
648662
registry.fill(HIST("hEventCounter"), EvCutLabel::Zdc);
649663

650-
if (!foundBC.has_ft0()) {
664+
// has T0?
665+
float aT0A = 0., aT0C = 0.;
666+
if (foundBC.has_ft0()) {
667+
for (const auto& amplitude : foundBC.ft0().amplitudeA()) {
668+
aT0A += amplitude;
669+
}
670+
for (const auto& amplitude : foundBC.ft0().amplitudeC()) {
671+
aT0C += amplitude;
672+
}
673+
} else {
651674
return;
652675
}
653676
registry.fill(HIST("hEventCounter"), EvCutLabel::TZero);
@@ -662,8 +685,8 @@ struct UccZdc {
662685
float tZPC{foundBC.zdc().timeZPC()};
663686
float tZDCdif{tZNC + tZPC - tZNA - tZPA};
664687
float tZDCsum{tZNC + tZPC + tZNA + tZPA};
665-
znA /= 2.81;
666-
znC /= 2.81;
688+
znA /= 2.68;
689+
znC /= 2.68;
667690
float sumZNs{znA + znC};
668691
float sumZEMs{aZEM1 + aZEM2};
669692

@@ -686,6 +709,7 @@ struct UccZdc {
686709
registry.fill(HIST("zPos"), collision.posZ());
687710
registry.fill(HIST("T0Ccent"), collision.centFT0C());
688711

712+
int glbTracks{0};
689713
std::vector<float> pTs;
690714
std::vector<float> wIs;
691715
// Calculates the event weight, W_k
@@ -698,6 +722,7 @@ struct UccZdc {
698722
registry.fill(HIST("sigma1Pt"), track.pt(), track.sigma1Pt());
699723
registry.fill(HIST("dcaXYvspT"), track.dcaXY(), track.pt());
700724

725+
glbTracks++;
701726
float pt{track.pt()};
702727
double weight{efficiency->GetBinContent(efficiency->FindBin(pt))};
703728
if (weight > 0.) {
@@ -712,10 +737,21 @@ struct UccZdc {
712737
}
713738
}
714739

740+
const double meanNch{fitMeanNch->Eval((aT0A + aT0C) / 100.)};
741+
const double sigmaNch{fitSigmaNch->Eval((aT0A + aT0C) / 100.)};
742+
const double diffMeanNch{std::abs(meanNch - glbTracks)};
743+
const double nSigmaSelection{nSigmaNchCut * sigmaNch};
744+
if (!(diffMeanNch < nSigmaSelection)) {
745+
registry.fill(HIST("RejectedEvtsVsFT0M"), (aT0A + aT0C) / 100.);
746+
registry.fill(HIST("RejectedEvtsVsNch"), glbTracks);
747+
return;
748+
}
749+
715750
double p1, p2, p3, p4, w1, w2, w3, w4;
716751
p1 = p2 = p3 = p4 = w1 = w2 = w3 = w4 = 0.0;
717752
getPTpowers(pTs, wIs, p1, w1, p2, w2, p3, w3, p4, w4);
718753
const double nch{static_cast<double>(pTs.size())};
754+
// To avoid calculating <pt> with zero particles
719755
if (nch < minNchSel) {
720756
return;
721757
}

0 commit comments

Comments
 (0)