Skip to content

Commit 237c3ed

Browse files
meiALICEYuanjun Mei
andauthored
[PWGCF] Fix impact parameter bug and other improvements according to code check (#18006)
Co-authored-by: Yuanjun Mei <yuanjun.mei@cern.ch>
1 parent 5591daa commit 237c3ed

1 file changed

Lines changed: 22 additions & 15 deletions

File tree

PWGCF/MultiparticleCorrelations/Tasks/multiparticleCorrelationsMei.cxx

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343

4444
#include <Rtypes.h>
4545

46+
#include <array>
4647
#include <cmath>
4748
#include <cstddef>
4849
#include <cstdint>
@@ -187,37 +188,37 @@ struct MultiparticleCorrelationsMei // this name is used in lower-case format to
187188
// *) Define and initialize all data members to be called in the main process* functions:
188189
// **) Task configuration:
189190
struct TaskConfiguration {
190-
bool fProcess[eProcess_N] = {false}; // Set what to process. See enum EProcess for full description. Set via implicit variables within a PROCESS_SWITCH clause.
191-
bool fDryRun = false; // book all histos and run without filling and calculating anything
192-
} tc; // you have to prepend "tc." for all objects name in this group later in the code
191+
std::array<bool, eProcess_N> fProcess{false}; // Set what to process. See enum EProcess for full description. Set via implicit variables within a PROCESS_SWITCH clause.
192+
bool fDryRun = false; // book all histos and run without filling and calculating anything
193+
} tc; // you have to prepend "tc." for all objects name in this group later in the code
193194

194195
// **) Particle histograms:
195196
struct ParticleHistograms {
196-
TList* fParticleHistogramsList = NULL; //!<! list to hold all control particle histograms
197-
TH1F* fParticleHistograms[eParticleHistograms_N][2][2] = {{{NULL}}};
197+
TList* fParticleHistogramsList = nullptr; //!<! list to hold all control particle histograms
198+
std::array<std::array<std::array<TH1F*, 2>, 2>, eParticleHistograms_N> fParticleHistograms{};
198199
} pc; // you have to prepend "pc." for all objects name in this group later in the code
199200

200201
// *) Event histograms:
201202
struct EventHistograms {
202-
TList* fEventHistogramsList = NULL; //!<! list to hold all event-level histograms
203-
TH1F* fEventHistograms[eEventHistograms_N][2][2] = {{{NULL}}}; //! [ type - see enum EEventHistograms ][reco,sim][before, after event cuts]
204-
} ec; // prepend "ec." for event counters
203+
TList* fEventHistogramsList = nullptr; //!<! list to hold all event-level histograms
204+
std::array<std::array<std::array<TH1F*, 2>, 2>, eEventHistograms_N> fEventHistograms{}; //! [ type - see enum EEventHistograms ][reco,sim][before, after event cuts]
205+
} ec; // prepend "ec." for event counters
205206

206207
// *) External histograms:
207208
struct ExternalHistograms {
208-
TList* fExternalHistogramsList = NULL;
209-
TH1D* fhistWeights = NULL;
209+
TList* fExternalHistogramsList = nullptr;
210+
TH1D* fhistWeights = nullptr;
210211
} ex;
211212

212213
struct Observables {
213-
TList* fObservablesList = NULL;
214-
TProfile* fProfTwo[2][2] = {{NULL}}; //! [reco,sim][before, after event cuts]
214+
TList* fObservablesList = nullptr;
215+
std::array<std::array<TProfile*, 2>, 2> fProfTwo{}; //! [reco,sim][before, after event cuts]
215216
} obs;
216217

217218
// *) Quality assurance histograms:
218219
struct QualityAssurance {
219-
TList* fQualityAssuranceList = NULL; //!<! list to hold all qualityAssurance histograms
220-
TH2F* fHistCentralityRecSim = NULL;
220+
TList* fQualityAssuranceList = nullptr; //!<! list to hold all qualityAssurance histograms
221+
TH2F* fHistCentralityRecSim = nullptr;
221222
} qa; // prepend "qa." for qa histograms
222223

223224
// *) functions
@@ -552,6 +553,12 @@ struct MultiparticleCorrelationsMei // this name is used in lower-case format to
552553
break; // thisCent is already FT0C
553554
}
554555

556+
LOGF(info,
557+
"centFT0C=%.6f centFT0M=%.6f centFV0A=%.6f",
558+
collision.centFT0C(),
559+
collision.centFT0M(),
560+
collision.centFV0A());
561+
555562
auto thisRefMult = collision.multTPC(); // use auto to determine the type
556563
switch (multiplicityTables) {
557564
case eMultTPC:
@@ -605,7 +612,7 @@ struct MultiparticleCorrelationsMei // this name is used in lower-case format to
605612
if (rm == eMC) {
606613
auto thisMCCollision = collision.mcCollision(); // corresponding MC truth simulated particle
607614
int multiplicitySim = static_cast<int>(tracks.size());
608-
auto impactParameter = thisMCCollision.impactParameter() * 1e15;
615+
auto impactParameter = thisMCCollision.impactParameter();
609616
LOGF(info,
610617
"Reco collision = %d, MC collision = %d, b = %f",
611618
collision.globalIndex(),

0 commit comments

Comments
 (0)