Skip to content

Commit 05f9891

Browse files
authored
[PWGLF] Add flag to use T0M or V0A-based Nch rejection (#12232)
1 parent 5e3310a commit 05f9891

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

PWGLF/Tasks/GlobalEventProperties/uccZdc.cxx

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737

3838
#include "TPDGCode.h"
3939
#include <TRandom3.h>
40+
#include <TString.h>
4041

4142
#include <chrono>
4243
#include <cmath>
@@ -118,6 +119,7 @@ struct UccZdc {
118119
Configurable<bool> applyFD{"applyFD", false, "Apply track-by-track feed down correction"};
119120
Configurable<bool> correctNch{"correctNch", true, "Correct also Nch"};
120121
Configurable<bool> skipRecoColGTOne{"skipRecoColGTOne", true, "Remove collisions if reconstructed more than once"};
122+
Configurable<std::string> detector4Calibration{"detector4Calibration", "T0M", "Detector for nSigma-Nch rejection"};
121123

122124
// Event selection
123125
Configurable<float> posZcut{"posZcut", +10.0, "z-vertex position cut"};
@@ -243,6 +245,7 @@ struct UccZdc {
243245
registry.add("NchUncorrected", Form(";%s;Entries;", tiNch), kTH1F, {{nBinsNch, minNch, maxNch}});
244246
registry.add("hEventCounter", ";;Events", kTH1F, {axisEvent});
245247
registry.add("ExcludedEvtVsFT0M", Form(";%s;Entries;", tiT0M), kTH1F, {{nBinsAmpFT0, 0., maxAmpFT0}});
248+
registry.add("ExcludedEvtVsFV0A", Form(";%s;Entries;", tiT0M), kTH1F, {{nBinsAmpV0A, 0., maxAmpV0A}});
246249
registry.add("ExcludedEvtVsNch", Form(";%s;Entries;", tiNch), kTH1F, {{nBinsNch, minNch, maxNch}});
247250
registry.add("Nch", Form(";%s;Entries;", tiNch), kTH1F, {{nBinsNch, minNch, maxNch}});
248251
registry.add("NchVsOneParCorr", Form(";%s;%s;", tiNch, tiOneParCorr), kTProfile, {{nBinsNch, minNch, maxNch}});
@@ -403,6 +406,7 @@ struct UccZdc {
403406
LOG(info) << "\tpaTHEff=" << paTHEff.value;
404407
LOG(info) << "\tpaTHFD=" << paTHFD.value;
405408
LOG(info) << "\tuseMidRapNchSel=" << useMidRapNchSel.value;
409+
LOG(info) << "\tdetector4Calibration=" << detector4Calibration.value;
406410
LOG(info) << "\tnSigmaNchCut=" << nSigmaNchCut.value;
407411
LOG(info) << "\tpaTHmeanNch=" << paTHmeanNch.value;
408412
LOG(info) << "\tpaTHsigmaNch=" << paTHsigmaNch.value;
@@ -599,14 +603,24 @@ struct UccZdc {
599603
if (!(cfgNch.hMeanNch && cfgNch.hSigmaNch))
600604
return;
601605

602-
const int binT0M{cfgNch.hMeanNch->FindBin(normT0M)};
603-
const double meanNch{cfgNch.hMeanNch->GetBinContent(binT0M)};
604-
const double sigmaNch{cfgNch.hSigmaNch->GetBinContent(binT0M)};
606+
TString s1 = TString(detector4Calibration.value);
607+
double xEval{1.};
608+
if (s1 == "T0M") {
609+
xEval = normT0M;
610+
}
611+
if (s1 == "V0A") {
612+
xEval = normV0A;
613+
}
614+
615+
const int bin4Calibration{cfgNch.hMeanNch->FindBin(xEval)};
616+
const double meanNch{cfgNch.hMeanNch->GetBinContent(bin4Calibration)};
617+
const double sigmaNch{cfgNch.hSigmaNch->GetBinContent(bin4Calibration)};
605618
const double nSigmaSelection{nSigmaNchCut * sigmaNch};
606619
const double diffMeanNch{meanNch - glbTracks};
607620

608621
if (std::abs(diffMeanNch) > nSigmaSelection) {
609622
registry.fill(HIST("ExcludedEvtVsFT0M"), normT0M);
623+
registry.fill(HIST("ExcludedEvtVsFV0A"), normV0A);
610624
registry.fill(HIST("ExcludedEvtVsNch"), glbTracks);
611625
skipEvent = true;
612626
}
@@ -763,19 +777,28 @@ struct UccZdc {
763777

764778
bool skipEvent{false};
765779
if (useMidRapNchSel) {
766-
767780
loadNchCalibrations(foundBC.timestamp());
768781
if (!(cfgNch.hMeanNch && cfgNch.hSigmaNch))
769782
return;
770783

771-
const int binT0M{cfgNch.hMeanNch->FindBin(normT0M)};
772-
const double meanNch{cfgNch.hMeanNch->GetBinContent(binT0M)};
773-
const double sigmaNch{cfgNch.hSigmaNch->GetBinContent(binT0M)};
784+
TString s1 = TString(detector4Calibration.value);
785+
double xEval{1.};
786+
if (s1 == "T0M") {
787+
xEval = normT0M;
788+
}
789+
if (s1 == "V0A") {
790+
xEval = normV0A;
791+
}
792+
793+
const int bin4Calibration{cfgNch.hMeanNch->FindBin(xEval)};
794+
const double meanNch{cfgNch.hMeanNch->GetBinContent(bin4Calibration)};
795+
const double sigmaNch{cfgNch.hSigmaNch->GetBinContent(bin4Calibration)};
774796
const double nSigmaSelection{nSigmaNchCut * sigmaNch};
775797
const double diffMeanNch{meanNch - glbTracks};
776798

777799
if (std::abs(diffMeanNch) > nSigmaSelection) {
778800
registry.fill(HIST("ExcludedEvtVsFT0M"), normT0M);
801+
registry.fill(HIST("ExcludedEvtVsFV0A"), normV0A);
779802
registry.fill(HIST("ExcludedEvtVsNch"), glbTracks);
780803
skipEvent = true;
781804
}

0 commit comments

Comments
 (0)