Skip to content

Commit 8f3416b

Browse files
authored
Update
1 parent bd4c98b commit 8f3416b

2 files changed

Lines changed: 225 additions & 21 deletions

File tree

Common/TableProducer/centralityTable.cxx

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,35 @@ static constexpr int kNGlobals = 13;
5757
static constexpr int kMFTs = 14;
5858
static constexpr int kNTables = 15;
5959
static constexpr int kNParameters = 1;
60-
static const std::vector<std::string> tableNames{"CentRun2V0Ms",
61-
"CentRun2V0As",
62-
"CentRun2SPDTrks",
63-
"CentRun2SPDClss",
64-
"CentRun2CL0s",
65-
"CentRun2CL1s",
66-
"CentFV0As",
67-
"CentFT0Ms",
68-
"CentFT0As",
69-
"CentFT0Cs",
70-
"CentFT0CVariant1s",
71-
"CentFDDMs",
72-
"CentNTPVs",
73-
"CentNGlobals",
60+
static const std::vector<std::string> tableNamesCentrality{"CentRun2V0Ms", // 0
61+
"CentRun2V0As", // 1
62+
"CentRun2SPDTrks", // 2
63+
"CentRun2SPDClss", // 3
64+
"CentRun2CL0s", // 4
65+
"CentRun2CL1s", // 5
66+
"CentFV0As", // 6
67+
"CentFT0Ms", // 7
68+
"CentFT0As", // 8
69+
"CentFT0Cs", // 9
70+
"CentFT0CVariant1s", // 10
71+
"CentFDDMs", // 11
72+
"CentNTPVs", // 12
73+
"CentNGlobals", // 13
7474
"CentMFTs"};
75+
static const std::vector<std::string> tableNamesMultiplicity{"FV0Mults", // 0
76+
"FT0Mults", // 1
77+
"FDDMults", // 2
78+
"ZDCMults", // 3
79+
"TrackletMults", // 4
80+
"TPCMults", // 5
81+
"PVMults", // 6
82+
"MultsExtra", // 7
83+
"MultSelections", // 8
84+
"FV0MultZeqs", // 9
85+
"FT0MultZeqs", // 10
86+
"FDDMultZeqs", // 11
87+
"PVMultZeqs", // 12
88+
"MultMCExtras"}; // 13
7589
static const std::vector<std::string> parameterNames{"Enable"};
7690
static const int defaultParameters[kNTables][kNParameters]{{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}};
7791

@@ -92,8 +106,8 @@ struct CentralityTable {
92106
Produces<aod::CentNGlobals> centNGlobals;
93107
Produces<aod::CentMFTs> centMFTs;
94108
Service<o2::ccdb::BasicCCDBManager> ccdb;
95-
Configurable<LabeledArray<int>> enabledTables{"enabledTables",
96-
{defaultParameters[0], kNTables, kNParameters, tableNames, parameterNames},
109+
Configurable<LabeledArray<int>> enabledCentralityTables{"enabledCentralityTables",
110+
{defaultParameters[0], kNTables, kNParameters, tableNamesCentrality, parameterNames},
97111
"Produce tables depending on needs. Values different than -1 override the automatic setup: the corresponding table can be set off (0) or on (1)"};
98112
struct : ConfigurableGroup {
99113
Configurable<std::string> ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "The CCDB endpoint url address"};
@@ -204,16 +218,16 @@ struct CentralityTable {
204218

205219
/* Checking the tables which are requested in the workflow and enabling them */
206220
for (int i = 0; i < kNTables; i++) {
207-
int f = enabledTables->get(tableNames[i].c_str(), "Enable");
208-
enableFlagIfTableRequired(context, tableNames[i], f);
221+
int f = enabledCentralityTables->get(tableNamesCentrality[i].c_str(), "Enable");
222+
enableFlagIfTableRequired(context, tableNamesCentrality[i], f);
209223
if (f == 1) {
210-
if (tableNames[i].find("Run2") != std::string::npos) {
224+
if (tableNamesCentrality[i].find("Run2") != std::string::npos) {
211225
if (doprocessRun3) {
212-
LOG(fatal) << "Cannot enable Run2 table `" << tableNames[i] << "` while running in Run3 mode. Please check and disable them.";
226+
LOG(fatal) << "Cannot enable Run2 table `" << tableNamesCentrality[i] << "` while running in Run3 mode. Please check and disable them.";
213227
}
214228
} else {
215229
if (doprocessRun2) {
216-
LOG(fatal) << "Cannot enable Run3 table `" << tableNames[i] << "` while running in Run2 mode. Please check and disable them.";
230+
LOG(fatal) << "Cannot enable Run3 table `" << tableNamesCentrality[i] << "` while running in Run2 mode. Please check and disable them.";
217231
}
218232
}
219233
isTableEnabled[i] = true;
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
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

Comments
 (0)