From 6cc2f0704c63adeb553dd3fbfbffe91b3956a99a Mon Sep 17 00:00:00 2001 From: Yuanjun Mei Date: Sat, 19 Sep 2026 11:05:32 +0200 Subject: [PATCH 1/3] Fix bugs for RecSim mode and add multiparticle correlation calculation --- .../Tasks/multiparticleCorrelationsMei.cxx | 920 +++++++++++------- 1 file changed, 565 insertions(+), 355 deletions(-) diff --git a/PWGCF/MultiparticleCorrelations/Tasks/multiparticleCorrelationsMei.cxx b/PWGCF/MultiparticleCorrelations/Tasks/multiparticleCorrelationsMei.cxx index 41b9c0b42be..a9a8acab9a7 100644 --- a/PWGCF/MultiparticleCorrelations/Tasks/multiparticleCorrelationsMei.cxx +++ b/PWGCF/MultiparticleCorrelations/Tasks/multiparticleCorrelationsMei.cxx @@ -13,6 +13,7 @@ /// \brief Multiparticle correlation in O2 Framework /// \author yuanjun.mei@cern.ch +#include "Common/CCDB/EventSelectionParams.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" @@ -29,6 +30,7 @@ #include #include +#include #include #include #include @@ -36,11 +38,13 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -65,60 +69,69 @@ using TrackSim = aod::McParticles::iterator; // *) Define enums: enum ECentralityEstimator { - EFT0C = 0, - EFT0M, - EFV0A, - ENTPV + eFT0C = 0, + eFT0M, + eFV0A, + eNTPV }; enum EMultiplicityTables { - EMultTPC = 0, - EMultFV0M, - EMultFT0C, - EMultFT0M, - EMultNTracksPV + eMultTPC = 0, + eMultFV0M, + eMultFT0C, + eMultFT0M, + eMultNTracksPV }; enum ERecSim { - ERec = 0, - ESim, - ERecAndSim + eRec = 0, + eSim, + eRecAndSim }; enum ECuts { - ENoCuts = 0, - EWithCuts + eNoCuts = 0, + eWithCuts +}; + +enum ERealMC { + eReal = 0, + eMC }; enum EProcess { - EProcessRec = 0, // Run 3, only reconstructed - EProcessRecSim, // Run 3, both reconstructed and simulated - EProcessSim, // Run 3, only simulated - EProcess_N + eProcessRec = 0, // Run 3, only reconstructed + eProcessRecSim, // Run 3, both reconstructed and simulated + eProcessSim, // Run 3, only simulated + eProcess_N }; enum EParticleHistograms { - EParticleHistogramsList = 0, - EHistPt, - EHistPhi, - EHistEta, - EParticleHistograms_N + eHistPt = 0, + eHistPhi, + eHistEta, + eParticleHistograms_N }; enum EEventHistograms { - EHistCentrality = 0, - EHistMultiplicity, - EHistVertexX, - EHistVertexY, - EHistVertexZ, - EHistImpactParameter, - EHistReferenceMultiplicity, - EEventHistograms_N + eHistCentrality = 0, + eHistMultiplicity, + eHistVertexX, + eHistVertexY, + eHistVertexZ, + eHistImpactParameter, + eHistReferenceMultiplicity, + eEventHistograms_N }; enum EExternalHistograms { - EHistWeights = 0, - EExternalHistograms_N + eHistWeights = 0, + eExternalHistograms_N +}; + +enum EObservables { + eProfTwo = 0, + eObservablesHist_N }; // *) Main task: @@ -138,56 +151,57 @@ struct MultiparticleCorrelationsMei // this name is used in lower-case format to Configurable multiplicityTables{"multiplicityTables", 0, "multiplicity tables: 0=multTPC, 1=multFV0M, 2=multFT0C, 3=multFT0M, 4=multNTracksPV"}; Configurable cfDryRun{"cfDryRun", false, "book all histos and run without filling and calculating anything"}; - // external root files + // *) external root files Configurable cfExternalFileSwitch{"cfExternalFileSwitch", false, "choose to include external root files or not"}; Configurable cfFileWithWeights{"cfFileWithWeights", "/alice-ccdb.cern.ch/Users/m/mei/O2challenge-", "path to external ROOT file which holds all particle weights"}; - // binnings + // *) binnings Configurable> cfPtBins{"cfPtBins", {2000, 0., 5.}, "nPtBins, ptMin, ptMax"}; // example for an array Configurable> cfPhiBins{"cfPhiBins", {180, 0., math::TwoPI}, "nPhiBins, phiMin, phiMax"}; // example for an array Configurable> cfEtaBins{"cfEtaBins", {800, -3., 3.}, "nEtaBins, etaMin, etaMax"}; // example for an array - Configurable> cfMultBinsRec{"cfMultBinsRec", {100, 0., 40000.}, "nMultBins, multMin, multMax"}; - Configurable> cfMultBinsRef{"cfMultBinsRef", {80, 0., 40000.}, "nMultBins, multMin, multMax"}; - Configurable> cfMultBinsSim{"cfMultBinsSim", {80, 0., 40000.}, "nMultBins, multMin, multMax"}; - Configurable> cfVxBins{"cfVxBins", {80, -0.04, 0.04}, "Vertex X hist: nVxBins, vxMin, vxMax"}; - Configurable> cfVyBins{"cfVyBins", {80, -0.01, 0.01}, "Vertex Y hist: nVyBins, vyMin, vyMax"}; - Configurable> cfVzBins{"cfVzBins", {80, -20., 20.}, "Vertex Z hist: nVzBins, vzMin, vzMax"}; + Configurable> cfMultBinsRec{"cfMultBinsRec", {400, 0., 40000.}, "nMultBins, multMin, multMax"}; + Configurable> cfMultBinsRef{"cfMultBinsRef", {400, 0., 40000.}, "nMultBins, multMin, multMax"}; + Configurable> cfMultBinsSim{"cfMultBinsSim", {400, 0., 40000.}, "nMultBins, multMin, multMax"}; + Configurable> cfVxBins{"cfVxBins", {300, -0.04, 0.04}, "Vertex X hist: nVxBins, vxMin, vxMax"}; + Configurable> cfVyBins{"cfVyBins", {300, -0.01, 0.01}, "Vertex Y hist: nVyBins, vyMin, vyMax"}; + Configurable> cfVzBins{"cfVzBins", {300, -20., 20.}, "Vertex Z hist: nVzBins, vzMin, vzMax"}; Configurable> cfCentBins{"cfCentBins", {100, 0., 100.}, "nCentBins, centMin, centMax"}; - Configurable> cfIpBins{"cfIpBins", {100, 0., 20.}, "Impact parameters hist: nIPBins, ipMin, ipMax"}; + Configurable> cfIpBins{"cfIpBins", {100, 0., 20.}, "Impact parameters hist (MC only): nIPBins, ipMin, ipMax"}; - // Cuts + // *) Cuts // event level cuts - Configurable cfEventCutSwitch{"cfEventCutSwitch", false, "switch to apply vertex z position cut"}; + Configurable cfMasterCutSwitch{"cfMasterCutSwitch", true, "switch on or off all cuts"}; + Configurable cfEventCutSwitch{"cfEventCutSwitch", true, "switch to apply vertex z position cut"}; Configurable> cfVertexZCutRange{"cfVertexZCutRange", {-10, 10.}, "vertex z position range: {min, max}[cm], with convention: min <= Vz < max"}; // particle level cuts - Configurable cfPtCutSwitch{"cfPtCutSwitch", false, "switch to apply pt cut"}; - Configurable> cfPtCutRange{"cfPtCutRange", {0.2, 5.}, "pt cut range: {min, max}, with convention: min <= Vz < max"}; + Configurable cfPtCutSwitch{"cfPtCutSwitch", true, "switch to apply pt cut"}; + Configurable> cfPtCutRange{"cfPtCutRange", {0.2, 5.}, "pt cut range: {min, max}, with convention: min <= pt < max"}; + Configurable cfEtaCutSwitch{"cfEtaCutSwitch", true, "switch to apply pt cut"}; + Configurable> cfEtaCutRange{"cfEtaCutRange", {-0.8, 0.8}, "eta cut range: {min, max}, with convention: min <= eta < max"}; - // misc + // *) misc Configurable sigmaInel{"sigmaInel", 7.71, "inelastic cross section in mb"}; Configurable qualityAssuranceSwitch{"qualityAssuranceSwitch", false, "quality assurance switch"}; // *) Define and initialize all data members to be called in the main process* functions: // **) Task configuration: struct TaskConfiguration { - bool fProcess[EProcess_N] = {false}; // Set what to process. See enum EProcess for full description. Set via implicit variables within a PROCESS_SWITCH clause. + bool fProcess[eProcess_N] = {false}; // Set what to process. See enum EProcess for full description. Set via implicit variables within a PROCESS_SWITCH clause. bool fDryRun = false; // book all histos and run without filling and calculating anything } tc; // you have to prepend "tc." for all objects name in this group later in the code // **) Particle histograms: struct ParticleHistograms { TList* fParticleHistogramsList = NULL; //! resultMultCorr(2, TComplex(0., 0.)); + // resultMultCorr = recursion(8, QVectorsTable, N8); profile_run1->Fill(6.5, (resultMultCorr[0]/resultMultCorr[1].Re()).Re()/(1e-8)); + std::vector> initQVectorsTable(int maxCorrelator, const std::vector& harmonic) + { + int sum = 0; + for (const int& x : harmonic) { + sum += std::abs(x); + } + const int maxHarmonic = sum + 1; // rows + const int maxPower = maxCorrelator + 1; // cols + + return std::vector>(maxHarmonic, std::vector(maxPower, TComplex(0., 0.))); + } + + template + void updateQVectorsTable(std::vector>& QVectorsTable, T1 phi, T1 weight = T1(1)) + { + const int maxHarmonic = QVectorsTable.size(); + const int maxPower = QVectorsTable.empty() ? 0 : QVectorsTable[0].size(); + + for (int h = 0; h < maxHarmonic; ++h) { + const auto cosH = std::cos(h * phi); + const auto sinH = std::sin(h * phi); + + for (int p = 0; p < maxPower; ++p) { + const auto wp = std::pow(weight, p); + QVectorsTable[h][p] += TComplex(wp * cosH, wp * sinH); + } + } + } + + std::vector two(const std::vector>& QVectorsTable, const std::vector& harmonic) + { + int n1 = harmonic[0], n2 = harmonic[1]; + auto q = [&](int n, int p) -> TComplex { + if (n >= 0) { + return QVectorsTable[n][p]; + } + return TComplex::Conjugate(QVectorsTable[-n][p]); + }; + auto corr = [&](int n1, int n2) -> TComplex { + return q(n1, 1) * q(n2, 1) - q(n1 + n2, 2); + }; + + TComplex n = corr(n1, n2); + TComplex d = corr(0, 0); + return {n, d}; + } + + std::vector recursion(int m, const std::vector>& Qvector, std::vector& harmonic, int mult = 1, int skip = 0) + { + // Calculate multi-particle correlators by using recursion (an improved faster version) originally developed by + // Kristjan Gulbrandsen (gulbrand@nbi.dk). + + auto q = [&](int n, int p) -> TComplex { + if (n >= 0) { + return Qvector[n][p]; + } + return TComplex::Conjugate(Qvector[-n][p]); + }; + + std::vector c = {q(harmonic[m - 1], mult), q(0, mult)}; + if ((m - 1) == 0) + return c; + std::vector temp = recursion(m - 1, Qvector, harmonic); + c[0] *= temp[0]; + c[1] *= temp[1]; + if ((m - 1) == skip) + return c; + + int counter1 = 0; + int hhold = harmonic[counter1]; + harmonic[counter1] = harmonic[m - 2]; + harmonic[m - 2] = hhold + harmonic[m - 1]; + std::vector c2 = recursion(m - 1, Qvector, harmonic, mult + 1, m - 2); + int counter2 = m - 3; + while (counter2 >= skip) { + harmonic[m - 2] = harmonic[counter1]; + harmonic[counter1] = hhold; + ++counter1; + hhold = harmonic[counter1]; + harmonic[counter1] = harmonic[m - 2]; + harmonic[m - 2] = hhold + harmonic[m - 1]; + temp = recursion(m - 1, Qvector, harmonic, mult + 1, counter2); + c2[0] += temp[0]; + c2[1] += temp[1]; + --counter2; + } + harmonic[m - 2] = harmonic[counter1]; + harmonic[counter1] = hhold; + + if (mult == 1) { + return {c[0] - c2[0], c[1] - c2[1]}; + } + return {c[0] - double(mult) * c2[0], c[1] - double(mult) * c2[1]}; + } + + bool noneZeroDenom(std::vector resultMultCorr) + { + if (resultMultCorr[1].Re() != 0) { + return true; + } else { + return false; + } + } + TObject* getObjectFromList(TList* list, const char* objectName) { // Get TObject pointer from TList, even if it's in some nested TList. Foreseen @@ -376,46 +504,50 @@ struct MultiparticleCorrelationsMei // this name is used in lower-case format to } // templates - template + template bool eventCuts(T1 const& collision) { - if constexpr (rs == ERec || rs == ERecAndSim) { + if constexpr (rs == eRec || rs == eRecAndSim) { if (cfEventCutSwitch) // event level cuts for Rec { - if (collision.posZ() > cfVertexZCutRange.value[1] || collision.posZ() < cfVertexZCutRange.value[0]) { - return false; - } // vertex z cut - if constexpr (rs == ERecAndSim) // event level cuts for Sim - { - if (!collision.has_mcCollision()) { - return false; - } - auto mcCollision = collision.mcCollision(); // corresponding MC truth simulated particle - if (mcCollision.posZ() > cfVertexZCutRange.value[1] || mcCollision.posZ() < cfVertexZCutRange.value[0]) { + if (rm == eReal) { + if (collision.posZ() > cfVertexZCutRange.value[1] || collision.posZ() < cfVertexZCutRange.value[0]) { return false; } // vertex z cut } + if constexpr (rs == eRecAndSim) // event level cuts for Sim + { + if (rm == eMC) { + if (!collision.has_mcCollision()) { + return false; + } + auto thisMCCollision = collision.mcCollision(); // corresponding MC truth simulated particle + if (thisMCCollision.posZ() > cfVertexZCutRange.value[1] || thisMCCollision.posZ() < cfVertexZCutRange.value[0]) { + return false; + } // vertex z cut + } + } } } return true; } - template + template void eventHistFill(T1 const& collision, T2 const& tracks) { auto thisCent = collision.centFT0C(); // use auto to determine the type switch (centralityEstimator) { - case EFT0C: + case eFT0C: thisCent = collision.centFT0C(); break; - case EFT0M: + case eFT0M: thisCent = collision.centFT0M(); break; - case EFV0A: + case eFV0A: thisCent = collision.centFV0A(); break; - case ENTPV: + case eNTPV: thisCent = collision.centNTPV(); break; default: @@ -425,19 +557,19 @@ struct MultiparticleCorrelationsMei // this name is used in lower-case format to auto thisRefMult = collision.multTPC(); // use auto to determine the type switch (multiplicityTables) { - case EMultTPC: + case eMultTPC: thisRefMult = collision.multTPC(); break; - case EMultFV0M: + case eMultFV0M: thisRefMult = collision.multFV0M(); break; - case EMultFT0C: + case eMultFT0C: thisRefMult = collision.multFT0C(); break; - case EMultFT0M: + case eMultFT0M: thisRefMult = collision.multFT0M(); break; - case EMultNTracksPV: + case eMultNTracksPV: thisRefMult = collision.multNTracksPV(); break; default: @@ -445,117 +577,156 @@ struct MultiparticleCorrelationsMei // this name is used in lower-case format to break; // thisRefMult is already multTPC } - if constexpr (rs == ERec || rs == ERecAndSim) { + if constexpr (rs == eRec || rs == eRecAndSim) { // Fill reconstructed-level event histograms - int multiplicityRec = static_cast(tracks.size()); - if constexpr (cuts == ENoCuts) { - ec.fEventHistograms[EHistMultiplicity][ERec][ENoCuts]->Fill(multiplicityRec); - ec.fEventHistograms[EHistCentrality][ERec][ENoCuts]->Fill(thisCent); - ec.fEventHistograms[EHistReferenceMultiplicity][ERec][ENoCuts]->Fill(thisRefMult); - ec.fEventHistograms[EHistVertexX][ERec][ENoCuts]->Fill(collision.posX()); - ec.fEventHistograms[EHistVertexY][ERec][ENoCuts]->Fill(collision.posY()); - ec.fEventHistograms[EHistVertexZ][ERec][ENoCuts]->Fill(collision.posZ()); - } - if constexpr (cuts == EWithCuts) { - ec.fEventHistograms[EHistMultiplicity][ERec][EWithCuts]->Fill(multiplicityRec); - ec.fEventHistograms[EHistCentrality][ERec][EWithCuts]->Fill(thisCent); - ec.fEventHistograms[EHistReferenceMultiplicity][ERec][EWithCuts]->Fill(thisRefMult); - ec.fEventHistograms[EHistVertexX][ERec][EWithCuts]->Fill(collision.posX()); - ec.fEventHistograms[EHistVertexY][ERec][EWithCuts]->Fill(collision.posY()); - ec.fEventHistograms[EHistVertexZ][ERec][EWithCuts]->Fill(collision.posZ()); + if (rm == eReal) { + int multiplicityRec = static_cast(tracks.size()); + if constexpr (cuts == eNoCuts) { + ec.fEventHistograms[eHistMultiplicity][eRec][eNoCuts]->Fill(multiplicityRec); + ec.fEventHistograms[eHistCentrality][eRec][eNoCuts]->Fill(thisCent); + ec.fEventHistograms[eHistReferenceMultiplicity][eRec][eNoCuts]->Fill(thisRefMult); + ec.fEventHistograms[eHistVertexX][eRec][eNoCuts]->Fill(collision.posX()); + ec.fEventHistograms[eHistVertexY][eRec][eNoCuts]->Fill(collision.posY()); + ec.fEventHistograms[eHistVertexZ][eRec][eNoCuts]->Fill(collision.posZ()); + } + if constexpr (cuts == eWithCuts) { + ec.fEventHistograms[eHistMultiplicity][eRec][eWithCuts]->Fill(multiplicityRec); + ec.fEventHistograms[eHistCentrality][eRec][eWithCuts]->Fill(thisCent); + ec.fEventHistograms[eHistReferenceMultiplicity][eRec][eWithCuts]->Fill(thisRefMult); + ec.fEventHistograms[eHistVertexX][eRec][eWithCuts]->Fill(collision.posX()); + ec.fEventHistograms[eHistVertexY][eRec][eWithCuts]->Fill(collision.posY()); + ec.fEventHistograms[eHistVertexZ][eRec][eWithCuts]->Fill(collision.posZ()); + } } // Fill MC simulated-level event histograms if both reconstructed and simulated data are processed - if constexpr (rs == ERecAndSim) { + if constexpr (rs == eRecAndSim) { if (!collision.has_mcCollision()) { + LOGF(warning, "No MC collision for this collision, skip..."); return; } - auto mcCollision = collision.mcCollision(); // corresponding MC truth simulated particle - int multiplicitySim = static_cast(tracks.size()); - float impactParameter = mcCollision.impactParameter(); - float centralitySim = math::PI * impactParameter * impactParameter / sigmaInel; // centrality for sim derived from impact parameter - if constexpr (cuts == ENoCuts) { - ec.fEventHistograms[EHistMultiplicity][ESim][ENoCuts]->Fill(multiplicitySim); - ec.fEventHistograms[EHistCentrality][ESim][ENoCuts]->Fill(centralitySim); - ec.fEventHistograms[EHistImpactParameter][ESim][ENoCuts]->Fill(mcCollision.impactParameter()); - ec.fEventHistograms[EHistVertexX][ESim][ENoCuts]->Fill(mcCollision.posX()); - ec.fEventHistograms[EHistVertexY][ESim][ENoCuts]->Fill(mcCollision.posY()); - ec.fEventHistograms[EHistVertexZ][ESim][ENoCuts]->Fill(mcCollision.posZ()); - } + if (rm == eMC) { + auto thisMCCollision = collision.mcCollision(); // corresponding MC truth simulated particle + int multiplicitySim = static_cast(tracks.size()); + auto impactParameter = thisMCCollision.impactParameter() * 1e15; + LOGF(info, + "Reco collision = %d, MC collision = %d, b = %f", + collision.globalIndex(), + thisMCCollision.globalIndex(), + impactParameter); + auto centralityMC = math::PI * impactParameter * impactParameter / sigmaInel; // centrality for sim derived from impact parameter + if constexpr (cuts == eNoCuts) { + ec.fEventHistograms[eHistMultiplicity][eSim][eNoCuts]->Fill(multiplicitySim); + ec.fEventHistograms[eHistCentrality][eSim][eNoCuts]->Fill(centralityMC); + ec.fEventHistograms[eHistImpactParameter][eSim][eNoCuts]->Fill(impactParameter); + ec.fEventHistograms[eHistVertexX][eSim][eNoCuts]->Fill(thisMCCollision.posX()); + ec.fEventHistograms[eHistVertexY][eSim][eNoCuts]->Fill(thisMCCollision.posY()); + ec.fEventHistograms[eHistVertexZ][eSim][eNoCuts]->Fill(thisMCCollision.posZ()); + } - if constexpr (cuts == EWithCuts) { - ec.fEventHistograms[EHistMultiplicity][ESim][EWithCuts]->Fill(multiplicitySim); - ec.fEventHistograms[EHistCentrality][ESim][EWithCuts]->Fill(centralitySim); - ec.fEventHistograms[EHistImpactParameter][ESim][EWithCuts]->Fill(mcCollision.impactParameter()); - ec.fEventHistograms[EHistVertexX][ESim][EWithCuts]->Fill(mcCollision.posX()); - ec.fEventHistograms[EHistVertexY][ESim][EWithCuts]->Fill(mcCollision.posY()); - ec.fEventHistograms[EHistVertexZ][ESim][EWithCuts]->Fill(mcCollision.posZ()); - } + if constexpr (cuts == eWithCuts) { + ec.fEventHistograms[eHistMultiplicity][eSim][eWithCuts]->Fill(multiplicitySim); + ec.fEventHistograms[eHistCentrality][eSim][eWithCuts]->Fill(centralityMC); + ec.fEventHistograms[eHistImpactParameter][eSim][eWithCuts]->Fill(impactParameter); + ec.fEventHistograms[eHistVertexX][eSim][eWithCuts]->Fill(thisMCCollision.posX()); + ec.fEventHistograms[eHistVertexY][eSim][eWithCuts]->Fill(thisMCCollision.posY()); + ec.fEventHistograms[eHistVertexZ][eSim][eWithCuts]->Fill(thisMCCollision.posZ()); + } + } // end of if (rm == eMC) { } } } - template + template bool particleCuts(T const& track) { - if constexpr (rs == ERec || rs == ERecAndSim) { - if (cfPtCutSwitch) // Vertex Z cuts for Rec + // add eta cuts!!!!!! + if constexpr (rs == eRec || rs == eRecAndSim) { + if (cfPtCutSwitch) // pt cuts for Rec { - if (track.pt() < cfPtCutRange.value[0] || track.pt() > cfPtCutRange.value[1]) { - return false; - } - if constexpr (rs == ERecAndSim) // Vertex Z cuts for Sim - { - if (!track.has_mcParticle()) { + if (rm == eReal) { + if (track.pt() < cfPtCutRange.value[0] || track.pt() > cfPtCutRange.value[1]) { return false; } - auto mcParticle = track.mcParticle(); // corresponding MC truth simulated particle - if (mcParticle.pt() < cfPtCutRange.value[0] || mcParticle.pt() > cfPtCutRange.value[1]) { + } + if constexpr (rs == eRecAndSim) // pt cuts for Sim + { + if (rm == eMC) { + if (!track.has_mcParticle()) { + return false; + } + auto mcParticle = track.mcParticle(); + if (mcParticle.pt() < cfPtCutRange.value[0] || mcParticle.pt() > cfPtCutRange.value[1]) { + return false; + } + } // end of if (rm == eMC) { + } + } + if (cfEtaCutSwitch) // eta cuts for Rec + { + if (rm == eReal) { + if (track.eta() < cfEtaCutRange.value[0] || track.eta() > cfEtaCutRange.value[1]) { return false; } } + if constexpr (rs == eRecAndSim) // eta cuts for Sim + { + if (rm == eMC) { + if (!track.has_mcParticle()) { + return false; + } + auto mcParticle = track.mcParticle(); + if (mcParticle.eta() < cfEtaCutRange.value[0] || mcParticle.eta() > cfEtaCutRange.value[1]) { + return false; + } + } // end of if (rm == eMC) { + } } } return true; } - template + template void particleHistFill(T1 const& track) { - if constexpr (rs == ERec || rs == ERecAndSim) { - if constexpr (cuts == ENoCuts) { - pc.fParticleHistograms[EHistPt][ERec][ENoCuts]->Fill(track.pt()); - pc.fParticleHistograms[EHistPhi][ERec][ENoCuts]->Fill(track.phi()); - pc.fParticleHistograms[EHistEta][ERec][ENoCuts]->Fill(track.eta()); - } + if constexpr (rs == eRec || rs == eRecAndSim) { + if (rm == eReal) { + if constexpr (cuts == eNoCuts) { + pc.fParticleHistograms[eHistPt][eRec][eNoCuts]->Fill(track.pt()); + pc.fParticleHistograms[eHistPhi][eRec][eNoCuts]->Fill(track.phi()); + pc.fParticleHistograms[eHistEta][eRec][eNoCuts]->Fill(track.eta()); + } - if constexpr (cuts == EWithCuts) { - pc.fParticleHistograms[EHistPt][ERec][EWithCuts]->Fill(track.pt()); - pc.fParticleHistograms[EHistPhi][ERec][EWithCuts]->Fill(track.phi()); - pc.fParticleHistograms[EHistEta][ERec][EWithCuts]->Fill(track.eta()); + if constexpr (cuts == eWithCuts) { + pc.fParticleHistograms[eHistPt][eRec][eWithCuts]->Fill(track.pt()); + pc.fParticleHistograms[eHistPhi][eRec][eWithCuts]->Fill(track.phi()); + pc.fParticleHistograms[eHistEta][eRec][eWithCuts]->Fill(track.eta()); + } } // ... and corresponding MC truth simulated: // See https://github.com/AliceO2Group/O2Physics/blob/master/Tutorials/src/mcHistograms.cxx // See https://aliceo2group.github.io/analysis-framework/docs/datamodel/ao2dTables.html#montecarlo - if constexpr (rs == ERecAndSim) { - if (!track.has_mcParticle()) { - LOGF(warning, " No MC particle for this track, skip..."); - return; - } - auto mcParticle = track.mcParticle(); // corresponding MC truth simulated particle - if constexpr (cuts == ENoCuts) { - pc.fParticleHistograms[EHistPt][ESim][ENoCuts]->Fill(mcParticle.pt()); - pc.fParticleHistograms[EHistPhi][ESim][ENoCuts]->Fill(mcParticle.phi()); - pc.fParticleHistograms[EHistEta][ESim][ENoCuts]->Fill(mcParticle.eta()); - } + if constexpr (rs == eRecAndSim) { + if (rm == eMC) { + if (!track.has_mcParticle()) { + LOGF(warning, " No MC particle for this track, skip..."); + return; + } + auto mcParticle = track.mcParticle(); // corresponding MC truth simulated particle + if constexpr (cuts == eNoCuts) { + pc.fParticleHistograms[eHistPt][eSim][eNoCuts]->Fill(mcParticle.pt()); + pc.fParticleHistograms[eHistPhi][eSim][eNoCuts]->Fill(mcParticle.phi()); + pc.fParticleHistograms[eHistEta][eSim][eNoCuts]->Fill(mcParticle.eta()); + } - if constexpr (cuts == EWithCuts) { - pc.fParticleHistograms[EHistPt][ESim][EWithCuts]->Fill(mcParticle.pt()); - pc.fParticleHistograms[EHistPhi][ESim][EWithCuts]->Fill(mcParticle.phi()); - pc.fParticleHistograms[EHistEta][ESim][EWithCuts]->Fill(mcParticle.eta()); - } + if constexpr (cuts == eWithCuts) { + pc.fParticleHistograms[eHistPt][eSim][eWithCuts]->Fill(mcParticle.pt()); + pc.fParticleHistograms[eHistPhi][eSim][eWithCuts]->Fill(mcParticle.phi()); + pc.fParticleHistograms[eHistEta][eSim][eWithCuts]->Fill(mcParticle.eta()); + } + } // end of if (rm == eMC) { } } } @@ -565,30 +736,30 @@ struct MultiparticleCorrelationsMei // this name is used in lower-case format to { auto thisCent = collision.centFT0C(); // use auto to determine the type switch (centralityEstimator) { - case EFT0C: + case eFT0C: thisCent = collision.centFT0C(); break; - case EFT0M: + case eFT0M: thisCent = collision.centFT0M(); break; - case EFV0A: + case eFV0A: thisCent = collision.centFV0A(); break; - case ENTPV: + case eNTPV: thisCent = collision.centNTPV(); break; default: LOG(warning) << "Unknown centrality estimator. Using FT0C as default."; break; // thisCent is already FT0C } - if constexpr (rs == ERecAndSim || rs == ESim) { + if constexpr (rs == eRecAndSim || rs == eSim) { if (!collision.has_mcCollision()) { return; } - auto mcCollision = collision.mcCollision(); - float impactParameter = mcCollision.impactParameter(); - float centralitySim = math::PI * impactParameter * impactParameter / sigmaInel; // centrality for sim derived from impact parameter - qa.fHistCentralityRecSim->Fill(thisCent, centralitySim); + auto thisMCCollision = collision.mcCollision(); + auto impactParameter = thisMCCollision.impactParameter(); + auto centralityMC = math::PI * impactParameter * impactParameter / sigmaInel; // centrality for sim derived from impact parameter + qa.fHistCentralityRecSim->Fill(thisCent, centralityMC); } } @@ -606,10 +777,20 @@ struct MultiparticleCorrelationsMei // this name is used in lower-case format to qaFill(collision); } + const bool passesEventCutsReal = eventCuts(collision); + const bool passesEventCutsMC = eventCuts(collision); + // Fill Event Hist - eventHistFill(collision, tracks); - if (cfEventCutSwitch && eventCuts(collision)) { - eventHistFill(collision, tracks); + eventHistFill(collision, tracks); + eventHistFill(collision, tracks); + + if (cfMasterCutSwitch) { + if (passesEventCutsReal) { + eventHistFill(collision, tracks); + } + if (passesEventCutsMC) { + eventHistFill(collision, tracks); + } } // Print current run number: @@ -621,6 +802,10 @@ struct MultiparticleCorrelationsMei // this name is used in lower-case format to // Print vertex X position: LOGF(info, "Vertex X position: %f", collision.posX()); + std::vector n2 = {-2, 2}; + auto qVectorsTableNoCutsReal = initQVectorsTable(2, n2); + auto qVectorsTableWithCutsReal = initQVectorsTable(2, n2); + // Main loop over particles: auto track = tracks.iteratorAt(0); // set the type and scope from one instance for (int64_t i = 0; i < tracks.size(); i++) { @@ -628,23 +813,50 @@ struct MultiparticleCorrelationsMei // this name is used in lower-case format to // LOGF(info, "Track azimuthal angle: %f", track.phi()); track = tracks.iteratorAt(i); - // Fill reconstructed ...: - particleHistFill(track); - if (cfPtCutSwitch && cfEventCutSwitch && eventCuts(collision) && particleCuts(track)) { - particleHistFill(track); + + particleHistFill(track); + updateQVectorsTable(qVectorsTableNoCutsReal, track.phi()); + + particleHistFill(track); + + if (cfMasterCutSwitch) { + if (passesEventCutsReal && particleCuts(track)) { + particleHistFill(track); + updateQVectorsTable(qVectorsTableWithCutsReal, track.phi()); + } + if (passesEventCutsMC && particleCuts(track)) { + particleHistFill(track); + } } } // end of for (int64_t i = 0; i < tracks.size(); i++) { + + std::vector resultMultCorr(2, TComplex(0., 0.)); + resultMultCorr = two(qVectorsTableNoCutsReal, n2); + if (noneZeroDenom(resultMultCorr)) { + obs.fProfTwo[eRec][eNoCuts]->Fill(0.5, (resultMultCorr[0] / resultMultCorr[1].Re()).Re() / (1e-2)); + } + if (cfMasterCutSwitch && passesEventCutsReal) { + resultMultCorr = two(qVectorsTableWithCutsReal, n2); + if (noneZeroDenom(resultMultCorr)) { + obs.fProfTwo[eRec][eWithCuts]->Fill(0.5, (resultMultCorr[0] / resultMultCorr[1].Re()).Re() / (1e-2)); + } + } + } // end of template void steer(T1 const& collision, T2 const& tracks) { // *) Initialize and book all objects: void init(InitContext&) { // ... code to book and initialize all analysis objects ... + const int withCutFillColor = kGreen - 10; + const int withCutLineColor = kGreen; + const int noCutFillColor = kRed - 10; + const int noCutLineColor = kRed; // *) Set automatically what to process, from an implicit variable "doprocessSomEProcessName" within a PROCESS_SWITCH clause: - tc.fProcess[EProcessRec] = doprocessRec; - tc.fProcess[EProcessRecSim] = doprocessRecSim; - tc.fProcess[EProcessSim] = doprocessSim; + tc.fProcess[eProcessRec] = doprocessRec; + tc.fProcess[eProcessRecSim] = doprocessRecSim; + tc.fProcess[eProcessSim] = doprocessSim; // *) Configure your task using configurables in the json file: tc.fDryRun = cfDryRun; @@ -654,6 +866,7 @@ struct MultiparticleCorrelationsMei // this name is used in lower-case format to temp->SetOwner(true); fBaseList.setObject(temp); + // *) Book and nest all other TLists: if (cfExternalFileSwitch) { // *) Book External Hist List ex.fExternalHistogramsList = new TList(); @@ -667,93 +880,89 @@ struct MultiparticleCorrelationsMei // this name is used in lower-case format to ex.fExternalHistogramsList->Add(ex.fhistWeights); } - // *) Book and nest all other TLists: + // *) Book particle TLists: pc.fParticleHistogramsList = new TList(); pc.fParticleHistogramsList->SetName("ParticleHistograms"); pc.fParticleHistogramsList->SetOwner(true); fBaseList->Add(pc.fParticleHistogramsList); // any nested TList in the base TList appears as a subdir in the output ROOT file // *) Book pt and phi distribution with binning defined through configurables in the json file: - vector lPtBins = cfPtBins.value; // define local array and initialize it from an array set in the configurables + std::vector lPtBins = cfPtBins.value; // define local array and initialize it from an array set in the configurables int nBinsPt = static_cast(lPtBins[0]); float minPt = lPtBins[1]; float maxPt = lPtBins[2]; - vector lPhiBins = cfPhiBins.value; // define local array and initialize it from an array set in the configurables + std::vector lPhiBins = cfPhiBins.value; // define local array and initialize it from an array set in the configurables int nBinsPhi = static_cast(lPhiBins[0]); float minPhi = lPhiBins[1]; float maxPhi = lPhiBins[2]; - vector lEtaBins = cfEtaBins.value; // define local array and initialize it from an array set in the configurables + std::vector lEtaBins = cfEtaBins.value; // define local array and initialize it from an array set in the configurables int nBinsEta = static_cast(lEtaBins[0]); float minEta = lEtaBins[1]; float maxEta = lEtaBins[2]; if (doprocessRec || doprocessRecSim) { - pc.fParticleHistograms[EHistPt][ERec][ENoCuts] = new TH1F("[EHistPt][ERec][ENoCuts]", "pt distribution for reconstructed particles before cuts", nBinsPt, minPt, maxPt); - pc.fParticleHistograms[EHistPt][ERec][ENoCuts]->GetXaxis()->SetTitle("p_{T}"); - pc.fParticleHistograms[EHistPt][ERec][ENoCuts]->SetColors(kRed, -1, kRed); - pc.fParticleHistogramsList->Add(pc.fParticleHistograms[EHistPt][ERec][ENoCuts]); + pc.fParticleHistograms[eHistPt][eRec][eNoCuts] = new TH1F("[eHistPt][eRec][eNoCuts]", "pt distribution for reconstructed particles before cuts", nBinsPt, minPt, maxPt); + pc.fParticleHistograms[eHistPt][eRec][eNoCuts]->GetXaxis()->SetTitle("p_{T}"); + + pc.fParticleHistograms[eHistPhi][eRec][eNoCuts] = new TH1F("[eHistPhi][eRec][eNoCuts]", "phi distribution for reconstructed particles before cuts", nBinsPhi, minPhi, maxPhi); + pc.fParticleHistograms[eHistPhi][eRec][eNoCuts]->GetXaxis()->SetTitle("#varphi"); - pc.fParticleHistograms[EHistPhi][ERec][ENoCuts] = new TH1F("[EHistPhi][ERec][ENoCuts]", "phi distribution for reconstructed particles before cuts", nBinsPhi, minPhi, maxPhi); - pc.fParticleHistograms[EHistPhi][ERec][ENoCuts]->GetXaxis()->SetTitle("p_{phi}"); - pc.fParticleHistograms[EHistPhi][ERec][ENoCuts]->SetColors(kRed, -1, kRed); - pc.fParticleHistogramsList->Add(pc.fParticleHistograms[EHistPhi][ERec][ENoCuts]); + pc.fParticleHistograms[eHistEta][eRec][eNoCuts] = new TH1F("[eHistEta][eRec][eNoCuts]", "eta distribution for reconstructed particles before cuts", nBinsEta, minEta, maxEta); + pc.fParticleHistograms[eHistEta][eRec][eNoCuts]->GetXaxis()->SetTitle("#eta"); + + for (int i = 0; i < eParticleHistograms_N; ++i) { + pc.fParticleHistograms[i][eRec][eNoCuts]->SetColors(noCutLineColor, -1, noCutFillColor); + pc.fParticleHistogramsList->Add(pc.fParticleHistograms[i][eRec][eNoCuts]); + } - pc.fParticleHistograms[EHistEta][ERec][ENoCuts] = new TH1F("[EHistEta][ERec][ENoCuts]", "eta distribution for reconstructed particles before cuts", nBinsEta, minEta, maxEta); - pc.fParticleHistograms[EHistEta][ERec][ENoCuts]->GetXaxis()->SetTitle("#eta"); - pc.fParticleHistograms[EHistEta][ERec][ENoCuts]->SetColors(kRed, -1, kRed); - pc.fParticleHistogramsList->Add(pc.fParticleHistograms[EHistEta][ERec][ENoCuts]); + if (cfMasterCutSwitch) { + pc.fParticleHistograms[eHistPt][eRec][eWithCuts] = new TH1F("[eHistPt][eRec][eWithCuts]", "pt distribution for reconstructed particles after cuts", nBinsPt, minPt, maxPt); + pc.fParticleHistograms[eHistPt][eRec][eWithCuts]->GetXaxis()->SetTitle("p_{T}"); - if (cfPtCutSwitch) { - pc.fParticleHistograms[EHistPt][ERec][EWithCuts] = new TH1F("[EHistPt][ERec][EWithCuts]", "pt distribution for reconstructed particles after cuts", nBinsPt, minPt, maxPt); - pc.fParticleHistograms[EHistPt][ERec][EWithCuts]->GetXaxis()->SetTitle("p_{T}"); - pc.fParticleHistograms[EHistPt][ERec][EWithCuts]->SetColors(kGreen, -1, kGreen); - pc.fParticleHistogramsList->Add(pc.fParticleHistograms[EHistPt][ERec][EWithCuts]); + pc.fParticleHistograms[eHistPhi][eRec][eWithCuts] = new TH1F("[eHistPhi][eRec][eWithCuts]", "phi distribution for reconstructed particles after cuts", nBinsPhi, minPhi, maxPhi); + pc.fParticleHistograms[eHistPhi][eRec][eWithCuts]->GetXaxis()->SetTitle("#varphi"); - pc.fParticleHistograms[EHistPhi][ERec][EWithCuts] = new TH1F("[EHistPhi][ERec][EWithCuts]", "phi distribution for reconstructed particles after cuts", nBinsPhi, minPhi, maxPhi); - pc.fParticleHistograms[EHistPhi][ERec][EWithCuts]->GetXaxis()->SetTitle("p_{phi}"); - pc.fParticleHistograms[EHistPhi][ERec][EWithCuts]->SetColors(kGreen, -1, kGreen); - pc.fParticleHistogramsList->Add(pc.fParticleHistograms[EHistPhi][ERec][EWithCuts]); + pc.fParticleHistograms[eHistEta][eRec][eWithCuts] = new TH1F("[eHistEta][eRec][eWithCuts]", "eta distribution for reconstructed particles after cuts", nBinsEta, minEta, maxEta); + pc.fParticleHistograms[eHistEta][eRec][eWithCuts]->GetXaxis()->SetTitle("#eta"); - pc.fParticleHistograms[EHistEta][ERec][EWithCuts] = new TH1F("[EHistEta][ERec][EWithCuts]", "eta distribution for reconstructed particles after cuts", nBinsEta, minEta, maxEta); - pc.fParticleHistograms[EHistEta][ERec][EWithCuts]->GetXaxis()->SetTitle("#eta"); - pc.fParticleHistograms[EHistEta][ERec][EWithCuts]->SetColors(kGreen, -1, kGreen); - pc.fParticleHistogramsList->Add(pc.fParticleHistograms[EHistEta][ERec][EWithCuts]); + for (int i = 0; i < eParticleHistograms_N; ++i) { + pc.fParticleHistograms[i][eRec][eWithCuts]->SetColors(withCutLineColor, -1, withCutFillColor); + pc.fParticleHistogramsList->Add(pc.fParticleHistograms[i][eRec][eWithCuts]); + } } } if (doprocessSim || doprocessRecSim) { - pc.fParticleHistograms[EHistPt][ESim][ENoCuts] = new TH1F("[EHistPt][ESim][ENoCuts]", "pt distribution for simulated particles before cuts", nBinsPt, minPt, maxPt); - pc.fParticleHistograms[EHistPt][ESim][ENoCuts]->GetXaxis()->SetTitle("p_{T}"); - pc.fParticleHistograms[EHistPt][ESim][ENoCuts]->SetColors(kRed, -1, kRed); - pc.fParticleHistogramsList->Add(pc.fParticleHistograms[EHistPt][ESim][ENoCuts]); + pc.fParticleHistograms[eHistPt][eSim][eNoCuts] = new TH1F("[eHistPt][eSim][eNoCuts]", "pt distribution for simulated particles before cuts", nBinsPt, minPt, maxPt); + pc.fParticleHistograms[eHistPt][eSim][eNoCuts]->GetXaxis()->SetTitle("p_{T}"); + + pc.fParticleHistograms[eHistPhi][eSim][eNoCuts] = new TH1F("[eHistPhi][eSim][eNoCuts]", "phi distribution for simulated particles before cuts", nBinsPhi, minPhi, maxPhi); + pc.fParticleHistograms[eHistPhi][eSim][eNoCuts]->GetXaxis()->SetTitle("#varphi"); - pc.fParticleHistograms[EHistPhi][ESim][ENoCuts] = new TH1F("[EHistPhi][ESim][ENoCuts]", "phi distribution for simulated particles before cuts", nBinsPhi, minPhi, maxPhi); - pc.fParticleHistograms[EHistPhi][ESim][ENoCuts]->GetXaxis()->SetTitle("p_{phi}"); - pc.fParticleHistograms[EHistPhi][ESim][ENoCuts]->SetColors(kRed, -1, kRed); - pc.fParticleHistogramsList->Add(pc.fParticleHistograms[EHistPhi][ESim][ENoCuts]); + pc.fParticleHistograms[eHistEta][eSim][eNoCuts] = new TH1F("[eHistEta][eSim][eNoCuts]", "eta distribution for simulated particles before cuts", nBinsEta, minEta, maxEta); + pc.fParticleHistograms[eHistEta][eSim][eNoCuts]->GetXaxis()->SetTitle("#eta"); + + for (int i = 0; i < eParticleHistograms_N; ++i) { + pc.fParticleHistograms[i][eSim][eNoCuts]->SetColors(noCutLineColor, -1, noCutFillColor); + pc.fParticleHistogramsList->Add(pc.fParticleHistograms[i][eSim][eNoCuts]); + } - pc.fParticleHistograms[EHistEta][ESim][ENoCuts] = new TH1F("[EHistEta][ESim][ENoCuts]", "eta distribution for simulated particles before cuts", nBinsEta, minEta, maxEta); - pc.fParticleHistograms[EHistEta][ESim][ENoCuts]->GetXaxis()->SetTitle("#eta"); - pc.fParticleHistograms[EHistEta][ESim][ENoCuts]->SetColors(kRed, -1, kRed); - pc.fParticleHistogramsList->Add(pc.fParticleHistograms[EHistEta][ESim][ENoCuts]); + if (cfMasterCutSwitch) { + pc.fParticleHistograms[eHistPt][eSim][eWithCuts] = new TH1F("[eHistPt][eSim][eWithCuts]", "pt distribution for simulated particles after cuts", nBinsPt, minPt, maxPt); + pc.fParticleHistograms[eHistPt][eSim][eWithCuts]->GetXaxis()->SetTitle("p_{T}"); - if (cfPtCutSwitch) { - pc.fParticleHistograms[EHistPt][ESim][EWithCuts] = new TH1F("[EHistPt][ESim][EWithCuts]", "pt distribution for simulated particles after cuts", nBinsPt, minPt, maxPt); - pc.fParticleHistograms[EHistPt][ESim][EWithCuts]->GetXaxis()->SetTitle("p_{T}"); - pc.fParticleHistograms[EHistPt][ESim][EWithCuts]->SetColors(kGreen, -1, kGreen); - pc.fParticleHistogramsList->Add(pc.fParticleHistograms[EHistPt][ESim][EWithCuts]); + pc.fParticleHistograms[eHistPhi][eSim][eWithCuts] = new TH1F("[eHistPhi][eSim][eWithCuts]", "phi distribution for simulated particles after cuts", nBinsPhi, minPhi, maxPhi); + pc.fParticleHistograms[eHistPhi][eSim][eWithCuts]->GetXaxis()->SetTitle("#varphi"); - pc.fParticleHistograms[EHistPhi][ESim][EWithCuts] = new TH1F("[EHistPhi][ESim][EWithCuts]", "phi distribution for simulated particles after cuts", nBinsPhi, minPhi, maxPhi); - pc.fParticleHistograms[EHistPhi][ESim][EWithCuts]->GetXaxis()->SetTitle("p_{phi}"); - pc.fParticleHistograms[EHistPhi][ESim][EWithCuts]->SetColors(kGreen, -1, kGreen); - pc.fParticleHistogramsList->Add(pc.fParticleHistograms[EHistPhi][ESim][EWithCuts]); + pc.fParticleHistograms[eHistEta][eSim][eWithCuts] = new TH1F("[eHistEta][eSim][eWithCuts]", "eta distribution for simulated particles after cuts", nBinsEta, minEta, maxEta); + pc.fParticleHistograms[eHistEta][eSim][eWithCuts]->GetXaxis()->SetTitle("#eta"); - pc.fParticleHistograms[EHistEta][ESim][EWithCuts] = new TH1F("[EHistEta][ESim][EWithCuts]", "eta distribution for simulated particles after cuts", nBinsEta, minEta, maxEta); - pc.fParticleHistograms[EHistEta][ESim][EWithCuts]->GetXaxis()->SetTitle("#eta"); - pc.fParticleHistograms[EHistEta][ESim][EWithCuts]->SetColors(kGreen, -1, kGreen); - pc.fParticleHistogramsList->Add(pc.fParticleHistograms[EHistEta][ESim][EWithCuts]); + for (int i = 0; i < eParticleHistograms_N; ++i) { + pc.fParticleHistograms[i][eSim][eWithCuts]->SetColors(withCutLineColor, -1, withCutFillColor); + pc.fParticleHistogramsList->Add(pc.fParticleHistograms[i][eSim][eWithCuts]); + } } } @@ -763,174 +972,175 @@ struct MultiparticleCorrelationsMei // this name is used in lower-case format to ec.fEventHistogramsList->SetOwner(true); fBaseList->Add(ec.fEventHistogramsList); - vector lCent = cfCentBins.value; + std::vector lCent = cfCentBins.value; int nBinsCent = static_cast(lCent[0]); float minCent = lCent[1]; float maxCent = lCent[2]; - vector lMultRec = cfMultBinsRec.value; + std::vector lMultRec = cfMultBinsRec.value; int nBinsMultRec = static_cast(lMultRec[0]); float minMultRec = lMultRec[1]; float maxMultRec = lMultRec[2]; - vector lMultRef = cfMultBinsRef.value; + std::vector lMultRef = cfMultBinsRef.value; int nBinsMultRef = static_cast(lMultRef[0]); float minMultRef = lMultRef[1]; float maxMultRef = lMultRef[2]; - vector lMultSim = cfMultBinsSim.value; + std::vector lMultSim = cfMultBinsSim.value; int nBinsMultSim = static_cast(lMultSim[0]); float minMultSim = lMultSim[1]; float maxMultSim = lMultSim[2]; - vector lVx = cfVxBins.value; + std::vector lVx = cfVxBins.value; int nBinsVx = static_cast(lVx[0]); float minVx = lVx[1]; float maxVx = lVx[2]; - vector lVy = cfVyBins.value; + std::vector lVy = cfVyBins.value; int nBinsVy = static_cast(lVy[0]); float minVy = lVy[1]; float maxVy = lVy[2]; - vector lVz = cfVzBins.value; + std::vector lVz = cfVzBins.value; int nBinsVz = static_cast(lVz[0]); float minVz = lVz[1]; float maxVz = lVz[2]; - vector lIp = cfIpBins.value; + std::vector lIp = cfIpBins.value; int nBinsIp = static_cast(lIp[0]); float minIp = lIp[1]; float maxIp = lIp[2]; + // eEventHistograms_N + if (doprocessRec || doprocessRecSim) { - ec.fEventHistograms[EHistCentrality][ERec][ENoCuts] = new TH1F("[EHistCentrality][ERec][ENoCuts]", "Centrality (reconstructed) before cuts", nBinsCent, minCent, maxCent); - ec.fEventHistograms[EHistCentrality][ERec][ENoCuts]->GetXaxis()->SetTitle("Centrality"); - ec.fEventHistograms[EHistCentrality][ERec][ENoCuts]->SetColors(kRed, -1, kRed); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistCentrality][ERec][ENoCuts]); - - ec.fEventHistograms[EHistMultiplicity][ERec][ENoCuts] = new TH1F("[EHistMultiplicity][ERec][ENoCuts]", "Multiplicity (reconstructed) before cuts", nBinsMultRec, minMultRec, maxMultRec); - ec.fEventHistograms[EHistMultiplicity][ERec][ENoCuts]->GetXaxis()->SetTitle("Multiplicity"); - ec.fEventHistograms[EHistMultiplicity][ERec][ENoCuts]->SetColors(kRed, -1, kRed); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistMultiplicity][ERec][ENoCuts]); - - ec.fEventHistograms[EHistReferenceMultiplicity][ERec][ENoCuts] = new TH1F("[EHistReferenceMultiplicity][ERec][ENoCuts]", "Reference Multiplicity before cuts", nBinsMultRef, minMultRef, maxMultRef); - ec.fEventHistograms[EHistReferenceMultiplicity][ERec][ENoCuts]->GetXaxis()->SetTitle("Reference Multiplicity"); - ec.fEventHistograms[EHistReferenceMultiplicity][ERec][ENoCuts]->SetColors(kRed, -1, kRed); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistReferenceMultiplicity][ERec][ENoCuts]); - - ec.fEventHistograms[EHistVertexX][ERec][ENoCuts] = new TH1F("[EHistVertexX][ERec][ENoCuts]", "Vertex X (reconstructed) before cuts", nBinsVx, minVx, maxVx); - ec.fEventHistograms[EHistVertexX][ERec][ENoCuts]->GetXaxis()->SetTitle("Vertex X"); - ec.fEventHistograms[EHistVertexX][ERec][ENoCuts]->SetColors(kRed, -1, kRed); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistVertexX][ERec][ENoCuts]); - - ec.fEventHistograms[EHistVertexY][ERec][ENoCuts] = new TH1F("[EHistVertexY][ERec][ENoCuts]", "Vertex Y (reconstructed) before cuts", nBinsVy, minVy, maxVy); - ec.fEventHistograms[EHistVertexY][ERec][ENoCuts]->GetXaxis()->SetTitle("Vertex Y"); - ec.fEventHistograms[EHistVertexY][ERec][ENoCuts]->SetColors(kRed, -1, kRed); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistVertexY][ERec][ENoCuts]); - - ec.fEventHistograms[EHistVertexZ][ERec][ENoCuts] = new TH1F("[EHistVertexZ][ERec][ENoCuts]", "Vertex Z (reconstructed) before cuts", nBinsVz, minVz, maxVz); - ec.fEventHistograms[EHistVertexZ][ERec][ENoCuts]->GetXaxis()->SetTitle("Vertex Z"); - ec.fEventHistograms[EHistVertexZ][ERec][ENoCuts]->SetColors(kRed, -1, kRed); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistVertexZ][ERec][ENoCuts]); - - if (cfEventCutSwitch) { - ec.fEventHistograms[EHistCentrality][ERec][EWithCuts] = new TH1F("[EHistCentrality][ERec][EWithCuts]", "Centrality (reconstructed) after cuts", nBinsCent, minCent, maxCent); - ec.fEventHistograms[EHistCentrality][ERec][EWithCuts]->GetXaxis()->SetTitle("Centrality"); - ec.fEventHistograms[EHistCentrality][ERec][EWithCuts]->SetColors(kGreen, -1, kGreen); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistCentrality][ERec][EWithCuts]); - - ec.fEventHistograms[EHistMultiplicity][ERec][EWithCuts] = new TH1F("[EHistMultiplicity][ERec][EWithCuts]", "Multiplicity (reconstructed) after cuts", nBinsMultRec, minMultRec, maxMultRec); - ec.fEventHistograms[EHistMultiplicity][ERec][EWithCuts]->GetXaxis()->SetTitle("Multiplicity"); - ec.fEventHistograms[EHistMultiplicity][ERec][EWithCuts]->SetColors(kGreen, -1, kGreen); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistMultiplicity][ERec][EWithCuts]); - - ec.fEventHistograms[EHistReferenceMultiplicity][ERec][EWithCuts] = new TH1F("[EHistReferenceMultiplicity][ERec][EWithCuts]", "Reference Multiplicity after cuts", nBinsMultRef, minMultRef, maxMultRef); - ec.fEventHistograms[EHistReferenceMultiplicity][ERec][EWithCuts]->GetXaxis()->SetTitle("Reference Multiplicity"); - ec.fEventHistograms[EHistReferenceMultiplicity][ERec][EWithCuts]->SetColors(kGreen, -1, kGreen); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistReferenceMultiplicity][ERec][EWithCuts]); - - ec.fEventHistograms[EHistVertexX][ERec][EWithCuts] = new TH1F("[EHistVertexX][ERec][EWithCuts]", "Vertex X (reconstructed) after cuts", nBinsVx, minVx, maxVx); - ec.fEventHistograms[EHistVertexX][ERec][EWithCuts]->GetXaxis()->SetTitle("Vertex X"); - ec.fEventHistograms[EHistVertexX][ERec][EWithCuts]->SetColors(kGreen, -1, kGreen); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistVertexX][ERec][EWithCuts]); - - ec.fEventHistograms[EHistVertexY][ERec][EWithCuts] = new TH1F("[EHistVertexY][ERec][EWithCuts]", "Vertex Y (reconstructed) after cuts", nBinsVy, minVy, maxVy); - ec.fEventHistograms[EHistVertexY][ERec][EWithCuts]->GetXaxis()->SetTitle("Vertex Y"); - ec.fEventHistograms[EHistVertexY][ERec][EWithCuts]->SetColors(kGreen, -1, kGreen); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistVertexY][ERec][EWithCuts]); - - ec.fEventHistograms[EHistVertexZ][ERec][EWithCuts] = new TH1F("[EHistVertexZ][ERec][EWithCuts]", "Vertex Z (reconstructed) after cuts", nBinsVz, minVz, maxVz); - ec.fEventHistograms[EHistVertexZ][ERec][EWithCuts]->GetXaxis()->SetTitle("Vertex Z"); - ec.fEventHistograms[EHistVertexZ][ERec][EWithCuts]->SetColors(kGreen, -1, kGreen); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistVertexZ][ERec][EWithCuts]); + ec.fEventHistograms[eHistCentrality][eRec][eNoCuts] = new TH1F("[eHistCentrality][eRec][eNoCuts]", "Centrality (reconstructed) before cuts", nBinsCent, minCent, maxCent); + ec.fEventHistograms[eHistCentrality][eRec][eNoCuts]->GetXaxis()->SetTitle("Centrality"); + + ec.fEventHistograms[eHistMultiplicity][eRec][eNoCuts] = new TH1F("[eHistMultiplicity][eRec][eNoCuts]", "Multiplicity (reconstructed) before cuts", nBinsMultRec, minMultRec, maxMultRec); + ec.fEventHistograms[eHistMultiplicity][eRec][eNoCuts]->GetXaxis()->SetTitle("Multiplicity"); + + ec.fEventHistograms[eHistReferenceMultiplicity][eRec][eNoCuts] = new TH1F("[eHistReferenceMultiplicity][eRec][eNoCuts]", "Reference Multiplicity before cuts", nBinsMultRef, minMultRef, maxMultRef); + ec.fEventHistograms[eHistReferenceMultiplicity][eRec][eNoCuts]->GetXaxis()->SetTitle("Reference Multiplicity"); + + ec.fEventHistograms[eHistVertexX][eRec][eNoCuts] = new TH1F("[eHistVertexX][eRec][eNoCuts]", "Vertex X (reconstructed) before cuts", nBinsVx, minVx, maxVx); + ec.fEventHistograms[eHistVertexX][eRec][eNoCuts]->GetXaxis()->SetTitle("Vertex X"); + + ec.fEventHistograms[eHistVertexY][eRec][eNoCuts] = new TH1F("[eHistVertexY][eRec][eNoCuts]", "Vertex Y (reconstructed) before cuts", nBinsVy, minVy, maxVy); + ec.fEventHistograms[eHistVertexY][eRec][eNoCuts]->GetXaxis()->SetTitle("Vertex Y"); + + ec.fEventHistograms[eHistVertexZ][eRec][eNoCuts] = new TH1F("[eHistVertexZ][eRec][eNoCuts]", "Vertex Z (reconstructed) before cuts", nBinsVz, minVz, maxVz); + ec.fEventHistograms[eHistVertexZ][eRec][eNoCuts]->GetXaxis()->SetTitle("Vertex Z"); + + for (int i = 0; i < eEventHistograms_N; ++i) { + if (i != eHistImpactParameter) { + ec.fEventHistograms[i][eRec][eNoCuts]->SetColors(noCutLineColor, -1, noCutFillColor); + ec.fEventHistogramsList->Add(ec.fEventHistograms[i][eRec][eNoCuts]); + } + } + + if (cfMasterCutSwitch) { + ec.fEventHistograms[eHistCentrality][eRec][eWithCuts] = new TH1F("[eHistCentrality][eRec][eWithCuts]", "Centrality (reconstructed) after cuts", nBinsCent, minCent, maxCent); + ec.fEventHistograms[eHistCentrality][eRec][eWithCuts]->GetXaxis()->SetTitle("Centrality"); + + ec.fEventHistograms[eHistMultiplicity][eRec][eWithCuts] = new TH1F("[eHistMultiplicity][eRec][eWithCuts]", "Multiplicity (reconstructed) after cuts", nBinsMultRec, minMultRec, maxMultRec); + ec.fEventHistograms[eHistMultiplicity][eRec][eWithCuts]->GetXaxis()->SetTitle("Multiplicity"); + + ec.fEventHistograms[eHistReferenceMultiplicity][eRec][eWithCuts] = new TH1F("[eHistReferenceMultiplicity][eRec][eWithCuts]", "Reference Multiplicity after cuts", nBinsMultRef, minMultRef, maxMultRef); + ec.fEventHistograms[eHistReferenceMultiplicity][eRec][eWithCuts]->GetXaxis()->SetTitle("Reference Multiplicity"); + + ec.fEventHistograms[eHistVertexX][eRec][eWithCuts] = new TH1F("[eHistVertexX][eRec][eWithCuts]", "Vertex X (reconstructed) after cuts", nBinsVx, minVx, maxVx); + ec.fEventHistograms[eHistVertexX][eRec][eWithCuts]->GetXaxis()->SetTitle("Vertex X"); + + ec.fEventHistograms[eHistVertexY][eRec][eWithCuts] = new TH1F("[eHistVertexY][eRec][eWithCuts]", "Vertex Y (reconstructed) after cuts", nBinsVy, minVy, maxVy); + ec.fEventHistograms[eHistVertexY][eRec][eWithCuts]->GetXaxis()->SetTitle("Vertex Y"); + + ec.fEventHistograms[eHistVertexZ][eRec][eWithCuts] = new TH1F("[eHistVertexZ][eRec][eWithCuts]", "Vertex Z (reconstructed) after cuts", nBinsVz, minVz, maxVz); + ec.fEventHistograms[eHistVertexZ][eRec][eWithCuts]->GetXaxis()->SetTitle("Vertex Z"); + + for (int i = 0; i < eEventHistograms_N; ++i) { + if (i != eHistImpactParameter) { + ec.fEventHistograms[i][eRec][eWithCuts]->SetColors(withCutLineColor, -1, withCutFillColor); + ec.fEventHistogramsList->Add(ec.fEventHistograms[i][eRec][eWithCuts]); + } + } } } if (doprocessSim || doprocessRecSim) { - ec.fEventHistograms[EHistCentrality][ESim][ENoCuts] = new TH1F("[EHistCentrality][ESim][ENoCuts]", "Centrality (simulated) before cuts", nBinsCent, minCent, maxCent); - ec.fEventHistograms[EHistCentrality][ESim][ENoCuts]->GetXaxis()->SetTitle("Centrality"); - ec.fEventHistograms[EHistCentrality][ESim][ENoCuts]->SetColors(kRed, -1, kRed); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistCentrality][ESim][ENoCuts]); - - ec.fEventHistograms[EHistMultiplicity][ESim][ENoCuts] = new TH1F("[EHistMultiplicity][ESim][ENoCuts]", "Multiplicity (simulated) before cuts", nBinsMultSim, minMultSim, maxMultSim); - ec.fEventHistograms[EHistMultiplicity][ESim][ENoCuts]->GetXaxis()->SetTitle("Multiplicity"); - ec.fEventHistograms[EHistMultiplicity][ESim][ENoCuts]->SetColors(kRed, -1, kRed); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistMultiplicity][ESim][ENoCuts]); - - ec.fEventHistograms[EHistVertexX][ESim][ENoCuts] = new TH1F("[EHistVertexX][ESim][ENoCuts]", "Vertex X (simulated) before cuts", nBinsVx, minVx, maxVx); - ec.fEventHistograms[EHistVertexX][ESim][ENoCuts]->GetXaxis()->SetTitle("Vertex X"); - ec.fEventHistograms[EHistVertexX][ESim][ENoCuts]->SetColors(kRed, -1, kRed); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistVertexX][ESim][ENoCuts]); - - ec.fEventHistograms[EHistVertexY][ESim][ENoCuts] = new TH1F("[EHistVertexY][ESim][ENoCuts]", "Vertex Y (simulated) before cuts", nBinsVy, minVy, maxVy); - ec.fEventHistograms[EHistVertexY][ESim][ENoCuts]->GetXaxis()->SetTitle("Vertex Y"); - ec.fEventHistograms[EHistVertexY][ESim][ENoCuts]->SetColors(kRed, -1, kRed); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistVertexY][ESim][ENoCuts]); - - ec.fEventHistograms[EHistVertexZ][ESim][ENoCuts] = new TH1F("[EHistVertexZ][ESim][ENoCuts]", "Vertex Z (simulated) before cuts", nBinsVz, minVz, maxVz); - ec.fEventHistograms[EHistVertexZ][ESim][ENoCuts]->GetXaxis()->SetTitle("Vertex Z"); - ec.fEventHistograms[EHistVertexZ][ESim][ENoCuts]->SetColors(kRed, -1, kRed); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistVertexZ][ESim][ENoCuts]); - - ec.fEventHistograms[EHistImpactParameter][ESim][ENoCuts] = new TH1F("[EHistImpactParameter][ESim][ENoCuts]", "Impact Parameter (simulated) before cuts", nBinsIp, minIp, maxIp); - ec.fEventHistograms[EHistImpactParameter][ESim][ENoCuts]->GetXaxis()->SetTitle("Impact Parameter"); - ec.fEventHistograms[EHistImpactParameter][ESim][ENoCuts]->SetColors(kRed, -1, kRed); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistImpactParameter][ESim][ENoCuts]); - - if (cfEventCutSwitch) { - ec.fEventHistograms[EHistCentrality][ESim][EWithCuts] = new TH1F("[EHistCentrality][ESim][EWithCuts]", "Centrality (simulated) after cuts", nBinsCent, minCent, maxCent); - ec.fEventHistograms[EHistCentrality][ESim][EWithCuts]->GetXaxis()->SetTitle("Centrality"); - ec.fEventHistograms[EHistCentrality][ESim][EWithCuts]->SetColors(kGreen, -1, kGreen); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistCentrality][ESim][EWithCuts]); - - ec.fEventHistograms[EHistMultiplicity][ESim][EWithCuts] = new TH1F("[EHistMultiplicity][ESim][EWithCuts]", "Multiplicity (simulated) after cuts", nBinsMultSim, minMultSim, maxMultSim); - ec.fEventHistograms[EHistMultiplicity][ESim][EWithCuts]->GetXaxis()->SetTitle("Multiplicity"); - ec.fEventHistograms[EHistMultiplicity][ESim][EWithCuts]->SetColors(kGreen, -1, kGreen); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistMultiplicity][ESim][EWithCuts]); - - ec.fEventHistograms[EHistVertexX][ESim][EWithCuts] = new TH1F("[EHistVertexX][ESim][EWithCuts]", "Vertex X (simulated) after cuts", nBinsVx, minVx, maxVx); - ec.fEventHistograms[EHistVertexX][ESim][EWithCuts]->GetXaxis()->SetTitle("Vertex X"); - ec.fEventHistograms[EHistVertexX][ESim][EWithCuts]->SetColors(kGreen, -1, kGreen); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistVertexX][ESim][EWithCuts]); - - ec.fEventHistograms[EHistVertexY][ESim][EWithCuts] = new TH1F("[EHistVertexY][ESim][EWithCuts]", "Vertex Y (simulated) after cuts", nBinsVy, minVy, maxVy); - ec.fEventHistograms[EHistVertexY][ESim][EWithCuts]->GetXaxis()->SetTitle("Vertex Y"); - ec.fEventHistograms[EHistVertexY][ESim][EWithCuts]->SetColors(kGreen, -1, kGreen); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistVertexY][ESim][EWithCuts]); - - ec.fEventHistograms[EHistVertexZ][ESim][EWithCuts] = new TH1F("[EHistVertexZ][ESim][EWithCuts]", "Vertex Z (simulated) after cuts", nBinsVz, minVz, maxVz); - ec.fEventHistograms[EHistVertexZ][ESim][EWithCuts]->GetXaxis()->SetTitle("Vertex Z"); - ec.fEventHistograms[EHistVertexZ][ESim][EWithCuts]->SetColors(kGreen, -1, kGreen); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistVertexZ][ESim][EWithCuts]); - - ec.fEventHistograms[EHistImpactParameter][ESim][EWithCuts] = new TH1F("[EHistImpactParameter][ESim][EWithCuts]", "Impact Parameter (simulated) after cuts", nBinsIp, minIp, maxIp); - ec.fEventHistograms[EHistImpactParameter][ESim][EWithCuts]->GetXaxis()->SetTitle("Impact Parameter"); - ec.fEventHistograms[EHistImpactParameter][ESim][EWithCuts]->SetColors(kGreen, -1, kGreen); - ec.fEventHistogramsList->Add(ec.fEventHistograms[EHistImpactParameter][ESim][EWithCuts]); + ec.fEventHistograms[eHistCentrality][eSim][eNoCuts] = new TH1F("[eHistCentrality][eSim][eNoCuts]", "Centrality (simulated) before cuts", nBinsCent, minCent, maxCent); + ec.fEventHistograms[eHistCentrality][eSim][eNoCuts]->GetXaxis()->SetTitle("Centrality"); + + ec.fEventHistograms[eHistMultiplicity][eSim][eNoCuts] = new TH1F("[eHistMultiplicity][eSim][eNoCuts]", "Multiplicity (simulated) before cuts", nBinsMultSim, minMultSim, maxMultSim); + ec.fEventHistograms[eHistMultiplicity][eSim][eNoCuts]->GetXaxis()->SetTitle("Multiplicity"); + + ec.fEventHistograms[eHistVertexX][eSim][eNoCuts] = new TH1F("[eHistVertexX][eSim][eNoCuts]", "Vertex X (simulated) before cuts", nBinsVx, minVx, maxVx); + ec.fEventHistograms[eHistVertexX][eSim][eNoCuts]->GetXaxis()->SetTitle("Vertex X"); + + ec.fEventHistograms[eHistVertexY][eSim][eNoCuts] = new TH1F("[eHistVertexY][eSim][eNoCuts]", "Vertex Y (simulated) before cuts", nBinsVy, minVy, maxVy); + ec.fEventHistograms[eHistVertexY][eSim][eNoCuts]->GetXaxis()->SetTitle("Vertex Y"); + + ec.fEventHistograms[eHistVertexZ][eSim][eNoCuts] = new TH1F("[eHistVertexZ][eSim][eNoCuts]", "Vertex Z (simulated) before cuts", nBinsVz, minVz, maxVz); + ec.fEventHistograms[eHistVertexZ][eSim][eNoCuts]->GetXaxis()->SetTitle("Vertex Z"); + + ec.fEventHistograms[eHistImpactParameter][eSim][eNoCuts] = new TH1F("[eHistImpactParameter][eSim][eNoCuts]", "Impact Parameter (simulated) before cuts", nBinsIp, minIp, maxIp); + ec.fEventHistograms[eHistImpactParameter][eSim][eNoCuts]->GetXaxis()->SetTitle("Impact Parameter"); + + for (int i = 0; i < eEventHistograms_N; ++i) { + if (i != eHistReferenceMultiplicity) { + ec.fEventHistograms[i][eSim][eNoCuts]->SetColors(noCutLineColor, -1, noCutFillColor); + ec.fEventHistogramsList->Add(ec.fEventHistograms[i][eSim][eNoCuts]); + } + } + + if (cfMasterCutSwitch) { + ec.fEventHistograms[eHistCentrality][eSim][eWithCuts] = new TH1F("[eHistCentrality][eSim][eWithCuts]", "Centrality (simulated) after cuts", nBinsCent, minCent, maxCent); + ec.fEventHistograms[eHistCentrality][eSim][eWithCuts]->GetXaxis()->SetTitle("Centrality"); + + ec.fEventHistograms[eHistMultiplicity][eSim][eWithCuts] = new TH1F("[eHistMultiplicity][eSim][eWithCuts]", "Multiplicity (simulated) after cuts", nBinsMultSim, minMultSim, maxMultSim); + ec.fEventHistograms[eHistMultiplicity][eSim][eWithCuts]->GetXaxis()->SetTitle("Multiplicity"); + + ec.fEventHistograms[eHistVertexX][eSim][eWithCuts] = new TH1F("[eHistVertexX][eSim][eWithCuts]", "Vertex X (simulated) after cuts", nBinsVx, minVx, maxVx); + ec.fEventHistograms[eHistVertexX][eSim][eWithCuts]->GetXaxis()->SetTitle("Vertex X"); + + ec.fEventHistograms[eHistVertexY][eSim][eWithCuts] = new TH1F("[eHistVertexY][eSim][eWithCuts]", "Vertex Y (simulated) after cuts", nBinsVy, minVy, maxVy); + ec.fEventHistograms[eHistVertexY][eSim][eWithCuts]->GetXaxis()->SetTitle("Vertex Y"); + + ec.fEventHistograms[eHistVertexZ][eSim][eWithCuts] = new TH1F("[eHistVertexZ][eSim][eWithCuts]", "Vertex Z (simulated) after cuts", nBinsVz, minVz, maxVz); + ec.fEventHistograms[eHistVertexZ][eSim][eWithCuts]->GetXaxis()->SetTitle("Vertex Z"); + + ec.fEventHistograms[eHistImpactParameter][eSim][eWithCuts] = new TH1F("[eHistImpactParameter][eSim][eWithCuts]", "Impact Parameter (simulated) after cuts", nBinsIp, minIp, maxIp); + ec.fEventHistograms[eHistImpactParameter][eSim][eWithCuts]->GetXaxis()->SetTitle("Impact Parameter"); + + for (int i = 0; i < eEventHistograms_N; ++i) { + if (i != eHistReferenceMultiplicity) { + ec.fEventHistograms[i][eSim][eWithCuts]->SetColors(withCutLineColor, -1, withCutFillColor); + ec.fEventHistogramsList->Add(ec.fEventHistograms[i][eSim][eWithCuts]); + } + } + } + } + + // *) Book observales TLists: + obs.fObservablesList = new TList(); + obs.fObservablesList->SetName("Observables"); + obs.fObservablesList->SetOwner(true); + fBaseList->Add(obs.fObservablesList); + + if (doprocessRec || doprocessRecSim) { + obs.fProfTwo[eRec][eNoCuts] = new TProfile("obs.fProfTwo[eRec][eNoCuts]", "obs.fProfTwo[eRec][eNoCuts]", 1, 0., 1); + obs.fProfTwo[eRec][eNoCuts]->GetYaxis()->SetTitle("#LT#LTk#GT#GT / 10^{-k}"); + obs.fObservablesList->Add(obs.fProfTwo[eRec][eNoCuts]); + + if (cfMasterCutSwitch) { + obs.fProfTwo[eRec][eWithCuts] = new TProfile("obs.fProfTwo[eRec][eWithCuts]", "obs.fProfTwo[eRec][eWithCuts]", 1, 0., 1); + obs.fProfTwo[eRec][eWithCuts]->GetYaxis()->SetTitle("#LT#LTk#GT#GT / 10^{-k}"); + obs.fObservablesList->Add(obs.fProfTwo[eRec][eWithCuts]); } } + // *) Book and QA TLists: if (qualityAssuranceSwitch && doprocessRecSim) { qa.fQualityAssuranceList = new TList(); qa.fQualityAssuranceList->SetName("QualityAssurance"); @@ -948,7 +1158,7 @@ struct MultiparticleCorrelationsMei // this name is used in lower-case format to void processRec(CollisionRec const& collision, aod::BCs const&, TracksRec const& tracks) { // *) steer all analysis steps: - steer(collision, tracks); + steer(collision, tracks); } PROCESS_SWITCH(MultiparticleCorrelationsMei, processRec, "process only reconstructed data", true); // yes, keep always one process switch "true", so that there is default running version @@ -957,7 +1167,7 @@ struct MultiparticleCorrelationsMei // this name is used in lower-case format to // B) Process both reconstructed and corresponding MC truth simulated data: void processRecSim(CollisionRecSim const& collision, aod::BCs const&, TracksRecSim const& tracks, aod::McParticles const&, aod::McCollisions const&) { - steer(collision, tracks); + steer(collision, tracks); } PROCESS_SWITCH(MultiparticleCorrelationsMei, processRecSim, "process both reconstructed and corresponding MC truth simulated data", false); @@ -966,7 +1176,7 @@ struct MultiparticleCorrelationsMei // this name is used in lower-case format to // C) Process only simulated data: void processSim(CollisionSim const& /*collision*/, aod::BCs const&, TracksSim const& /*tracks*/) { - // steer(collision, tracks); // TBI 20241105 not ready yet, but I do not really need this one urgently, since RecSim is working, and I need that one for efficiencies... + // steer(collision, tracks); // TBI 20241105 not ready yet, but I do not really need this one urgently, since RecSim is working, and I need that one for efficiencies... } PROCESS_SWITCH(MultiparticleCorrelationsMei, processSim, "process only simulated data", false); From e6a79d64535cb5310971b421734a70f3008cde47 Mon Sep 17 00:00:00 2001 From: Yuanjun Mei Date: Sat, 19 Sep 2026 11:25:10 +0200 Subject: [PATCH 2/3] Use static_cast --- .../Tasks/multiparticleCorrelationsMei.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/MultiparticleCorrelations/Tasks/multiparticleCorrelationsMei.cxx b/PWGCF/MultiparticleCorrelations/Tasks/multiparticleCorrelationsMei.cxx index a9a8acab9a7..70c350fbfa3 100644 --- a/PWGCF/MultiparticleCorrelations/Tasks/multiparticleCorrelationsMei.cxx +++ b/PWGCF/MultiparticleCorrelations/Tasks/multiparticleCorrelationsMei.cxx @@ -319,7 +319,7 @@ struct MultiparticleCorrelationsMei // this name is used in lower-case format to if (mult == 1) { return {c[0] - c2[0], c[1] - c2[1]}; } - return {c[0] - double(mult) * c2[0], c[1] - double(mult) * c2[1]}; + return {c[0] - static_cast(mult) * c2[0], c[1] - static_cast(mult) * c2[1]}; } bool noneZeroDenom(std::vector resultMultCorr) From dd38e44df9b4615579c75627037529a8c933162d Mon Sep 17 00:00:00 2001 From: Yuanjun Mei Date: Sat, 19 Sep 2026 13:44:28 +0200 Subject: [PATCH 3/3] Changes according to code-check --- .../Tasks/multiparticleCorrelationsMei.cxx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/PWGCF/MultiparticleCorrelations/Tasks/multiparticleCorrelationsMei.cxx b/PWGCF/MultiparticleCorrelations/Tasks/multiparticleCorrelationsMei.cxx index 70c350fbfa3..b676b66994d 100644 --- a/PWGCF/MultiparticleCorrelations/Tasks/multiparticleCorrelationsMei.cxx +++ b/PWGCF/MultiparticleCorrelations/Tasks/multiparticleCorrelationsMei.cxx @@ -13,7 +13,6 @@ /// \brief Multiparticle correlation in O2 Framework /// \author yuanjun.mei@cern.ch -#include "Common/CCDB/EventSelectionParams.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" @@ -287,13 +286,15 @@ struct MultiparticleCorrelationsMei // this name is used in lower-case format to }; std::vector c = {q(harmonic[m - 1], mult), q(0, mult)}; - if ((m - 1) == 0) + if ((m - 1) == 0) { return c; + } std::vector temp = recursion(m - 1, Qvector, harmonic); c[0] *= temp[0]; c[1] *= temp[1]; - if ((m - 1) == skip) + if ((m - 1) == skip) { return c; + } int counter1 = 0; int hhold = harmonic[counter1]; @@ -324,11 +325,7 @@ struct MultiparticleCorrelationsMei // this name is used in lower-case format to bool noneZeroDenom(std::vector resultMultCorr) { - if (resultMultCorr[1].Re() != 0) { - return true; - } else { - return false; - } + return resultMultCorr[1].Re() != 0; } TObject* getObjectFromList(TList* list, const char* objectName)