1818// /
1919
2020// O2 includes
21+ #include " PWGLF/DataModel/mcCentrality.h"
22+
23+ #include " TableHelper.h"
24+
25+ #include " PWGLF/Utils/inelGt.h"
26+
27+ #include " Common/DataModel/Centrality.h"
28+ #include " Common/DataModel/TrackSelectionTables.h"
29+
2130#include " CCDB/BasicCCDBManager.h"
22- #include " ReconstructionDataFormats/Track.h"
2331#include " CCDB/CcdbApi.h"
24- #include " Common/DataModel/TrackSelectionTables.h"
25- #include " Framework/AnalysisTask.h"
2632#include " Framework/AnalysisDataModel.h"
27- #include " Framework/runDataProcessing .h"
33+ #include " Framework/AnalysisTask .h"
2834#include " Framework/HistogramRegistry.h"
35+ #include " Framework/O2DatabasePDGPlugin.h"
2936#include " Framework/RunningWorkflowInfo.h"
3037#include " Framework/StaticFor.h"
31- #include " TableHelper.h"
32- #include " Framework/O2DatabasePDGPlugin.h"
33- #include " Common/DataModel/Centrality.h"
34- #include " PWGLF/DataModel/mcCentrality.h"
35- #include " PWGLF/Utils/inelGt.h"
38+ #include " Framework/runDataProcessing.h"
39+ #include " ReconstructionDataFormats/Track.h"
3640
3741using namespace o2 ;
3842using namespace o2 ::framework;
@@ -58,14 +62,17 @@ struct mcCentrality {
5862 Configurable<bool > selectPrimaries{" selectPrimaries" , true , " Select only primary particles" };
5963 Service<o2::framework::O2DatabasePDG> pdgDB;
6064 ConfigurableAxis binsPercentile{" binsPercentile" , {VARIABLE_WIDTH, 0 , 0.001 , 0.01 , 1.0 , 5.0 , 10.0 , 15.0 , 20.0 , 25.0 , 30.0 , 40.0 , 50.0 , 60.0 , 70.0 , 80.0 , 90.0 , 100.0 }, " Binning of the percentile axis" };
65+ ConfigurableAxis binsMultiplicity{" binsMultiplicity" , {1000 , 0 , 5000 }, " Binning of the multiplicity axis" };
66+ Configurable<bool > fillFt0A{" fillFt0A" , false , " Fills the FT0A histogram" };
67+ Configurable<bool > fillFt0C{" fillFt0C" , false , " Fills the FT0C histogram" };
6168
6269 HistogramRegistry histos{" histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
6370
6471 TH1F* h1dFT0M;
65- /* TH1F* h1dFT0A;
72+ TH1F* h1dFT0A;
6673 TH1F* h1dFT0C;
67- TH1F* h1dFDD;
68- TH1F* h1dNTP;*/
74+ // TH1F* h1dFDD;
75+ // TH1F* h1dNTP;
6976
7077 o2::pwglf::ParticleCounter<o2::framework::O2DatabasePDG> mCounter ;
7178
@@ -81,7 +88,15 @@ struct mcCentrality {
8188 mCounter .mPdgDatabase = pdgDB.service ;
8289 mCounter .mSelectPrimaries = selectPrimaries.value ;
8390 histos.add (" FT0M/percentile" , " FT0M percentile." , HistType::kTH1D , {{binsPercentile, " FT0M percentile" }});
84- histos.add (" FT0M/percentilevsMult" , " FT0M percentile." , HistType::kTH2D , {{binsPercentile, " FT0M percentile" }, {1000 , 0 , 5000 , " FT0M mult." }});
91+ histos.add (" FT0M/percentilevsMult" , " FT0M percentile." , HistType::kTH2D , {{binsPercentile, " FT0M percentile" }, {binsMultiplicity, " FT0M mult." }});
92+ if (fillFt0A) {
93+ histos.add (" FT0A/percentile" , " FT0A percentile." , HistType::kTH1D , {{binsPercentile, " FT0A percentile" }});
94+ histos.add (" FT0A/percentilevsMult" , " FT0A percentile." , HistType::kTH2D , {{binsPercentile, " FT0A percentile" }, {binsMultiplicity, " FT0A mult." }});
95+ }
96+ if (fillFt0C) {
97+ histos.add (" FT0C/percentile" , " FT0C percentile." , HistType::kTH1D , {{binsPercentile, " FT0C percentile" }});
98+ histos.add (" FT0C/percentilevsMult" , " FT0C percentile." , HistType::kTH2D , {{binsPercentile, " FT0C percentile" }, {binsMultiplicity, " FT0C mult." }});
99+ }
85100
86101 TList* lOfInput;
87102 if (path.value .rfind (" ccdb://" , 0 ) == 0 ) { // Getting post calib. from CCDB
@@ -105,32 +120,45 @@ struct mcCentrality {
105120 LOG (fatal) << " The input file " << path.value << " does not contain the TList ccdb_object" ;
106121 }
107122 }
108- h1dFT0M = static_cast <TH1F*>(lOfInput->FindObject (" h1dFT0M" ));
109- if (!h1dFT0M) {
110- lOfInput->ls ();
111- LOG (fatal) << " Could not open histogram h1dFT0M from TList" ;
112- return ;
123+ auto getHist = [lOfInput](const char * name) -> TH1F* {
124+ auto hist = static_cast <TH1F*>(lOfInput->FindObject (name));
125+ if (!hist) {
126+ lOfInput->ls ();
127+ LOG (fatal) << " Could not open histogram " << name << " from TList" ;
128+ }
129+ return hist;
130+ };
131+ h1dFT0M = getHist (lOfInput, " h1dFT0M" );
132+ if (fillFt0A) {
133+ h1dFT0A = getHist (" h1dFT0A" );
134+ }
135+ if (fillFt0C) {
136+ h1dFT0C = getHist (" h1dFT0C" );
113137 }
114138 }
115139
116140 // Full tables (independent on central calibrations)
117141 void process (aod::McCollision const & /* mcCollision*/ ,
118142 aod::McParticles const & mcParticles)
119143 {
120- const float nFT0M = mCounter .countFT0A (mcParticles) + mCounter .countFT0C (mcParticles);
121- /* const float nFT0A = mCounter.countFT0A(mcParticles);
144+ const float nFT0A = mCounter .countFT0A (mcParticles);
122145 const float nFT0C = mCounter .countFT0C (mcParticles);
123- const float nFV0A = mCounter.countFV0A(mcParticles);*/
146+ const float nFT0M = nFT0A + nFT0C;
147+ // const float nFV0A = mCounter.countFV0A(mcParticles);
124148
125149 const float valueCentFT0M = h1dFT0M->GetBinContent (h1dFT0M->FindBin (nFT0M));
126- /* const float valueCentFT0A = h1dFT0M->GetBinContent(h1dFT0M->FindBin(nFT0A));
127- const float valueCentFT0C = h1dFT0M->GetBinContent(h1dFT0M->FindBin(nFT0C));
128- const float valueCentFV0A = h1dFT0M->GetBinContent(h1dFT0M->FindBin(nFV0A));*/
150+ if (fillFt0A) {
151+ const float valueCentFT0A = h1dFT0M->GetBinContent (h1dFT0M->FindBin (nFT0A));
152+ centFT0A (valueCentFT0A);
153+ }
154+ if (fillFt0C) {
155+ const float valueCentFT0C = h1dFT0M->GetBinContent (h1dFT0M->FindBin (nFT0C));
156+ centFT0C (valueCentFT0C);
157+ }
158+ // const float valueCentFV0A = h1dFT0M->GetBinContent(h1dFT0M->FindBin(nFV0A));
129159
130160 centFT0M (valueCentFT0M);
131- /* centFT0A(valueCentFT0A);
132- centFT0C(valueCentFT0C);
133- centFV0A(valueCentFV0A);*/
161+ // centFV0A(valueCentFV0A);
134162 histos.fill (HIST (" FT0M/percentile" ), valueCentFT0M);
135163 histos.fill (HIST (" FT0M/percentilevsMult" ), valueCentFT0M, nFT0M);
136164 }
0 commit comments