1+ // Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+ // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+ // All rights not expressly granted are reserved.
4+ //
5+ // This software is distributed under the terms of the GNU General Public
6+ // License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+ //
8+ // In applying this license CERN does not waive the privileges and immunities
9+ // granted to it by virtue of its status as an Intergovernmental Organization
10+ // or submit itself to any jurisdiction.
11+ //
12+ // / \file multCentrality.cxx
13+ // / \brief Produces multiplicity and centrality percentiles tables
14+ // /
15+ // / \author ALICE
16+ // /
17+
18+
19+ #include < vector>
20+ #include < algorithm>
21+ #include < map>
22+ #include < string>
23+
24+ #include " Framework/ConfigParamSpec.h"
25+ #include " Framework/runDataProcessing.h"
26+ #include " Framework/AnalysisTask.h"
27+ #include " Framework/AnalysisDataModel.h"
28+ #include " Framework/HistogramRegistry.h"
29+ #include " Framework/ASoAHelpers.h"
30+ #include " Framework/O2DatabasePDGPlugin.h"
31+ #include " CCDB/BasicCCDBManager.h"
32+ #include " Common/DataModel/Multiplicity.h"
33+ #include " Common/DataModel/EventSelection.h"
34+ #include " Common/DataModel/TrackSelectionTables.h"
35+ #include " TableHelper.h"
36+ #include " MetadataHelper.h"
37+ #include " TList.h"
38+ #include " PWGMM/Mult/DataModel/bestCollisionTable.h"
39+
40+ using namespace o2 ;
41+ using namespace o2 ::framework;
42+ using namespace o2 ::framework::expressions;
43+
44+ MetadataHelper metadataInfo; // Metadata helper
45+
46+ namespace multiplicity {
47+ static constexpr int kFV0Mults = 0 ;
48+ static constexpr int kFT0Mults = 1 ;
49+ static constexpr int kFDDMults = 2 ;
50+ static constexpr int kZDCMults = 3 ;
51+ static constexpr int kTrackletMults = 4 ;
52+ static constexpr int kTPCMults = 5 ;
53+ static constexpr int kPVMults = 6 ;
54+ static constexpr int kMultsExtra = 7 ;
55+ static constexpr int kMultSelections = 8 ;
56+ static constexpr int kFV0MultZeqs = 9 ;
57+ static constexpr int kFT0MultZeqs = 10 ;
58+ static constexpr int kFDDMultZeqs = 11 ;
59+ static constexpr int kPVMultZeqs = 12 ;
60+ static constexpr int kMultMCExtras = 13 ;
61+ static constexpr int kNTables = 14 ;
62+
63+ // Checking that the Zeq tables are after the normal ones
64+ static_assert (kFV0Mults < kFV0MultZeqs );
65+ static_assert (kFT0Mults < kFT0MultZeqs );
66+ static_assert (kFDDMults < kFDDMultZeqs );
67+ static_assert (kPVMults < kPVMultZeqs );
68+
69+
70+ static const std::vector<std::string> tableNames{" FV0Mults" , // 0
71+ " FT0Mults" , // 1
72+ " FDDMults" , // 2
73+ " ZDCMults" , // 3
74+ " TrackletMults" , // 4
75+ " TPCMults" , // 5
76+ " PVMults" , // 6
77+ " MultsExtra" , // 7
78+ " MultSelections" , // 8
79+ " FV0MultZeqs" , // 9
80+ " FT0MultZeqs" , // 10
81+ " FDDMultZeqs" , // 11
82+ " PVMultZeqs" , // 12
83+ " MultMCExtras" }; // 13
84+ static const int defaultParameters[kNTables ][1 ]{{-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }};
85+ }
86+
87+ namespace centrality {
88+ static constexpr int kRun2V0Ms = 0 ;
89+ static constexpr int kRun2V0As = 1 ;
90+ static constexpr int kRun2SPDTrks = 2 ;
91+ static constexpr int kRun2SPDClss = 3 ;
92+ static constexpr int kRun2CL0s = 4 ;
93+ static constexpr int kRun2CL1s = 5 ;
94+ static constexpr int kFV0As = 6 ;
95+ static constexpr int kFT0Ms = 7 ;
96+ static constexpr int kFT0As = 8 ;
97+ static constexpr int kFT0Cs = 9 ;
98+ static constexpr int kFT0CVariant1s = 10 ;
99+ static constexpr int kFDDMs = 11 ;
100+ static constexpr int kNTPVs = 12 ;
101+ static constexpr int kNGlobals = 13 ;
102+ static constexpr int kMFTs = 14 ;
103+ static constexpr int kNTables = 15 ;
104+ static const std::vector<std::string> tableNames{" CentRun2V0Ms" , // 0
105+ " CentRun2V0As" , // 1
106+ " CentRun2SPDTrks" , // 2
107+ " CentRun2SPDClss" , // 3
108+ " CentRun2CL0s" , // 4
109+ " CentRun2CL1s" , // 5
110+ " CentFV0As" , // 6
111+ " CentFT0Ms" , // 7
112+ " CentFT0As" , // 8
113+ " CentFT0Cs" , // 9
114+ " CentFT0CVariant1s" , // 10
115+ " CentFDDMs" , // 11
116+ " CentNTPVs" , // 12
117+ " CentNGlobals" , // 13
118+ " CentMFTs" };
119+
120+ static const int defaultParameters[kNTables ][1 ]{{-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }};
121+
122+ }
123+
124+ static const std::vector<std::string> parameterNames{" Enable" };
125+
126+
127+
128+
129+ struct multiplicityPercentile {
130+ SliceCache cache;
131+ // Services
132+ Service<o2::ccdb::BasicCCDBManager> ccdb;
133+
134+
135+ // Multiplicity tables
136+ Produces<aod::FV0Mults> tableFV0; // 0
137+ Produces<aod::FV0AOuterMults> tableFV0AOuter; // 0-bis (produced with FV0)
138+ Produces<aod::FT0Mults> tableFT0; // 1
139+ Produces<aod::FDDMults> tableFDD; // 2
140+ Produces<aod::ZDCMults> tableZDC; // 3
141+ Produces<aod::TrackletMults> tableTracklet; // 4
142+ Produces<aod::TPCMults> tableTpc; // 5
143+ Produces<aod::PVMults> tablePv; // 6
144+ Produces<aod::MultsExtra> tableExtra; // 7
145+ Produces<aod::MultSelections> multSelections; // 8
146+ Produces<aod::FV0MultZeqs> tableFV0Zeqs; // 9
147+ Produces<aod::FT0MultZeqs> tableFT0Zeqs; // 10
148+ Produces<aod::FDDMultZeqs> tableFDDZeqs; // 11
149+ Produces<aod::PVMultZeqs> tablePVZeqs; // 12
150+ Produces<aod::MultMCExtras> tableExtraMc; // 13
151+ Produces<aod::Mult2MCExtras> tableExtraMult2MCExtras;
152+ Produces<aod::MFTMults> mftMults; // Not accounted for, produced using custom process function to avoid dependencies
153+ Produces<aod::MultsGlobal> multsGlobal; // Not accounted for, produced based on process function processGlobalTrackingCounters
154+ Configurable<LabeledArray<int >> enabledMultiplicityTables{" enabledMultiplicityTables" ,
155+ {defaultParameters[0 ], multiplicity::kNTables , 1 , multiplicity::tableNames, parameterNames},
156+ " Produce multiplicity tables depending on needs. Values different than -1 override the automatic setup: the corresponding table can be set off (0) or on (1)" };
157+
158+
159+ // Centrality tables
160+ Produces<aod::CentRun2V0Ms> centRun2V0M;
161+ Produces<aod::CentRun2V0As> centRun2V0A;
162+ Produces<aod::CentRun2SPDTrks> centRun2SPDTracklets;
163+ Produces<aod::CentRun2SPDClss> centRun2SPDClusters;
164+ Produces<aod::CentRun2CL0s> centRun2CL0;
165+ Produces<aod::CentRun2CL1s> centRun2CL1;
166+ Produces<aod::CentFV0As> centFV0A;
167+ Produces<aod::CentFT0Ms> centFT0M;
168+ Produces<aod::CentFT0As> centFT0A;
169+ Produces<aod::CentFT0Cs> centFT0C;
170+ Produces<aod::CentFT0CVariant1s> centFT0CVariant1;
171+ Produces<aod::CentFDDMs> centFDDM;
172+ Produces<aod::CentNTPVs> centNTPV;
173+ Produces<aod::CentNGlobals> centNGlobals;
174+ Produces<aod::CentMFTs> centMFTs;
175+ Configurable<LabeledArray<int >> enabledCentralityTables{" enabledCentralityTables" ,
176+ {defaultParameters[0 ], centrality::kNTables , 1 , centrality::tableNames, parameterNames},
177+ " Produce centrality tables depending on needs. Values different than -1 override the automatic setup: the corresponding table can be set off (0) or on (1)" };
178+
179+
180+ // Configuration
181+ struct : ConfigurableGroup {
182+ Configurable<std::string> ccdbUrl{" ccdbUrl" , " http://alice-ccdb.cern.ch" , " The CCDB endpoint url address" };
183+ Configurable<std::string> ccdbPath{" ccdbPath" , " Centrality/Estimators" , " The CCDB path for centrality/multiplicity information" };
184+ Configurable<std::string> genName{" genName" , " " , " Genearator name: HIJING, PYTHIA8, ... Default: \"\" " };
185+ Configurable<bool > doNotCrashOnNull{" doNotCrashOnNull" , false , {" Option to not crash on null and instead fill required tables with dummy info" }};
186+ Configurable<std::string> reconstructionPass{" reconstructionPass" , " " , {" Apass to use when fetching the calibration tables. Empty (default) does not check for any pass. Use `metadata` to fetch it from the AO2D metadata. Otherwise it will override the metadata." }};
187+ } ccdbConfig;
188+
189+
190+ }
0 commit comments