Skip to content

Commit 8a82179

Browse files
authored
[PWGCF] [PWG-CF] new utility functions, clean up, improved log messages, supp… (#8369)
1 parent 025aae9 commit 8a82179

File tree

5 files changed

+395
-64
lines changed

5 files changed

+395
-64
lines changed

PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ struct : ConfigurableGroup {
2121
// std::string prefix = "Task configuration"; // AA: now these configurables also appear grouped on hyperloop => TBI 20240522 check if this work, and if further modifications in init are needed
2222
Configurable<string> cfTaskName{"cfTaskName", "Default task name", "set task name - use eventually to determine weights for this task"};
2323
Configurable<bool> cfDryRun{"cfDryRun", false, "book all histos and run without storing and calculating anything"};
24-
Configurable<bool> cfVerbose{"cfVerbose", false, "run or not in verbose mode (but not for function calls per particle)"};
24+
Configurable<bool> cfVerbose{"cfVerbose", false, "run or not in verbose mode (but not for simple utility functions or function calls per particle)"};
25+
Configurable<bool> cfVerboseUtility{"cfVerboseUtility", false, "run or not in verbose mode, also for simple utility functions (but not for function calls per particle)"};
2526
Configurable<bool> cfVerboseForEachParticle{"cfVerboseForEachParticle", false, "run or not in verbose mode (also for function calls per particle)"};
2627
Configurable<bool> cfDoAdditionalInsanityChecks{"cfDoAdditionalInsanityChecks", false, "do additional insanity checks at run time (this leads to small loss of performance)"};
2728
Configurable<bool> cfInsanityCheckForEachParticle{"cfInsanityCheckForEachParticle", false, "do insanity checks at run time for each particle, at the expense of losing a lot of performance. Use only during debugging."};
@@ -37,20 +38,20 @@ struct : ConfigurableGroup {
3738
struct : ConfigurableGroup {
3839
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)"};
3940
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"};
40-
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"}, "book (1) or do not book (0) this QA 2D event histogram"};
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"}, "book (1) or do not book (0) this QA 2D event histogram"};
4142
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"};
4243
Configurable<vector<string>> cfBookQAParticleHistograms2D{"cfBookQAParticleHistograms2D", {"Pt_vs_dcaXY-1"}, "book (1) or do not book (0) this QA 2D particle histogram"};
4344
} cf_qa;
4445

4546
// *) Event histograms:
4647
struct : ConfigurableGroup {
4748
Configurable<bool> cfFillEventHistograms{"cfFillEventHistograms", true, "if false, all event histograms are not filled. if true, only the ones for which fBookEventHistograms[...] is true, are filled"};
48-
Configurable<vector<string>> cfBookEventHistograms{"cfBookEventHistograms", {"NumberOfEvents-1", "TotalMultiplicity-1", "SelectedTracks-1", "MultFV0M-1", "MultFT0M-1", "MultTPC-1", "MultNTracksPV-1", "MultTracklets-1", "Centrality-1", "Vertex_x-1", "Vertex_y-1", "Vertex_z-1", "NContributors-1", "ImpactParameter-1"}, "Book (1) or do not book (0) event histogram"};
49+
Configurable<vector<string>> cfBookEventHistograms{"cfBookEventHistograms", {"NumberOfEvents-1", "TotalMultiplicity-1", "SelectedTracks-1", "MultFV0M-1", "MultFT0M-1", "MultTPC-1", "MultNTracksPV-1", "MultTracklets-1", "Centrality-1", "Vertex_x-1", "Vertex_y-1", "Vertex_z-1", "NContributors-1", "ImpactParameter-1", "Occupancy-1"}, "Book (1) or do not book (0) event histogram"};
4950
} cf_eh;
5051

5152
// *) Event cuts:
5253
struct : ConfigurableGroup {
53-
Configurable<vector<string>> cfUseEventCuts{"cfUseEventCuts", {"NumberOfEvents-1", "TotalMultiplicity-1", "SelectedTracks-1", "MultFV0M-1", "MultFT0M-1", "MultTPC-1", "MultNTracksPV-1", "MultTracklets-1", "Centrality-1", "Vertex_x-1", "Vertex_y-1", "Vertex_z-1", "NContributors-1", "ImpactParameter-1", "Trigger-1", "Sel7-1", "Sel8-1", "CentralityEstimator-1", "SelectedEvents-1", "NoSameBunchPileup-1", "IsGoodZvtxFT0vsPV-1", "IsVertexITSTPC-1", "IsVertexTOFmatched-1", "IsVertexTRDmatched-1"}, "use (1) or do not use (0) event cuts"};
54+
Configurable<vector<string>> cfUseEventCuts{"cfUseEventCuts", {"NumberOfEvents-1", "TotalMultiplicity-1", "SelectedTracks-1", "MultFV0M-1", "MultFT0M-1", "MultTPC-1", "MultNTracksPV-1", "MultTracklets-1", "Centrality-1", "Vertex_x-1", "Vertex_y-1", "Vertex_z-1", "NContributors-1", "ImpactParameter-1", "Occupancy-1", "Trigger-0", "Sel7-1", "Sel8-1", "CentralityEstimator-1", "SelectedEvents-1", "NoSameBunchPileup-1", "IsGoodZvtxFT0vsPV-1", "IsVertexITSTPC-1", "IsVertexTOFmatched-1", "IsVertexTRDmatched-1", "OccupancyEstimator-1"}, "use (1) or do not use (0) event cuts"};
5455
Configurable<bool> cfUseEventCutCounterAbsolute{"cfUseEventCutCounterAbsolute", false, "profile and save how many times each event cut counter triggered (absolute). Use with care, as this is computationally heavy"};
5556
Configurable<bool> cfUseEventCutCounterSequential{"cfUseEventCutCounterSequential", false, "profile and save how many times each event cut counter triggered (sequential). Use with care, as this is computationally heavy"};
5657
Configurable<bool> cfPrintCutCounterContent{"cfPrintCutCounterContent", false, "if true, prints on the screen after each event the content of fEventCutCounterHist[*][*] (all which were booked)"};
@@ -69,16 +70,18 @@ struct : ConfigurableGroup {
6970
Configurable<vector<float>> cfVertex_z{"cfVertex_z", {-10., 10.}, "vertex z position range: {min, max}[cm], with convention: min <= Vz < max"};
7071
Configurable<vector<int>> cfNContributors{"cfNContributors", {-1, 1000000000}, "Number of vertex contributors: {min, max}, with convention: min <= N < max"};
7172
Configurable<vector<float>> cfImpactParameter{"cfImpactParameter", {-1, 1000000000}, "Impact parameter range (can be used only for sim): {min, max}, with convention: min <= IP < max"};
73+
Configurable<vector<float>> cfOccupancy{"cfOccupancy", {-2, 1000000000}, "Range for occupancy (use cfOccupancyEstimator to set specific estimator): {min, max}, with convention: min <= X < max"};
7274
Configurable<string> cfTrigger{"cfTrigger", "some supported trigger", "set here some supported trigger (kINT7, ...) "};
7375
Configurable<bool> cfUseSel7{"cfUseSel7", false, "use for Run 1 and 2 data and MC (see official doc)"};
7476
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) "};
7578
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"};
7679
Configurable<bool> cfUseNoSameBunchPileup{"cfUseNoSameBunchPileup", false, "TBI 20240521 explanation"};
7780
Configurable<bool> cfUseIsGoodZvtxFT0vsPV{"cfUseIsGoodZvtxFT0vsPV", false, "TBI 20240521 explanation"};
7881
Configurable<bool> cfUseIsVertexITSTPC{"cfUseIsVertexITSTPC", false, "TBI 20240521 explanation"};
7982
Configurable<bool> cfUseIsVertexTOFmatched{"cfUseIsVertexTOFmatched", false, "TBI 20240521 explanation"};
8083
Configurable<bool> cfUseIsVertexTRDmatched{"cfUseIsVertexTRDmatched", false, "TBI 20240521 explanation"};
81-
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) "};
84+
Configurable<string> cfOccupancyEstimator{"cfOccupancyEstimator", "some supported occupancy estimator", "set here some supported occupancy estimator (TrackOccupancyInTimeRange, FT0COccupancyInTimeRange, ..."};
8285
} cf_ec;
8386

8487
// *) Particle histograms:
@@ -107,8 +110,8 @@ struct : ConfigurableGroup {
107110
Configurable<vector<float>> cftpcCrossedRowsOverFindableCls{"cftpcCrossedRowsOverFindableCls", {-1000., 1000.}, "tpcCrossedRowsOverFindableCls range: {min, max}, with convention: min <= eta < max"};
108111
Configurable<vector<float>> cftpcFoundOverFindableCls{"cftpcFoundOverFindableCls", {-1000., 1000.}, "tpcFoundOverFindableCls range: {min, max}, with convention: min <= eta < max"};
109112
Configurable<vector<float>> cftpcFractionSharedCls{"cftpcFractionSharedCls", {-1000., 1000.}, "tpcFractionSharedCls range: {min, max}, with convention: min <= eta < max"};
110-
Configurable<vector<float>> cfdcaXY{"cfdcaXY", {-1000., 1000.}, "dcaXY range: {min, max}, with convention: min <= eta < max"};
111-
Configurable<vector<float>> cfdcaZ{"cfdcaZ", {-1000., 1000.}, "dcaZ range: {min, max}, with convention: min <= eta < max"};
113+
Configurable<vector<float>> cfdcaXY{"cfdcaXY", {-1000., 1000.}, "dcaXY range: {min, max}, with convention: min <= dcaXY < max (yes, DCA can be negative!)"};
114+
Configurable<vector<float>> cfdcaZ{"cfdcaZ", {-1000., 1000.}, "dcaZ range: {min, max}, with convention: min <= dcaZ < max (yes, DCA can be negative!)"};
112115
Configurable<vector<float>> cfPDG{"cfPDG", {-5000., 5000.}, "PDG code"};
113116
Configurable<bool> cftrackCutFlagFb1{"cftrackCutFlagFb1", false, "TBI 20240510 add description"};
114117
Configurable<bool> cftrackCutFlagFb2{"cftrackCutFlagFb2", false, "TBI 20240510 add description"};
@@ -138,6 +141,7 @@ struct : ConfigurableGroup {
138141
Configurable<bool> cfCalculateTest0AsFunctionOfCentrality{"cfCalculateTest0AsFunctionOfCentrality", false, "calculate or not Test0 as a function of centrality"};
139142
Configurable<bool> cfCalculateTest0AsFunctionOfPt{"cfCalculateTest0AsFunctionOfPt", false, "calculate or not Test0 as a function of pt"};
140143
Configurable<bool> cfCalculateTest0AsFunctionOfEta{"cfCalculateTest0AsFunctionOfEta", false, "calculate or not Test0 as a function of eta"};
144+
Configurable<bool> cfCalculateTest0AsFunctionOfOccupancy{"cfCalculateTest0AsFunctionOfOccupancy", false, "calculate or not Test0 as a function of occupancy"};
141145
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"
142146
} cf_t0;
143147

@@ -182,11 +186,15 @@ struct : ConfigurableGroup {
182186
// *) Results histograms:
183187
struct : ConfigurableGroup {
184188
Configurable<bool> cfSaveResultsHistograms{"cfSaveResultsHistograms", false, "save or not results histograms"};
189+
185190
// Fixed-length binning (default):
186191
Configurable<vector<float>> cfFixedLength_mult_bins{"cfFixedLength_mult_bins", {2000, 0., 20000.}, "nMultBins, multMin, multMax"};
187192
Configurable<vector<float>> cfFixedLength_cent_bins{"cfFixedLength_cent_bins", {110, 0., 110.}, "nCentBins, centMin, centMax"};
188193
Configurable<vector<float>> cfFixedLength_pt_bins{"cfFixedLength_pt_bins", {1000, 0., 100.}, "nPtBins, ptMin, ptMax"};
189194
Configurable<vector<float>> cfFixedLength_eta_bins{"cfFixedLength_eta_bins", {1000, -2., 2.}, "nEtaBins, etaMin, etaMax"};
195+
Configurable<vector<float>> cfFixedLength_occu_bins{"cfFixedLength_occu_bins", {400, 0., 4000.}, "nOccuBins, occuMin, occuMax"};
196+
197+
// Variable-length binning (per request):
190198
Configurable<bool> cfUseVariableLength_mult_bins{"cfUseVariableLength_mult_bins", false, "use or not variable-length multiplicity bins"};
191199
Configurable<vector<float>> cfVariableLength_mult_bins{"cfVariableLength_mult_bins", {0., 5., 6., 7., 8., 9., 100., 200., 500., 1000., 10000.}, "variable-length multiplicity bins"};
192200
Configurable<bool> cfUseVariableLength_cent_bins{"cfUseVariableLength_cent_bins", false, "use or not variable-length centrality bins"};
@@ -195,6 +203,9 @@ struct : ConfigurableGroup {
195203
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"};
196204
Configurable<bool> cfUseVariableLength_eta_bins{"cfUseVariableLength_eta_bins", false, "use or not variable-length eta bins"};
197205
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"};
206+
Configurable<bool> cfUseVariableLength_occu_bins{"cfUseVariableLength_occu_bins", false, "use or not variable-length occupancy bins"};
207+
Configurable<vector<float>> cfVariableLength_occu_bins{"cfVariableLength_occu_bins", {0., 5., 6., 7., 8., 9., 100., 200., 500., 1000., 10000.}, "variable-length occupancy bins"};
208+
198209
} cf_res;
199210

200211
#endif // PWGCF_MULTIPARTICLECORRELATIONS_CORE_MUPA_CONFIGURABLES_H_

PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ struct TaskConfiguration {
4242
TString fRunNumber = ""; // over which run number this task is executed
4343
Bool_t fRunNumberIsDetermined = kFALSE; // ensures that run number is determined in process() and propagated to already booked objects only once
4444
Bool_t fDryRun = kFALSE; // book all histos and run without storing and calculating anything
45-
Bool_t fVerbose = kFALSE; // print additional info during debugging, but not for function calls per particle (see next)
45+
Bool_t fVerbose = kFALSE; // print additional info during debugging, but not for simply utility function or function calls per particle (see next)
46+
Bool_t fVerboseUtility = kFALSE; // print additional info during debugging also for simply utility function, but not for function calls per particle (see next)
4647
Bool_t fVerboseForEachParticle = kFALSE; // print additional info during debugging, also for function calls per particle
4748
Bool_t fDoAdditionalInsanityChecks = kFALSE; // do additional insanity checks at run time, at the expense of losing a bit of performance
4849
// (for instance, check if the run number in the current 'collision' is the same as run number in the first 'collision', etc.)
@@ -67,6 +68,7 @@ struct TaskConfiguration {
6768
struct EventByEventQuantities {
6869
Int_t fSelectedTracks = 0; // integer counter of tracks used to calculate Q-vectors, after all particle cuts have been applied
6970
Float_t fCentrality = 0.; // event-by-event centrality. Value of the default centrality estimator, set via configurable cfCentralityEstimator
71+
Float_t fOccupancy = 0.; // event-by-event occupancy. Value of the default occupancy estimator, set via configurable cfOccupancyEstimator
7072
} ebye; // "ebye" is a common label for objects in this struct
7173

7274
// *) QA:
@@ -90,6 +92,8 @@ struct QualityAssurance {
9092
// Int_t fQAParticleHistograms2DRebin[eQAParticleHistograms2D_N][2] = {{1}}; // to reduce memory consumption, use this number to merge bins together (i.e. "rebinning") [type - see enum][x,y]
9193
Float_t fCentrality[eCentralityEstimators_N] = {0.}; // used mostly in QA correlation plots
9294
TString fCentralityEstimatorName[eCentralityEstimators_N] = {""}; //
95+
Float_t fOccupancy[eOccupancyEstimators_N] = {0.}; // used mostly in QA correlation plots
96+
TString fOccupancyEstimatorName[eOccupancyEstimators_N] = {""}; //
9397
} qa; // "qa" is a common label for objects in this struct
9498

9599
// *) Event histograms:
@@ -258,12 +262,12 @@ struct Results { // This is in addition also s
258262
TProfile* fResultsPro[eAsFunctionOf_N] = {NULL}; //!<! example histogram to store some results + "abstract" interface, which defines common binning, etc., for other groups of histograms.
259263

260264
// Remark: These settings apply to following categories fCorrelationsPro, fNestedLoopsPro, fTest0Pro, and fResultsHist
261-
Float_t fResultsProFixedLengthBins[eAsFunctionOf_N][3] = {{0.}}; // [nBins,min,max]
262-
TArrayF* fResultsProVariableLengthBins[eAsFunctionOf_N] = {NULL}; // here for each variable in eAsFunctionOf I specify array holding bin boundaries
263-
Bool_t fUseResultsProVariableLengthBins[eAsFunctionOf_N] = {kFALSE}; // use or not variable-length bins
264-
TString fResultsProVariableLengthBinsString[eAsFunctionOf_N] = {""}; // TBI 20240113 temporary I do it this way
265-
TString fResultsProXaxisTitle[eAsFunctionOf_N] = {"integrated", "multiplicity", "centrality", "p_{T}", "#eta"}; // keep ordering in sync with enum eAsFunctionOf
266-
TString fResultsProRawName[eAsFunctionOf_N] = {"int", "mult", "cent", "pt", "eta"}; // this is how it appears simplified in the hist name when saved to the file
267-
} res; // "res" labels an instance of this group of histograms
265+
Float_t fResultsProFixedLengthBins[eAsFunctionOf_N][3] = {{0.}}; // [nBins,min,max]
266+
TArrayF* fResultsProVariableLengthBins[eAsFunctionOf_N] = {NULL}; // here for each variable in eAsFunctionOf I specify array holding bin boundaries
267+
Bool_t fUseResultsProVariableLengthBins[eAsFunctionOf_N] = {kFALSE}; // use or not variable-length bins
268+
TString fResultsProVariableLengthBinsString[eAsFunctionOf_N] = {""}; // TBI 20241110 this one is obsolete, can be removed
269+
TString fResultsProXaxisTitle[eAsFunctionOf_N] = {"integrated", "multiplicity", "centrality", "p_{T}", "#eta", "occupancy"}; // keep ordering in sync with enum eAsFunctionOf
270+
TString fResultsProRawName[eAsFunctionOf_N] = {"int", "mult", "cent", "pt", "eta", "occu"}; // this is how it appears simplified in the hist name when saved to the file
271+
} res; // "res" labels an instance of this group of histograms
268272

269273
#endif // PWGCF_MULTIPARTICLECORRELATIONS_CORE_MUPA_DATAMEMBERS_H_

0 commit comments

Comments
 (0)