Skip to content

Commit 52d7ad8

Browse files
authored
[PWGLF] Introduced selection on Nch (#11138)
1 parent 872fde6 commit 52d7ad8

File tree

1 file changed

+33
-8
lines changed

1 file changed

+33
-8
lines changed

PWGLF/Tasks/GlobalEventProperties/uccZdc.cxx

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#include "ReconstructionDataFormats/GlobalTrackID.h"
4747
#include "ReconstructionDataFormats/Track.h"
4848
#include "TPDGCode.h"
49+
#include "TF1.h"
4950

5051
using namespace std;
5152
using namespace o2;
@@ -107,6 +108,7 @@ struct UccZdc {
107108
Configurable<bool> isTDCcut{"isTDCcut", false, "Use TDC cut?"};
108109
Configurable<bool> isZEMcut{"isZEMcut", true, "Use ZEM cut?"};
109110

111+
Configurable<double> nSigmaNchCut{"nSigmaNchCut", 1., "nSigma Nch selection"};
110112
Configurable<double> minNchSel{"minNchSel", 5., "min Nch Selection"};
111113
Configurable<float> znBasedCut{"znBasedCut", 100, "ZN-based cut"};
112114
Configurable<float> zemCut{"zemCut", 1000., "ZEM cut"};
@@ -164,9 +166,13 @@ struct UccZdc {
164166

165167
Service<ccdb::BasicCCDBManager> ccdb;
166168
Configurable<std::string> paTH{"paTH", "Users/o/omvazque/TrackingEfficiency", "base path to the ccdb object"};
169+
Configurable<std::string> paTHmeanNch{"paTHmeanNch", "Users/o/omvazque/FitMeanNch", "base path to the ccdb object"};
170+
Configurable<std::string> paTHsigmaNch{"paTHsigmaNch", "Users/o/omvazque/FitSigmaNch", "base path to the ccdb object"};
167171

168172
// the efficiency has been previously stored in the CCDB as TH1F histogram
169173
TH1F* efficiency = nullptr;
174+
TF1* fitSigmaNch = nullptr;
175+
TF1* fitMeanNch = nullptr;
170176

171177
void init(InitContext const&)
172178
{
@@ -301,14 +307,16 @@ struct UccZdc {
301307
if (doprocessQA) {
302308
registry.add("T0Ccent", ";;Entries", kTH1F, {axisCent});
303309
registry.add("EtaVsPhi", ";#eta;#varphi", kTH2F, {{{axisEta}, {100, -0.1 * PI, +2.1 * PI}}});
304-
registry.add("dcaXYvspTOpen", ";DCA_{xy} (cm);;", kTH2F, {{{150, -3., 3.}, {axisPt}}});
305-
registry.add("dcaXYvspT", ";DCA_{xy} (cm);;", kTH2F, {{{150, -3., 3.}, {axisPt}}});
310+
registry.add("dcaXYvspTOpen", ";DCA_{xy} (cm);;", kTH2F, {{{150, -1.5, 1.5}, {axisPt}}});
311+
registry.add("dcaXYvspT", ";DCA_{xy} (cm);;", kTH2F, {{{150, -1.5, 1.5}, {axisPt}}});
306312
registry.add("nClustersITS", ";<n clusters ITS>;;", kTProfile, {{axisPt}});
307313
registry.add("nClustersTPC", ";<n clusters TPC>;;", kTProfile, {{axisPt}});
308314

309315
registry.add("ZNVsFT0A", ";T0A (#times 1/100);ZNA+ZNC;", kTH2F, {{{nBinsAmpFT0, 0., maxAmpFT0}, {nBinsZDC, -0.5, maxZN}}});
310316
registry.add("ZNVsFT0C", ";T0C (#times 1/100);ZNA+ZNC;", kTH2F, {{{nBinsAmpFT0, 0., maxAmpFT0}, {nBinsZDC, -0.5, maxZN}}});
311317
registry.add("ZNVsFT0M", ";T0A+T0C (#times 1/100);ZNA+ZNC;", kTH2F, {{{nBinsAmpFT0, 0., 3000.}, {nBinsZDC, -0.5, maxZN}}});
318+
registry.add("RejectedEvtsVsFT0M", ";T0A+T0C (#times 1/100, -3.3 < #eta < -2.1 and 3.5 < #eta < 4.9);Entries;", kTH1F, {{nBinsAmpFT0, 0., 3000.}});
319+
registry.add("RejectedEvtsVsNch", ";#it{N}_{ch} (|#eta|<0.8);Entries;", kTH1F, {{nBinsNch, minNch, maxNch}});
312320

313321
registry.add("ZN", ";ZNA+ZNC;Entries;", kTH1F, {{nBinsZDC, -0.5, maxZN}});
314322
registry.add("ZNA", ";ZNA;Entries;", kTH1F, {{nBinsZDC, -0.5, maxZN}});
@@ -452,6 +460,18 @@ struct UccZdc {
452460
return;
453461
}
454462

463+
auto fitMeanNch = ccdb->getForTimeStamp<TF1>(paTHmeanNch.value, foundBC.timestamp());
464+
if (!fitMeanNch) {
465+
LOGF(fatal, "fitMeanNch object not found!");
466+
return;
467+
}
468+
469+
auto fitSigmaNch = ccdb->getForTimeStamp<TF1>(paTHsigmaNch.value, foundBC.timestamp());
470+
if (!fitSigmaNch) {
471+
LOGF(fatal, "fitSigmaNch object not found!");
472+
return;
473+
}
474+
455475
// has ZDC?
456476
if (!foundBC.has_zdc()) {
457477
return;
@@ -533,6 +553,7 @@ struct UccZdc {
533553
}
534554
// Track Selection
535555
if (myTrackSel.IsSelected(track)) {
556+
registry.fill(HIST("dcaXYvspTOpen"), track.dcaXY(), track.pt());
536557
if (passesDCAxyCut(track)) {
537558
glbTracks++;
538559
meanpt += track.pt();
@@ -541,12 +562,20 @@ struct UccZdc {
541562
registry.fill(HIST("dcaXYvspT"), track.dcaXY(), track.pt());
542563
registry.fill(HIST("nClustersITS"), track.pt(), track.itsNCls());
543564
registry.fill(HIST("nClustersTPC"), track.pt(), track.tpcNClsFound());
544-
} else {
545-
registry.fill(HIST("dcaXYvspTOpen"), track.dcaXY(), track.pt());
546565
}
547566
}
548567
}
549568

569+
const double meanNch{fitMeanNch->Eval((aT0A + aT0C) / 100.)};
570+
const double sigmaNch{fitSigmaNch->Eval((aT0A + aT0C) / 100.)};
571+
const double diffMeanNch{std::abs(meanNch - glbTracks)};
572+
const double nSigmaSelection{nSigmaNchCut * sigmaNch};
573+
if (!(diffMeanNch < nSigmaSelection)) {
574+
registry.fill(HIST("RejectedEvtsVsFT0M"), (aT0A + aT0C) / 100.);
575+
registry.fill(HIST("RejectedEvtsVsNch"), glbTracks);
576+
return;
577+
}
578+
550579
registry.fill(HIST("zPos"), collision.posZ());
551580
registry.fill(HIST("T0Ccent"), collision.centFT0C());
552581

@@ -577,10 +606,6 @@ struct UccZdc {
577606
registry.fill(HIST("ZNVsFT0C"), aT0C / 100., sumZNs);
578607
registry.fill(HIST("ZNVsFT0M"), (aT0A + aT0C) / 100., sumZNs);
579608

580-
if (sumZNs > znBasedCut) {
581-
return;
582-
}
583-
584609
registry.fill(HIST("NchVsFV0A"), aV0A / 100., glbTracks);
585610
registry.fill(HIST("NchVsFT0A"), aT0A / 100., glbTracks);
586611
registry.fill(HIST("NchVsFT0C"), aT0C / 100., glbTracks);

0 commit comments

Comments
 (0)