Skip to content

Commit f9b8b21

Browse files
Add event selection vs centrality histogram
1 parent 01cd68c commit f9b8b21

File tree

1 file changed

+147
-23
lines changed

1 file changed

+147
-23
lines changed

PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx

Lines changed: 147 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,34 @@ struct derivedlambdakzeroanalysis {
643643
histos.add("hCentralityVsNch", "hCentralityVsNch", kTH2D, {{101, 0.0f, 101.0f}, axisConfigurations.axisNch});
644644
if (doEventQA) {
645645
if (isRun3) {
646+
histos.add("hEventSelectionVsCentrality", "hEventSelectionVsCentrality", kTH2D, {{21, -0.5f, +20.5f}, {101, 0.0f, 101.0f}});
647+
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(1, "All collisions");
648+
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(2, "sel8 cut");
649+
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(3, "kIsTriggerTVX");
650+
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(4, "kNoITSROFrameBorder");
651+
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(5, "kNoTimeFrameBorder");
652+
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(6, "posZ cut");
653+
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(7, "kIsVertexITSTPC");
654+
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(8, "kIsGoodZvtxFT0vsPV");
655+
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(9, "kIsVertexTOFmatched");
656+
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(10, "kIsVertexTRDmatched");
657+
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(11, "kNoSameBunchPileup");
658+
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(12, "kNoCollInTimeRangeStd");
659+
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(13, "kNoCollInTimeRangeStrict");
660+
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(14, "kNoCollInTimeRangeNarrow");
661+
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(15, "kNoCollInRofStd");
662+
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(16, "kNoCollInRofStrict");
663+
if (doPPAnalysis) {
664+
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(17, "INEL>0");
665+
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(18, "INEL>1");
666+
} else {
667+
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(17, "Below min occup.");
668+
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(18, "Above max occup.");
669+
}
670+
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(19, "Below min IR");
671+
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(20, "Above max IR");
672+
histos.get<TH2>(HIST("hEventSelectionVsCentrality"))->GetXaxis()->SetBinLabel(21, "RCT flags");
673+
646674
histos.add("hCentralityVsNGlobal", "hCentralityVsNGlobal", kTH2D, {{101, 0.0f, 101.0f}, axisConfigurations.axisNch});
647675
histos.add("hEventCentVsMultFT0M", "hEventCentVsMultFT0M", kTH2D, {{101, 0.0f, 101.0f}, axisConfigurations.axisMultFT0M});
648676
histos.add("hEventCentVsMultFT0C", "hEventCentVsMultFT0C", kTH2D, {{101, 0.0f, 101.0f}, axisConfigurations.axisMultFT0C});
@@ -1924,147 +1952,243 @@ struct derivedlambdakzeroanalysis {
19241952
bool isEventAccepted(TCollision collision, bool fillHists)
19251953
// check whether the collision passes our collision selections
19261954
{
1927-
if (fillHists)
1955+
float centrality = -1.0f;
1956+
if (fillHists) {
19281957
histos.fill(HIST("hEventSelection"), 0. /* all collisions */);
1958+
if (doEventQA) {
1959+
if constexpr (requires { collision.centFT0C(); }) { // check if we are in Run 3
1960+
centrality = getCentralityRun3(collision);
1961+
}
1962+
histos.fill(HIST("hEventSelectionVsCentrality"), 0. /* all collisions */, centrality);
1963+
}
1964+
}
19291965

19301966
if constexpr (requires { collision.centFT0C(); }) { // check if we are in Run 3
19311967
if (eventSelections.requireSel8 && !collision.sel8()) {
19321968
return false;
19331969
}
1934-
if (fillHists)
1970+
if (fillHists) {
19351971
histos.fill(HIST("hEventSelection"), 1 /* sel8 collisions */);
1972+
if (doEventQA) {
1973+
histos.fill(HIST("hEventSelectionVsCentrality"), 1 /* sel8 collisions */, centrality);
1974+
}
1975+
}
19361976

19371977
if (eventSelections.requireTriggerTVX && !collision.selection_bit(aod::evsel::kIsTriggerTVX)) {
19381978
return false;
19391979
}
1940-
if (fillHists)
1980+
if (fillHists) {
19411981
histos.fill(HIST("hEventSelection"), 2 /* FT0 vertex (acceptable FT0C-FT0A time difference) collisions */);
1982+
if (doEventQA) {
1983+
histos.fill(HIST("hEventSelectionVsCentrality"), 2 /* FT0 vertex (acceptable FT0C-FT0A time difference) collisions */, centrality);
1984+
}
1985+
}
19421986

19431987
if (eventSelections.rejectITSROFBorder && !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) {
19441988
return false;
19451989
}
1946-
if (fillHists)
1990+
if (fillHists) {
19471991
histos.fill(HIST("hEventSelection"), 3 /* Not at ITS ROF border */);
1992+
if (doEventQA) {
1993+
histos.fill(HIST("hEventSelectionVsCentrality"), 3 /* Not at ITS ROF border */, centrality);
1994+
}
1995+
}
19481996

19491997
if (eventSelections.rejectTFBorder && !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) {
19501998
return false;
19511999
}
1952-
if (fillHists)
2000+
if (fillHists) {
19532001
histos.fill(HIST("hEventSelection"), 4 /* Not at TF border */);
2002+
if (doEventQA) {
2003+
histos.fill(HIST("hEventSelectionVsCentrality"), 4 /* Not at TF border */, centrality);
2004+
}
2005+
}
19542006

19552007
if (std::abs(collision.posZ()) > eventSelections.maxZVtxPosition) {
19562008
return false;
19572009
}
1958-
if (fillHists)
2010+
if (fillHists) {
19592011
histos.fill(HIST("hEventSelection"), 5 /* vertex-Z selected */);
2012+
if (doEventQA) {
2013+
histos.fill(HIST("hEventSelectionVsCentrality"), 5 /* vertex-Z selected */, centrality);
2014+
}
2015+
}
19602016

19612017
if (eventSelections.requireIsVertexITSTPC && !collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) {
19622018
return false;
19632019
}
1964-
if (fillHists)
2020+
if (fillHists) {
19652021
histos.fill(HIST("hEventSelection"), 6 /* Contains at least one ITS-TPC track */);
2022+
if (doEventQA) {
2023+
histos.fill(HIST("hEventSelectionVsCentrality"), 6 /* Contains at least one ITS-TPC track */, centrality);
2024+
}
2025+
}
19662026

19672027
if (eventSelections.requireIsGoodZvtxFT0VsPV && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) {
19682028
return false;
19692029
}
1970-
if (fillHists)
2030+
if (fillHists) {
19712031
histos.fill(HIST("hEventSelection"), 7 /* PV position consistency check */);
2032+
if (doEventQA) {
2033+
histos.fill(HIST("hEventSelectionVsCentrality"), 7 /* PV position consistency check */, centrality);
2034+
}
2035+
}
19722036

19732037
if (eventSelections.requireIsVertexTOFmatched && !collision.selection_bit(o2::aod::evsel::kIsVertexTOFmatched)) {
19742038
return false;
19752039
}
1976-
if (fillHists)
2040+
if (fillHists) {
19772041
histos.fill(HIST("hEventSelection"), 8 /* PV with at least one contributor matched with TOF */);
2042+
if (doEventQA) {
2043+
histos.fill(HIST("hEventSelectionVsCentrality"), 8 /* PV with at least one contributor matched with TOF */, centrality);
2044+
}
2045+
}
19782046

19792047
if (eventSelections.requireIsVertexTRDmatched && !collision.selection_bit(o2::aod::evsel::kIsVertexTRDmatched)) {
19802048
return false;
19812049
}
1982-
if (fillHists)
2050+
if (fillHists) {
19832051
histos.fill(HIST("hEventSelection"), 9 /* PV with at least one contributor matched with TRD */);
2052+
if (doEventQA) {
2053+
histos.fill(HIST("hEventSelectionVsCentrality"), 9 /* PV with at least one contributor matched with TRD */, centrality);
2054+
}
2055+
}
19842056

19852057
if (eventSelections.rejectSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) {
19862058
return false;
19872059
}
1988-
if (fillHists)
2060+
if (fillHists) {
19892061
histos.fill(HIST("hEventSelection"), 10 /* Not at same bunch pile-up */);
2062+
if (doEventQA) {
2063+
histos.fill(HIST("hEventSelectionVsCentrality"), 10 /* Not at same bunch pile-up */, centrality);
2064+
}
2065+
}
19902066

19912067
if (eventSelections.requireNoCollInTimeRangeStd && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) {
19922068
return false;
19932069
}
1994-
if (fillHists)
2070+
if (fillHists) {
19952071
histos.fill(HIST("hEventSelection"), 11 /* No other collision within +/- 2 microseconds or mult above a certain threshold in -4 - -2 microseconds*/);
2072+
if (doEventQA) {
2073+
histos.fill(HIST("hEventSelectionVsCentrality"), 11 /* No other collision within +/- 2 microseconds or mult above a certain threshold in -4 - -2 microseconds*/, centrality);
2074+
}
2075+
}
19962076

19972077
if (eventSelections.requireNoCollInTimeRangeStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStrict)) {
19982078
return false;
19992079
}
2000-
if (fillHists)
2080+
if (fillHists) {
20012081
histos.fill(HIST("hEventSelection"), 12 /* No other collision within +/- 10 microseconds */);
2082+
if (doEventQA) {
2083+
histos.fill(HIST("hEventSelectionVsCentrality"), 12 /* No other collision within +/- 10 microseconds */, centrality);
2084+
}
2085+
}
20022086

20032087
if (eventSelections.requireNoCollInTimeRangeNarrow && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeNarrow)) {
20042088
return false;
20052089
}
2006-
if (fillHists)
2090+
if (fillHists) {
20072091
histos.fill(HIST("hEventSelection"), 13 /* No other collision within +/- 2 microseconds */);
2092+
if (doEventQA) {
2093+
histos.fill(HIST("hEventSelectionVsCentrality"), 13 /* No other collision within +/- 2 microseconds */, centrality);
2094+
}
2095+
}
20082096

20092097
if (eventSelections.requireNoCollInROFStd && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) {
20102098
return false;
20112099
}
2012-
if (fillHists)
2100+
if (fillHists) {
20132101
histos.fill(HIST("hEventSelection"), 14 /* No other collision within the same ITS ROF with mult. above a certain threshold */);
2102+
if (doEventQA) {
2103+
histos.fill(HIST("hEventSelectionVsCentrality"), 14 /* No other collision within the same ITS ROF with mult. above a certain threshold */, centrality);
2104+
}
2105+
}
20142106

20152107
if (eventSelections.requireNoCollInROFStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStrict)) {
20162108
return false;
20172109
}
2018-
if (fillHists)
2110+
if (fillHists) {
20192111
histos.fill(HIST("hEventSelection"), 15 /* No other collision within the same ITS ROF */);
2112+
if (doEventQA) {
2113+
histos.fill(HIST("hEventSelectionVsCentrality"), 15 /* No other collision within the same ITS ROF */, centrality);
2114+
}
2115+
}
20202116

20212117
if (doPPAnalysis) { // we are in pp
20222118
if (eventSelections.requireINEL0 && collision.multNTracksPVeta1() < 1) {
20232119
return false;
20242120
}
2025-
if (fillHists)
2121+
if (fillHists) {
20262122
histos.fill(HIST("hEventSelection"), 16 /* INEL > 0 */);
2123+
if (doEventQA) {
2124+
histos.fill(HIST("hEventSelectionVsCentrality"), 16 /* INEL > 0 */, centrality);
2125+
}
2126+
}
20272127

20282128
if (eventSelections.requireINEL1 && collision.multNTracksPVeta1() < 2) {
20292129
return false;
20302130
}
2031-
if (fillHists)
2131+
if (fillHists) {
20322132
histos.fill(HIST("hEventSelection"), 17 /* INEL > 1 */);
2133+
if (doEventQA) {
2134+
histos.fill(HIST("hEventSelectionVsCentrality"), 17 /* INEL > 1 */, centrality);
2135+
}
2136+
}
20332137

20342138
} else { // we are in Pb-Pb
20352139
float collisionOccupancy = eventSelections.useFT0CbasedOccupancy ? collision.ft0cOccupancyInTimeRange() : collision.trackOccupancyInTimeRange();
20362140
if (eventSelections.minOccupancy >= 0 && collisionOccupancy < eventSelections.minOccupancy) {
20372141
return false;
20382142
}
2039-
if (fillHists)
2143+
if (fillHists) {
20402144
histos.fill(HIST("hEventSelection"), 16 /* Below min occupancy */);
2145+
if (doEventQA) {
2146+
histos.fill(HIST("hEventSelectionVsCentrality"), 16 /* Below min occupancy */, centrality);
2147+
}
2148+
}
20412149

20422150
if (eventSelections.maxOccupancy >= 0 && collisionOccupancy > eventSelections.maxOccupancy) {
20432151
return false;
20442152
}
2045-
if (fillHists)
2153+
if (fillHists) {
20462154
histos.fill(HIST("hEventSelection"), 17 /* Above max occupancy */);
2155+
if (doEventQA) {
2156+
histos.fill(HIST("hEventSelectionVsCentrality"), 17 /* Above max occupancy */, centrality);
2157+
}
2158+
}
20472159
}
20482160

20492161
// Fetch interaction rate only if required (in order to limit ccdb calls)
20502162
double interactionRate = (eventSelections.minIR >= 0 || eventSelections.maxIR >= 0) ? rateFetcher.fetch(ccdb.service, collision.timestamp(), collision.runNumber(), irSource) * 1.e-3 : -1;
20512163
if (eventSelections.minIR >= 0 && interactionRate < eventSelections.minIR) {
20522164
return false;
20532165
}
2054-
if (fillHists)
2166+
if (fillHists) {
20552167
histos.fill(HIST("hEventSelection"), 18 /* Below min IR */);
2168+
if (doEventQA) {
2169+
histos.fill(HIST("hEventSelectionVsCentrality"), 18 /* Below min IR */, centrality);
2170+
}
2171+
}
20562172

20572173
if (eventSelections.maxIR >= 0 && interactionRate > eventSelections.maxIR) {
20582174
return false;
20592175
}
2060-
if (fillHists)
2176+
if (fillHists) {
20612177
histos.fill(HIST("hEventSelection"), 19 /* Above max IR */);
2178+
if (doEventQA) {
2179+
histos.fill(HIST("hEventSelectionVsCentrality"), 19 /* Above max IR */, centrality);
2180+
}
2181+
}
20622182

20632183
if (!rctConfigurations.cfgRCTLabel.value.empty() && !rctFlagsChecker(collision)) {
20642184
return false;
20652185
}
2066-
if (fillHists)
2186+
if (fillHists) {
20672187
histos.fill(HIST("hEventSelection"), 20 /* Pass CBT condition */);
2188+
if (doEventQA) {
2189+
histos.fill(HIST("hEventSelectionVsCentrality"), 20 /* Pass CBT condition */, centrality);
2190+
}
2191+
}
20682192

20692193
} else { // we are in Run 2
20702194
if (eventSelections.requireSel8 && !collision.sel8()) {

0 commit comments

Comments
 (0)