From 6c8307f37d86e209607011d52631d80a1c232392 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 28 May 2026 04:08:32 +0000 Subject: [PATCH] Please consider the following formatting changes --- .../Tasks/multiparticleCumulants.cxx | 111 +++++++++--------- 1 file changed, 56 insertions(+), 55 deletions(-) diff --git a/PWGCF/MultiparticleCorrelations/Tasks/multiparticleCumulants.cxx b/PWGCF/MultiparticleCorrelations/Tasks/multiparticleCumulants.cxx index cf2b60c7e26..8471a51d626 100644 --- a/PWGCF/MultiparticleCorrelations/Tasks/multiparticleCumulants.cxx +++ b/PWGCF/MultiparticleCorrelations/Tasks/multiparticleCumulants.cxx @@ -35,9 +35,9 @@ #include #include #include +#include #include #include -#include #include @@ -94,8 +94,7 @@ const char* eventHistNames[eEventHistograms_N] = { "VertexX", "VertexY", "VertexZ", - "NumContrib" -}; + "NumContrib"}; enum EnParticleHistograms { ePt, @@ -162,7 +161,7 @@ struct MultiparticleCumulants { // this name is used in lower-case format to nam Configurable> cfDCAXYCut{"cfDCAXYCut", {-3.2, 3.2}, "range of distance-of-closest-approach (DCA) of the extrapolated track to the primary position in XY-direction: {min, max}[cm]"}; Configurable> cfDCAZCut{"cfDCAZCut", {-2.4, 2.4}, "range of distance-of-closest-approach (DCA) of the extrapolated track to the primary position in Z-direction: {min, max}[cm]"}; - // *) + // *) Configurable cfFileWithWeights{"cfFileWithWeights", "/scratch3/go52dab/O2tutorial/tutorial3-6/weights.root", "path to external ROOT file which holds all particle weights in O2 format"}; Configurable cfRunNumber{"cfRunNumber", "000123456", "run number"}; @@ -185,7 +184,7 @@ struct MultiparticleCumulants { // this name is used in lower-case format to nam std::string fMultEstm = "FT0A"; bool fPrintSwitch = true; - + bool fVertexZCutSwitch = true; bool fSel8CutSwitch = true; bool fCentCutSwitch = true; @@ -208,7 +207,7 @@ struct MultiparticleCumulants { // this name is used in lower-case format to nam std::vector fTpcNClsFoundCut = {70., 160.}; std::vector fDCAXYCut = {-3.2, 3.2}; std::vector fDCAZCut = {-2.4, 2.4}; - + std::string fFileWithWeights = "/scratch3/go52dab/O2tutorial/tutorial3-6/weights.root"; std::string fRunNumber = "000123456"; } tc; // you have to prepend "tc." for all objects name in this group later in the code @@ -245,9 +244,6 @@ struct MultiparticleCumulants { // this name is used in lower-case format to nam int fNumContrib = 0.; } ebye; - - - template bool EventCuts(T1 const& collision) { @@ -273,10 +269,18 @@ struct MultiparticleCumulants { // this name is used in lower-case format to nam CentCut = ebye.fCentralitySim < tc.fCentCut[1] && ebye.fCentralitySim > tc.fCentCut[0]; } - if (tc.fVertexZCutSwitch) {pass = pass && VertexZCut;} - if (tc.fSel8CutSwitch) {pass = pass && Sel8Cut;} - if (tc.fCentCutSwitch) {pass = pass && CentCut;} - if (tc.fNumContribCutSwitch) {pass = pass && NumContribCut;} + if (tc.fVertexZCutSwitch) { + pass = pass && VertexZCut; + } + if (tc.fSel8CutSwitch) { + pass = pass && Sel8Cut; + } + if (tc.fCentCutSwitch) { + pass = pass && CentCut; + } + if (tc.fNumContribCutSwitch) { + pass = pass && NumContribCut; + } return pass; } @@ -296,7 +300,7 @@ struct MultiparticleCumulants { // this name is used in lower-case format to nam // *) For real event and MC event PtCut = track.pt() < tc.fPtCut[1] && track.pt() > tc.fPtCut[0]; EtaCut = track.eta() < tc.fEtaCut[1] && track.eta() > tc.fEtaCut[0]; - + // *) For real event only if constexpr (rm == eRl) { SignCut = (track.sign() == -1 && tc.fSignCut[0]) || (track.sign() == 0 && tc.fSignCut[1]) || (track.sign() == 1 && tc.fSignCut[2]); @@ -313,20 +317,31 @@ struct MultiparticleCumulants { // this name is used in lower-case format to nam if (!particle) { // LOGF(warning, "PDG code %d not found", track.pdgCode()); SignCut = false; - } - else { + } else { // LOGF(info, "PDG code %d found", track.pdgCode()); float charge = particle->Charge(); SignCut = (charge < 0 && tc.fSignCut[0]) || (charge == 0 && tc.fSignCut[1]) || (charge > 0 && tc.fSignCut[2]); } } - if (tc.fPtCutSwitch) {pass = pass && PtCut;} - if (tc.fEtaCutSwitch) {pass = pass && EtaCut;} - if (tc.fSignCutSwitch) {pass = pass && SignCut;} - if (tc.fTpcNClsFoundCutSwitch) {pass = pass && TpcNClsFoundCut;} - if (tc.fDCAXYCutSwitch) {pass = pass && DCAXYCut;} - if (tc.fDCAZCutSwitch) {pass = pass && DCAZCut;} + if (tc.fPtCutSwitch) { + pass = pass && PtCut; + } + if (tc.fEtaCutSwitch) { + pass = pass && EtaCut; + } + if (tc.fSignCutSwitch) { + pass = pass && SignCut; + } + if (tc.fTpcNClsFoundCutSwitch) { + pass = pass && TpcNClsFoundCut; + } + if (tc.fDCAXYCutSwitch) { + pass = pass && DCAXYCut; + } + if (tc.fDCAZCutSwitch) { + pass = pass && DCAZCut; + } return pass; } @@ -559,13 +574,13 @@ struct MultiparticleCumulants { // this name is used in lower-case format to nam LOGF(info, "Vertex Y position: %f", collision.posY()); LOGF(info, "Vertex Z position: %f", collision.posZ()); - //Print NContributors + // Print NContributors LOGF(info, "NContributors: %f", static_cast(rlCollisionNumContrib)); } ebye.fCentrality = rlCollisionCent; ebye.fReferenceMultiplicity = rlCollisionMult; ebye.fNumContrib = rlCollisionNumContrib; - + if constexpr (rs == eRec || rs == eRecAndSim) { ev.fEventHistograms[eCent][eRec][0]->Fill(rlCollisionCent); ev.fEventHistograms[eMult][eRec][0]->Fill(rlCollisionMult); @@ -763,12 +778,10 @@ struct MultiparticleCumulants { // this name is used in lower-case format to nam if constexpr (histType == eCent) { std::string nameRecNocutfull = tc.fCentEstm + eventHistNames[histType] + std::string(" distribution for reconstructed events"); std::string nameSimNocutfull = tc.fCentEstm + eventHistNames[histType] + std::string(" distribution for simulated events"); - } - else if constexpr (histType == eMult) { + } else if constexpr (histType == eMult) { std::string nameRecNocutfull = tc.fMultEstm + eventHistNames[histType] + std::string(" distribution for reconstructed events"); std::string nameSimNocutfull = tc.fMultEstm + eventHistNames[histType] + std::string(" distribution for simulated events"); - } - else { + } else { std::string nameRecNocutfull = eventHistNames[histType] + std::string(" distribution for reconstructed events"); std::string nameSimNocutfull = eventHistNames[histType] + std::string(" distribution for simulated events"); } @@ -785,10 +798,8 @@ struct MultiparticleCumulants { // this name is used in lower-case format to nam ev.fEventHistograms[histType][eSim][0]->GetXaxis()->SetTitle(eventHistNames[histType]); ev.fEventHistogramsList->Add(ev.fEventHistograms[histType][eSim][0]); } // No nContrib and multiplicity for processSim - } - std::string nameRecCut = std::string("fHist") + eventHistNames[histType] + std::string("[eRec][after cut]"); std::string nameSimCut = std::string("fHist") + eventHistNames[histType] + std::string("[eSim][after cut]"); std::string nameRecCutfull; @@ -797,12 +808,10 @@ struct MultiparticleCumulants { // this name is used in lower-case format to nam if constexpr (histType == eCent) { std::string nameRecCutfull = tc.fCentEstm + eventHistNames[histType] + std::string(" distribution for reconstructed events"); std::string nameSimCutfull = tc.fCentEstm + eventHistNames[histType] + std::string(" distribution for simulated events"); - } - else if constexpr (histType == eMult) { + } else if constexpr (histType == eMult) { std::string nameRecCutfull = tc.fMultEstm + eventHistNames[histType] + std::string(" distribution for reconstructed events"); std::string nameSimCutfull = tc.fMultEstm + eventHistNames[histType] + std::string(" distribution for simulated events"); - } - else { + } else { std::string nameRecCutfull = eventHistNames[histType] + std::string(" distribution for reconstructed events"); std::string nameSimCutfull = eventHistNames[histType] + std::string(" distribution for simulated events"); } @@ -844,22 +853,19 @@ struct MultiparticleCumulants { // this name is used in lower-case format to nam std::string nameNocutfull; if constexpr (histType == eCent) { std::string nameNocutfull = std::string("Quality assurance of ") + tc.fCentEstm + eventHistNames[histType]; - } - else if constexpr (histType == eNumContrib) { + } else if constexpr (histType == eNumContrib) { std::string nameNocutfull = std::string("Quality assurance of ") + tc.fMultEstm + eventHistNames[histType] + std::string(" vs. NContributors"); - } - else { + } else { std::string nameNocutfull = std::string("Quality assurance of ") + eventHistNames[histType]; } - + qa.fQAHistograms[histType][0] = new TH2F(nameNocut.c_str(), nameNocutfull.c_str(), nBinsCent, minCent, maxCent, nBinsCent, minCent, maxCent); if constexpr (histType == eNumContrib) { qa.fQAHistograms[histType][0]->GetYaxis()->SetTitle("NContributors"); - qa.fQAHistograms[histType][0]->GetXaxis()->SetTitle("Reference multiplicity"); - } - else { + qa.fQAHistograms[histType][0]->GetXaxis()->SetTitle("Reference multiplicity"); + } else { qa.fQAHistograms[histType][0]->GetYaxis()->SetTitle(Form("Simulated %s", eventHistNames[histType])); - qa.fQAHistograms[histType][0]->GetXaxis()->SetTitle(Form("Reconstructed %s", eventHistNames[histType])); + qa.fQAHistograms[histType][0]->GetXaxis()->SetTitle(Form("Reconstructed %s", eventHistNames[histType])); } qa.fQAHistogramsList->Add(qa.fQAHistograms[histType][0]); @@ -867,25 +873,21 @@ struct MultiparticleCumulants { // this name is used in lower-case format to nam std::string nameCutfull; if constexpr (histType == eCent) { std::string nameCutfull = std::string("Quality assurance of ") + tc.fCentEstm + eventHistNames[histType]; - } - else if constexpr (histType == eNumContrib) { + } else if constexpr (histType == eNumContrib) { std::string nameCutfull = std::string("Quality assurance of ") + tc.fMultEstm + eventHistNames[histType]; - } - else { + } else { std::string nameCutfull = std::string("Quality assurance of ") + eventHistNames[histType]; } - + qa.fQAHistograms[histType][1] = new TH2F(nameCut.c_str(), nameCutfull.c_str(), nBinsCent, minCent, maxCent, nBinsCent, minCent, maxCent); if constexpr (histType == eNumContrib) { qa.fQAHistograms[histType][1]->GetYaxis()->SetTitle("NContributors"); - qa.fQAHistograms[histType][1]->GetXaxis()->SetTitle("Reference multiplicity"); - } - else { + qa.fQAHistograms[histType][1]->GetXaxis()->SetTitle("Reference multiplicity"); + } else { qa.fQAHistograms[histType][1]->GetYaxis()->SetTitle(Form("Simulated %s", eventHistNames[histType])); - qa.fQAHistograms[histType][1]->GetXaxis()->SetTitle(Form("Reconstructed %s", eventHistNames[histType])); + qa.fQAHistograms[histType][1]->GetXaxis()->SetTitle(Form("Reconstructed %s", eventHistNames[histType])); } qa.fQAHistogramsList->Add(qa.fQAHistograms[histType][1]); - } // *) Initialize and book all objects: @@ -982,7 +984,6 @@ struct MultiparticleCumulants { // this name is used in lower-case format to nam } } - } // end of void init(InitContext&) { // A) Process only reconstructed data: @@ -1021,4 +1022,4 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) return WorkflowSpec{ adaptAnalysisTask(cfgc), }; -} // WorkflowSpec... \ No newline at end of file +} // WorkflowSpec...