@@ -65,6 +65,7 @@ struct HfTaskFlowCharmHadrons {
65
65
Configurable<float > centralityMax{" centralityMax" , 100 ., " Maximum centrality accepted in SP/EP computation (not applied in resolution process)" };
66
66
Configurable<bool > storeEP{" storeEP" , false , " Flag to store EP-related axis" };
67
67
Configurable<bool > storeMl{" storeMl" , false , " Flag to store ML scores" };
68
+ Configurable<bool > storeResoOccu{" storeResoOccu" , false , " Flag to store Occupancy in resolution ThnSparse" };
68
69
Configurable<int > occEstimator{" occEstimator" , 0 , " Occupancy estimation (0: None, 1: ITS, 2: FT0C)" };
69
70
Configurable<bool > saveEpResoHisto{" saveEpResoHisto" , false , " Flag to save event plane resolution histogram" };
70
71
Configurable<std::string> ccdbUrl{" ccdbUrl" , " http://alice-ccdb.cern.ch" , " url of the ccdb repository" };
@@ -85,6 +86,9 @@ struct HfTaskFlowCharmHadrons {
85
86
ConfigurableAxis thnConfigAxisNoCollInTimeRangeNarrow{" thnConfigAxisNoCollInTimeRangeNarrow" , {2 , 0 , 2 }, " " };
86
87
ConfigurableAxis thnConfigAxisNoCollInTimeRangeStandard{" thnConfigAxisNoCollInTimeRangeStandard" , {2 , 0 , 2 }, " " };
87
88
ConfigurableAxis thnConfigAxisNoCollInRofStandard{" thnConfigAxisNoCollInRofStandard" , {2 , 0 , 2 }, " " };
89
+ ConfigurableAxis thnConfigAxisResoFT0cFV0a{" thnConfigAxisResoFT0cFV0a" , {160 , -8 , 8 }, " " };
90
+ ConfigurableAxis thnConfigAxisResoFT0cTPCtot{" thnConfigAxisResoFT0cTPCtot" , {160 , -8 , 8 }, " " };
91
+ ConfigurableAxis thnConfigAxisResoFV0aTPCtot{" thnConfigAxisResoFV0aTPCtot" , {160 , -8 , 8 }, " " };
88
92
89
93
using CandDsDataWMl = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDsToKKPi, aod::HfMlDsToKKPi>>;
90
94
using CandDsData = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDsToKKPi>>;
@@ -124,6 +128,9 @@ struct HfTaskFlowCharmHadrons {
124
128
125
129
void init (InitContext&)
126
130
{
131
+ if (storeResoOccu && occEstimator == 0 ) {
132
+ LOGP (fatal, " Occupancy estimation must be enabled to store resolution THnSparse! Please check your configuration!" );
133
+ }
127
134
const AxisSpec thnAxisInvMass{thnConfigAxisInvMass, " Inv. mass (GeV/#it{c}^{2})" };
128
135
const AxisSpec thnAxisPt{thnConfigAxisPt, " #it{p}_{T} (GeV/#it{c})" };
129
136
const AxisSpec thnAxisCent{thnConfigAxisCent, " Centrality" };
@@ -139,6 +146,10 @@ struct HfTaskFlowCharmHadrons {
139
146
const AxisSpec thnAxisNoCollInTimeRangeNarrow{thnConfigAxisNoCollInTimeRangeNarrow, " NoCollInTimeRangeNarrow" };
140
147
const AxisSpec thnAxisNoCollInTimeRangeStandard{thnConfigAxisNoCollInTimeRangeStandard, " NoCollInTimeRangeStandard" };
141
148
const AxisSpec thnAxisNoCollInRofStandard{thnConfigAxisNoCollInRofStandard, " NoCollInRofStandard" };
149
+ // TODO: currently only the Q vector of FT0c FV0a and TPCtot are considered
150
+ const AxisSpec thnAxisResoFT0cFV0a{thnConfigAxisResoFT0cFV0a, " Q_{FT0c} #bullet Q_{FV0a}" };
151
+ const AxisSpec thnAxisResoFT0cTPCtot{thnConfigAxisResoFT0cTPCtot, " Q_{FT0c} #bullet Q_{TPCtot}" };
152
+ const AxisSpec thnAxisResoFV0aTPCtot{thnConfigAxisResoFV0aTPCtot, " Q_{FV0a} #bullet Q_{TPCtot}" };
142
153
143
154
std::vector<AxisSpec> axes = {thnAxisInvMass, thnAxisPt, thnAxisCent, thnAxisScalarProd};
144
155
if (storeEP) {
@@ -201,6 +212,18 @@ struct HfTaskFlowCharmHadrons {
201
212
registry.add (" epReso/hEpResoTPCposTPCneg" , " hEpResoTPCposTPCneg; centrality; #Delta#Psi_{sub}" , {HistType::kTH2F , {thnAxisCent, thnAxisCosNPhi}});
202
213
}
203
214
215
+ if (storeResoOccu) {
216
+ std::vector<AxisSpec> axes_reso = {thnAxisCent, thnAxisResoFT0cFV0a, thnAxisResoFT0cTPCtot, thnAxisResoFV0aTPCtot};
217
+ if (occEstimator == 1 ) {
218
+ axes_reso.insert (axes_reso.end (), {thnAxisOccupancyITS, thnAxisNoSameBunchPileup, thnAxisOccupancy,
219
+ thnAxisNoCollInTimeRangeNarrow, thnAxisNoCollInTimeRangeStandard, thnAxisNoCollInRofStandard});
220
+ } else {
221
+ axes_reso.insert (axes_reso.end (), {thnAxisOccupancyFT0C, thnAxisNoSameBunchPileup, thnAxisOccupancy,
222
+ thnAxisNoCollInTimeRangeNarrow, thnAxisNoCollInTimeRangeStandard, thnAxisNoCollInRofStandard});
223
+ }
224
+ registry.add (" spReso/hSparseReso" , " THn for resolution with occupancy" , HistType::kTHnSparseF , axes_reso);
225
+ }
226
+
204
227
hfEvSel.addHistograms (registry); // collision monitoring
205
228
ccdb->setURL (ccdbUrl);
206
229
ccdb->setCaching (true );
@@ -260,6 +283,18 @@ struct HfTaskFlowCharmHadrons {
260
283
return deltaPsi;
261
284
}
262
285
286
+ // / Get the event selection flags
287
+ // / \param hfevselflag is the event selection flag
288
+ std::vector<int > getEventSelectionFlags (uint16_t hfevselflag)
289
+ {
290
+ return {
291
+ TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::NoSameBunchPileup),
292
+ TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::Occupancy),
293
+ TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeNarrow),
294
+ TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeStandard),
295
+ TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::NoCollInRofStandard)};
296
+ }
297
+
263
298
// / Fill THnSparse
264
299
// / \param mass is the invariant mass of the candidate
265
300
// / \param pt is the transverse momentum of the candidate
@@ -281,37 +316,22 @@ struct HfTaskFlowCharmHadrons {
281
316
uint16_t & hfevselflag)
282
317
{
283
318
if (occEstimator != 0 ) {
319
+ std::vector<int > evtSelFlags = getEventSelectionFlags (hfevselflag);
284
320
if (storeMl) {
285
321
if (storeEP) {
286
322
registry.fill (HIST (" hSparseFlowCharm" ), mass, pt, cent, sp, cosNPhi, cosDeltaPhi, outputMl[0 ], outputMl[1 ], occupancy,
287
- TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::NoSameBunchPileup),
288
- TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::Occupancy),
289
- TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeNarrow),
290
- TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeStandard),
291
- TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::NoCollInRofStandard));
323
+ evtSelFlags[0 ], evtSelFlags[1 ], evtSelFlags[2 ], evtSelFlags[3 ], evtSelFlags[4 ]);
292
324
} else {
293
325
registry.fill (HIST (" hSparseFlowCharm" ), mass, pt, cent, sp, outputMl[0 ], outputMl[1 ], occupancy,
294
- TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::NoSameBunchPileup),
295
- TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::Occupancy),
296
- TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeNarrow),
297
- TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeStandard),
298
- TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::NoCollInRofStandard));
326
+ evtSelFlags[0 ], evtSelFlags[1 ], evtSelFlags[2 ], evtSelFlags[3 ], evtSelFlags[4 ]);
299
327
}
300
328
} else {
301
329
if (storeEP) {
302
330
registry.fill (HIST (" hSparseFlowCharm" ), mass, pt, cent, sp, cosNPhi, cosDeltaPhi, occupancy,
303
- TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::NoSameBunchPileup),
304
- TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::Occupancy),
305
- TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeNarrow),
306
- TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeStandard),
307
- TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::NoCollInRofStandard));
331
+ evtSelFlags[0 ], evtSelFlags[1 ], evtSelFlags[2 ], evtSelFlags[3 ], evtSelFlags[4 ]);
308
332
} else {
309
333
registry.fill (HIST (" hSparseFlowCharm" ), mass, pt, cent, sp, occupancy,
310
- TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::NoSameBunchPileup),
311
- TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::Occupancy),
312
- TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeNarrow),
313
- TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeStandard),
314
- TESTBIT (hfevselflag, o2::hf_evsel::EventRejection::NoCollInRofStandard));
334
+ evtSelFlags[0 ], evtSelFlags[1 ], evtSelFlags[2 ], evtSelFlags[3 ], evtSelFlags[4 ]);
315
335
}
316
336
}
317
337
} else {
@@ -607,11 +627,6 @@ struct HfTaskFlowCharmHadrons {
607
627
aod::BCsWithTimestamps const & bcs)
608
628
{
609
629
float centrality{-1 .f };
610
- if (!isCollSelected<o2::hf_centrality::CentralityEstimator::FT0C>(collision, bcs, centrality)) {
611
- // no selection on the centrality is applied on purpose to allow for the resolution study in post-processing
612
- return ;
613
- }
614
-
615
630
float xQVecFT0a = collision.qvecFT0ARe ();
616
631
float yQVecFT0a = collision.qvecFT0AIm ();
617
632
float xQVecFT0c = collision.qvecFT0CRe ();
@@ -627,6 +642,24 @@ struct HfTaskFlowCharmHadrons {
627
642
float xQVecBTot = collision.qvecBTotRe ();
628
643
float yQVecBTot = collision.qvecBTotIm ();
629
644
645
+ centrality = o2::hf_centrality::getCentralityColl (collision, o2::hf_centrality::CentralityEstimator::FT0C);
646
+ if (storeResoOccu) {
647
+ float occupancy{-1 .f };
648
+ occupancy = getOccupancyColl (collision, occEstimator);
649
+ registry.fill (HIST (" trackOccVsFT0COcc" ), collision.trackOccupancyInTimeRange (), collision.ft0cOccupancyInTimeRange ());
650
+ uint16_t hfevflag = hfEvSel.getHfCollisionRejectionMask <true , o2::hf_centrality::CentralityEstimator::None, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
651
+ std::vector<int > evtSelFlags = getEventSelectionFlags (hfevflag);
652
+ registry.fill (HIST (" spReso/hSparseReso" ), centrality, xQVecFT0c * xQVecFV0a + yQVecFT0c * yQVecFV0a,
653
+ xQVecFT0c * xQVecBTot + yQVecFT0c * yQVecBTot,
654
+ xQVecFV0a * xQVecBTot + yQVecFV0a * yQVecBTot,
655
+ occupancy, evtSelFlags[0 ], evtSelFlags[1 ], evtSelFlags[2 ], evtSelFlags[3 ], evtSelFlags[4 ]);
656
+ }
657
+
658
+ if (!isCollSelected<o2::hf_centrality::CentralityEstimator::FT0C>(collision, bcs, centrality)) {
659
+ // no selection on the centrality is applied, but on event selection flags
660
+ return ;
661
+ }
662
+
630
663
registry.fill (HIST (" spReso/hSpResoFT0cFT0a" ), centrality, xQVecFT0c * xQVecFT0a + yQVecFT0c * yQVecFT0a);
631
664
registry.fill (HIST (" spReso/hSpResoFT0cFV0a" ), centrality, xQVecFT0c * xQVecFV0a + yQVecFT0c * yQVecFV0a);
632
665
registry.fill (HIST (" spReso/hSpResoFT0cTPCpos" ), centrality, xQVecFT0c * xQVecBPos + yQVecFT0c * yQVecBPos);
0 commit comments