Skip to content

Commit 28efcf1

Browse files
authored
[PWGCF] support for sequential bailout, default labels, and added few more QA… (#8448)
1 parent a3e82c9 commit 28efcf1

File tree

5 files changed

+274
-116
lines changed

5 files changed

+274
-116
lines changed

PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@ struct : ConfigurableGroup {
3232
Configurable<int> cfFixedNumberOfRandomlySelectedTracks{"cfFixedNumberOfRandomlySelectedTracks", -1, "set to some integer > 0, to apply and use. Set to <=0, to ignore."};
3333
Configurable<bool> cfUseStopwatch{"cfUseStopwatch", false, "if true, some basic info on time execution is printed, here and there. Very loosely, this can be used for execution time profiling."};
3434
Configurable<float> cfFloatingPointPrecision{"cfFloatingPointPrecision", 0.000001, "two floats are the same if TMath::Abs(f1 - f2) < fFloatingPointPrecision"};
35+
Configurable<int> cfSequentialBailout{"cfSequentialBailout", 0, "if fSequentialBailout > 0, then each fSequentialBailout events the function BailOut() is called. Can be used for real analysis and for IV"};
36+
3537
} cf_tc;
3638

3739
// *) QA:
3840
struct : ConfigurableGroup {
3941
Configurable<bool> cfCheckUnderflowAndOverflow{"cfCheckUnderflowAndOverflow", false, "check and bail out if in event and particle histograms there are entries which went to underflow or overflow bins (use only locally)"};
4042
Configurable<bool> cfFillQAEventHistograms2D{"cfFillQAEventHistograms2D", false, "if false, all QA 2D event histograms are not filled. if true, only the ones for which fBookQAEventHistograms2D[...] is true, are filled"};
41-
Configurable<vector<string>> cfBookQAEventHistograms2D{"cfBookQAEventHistograms2D", {"MultTPC_vs_NContributors-1", "Vertex_z_vs_MultTPC-1", "Vertex_z_vs_NContributors-1", "CentFT0M_vs_CentNTPV-1", "CentRun2V0M_vs_CentRun2SPDTracklets-1", "CentRun2V0M_vs_NContributors-1", "TrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange-1", "TrackOccupancyInTimeRange_vs_MultTPC-1", "TrackOccupancyInTimeRange_vs_Vertex_z-1"}, "book (1) or do not book (0) this QA 2D event histogram"};
43+
Configurable<vector<string>> cfBookQAEventHistograms2D{"cfBookQAEventHistograms2D", {"MultTPC_vs_NContributors-1", "MultTPC_vs_Centrality-1", "Vertex_z_vs_MultTPC-1", "Vertex_z_vs_NContributors-1", "CentFT0C_vs_CentNTPV-1", "CentFT0M_vs_CentNTPV-1", "CentRun2V0M_vs_CentRun2SPDTracklets-1", "CentRun2V0M_vs_NContributors-1", "TrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange-1", "TrackOccupancyInTimeRange_vs_MultTPC-1", "TrackOccupancyInTimeRange_vs_Vertex_z-1", "TrackOccupancyInTimeRange_vs_Centrality-1"}, "book (1) or do not book (0) this QA 2D event histogram"};
4244
Configurable<bool> cfFillQAParticleHistograms2D{"cfFillQAParticleHistograms2D", false, "if false, all QA 2D particle histograms are not filled. if true, only the ones for which fBookQAParticleHistograms2D[...] is true, are filled"};
4345
Configurable<vector<string>> cfBookQAParticleHistograms2D{"cfBookQAParticleHistograms2D", {"Pt_vs_dcaXY-1"}, "book (1) or do not book (0) this QA 2D particle histogram"};
4446
} cf_qa;
@@ -74,7 +76,7 @@ struct : ConfigurableGroup {
7476
Configurable<string> cfTrigger{"cfTrigger", "some supported trigger", "set here some supported trigger (kINT7, ...) "};
7577
Configurable<bool> cfUseSel7{"cfUseSel7", false, "use for Run 1 and 2 data and MC (see official doc)"};
7678
Configurable<bool> cfUseSel8{"cfUseSel8", false, "use for Run 3 data and MC (see official doc)"};
77-
Configurable<string> cfCentralityEstimator{"cfCentralityEstimator", "some supported centrality estimator", "set here some supported centrality estimator (CentFT0M, CentFV0A, CentNTPV, ... for Run 3, and CentRun2V0M, CentRun2SPDTracklets, ..., for Run 2 and 1) "};
79+
Configurable<string> cfCentralityEstimator{"cfCentralityEstimator", "some supported centrality estimator", "set here some supported centrality estimator (CentFT0C, CentFT0M, CentFV0A, CentNTPV, ... for Run 3, and CentRun2V0M, CentRun2SPDTracklets, ..., for Run 2 and 1) "};
7880
Configurable<vector<int>> cfSelectedEvents{"cfSelectedEvents", {-1, 1000000000}, "Selected number of events to process (i.e. only events which survive event cuts): {min, max}, with convention: min <= N < max"};
7981
Configurable<bool> cfUseNoSameBunchPileup{"cfUseNoSameBunchPileup", false, "TBI 20240521 explanation"};
8082
Configurable<bool> cfUseIsGoodZvtxFT0vsPV{"cfUseIsGoodZvtxFT0vsPV", false, "TBI 20240521 explanation"};
@@ -89,7 +91,7 @@ struct : ConfigurableGroup {
8991
Configurable<bool> cfFillParticleHistograms{"cfFillParticleHistograms", true, "if false, all 1D particle histograms are not filled. if kTRUE, the ones for which fBookParticleHistograms[...] is kTRUE, are filled"};
9092
Configurable<vector<string>> cfBookParticleHistograms{"cfBookParticleHistograms", {"Phi-1", "Pt-1", "Eta-1", "Charge-1", "tpcNClsFindable-1", "tpcNClsShared-1", "tpcNClsFound-1", "tpcNClsCrossedRows-1", "itsNCls-1", "itsNClsInnerBarrel-1", "tpcCrossedRowsOverFindableCls-1", "tpcFoundOverFindableCls-1", "tpcFractionSharedCls-1", "dcaXY-1", "dcaZ-1", "PDG-1"}, "Book (1) or do not book (0) particle histogram"};
9193
Configurable<bool> cfFillParticleHistograms2D{"cfFillParticleHistograms2D", true, "if false, all 2D particle histograms are not filled. if kTRUE, the ones for which fBookParticleHistograms2D[...] is kTRUE, are filled"};
92-
Configurable<vector<string>> cfBookParticleHistograms2D{"cfBookParticleHistograms2D", {"Phi_vs_Pt-1", "Phi_vs_Eta-1"}, "Book (1) or do not book (0) this 2D particle histogram"};
94+
Configurable<vector<string>> cfBookParticleHistograms2D{"cfBookParticleHistograms2D", {"Phi_vs_Pt-1", "Phi_vs_Eta-1"}, "Book (1) or do not book (0) event histogram"};
9395
} cf_ph;
9496

9597
// *) Particle cuts:
@@ -149,6 +151,7 @@ struct : ConfigurableGroup {
149151
Configurable<bool> cfCalculateTest0AsFunctionOfEta{"cfCalculateTest0AsFunctionOfEta", false, "calculate or not Test0 as a function of eta"};
150152
Configurable<bool> cfCalculateTest0AsFunctionOfOccupancy{"cfCalculateTest0AsFunctionOfOccupancy", false, "calculate or not Test0 as a function of occupancy"};
151153
Configurable<string> cfFileWithLabels{"cfFileWithLabels", "/home/abilandz/DatasetsO2/labels.root", "path to external ROOT file which specifies all labels"}; // for AliEn file prepend "/alice/cern.ch/", for CCDB prepend "/alice-ccdb.cern.ch"
154+
Configurable<bool> cfUseDefaultLabels{"cfUseDefaultLabels", false, "use default internally hardwired labels, only for testing purposes"};
152155
} cf_t0;
153156

154157
// *) Particle weights:
@@ -184,8 +187,8 @@ struct : ConfigurableGroup {
184187
Configurable<unsigned int> cfnEventsInternalValidation{"cfnEventsInternalValidation", 0, "number of events simulated on-the-fly for internal validation"};
185188
Configurable<string> cfHarmonicsOptionInternalValidation{"cfHarmonicsOptionInternalValidation", "constant", "for internal validation, set whether flow amplitudes are \"constant\" or \"correlated\""};
186189
Configurable<bool> cfRescaleWithTheoreticalInput{"cfRescaleWithTheoreticalInput", false, "if kTRUE, all correlators are rescaled with theoretical input, so that all results in profiles are 1"};
187-
Configurable<vector<float>> cfInternalValidationAmplitudes{"cfInternalValidationAmplitudes", {0.01, 0.02, 0.03, 0.04}, "{v1, v2, v3, v4, ...} + has an effect only in combination with cfHarmonicsOptionInternalValidation = \"constant\". Max number of vn's is gMaxHarmonic."};
188-
Configurable<vector<float>> cfInternalValidationPlanes{"cfInternalValidationPlanes", {0.0, 0.0, 0.0, 0.0}, "{Psi1, Psi2, Psi3, Psi4, ...} + has an effect only in combination with cfHarmonicsOptionInternalValidation = \"constant\". Max number of Psin's is gMaxHarmonic."};
190+
Configurable<vector<float>> cfInternalValidationAmplitudes{"cfInternalValidationAmplitudes", {0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09}, "{v1, v2, v3, v4, ...} + has an effect only in combination with cfHarmonicsOptionInternalValidation = \"constant\". Max number of vn's is gMaxHarmonic."};
191+
Configurable<vector<float>> cfInternalValidationPlanes{"cfInternalValidationPlanes", {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, "{Psi1, Psi2, Psi3, Psi4, ...} + has an effect only in combination with cfHarmonicsOptionInternalValidation = \"constant\". Max number of Psin's is gMaxHarmonic."};
189192
Configurable<vector<int>> cfMultRangeInternalValidation{"cfMultRangeInternalValidation", {1000, 1001}, "{min, max}, with convention: min <= M < max"};
190193
} cf_iv;
191194

@@ -208,7 +211,7 @@ struct : ConfigurableGroup {
208211
Configurable<bool> cfUseVariableLength_pt_bins{"cfUseVariableLength_pt_bins", false, "use or not variable-length pt bins"};
209212
Configurable<vector<float>> cfVariableLength_pt_bins{"cfVariableLength_pt_bins", {0.20, 0.30, 0.40, 0.65, 1.00, 2.00, 5.00}, "variable-length pt bins"};
210213
Configurable<bool> cfUseVariableLength_eta_bins{"cfUseVariableLength_eta_bins", false, "use or not variable-length eta bins"};
211-
Configurable<vector<float>> cfVariableLength_eta_bins{"cfVariableLength_eta_bins", {3.0, -1.0, -0.4, 0.0, 0.4, 1.0, 3.0}, "variable-length eta bins"};
214+
Configurable<vector<float>> cfVariableLength_eta_bins{"cfVariableLength_eta_bins", {-0.8, 0.0, 0.3, 0.8}, "variable-length eta bins"};
212215
Configurable<bool> cfUseVariableLength_occu_bins{"cfUseVariableLength_occu_bins", false, "use or not variable-length occupancy bins"};
213216
Configurable<vector<float>> cfVariableLength_occu_bins{"cfVariableLength_occu_bins", {0., 5., 6., 7., 8., 9., 100., 200., 500., 1000., 10000.}, "variable-length occupancy bins"};
214217

PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,8 @@ struct TaskConfiguration {
5959
Bool_t fUseStopwatch = kFALSE; // do some basing profiling with TStopwatch for where the execution time is going
6060
TStopwatch* fTimer[eTimer_N] = {NULL}; // stopwatch, global (overal execution time) and local
6161
Float_t fFloatingPointPrecision = 1.e-6; // two floats are the same if TMath::Abs(f1 - f2) < fFloatingPointPrecision (there is configurable for it)
62-
// Bool_t fRescaleWithTheoreticalInput; // if kTRUE, all measured correlators are
63-
// rescaled with theoretical input, so that in profiles everything is at 1. Used
64-
// both in OTF and internal val.
65-
} tc; // "tc" labels an instance of this group of variables.
62+
Int_t fSequentialBailout = 0; // if fSequentialBailout > 0, then each fSequentialBailout events the function BailOut() is called. Can be used for real analysis and for IV.
63+
} tc; // "tc" labels an instance of this group of variables.
6664

6765
// *) Event-by-event quantities:
6866
struct EventByEventQuantities {
@@ -106,6 +104,7 @@ struct EventHistograms {
106104
Bool_t fBookEventHistograms[eEventHistograms_N] = {kTRUE}; // book or not this histogram, see SetBookEventHistograms
107105
Float_t fEventHistogramsBins[eEventHistograms_N][3] = {{0.}}; // [nBins,min,max]
108106
TString fEventHistogramsName[eEventHistograms_N] = {""}; // name of event histogram, used both for 1D and 2D histograms
107+
Int_t fEventCounter[eEventCounter_N] = {0}; // event counters, see enum eEventCounter for full explanation
109108
// 2D:
110109
// ...
111110
// Remark: All 2D event histograms are still in the QA group. Move here only the ones I will use regularly in the analysis
@@ -239,6 +238,7 @@ struct InternalValidation {
239238
Bool_t fInternalValidationForceBailout = kFALSE; // force bailout in internal validation after either eNumberOfEvents or eSelectedEvents is reached.
240239
// This is OK as long as I do not apply any event cuts in InternalValidation().
241240
// Remember that for each real event, I do fnEventsInternalValidation events on-the-fly.
241+
// Can be used in combination with setting fSequentialBailout > 0.
242242
UInt_t fnEventsInternalValidation = 0; // how many on-the-fly events will be sampled for each real event, for internal validation
243243
TString* fHarmonicsOptionInternalValidation = NULL; // "constant" or "correlated", see .cxx for full documentation
244244
Bool_t fRescaleWithTheoreticalInput = kFALSE; // if kTRUE, all measured correlators are rescaled with theoretical input, so that in profiles everything is at 1
@@ -255,6 +255,7 @@ struct Test0 {
255255
TString* fTest0Labels[gMaxCorrelator][gMaxIndex] = {{NULL}}; // all labels: k-p'th order is stored in k-1'th index. So yes, I also store 1-p
256256
Bool_t fCalculateTest0AsFunctionOf[eAsFunctionOf_N] = {true, true, true, false, false, false}; //! [0=integrated,1=vs. multiplicity,2=vs. centrality,3=pT,4=eta,5=vs. occupancy]
257257
TString fFileWithLabels = ""; // path to external ROOT file which specifies all labels of interest
258+
Bool_t fUseDefaultLabels = kFALSE; // use default labels hardwired in GetDefaultObjArrayWithLabels()
258259
TH1I* fTest0LabelsPlaceholder = NULL; // store all Test0 labels in this histogram
259260
} t0; // "t0" labels an instance of this group of histograms
260261

PWGCF/MultiparticleCorrelations/Core/MuPa-Enums.h

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ enum eConfiguration {
2828
eFixedNumberOfRandomlySelectedTracks,
2929
eUseStopwatch,
3030
eFloatingPointPrecision,
31+
eSequentialBailout,
3132
eConfiguration_N
3233
};
3334

@@ -206,7 +207,7 @@ enum eTimer {
206207
eTimer_N
207208
};
208209

209-
enum eEventCounter {
210+
enum eEventCounterForDryRun {
210211
eFill = 0,
211212
ePrint
212213
};
@@ -225,16 +226,18 @@ enum eCutCounter {
225226
};
226227

227228
enum eQAEventHistograms2D {
228-
// Common:
229229
eMultTPC_vs_NContributors = 0,
230+
eMultTPC_vs_Centrality, // only vs. chosen centrality estimator
230231
eVertex_z_vs_MultTPC,
231232
eVertex_z_vs_NContributors,
233+
eCentFT0C_vs_CentNTPV, // Run 3 centrality
232234
eCentFT0M_vs_CentNTPV, // Run 3 centrality
233235
eCentRun2V0M_vs_CentRun2SPDTracklets, // Run 2 centrality (do not use in Run 1 converted, because there is no centrality information)
234236
eCentRun2V0M_vs_NContributors, // Run 2 centrality (do not use in Run 1 converted, because there is no centrality information)
235237
eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange,
236238
eTrackOccupancyInTimeRange_vs_MultTPC,
237239
eTrackOccupancyInTimeRange_vs_Vertex_z,
240+
eTrackOccupancyInTimeRange_vs_Centrality, // only vs. chosen centrality estimator
238241
eQAEventHistograms2D_N
239242
};
240243

@@ -245,7 +248,8 @@ enum eQAParticleHistograms2D {
245248

246249
enum eCentralityEstimators {
247250
// Run 3:
248-
eCentFT0M = 0,
251+
eCentFT0C = 0,
252+
eCentFT0M,
249253
eCentFV0A,
250254
eCentNTPV,
251255
// Run 2:
@@ -260,4 +264,10 @@ enum eOccupancyEstimators {
260264
eOccupancyEstimators_N
261265
};
262266

267+
enum eEventCounter {
268+
eTotal, // total number of events, before any cuts are applied
269+
eProcessed, // number of processed events, i.e. number of events which survived cuts and on which analysis have been performed
270+
eEventCounter_N
271+
};
272+
263273
#endif // PWGCF_MULTIPARTICLECORRELATIONS_CORE_MUPA_ENUMS_H_

0 commit comments

Comments
 (0)