Skip to content

Commit 2d97e3c

Browse files
Removing deprecated event selection in sigmaanalysis
1 parent 3aaff9a commit 2d97e3c

File tree

2 files changed

+11
-163
lines changed

2 files changed

+11
-163
lines changed

PWGLF/TableProducer/Strangeness/sigma0builder.cxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ struct sigma0builder {
289289
if (fGetIR){
290290
histos.add("GeneralQA/hRunNumberNegativeIR", "", kTH1D, {{1, 0., 1.}});
291291
histos.add("GeneralQA/hInteractionRate", "hInteractionRate", kTH1F, {axisIRBinning});
292+
histos.add("GeneralQA/hCentralityVsInteractionRate", "hCentralityVsInteractionRate", kTH2F, {axisCentrality, axisIRBinning});
292293
}
293294

294295
if (doAssocStudy && doprocessMonteCarlo){
@@ -922,7 +923,8 @@ struct sigma0builder {
922923
if (interactionRate<0)
923924
histos.get<TH1>(HIST("GeneralQA/hRunNumberNegativeIR"))->Fill(Form("%d", coll.runNumber()), 1);
924925

925-
histos.fill(HIST("GeneralQA/hInteractionRate"), interactionRate);
926+
histos.fill(HIST("GeneralQA/hInteractionRate"), interactionRate);
927+
histos.fill(HIST("GeneralQA/hCentralityVsInteractionRate"), centrality, interactionRate);
926928
}
927929

928930
std::vector<int> bestGammasArray;
@@ -1112,7 +1114,8 @@ struct sigma0builder {
11121114
if (interactionRate<0)
11131115
histos.get<TH1>(HIST("GeneralQA/hRunNumberNegativeIR"))->Fill(Form("%d", coll.runNumber()), 1);
11141116

1115-
histos.fill(HIST("GeneralQA/hInteractionRate"), interactionRate);
1117+
histos.fill(HIST("GeneralQA/hInteractionRate"), interactionRate);
1118+
histos.fill(HIST("GeneralQA/hCentralityVsInteractionRate"), centrality, interactionRate);
11161119
}
11171120

11181121
std::vector<int> bestGammasArray;

PWGLF/Tasks/Strangeness/sigmaanalysis.cxx

Lines changed: 6 additions & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -64,39 +64,13 @@ struct sigmaanalysis {
6464
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
6565

6666
// Interaction rate selection:
67-
// Event selection
68-
Configurable<bool> doPPAnalysis{"doPPAnalysis", true, "if in pp, set to true"};
67+
// Event selection
6968
Configurable<bool> fGetIR{"fGetIR", false, "Flag to retrieve the IR info."};
7069
Configurable<bool> fIRCrashOnNull{"fIRCrashOnNull", false, "Flag to avoid CTP RateFetcher crash."};
7170
Configurable<std::string> irSource{"irSource", "T0VTX", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"};
7271
Configurable<float> minIR{"minIR", -1, "Min Interaction Rate (kHz). Leave -1 if no selection desired."};
7372
Configurable<float> maxIR{"maxIR", -1, "Max Interaction Rate (kHz). Leave -1 if no selection desired."};
7473

75-
struct : ConfigurableGroup {
76-
Configurable<bool> requireSel8{"requireSel8", true, "require sel8 event selection"};
77-
Configurable<bool> requireTriggerTVX{"requireTriggerTVX", true, "require FT0 vertex (acceptable FT0C-FT0A time difference) at trigger level"};
78-
Configurable<bool> rejectITSROFBorder{"rejectITSROFBorder", true, "reject events at ITS ROF border"};
79-
Configurable<bool> rejectTFBorder{"rejectTFBorder", true, "reject events at TF border"};
80-
Configurable<bool> requireIsVertexITSTPC{"requireIsVertexITSTPC", true, "require events with at least one ITS-TPC track"};
81-
Configurable<bool> requireIsGoodZvtxFT0VsPV{"requireIsGoodZvtxFT0VsPV", true, "require events with PV position along z consistent (within 1 cm) between PV reconstructed using tracks and PV using FT0 A-C time difference"};
82-
Configurable<bool> requireIsVertexTOFmatched{"requireIsVertexTOFmatched", false, "require events with at least one of vertex contributors matched to TOF"};
83-
Configurable<bool> requireIsVertexTRDmatched{"requireIsVertexTRDmatched", false, "require events with at least one of vertex contributors matched to TRD"};
84-
Configurable<bool> rejectSameBunchPileup{"rejectSameBunchPileup", false, "reject collisions in case of pileup with another collision in the same foundBC"};
85-
Configurable<bool> requireNoCollInTimeRangeStd{"requireNoCollInTimeRangeStd", false, "reject collisions corrupted by the cannibalism, with other collisions within +/- 2 microseconds or mult above a certain threshold in -4 - -2 microseconds"};
86-
Configurable<bool> requireNoCollInTimeRangeStrict{"requireNoCollInTimeRangeStrict", false, "reject collisions corrupted by the cannibalism, with other collisions within +/- 10 microseconds"};
87-
Configurable<bool> requireNoCollInTimeRangeNarrow{"requireNoCollInTimeRangeNarrow", false, "reject collisions corrupted by the cannibalism, with other collisions within +/- 2 microseconds"};
88-
Configurable<bool> requireNoCollInTimeRangeVzDep{"requireNoCollInTimeRangeVzDep", false, "reject collisions corrupted by the cannibalism, with other collisions with pvZ of drifting TPC tracks from past/future collisions within 2.5 cm the current pvZ"};
89-
Configurable<bool> requireNoCollInROFStd{"requireNoCollInROFStd", false, "reject collisions corrupted by the cannibalism, with other collisions within the same ITS ROF with mult. above a certain threshold"};
90-
Configurable<bool> requireNoCollInROFStrict{"requireNoCollInROFStrict", false, "reject collisions corrupted by the cannibalism, with other collisions within the same ITS ROF"};
91-
Configurable<bool> requireINEL0{"requireINEL0", false, "require INEL>0 event selection"};
92-
Configurable<bool> requireINEL1{"requireINEL1", false, "require INEL>1 event selection"};
93-
Configurable<float> maxZVtxPosition{"maxZVtxPosition", 10., "max Z vtx position"};
94-
Configurable<bool> useFT0CbasedOccupancy{"useFT0CbasedOccupancy", false, "Use sum of FT0-C amplitudes for estimating occupancy? (if not, use track-based definition)"};
95-
// fast check on occupancy
96-
Configurable<float> minOccupancy{"minOccupancy", -1, "minimum occupancy from neighbouring collisions"};
97-
Configurable<float> maxOccupancy{"maxOccupancy", -1, "maximum occupancy from neighbouring collisions"};
98-
} eventSelections;
99-
10074
// Analysis strategy:
10175
Configurable<bool> fUseMLSel{"fUseMLSel", false, "Flag to use ML selection. If False, the standard selection is applied."};
10276
Configurable<bool> fProcessMonteCarlo{"fProcessMonteCarlo", false, "Flag to process MC data."};
@@ -202,6 +176,7 @@ struct sigmaanalysis {
202176

203177
// ML
204178
ConfigurableAxis MLProb{"MLOutput", {100, 0.0f, 1.0f}, ""};
179+
205180
int nSigmaCandidates = 0;
206181
void init(InitContext const&)
207182
{
@@ -210,38 +185,10 @@ struct sigmaanalysis {
210185
ccdb->setCaching(true);
211186
ccdb->setFatalWhenNull(false);
212187

213-
// Event Counters
214-
histos.add("hEventSelection", "hEventSelection", kTH1F, {{20, -0.5f, +18.5f}});
215-
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(1, "All collisions");
216-
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(2, "sel8 cut");
217-
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(3, "kIsTriggerTVX");
218-
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(4, "kNoITSROFrameBorder");
219-
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(5, "kNoTimeFrameBorder");
220-
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(6, "posZ cut");
221-
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(7, "kIsVertexITSTPC");
222-
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(8, "kIsGoodZvtxFT0vsPV");
223-
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(9, "kIsVertexTOFmatched");
224-
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(10, "kIsVertexTRDmatched");
225-
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(11, "kNoSameBunchPileup");
226-
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(12, "kNoCollInTimeRangeStd");
227-
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(13, "kNoCollInTimeRangeStrict");
228-
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(14, "kNoCollInTimeRangeNarrow");
229-
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(15, "kNoCollInRofStd");
230-
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(16, "kNoCollInRofStrict");
231-
if (doPPAnalysis) {
232-
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(17, "INEL>0");
233-
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(18, "INEL>1");
234-
} else {
235-
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(17, "Below min occup.");
236-
histos.get<TH1>(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(18, "Above max occup.");
237-
}
238-
239188
// All candidates received
240189
histos.add("GeneralQA/hRunNumberNegativeIR", "", kTH1D, {{1, 0., 1.}});
241-
histos.add("GeneralQA/hInteractionRate", "hInteractionRate", kTH1F, {axisIRBinning});
242-
histos.add("GeneralQA/hInteractionRatePerColl", "hInteractionRatePerColl", kTH1F, {axisIRBinning});
243-
histos.add("GeneralQA/hCentralityVsInteractionRate", "hCentralityVsInteractionRate", kTH2F, {axisCentrality, axisIRBinning});
244-
histos.add("GeneralQA/hCentralityVsInteractionRatePerColl", "hCentralityVsInteractionRatePerColl", kTH2F, {axisCentrality, axisIRBinning});
190+
histos.add("GeneralQA/hInteractionRate", "hInteractionRate", kTH1F, {axisIRBinning});
191+
histos.add("GeneralQA/hCentralityVsInteractionRate", "hCentralityVsInteractionRate", kTH2F, {axisCentrality, axisIRBinning});
245192
histos.add("GeneralQA/h2dArmenterosBeforeSel", "h2dArmenterosBeforeSel", {HistType::kTH2F, {axisAPAlpha, axisAPQt}});
246193
histos.add("GeneralQA/h2dArmenterosAfterSel", "h2dArmenterosAfterSel", {HistType::kTH2F, {axisAPAlpha, axisAPQt}});
247194
histos.add("GeneralQA/hMassSigma0BeforeSel", "hMassSigma0BeforeSel", kTH1F, {axisSigmaMass});
@@ -523,94 +470,6 @@ struct sigmaanalysis {
523470
}
524471
}
525472

526-
template <typename TCollision>
527-
bool IsEventAccepted(TCollision collision)
528-
// check whether the collision passes our collision selections
529-
{
530-
histos.fill(HIST("hEventSelection"), 0. /* all collisions */);
531-
if (eventSelections.requireSel8 && !collision.sel8()) {
532-
return false;
533-
}
534-
histos.fill(HIST("hEventSelection"), 1 /* sel8 collisions */);
535-
if (eventSelections.requireTriggerTVX && !collision.selection_bit(aod::evsel::kIsTriggerTVX)) {
536-
return false;
537-
}
538-
histos.fill(HIST("hEventSelection"), 2 /* FT0 vertex (acceptable FT0C-FT0A time difference) collisions */);
539-
if (eventSelections.rejectITSROFBorder && !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) {
540-
return false;
541-
}
542-
histos.fill(HIST("hEventSelection"), 3 /* Not at ITS ROF border */);
543-
if (eventSelections.rejectTFBorder && !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) {
544-
return false;
545-
}
546-
histos.fill(HIST("hEventSelection"), 4 /* Not at TF border */);
547-
if (std::abs(collision.posZ()) > eventSelections.maxZVtxPosition) {
548-
return false;
549-
}
550-
histos.fill(HIST("hEventSelection"), 5 /* vertex-Z selected */);
551-
if (eventSelections.requireIsVertexITSTPC && !collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) {
552-
return false;
553-
}
554-
histos.fill(HIST("hEventSelection"), 6 /* Contains at least one ITS-TPC track */);
555-
if (eventSelections.requireIsGoodZvtxFT0VsPV && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) {
556-
return false;
557-
}
558-
histos.fill(HIST("hEventSelection"), 7 /* PV position consistency check */);
559-
if (eventSelections.requireIsVertexTOFmatched && !collision.selection_bit(o2::aod::evsel::kIsVertexTOFmatched)) {
560-
return false;
561-
}
562-
histos.fill(HIST("hEventSelection"), 8 /* PV with at least one contributor matched with TOF */);
563-
if (eventSelections.requireIsVertexTRDmatched && !collision.selection_bit(o2::aod::evsel::kIsVertexTRDmatched)) {
564-
return false;
565-
}
566-
histos.fill(HIST("hEventSelection"), 9 /* PV with at least one contributor matched with TRD */);
567-
if (eventSelections.rejectSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) {
568-
return false;
569-
}
570-
histos.fill(HIST("hEventSelection"), 10 /* Not at same bunch pile-up */);
571-
if (eventSelections.requireNoCollInTimeRangeStd && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) {
572-
return false;
573-
}
574-
histos.fill(HIST("hEventSelection"), 11 /* No other collision within +/- 2 microseconds or mult above a certain threshold in -4 - -2 microseconds*/);
575-
if (eventSelections.requireNoCollInTimeRangeStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStrict)) {
576-
return false;
577-
}
578-
histos.fill(HIST("hEventSelection"), 12 /* No other collision within +/- 10 microseconds */);
579-
if (eventSelections.requireNoCollInTimeRangeNarrow && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeNarrow)) {
580-
return false;
581-
}
582-
histos.fill(HIST("hEventSelection"), 13 /* No other collision within +/- 2 microseconds */);
583-
if (eventSelections.requireNoCollInROFStd && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) {
584-
return false;
585-
}
586-
histos.fill(HIST("hEventSelection"), 14 /* No other collision within the same ITS ROF with mult. above a certain threshold */);
587-
if (eventSelections.requireNoCollInROFStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStrict)) {
588-
return false;
589-
}
590-
histos.fill(HIST("hEventSelection"), 15 /* No other collision within the same ITS ROF */);
591-
if (doPPAnalysis) { // we are in pp
592-
if (eventSelections.requireINEL0 && collision.multNTracksPVeta1() < 1) {
593-
return false;
594-
}
595-
histos.fill(HIST("hEventSelection"), 16 /* INEL > 0 */);
596-
if (eventSelections.requireINEL1 && collision.multNTracksPVeta1() < 2) {
597-
return false;
598-
}
599-
histos.fill(HIST("hEventSelection"), 17 /* INEL > 1 */);
600-
} else { // we are in Pb-Pb
601-
float collisionOccupancy = eventSelections.useFT0CbasedOccupancy ? collision.ft0cOccupancyInTimeRange() : collision.trackOccupancyInTimeRange();
602-
if (eventSelections.minOccupancy >= 0 && collisionOccupancy < eventSelections.minOccupancy) {
603-
return false;
604-
}
605-
histos.fill(HIST("hEventSelection"), 16 /* Below min occupancy */);
606-
if (eventSelections.maxOccupancy >= 0 && collisionOccupancy > eventSelections.maxOccupancy) {
607-
return false;
608-
}
609-
histos.fill(HIST("hEventSelection"), 17 /* Above max occupancy */);
610-
}
611-
return true;
612-
}
613-
614473
// Apply selections in sigma candidates
615474
template <typename TV0Object>
616475
bool processSigmaCandidate(TV0Object const& cand, bool isLambdalike)
@@ -1187,23 +1046,9 @@ struct sigmaanalysis {
11871046
histos.fill(HIST("GeneralQA/hPhotonMassSelected"), sigma.photonMass());
11881047
}
11891048
}
1190-
1191-
void processCollisions(soa::Join<aod::StraCollisions, aod::StraCents, aod::StraEvSels, aod::StraStamps> const& collisions)
1192-
{
1193-
for (const auto& coll : collisions) {
1194-
if (!IsEventAccepted(coll)) {
1195-
continue;
1196-
}
1197-
double interactionRate = rateFetcher.fetch(ccdb.service, coll.timestamp(), coll.runNumber(), irSource) * 1.e-3;
1198-
histos.fill(HIST("GeneralQA/hInteractionRatePerColl"), interactionRate);
1199-
histos.fill(HIST("GeneralQA/hCentralityVsInteractionRatePerColl"), coll.centFT0C(), interactionRate);
1200-
}
1201-
}
1202-
1203-
// PROCESS_SWITCH(sigmaanalysis, processCounterQA, "Check standard counter correctness", true);
1049+
12041050
PROCESS_SWITCH(sigmaanalysis, processMonteCarlo, "Do Monte-Carlo-based analysis", false);
1205-
PROCESS_SWITCH(sigmaanalysis, processRealData, "Do real data analysis", true);
1206-
PROCESS_SWITCH(sigmaanalysis, processCollisions, "Process collisions to retrieve IR info", false);
1051+
PROCESS_SWITCH(sigmaanalysis, processRealData, "Do real data analysis", true);
12071052
};
12081053

12091054
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)