Skip to content

Commit e9950f9

Browse files
Implementation of SPD Clusters, CL0 and CL1 estimators
1 parent 245db43 commit e9950f9

3 files changed

Lines changed: 151 additions & 41 deletions

File tree

Common/DataModel/Centrality.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,18 @@ namespace cent
1919
{
2020
DECLARE_SOA_COLUMN(CentEstV0M, centV0M, float); //! Centrality percentile estimated from V0C+V0A multiplicities
2121
DECLARE_SOA_COLUMN(CentEstRun2SPDTracklets, centRun2SPDTracklets, float); //! Run2 centrality percentile estimated from SPD tracklets multiplicity
22+
DECLARE_SOA_COLUMN(CentEstRun2SPDClusters, centRun2SPDClusters, float); //! Run2 centrality percentile estimated from SPD clusters multiplicity
2223
DECLARE_SOA_COLUMN(CentEstRun2CL0, centRun2CL0, float); //! Run2 centrality percentile estimated from CL0 multiplicity
2324
DECLARE_SOA_COLUMN(CentEstRun2CL1, centRun2CL1, float); //! Run2 centrality percentile estimated from CL1 multiplicity
2425
} // namespace cent
25-
DECLARE_SOA_TABLE(CentV0Ms, "AOD", "CENTV0M", cent::CentEstV0M); //! V0M estimated centrality table
26-
DECLARE_SOA_TABLE(CentRun2SPDs, "AOD", "CENTRUN2SPD", cent::CentEstRun2SPDTracklets); //! Run2 SPD tracklets estimated centrality table
27-
DECLARE_SOA_TABLE(CentRun2CL0s, "AOD", "CENTRUN2CL0", cent::CentEstRun2CL0); //! Run2 CL0 estimated centrality table
28-
DECLARE_SOA_TABLE(CentRun2CL1s, "AOD", "CENTRUN2CL1", cent::CentEstRun2CL1); //! Run2 CL1 estimated centrality table
26+
DECLARE_SOA_TABLE(CentV0Ms, "AOD", "CENTV0M", cent::CentEstV0M); //! V0M estimated centrality table
27+
DECLARE_SOA_TABLE(CentRun2SPDTrks, "AOD", "CENTRUN2SPDTRK", cent::CentEstRun2SPDTracklets); //! Run2 SPD tracklets estimated centrality table
28+
DECLARE_SOA_TABLE(CentRun2SPDClss, "AOD", "CENTRUN2SPDCLS", cent::CentEstRun2SPDClusters); //! Run2 SPD clusters estimated centrality table
29+
DECLARE_SOA_TABLE(CentRun2CL0s, "AOD", "CENTRUN2CL0", cent::CentEstRun2CL0); //! Run2 CL0 estimated centrality table
30+
DECLARE_SOA_TABLE(CentRun2CL1s, "AOD", "CENTRUN2CL1", cent::CentEstRun2CL1); //! Run2 CL1 estimated centrality table
2931
using CentV0M = CentV0Ms::iterator;
30-
using CentRun2SPD = CentRun2SPDs::iterator;
32+
using CentRun2SPDTrk = CentRun2SPDTrks::iterator;
33+
using CentRun2SPDCls = CentRun2SPDClss::iterator;
3134
using CentRun2CL0 = CentRun2CL0s::iterator;
3235
using CentRun2CL1 = CentRun2CL1s::iterator;
3336
} // namespace o2::aod

Common/TableProducer/centralityTable.cxx

Lines changed: 111 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,46 @@ using namespace o2::framework;
2626

2727
struct CentralityTable {
2828
Produces<aod::CentV0Ms> centVOM;
29-
Produces<aod::CentRun2SPDs> centRun2SPD;
30-
Produces<aod::CentRun2CL0s> centRun2CL1;
31-
Produces<aod::CentRun2CL1s> centRun2CL2;
29+
Produces<aod::CentRun2SPDTrks> centRun2SPDTracklets;
30+
Produces<aod::CentRun2SPDClss> centRun2SPDClusters;
31+
Produces<aod::CentRun2CL0s> centRun2CL0;
32+
Produces<aod::CentRun2CL1s> centRun2CL1;
3233
Service<o2::ccdb::BasicCCDBManager> ccdb;
3334

3435
Configurable<int> estV0M{"estV0M", -1, {"Produces centrality percentiles using V0 multiplicity. -1: auto, 0: don't, 1: yes. Default: auto (-1)"}};
35-
Configurable<int> estRun2SPD{"estRun2SPD", -1, {"Produces Run2 centrality percentiles using SPD tracklets multiplicity. -1: auto, 0: don't, 1: yes. Default: auto (-1)"}};
36+
Configurable<int> estRun2SPDTrklets{"estRun2SPDtks", -1, {"Produces Run2 centrality percentiles using SPD tracklets multiplicity. -1: auto, 0: don't, 1: yes. Default: auto (-1)"}};
37+
Configurable<int> estRun2SPDClusters{"estRun2SPDcls", -1, {"Produces Run2 centrality percentiles using SPD clusters multiplicity. -1: auto, 0: don't, 1: yes. Default: auto (-1)"}};
3638
Configurable<int> estRun2CL0{"estRun2CL0", -1, {"Produces Run2 centrality percentiles using CL0 multiplicity. -1: auto, 0: don't, 1: yes. Default: auto (-1)"}};
3739
Configurable<int> estRun2CL1{"estRun2CL1", -1, {"Produces Run2 centrality percentiles using CL1 multiplicity. -1: auto, 0: don't, 1: yes. Default: auto (-1)"}};
3840

3941
int mRunNumber;
4042
struct tagV0MCalibration {
41-
bool mV0MCalibrationStored = false;
43+
bool mCalibrationStored = false;
4244
TH1* mhVtxAmpCorrV0A = nullptr;
4345
TH1* mhVtxAmpCorrV0C = nullptr;
44-
TH1* mhMultSelCalibV0M = nullptr;
46+
TH1* mhMultSelCalib = nullptr;
4547
} V0MInfo;
4648
struct tagSPDTrackletsCalibration {
47-
bool mSPDCalibrationStored = false;
48-
TH1* mhVtxAmpCorrSPD = nullptr;
49-
TH1* mhMultSelCalibSPD = nullptr;
50-
} SPDInfo;
49+
bool mCalibrationStored = false;
50+
TH1* mhVtxAmpCorr = nullptr;
51+
TH1* mhMultSelCalib = nullptr;
52+
} SPDTksInfo;
53+
struct tagSPDClustersCalibration {
54+
bool mCalibrationStored = false;
55+
TH1* mhVtxAmpCorrCL0 = nullptr;
56+
TH1* mhVtxAmpCorrCL1 = nullptr;
57+
TH1* mhMultSelCalib = nullptr;
58+
} SPDClsInfo;
59+
struct tagCL0Calibration {
60+
bool mCalibrationStored = false;
61+
TH1* mhVtxAmpCorr = nullptr;
62+
TH1* mhMultSelCalib = nullptr;
63+
} CL0Info;
64+
struct tagCL1Calibration {
65+
bool mCalibrationStored = false;
66+
TH1* mhVtxAmpCorr = nullptr;
67+
TH1* mhMultSelCalib = nullptr;
68+
} CL1Info;
5169

5270
void
5371
init(InitContext& context)
@@ -71,7 +89,8 @@ struct CentralityTable {
7189
}
7290
};
7391
enable("V0M", estV0M);
74-
enable("Run2SPD", estRun2SPD);
92+
enable("Run2SPDTrk", estRun2SPDTrklets);
93+
enable("Run2SPDCls", estRun2SPDClusters);
7594
enable("Run2CL0", estRun2CL0);
7695
enable("Run2CL1", estRun2CL1);
7796
}
@@ -82,16 +101,21 @@ struct CentralityTable {
82101
mRunNumber = 0;
83102
}
84103

85-
void process(soa::Join<aod::Collisions, aod::Mults>::iterator const& collision, aod::BCsWithTimestamps const&, aod::Tracks const& tracks)
104+
using BCsWithTimestampsAndRun2Infos = soa::Join<aod::BCs, aod::Run2BCInfos, aod::Timestamps>;
105+
106+
void process(soa::Join<aod::Collisions, aod::Mults>::iterator const& collision, BCsWithTimestampsAndRun2Infos const&)
86107
{
87108
/* check the previous run number */
88-
auto bc = collision.bc_as<aod::BCsWithTimestamps>();
109+
auto bc = collision.bc_as<BCsWithTimestampsAndRun2Infos>();
89110
if (bc.runNumber() != mRunNumber) {
90111
LOGF(debug, "timestamp=%llu", bc.timestamp());
91112
TList* callst = ccdb->getForTimeStamp<TList>("Centrality/Estimators", bc.timestamp());
92113

93-
V0MInfo.mV0MCalibrationStored = false;
94-
SPDInfo.mSPDCalibrationStored = false;
114+
V0MInfo.mCalibrationStored = false;
115+
SPDTksInfo.mCalibrationStored = false;
116+
SPDClsInfo.mCalibrationStored = false;
117+
CL0Info.mCalibrationStored = false;
118+
CL1Info.mCalibrationStored = false;
95119
if (callst != nullptr) {
96120
auto getccdb = [callst](const char* ccdbhname) {
97121
TH1* h = (TH1*)callst->FindObject(ccdbhname);
@@ -101,30 +125,55 @@ struct CentralityTable {
101125
LOGF(debug, "Getting new histograms with %d run number for %d run number", mRunNumber, bc.runNumber());
102126
V0MInfo.mhVtxAmpCorrV0A = getccdb("hVtx_fAmplitude_V0A_Normalized");
103127
V0MInfo.mhVtxAmpCorrV0C = getccdb("hVtx_fAmplitude_V0C_Normalized");
104-
V0MInfo.mhMultSelCalibV0M = getccdb("hMultSelCalib_V0M");
105-
if ((V0MInfo.mhVtxAmpCorrV0A != nullptr) and (V0MInfo.mhVtxAmpCorrV0C != nullptr) and (V0MInfo.mhMultSelCalibV0M != nullptr)) {
106-
V0MInfo.mV0MCalibrationStored = true;
128+
V0MInfo.mhMultSelCalib = getccdb("hMultSelCalib_V0M");
129+
if ((V0MInfo.mhVtxAmpCorrV0A != nullptr) and (V0MInfo.mhVtxAmpCorrV0C != nullptr) and (V0MInfo.mhMultSelCalib != nullptr)) {
130+
V0MInfo.mCalibrationStored = true;
107131
} else {
108132
LOGF(fatal, "Calibration information from V0M for run %d corrupted", bc.runNumber());
109133
}
110134
}
111-
if (estRun2SPD == 1) {
135+
if (estRun2SPDTrklets == 1) {
112136
LOGF(debug, "Getting new histograms with %d run number for %d run number", mRunNumber, bc.runNumber());
113-
SPDInfo.mhVtxAmpCorrSPD = getccdb("hVtx_fnTracklets_Normalized");
114-
SPDInfo.mhMultSelCalibSPD = getccdb("hMultSelCalib_SPDTracklets");
115-
if ((SPDInfo.mhVtxAmpCorrSPD != nullptr) and (SPDInfo.mhMultSelCalibSPD != nullptr)) {
116-
SPDInfo.mSPDCalibrationStored = true;
137+
SPDTksInfo.mhVtxAmpCorr = getccdb("hVtx_fnTracklets_Normalized");
138+
SPDTksInfo.mhMultSelCalib = getccdb("hMultSelCalib_SPDTracklets");
139+
if ((SPDTksInfo.mhVtxAmpCorr != nullptr) and (SPDTksInfo.mhMultSelCalib != nullptr)) {
140+
SPDTksInfo.mCalibrationStored = true;
117141
} else {
118142
LOGF(fatal, "Calibration information from SPD tracklets for run %d corrupted", bc.runNumber());
119143
}
120144
}
145+
if (estRun2SPDClusters == 1) {
146+
LOGF(debug, "Getting new histograms with %d run number for %d run number", mRunNumber, bc.runNumber());
147+
SPDClsInfo.mhVtxAmpCorrCL0 = getccdb("hVtx_fnSPDClusters0_Normalized");
148+
SPDClsInfo.mhVtxAmpCorrCL1 = getccdb("hVtx_fnSPDClusters1_Normalized");
149+
SPDClsInfo.mhMultSelCalib = getccdb("hMultSelCalib_SPDClusters");
150+
if ((SPDClsInfo.mhVtxAmpCorrCL0 != nullptr) and (SPDClsInfo.mhVtxAmpCorrCL1 != nullptr) and (SPDClsInfo.mhMultSelCalib != nullptr)) {
151+
SPDClsInfo.mCalibrationStored = true;
152+
} else {
153+
LOGF(fatal, "Calibration information from SPD clusters for run %d corrupted", bc.runNumber());
154+
}
155+
}
121156
if (estRun2CL0 == 1) {
122-
LOGF(fatal, "Run2 calibration information estimated from CL0 still not available");
157+
LOGF(debug, "Getting new histograms with %d run number for %d run number", mRunNumber, bc.runNumber());
158+
CL0Info.mhVtxAmpCorr = getccdb("hVtx_fnSPDClusters0_Normalized");
159+
CL0Info.mhMultSelCalib = getccdb("hMultSelCalib_CL0");
160+
if ((CL0Info.mhVtxAmpCorr != nullptr) and (CL0Info.mhMultSelCalib != nullptr)) {
161+
CL0Info.mCalibrationStored = true;
162+
} else {
163+
LOGF(fatal, "Calibration information from CL0 multiplicity for run %d corrupted", bc.runNumber());
164+
}
123165
}
124166
if (estRun2CL1 == 1) {
125-
LOGF(fatal, "Run2 calibration information estimated from CL1 still not available");
167+
LOGF(debug, "Getting new histograms with %d run number for %d run number", mRunNumber, bc.runNumber());
168+
CL1Info.mhVtxAmpCorr = getccdb("hVtx_fnSPDClusters1_Normalized");
169+
CL1Info.mhMultSelCalib = getccdb("hMultSelCalib_CL1");
170+
if ((CL1Info.mhVtxAmpCorr != nullptr) and (CL1Info.mhMultSelCalib != nullptr)) {
171+
CL1Info.mCalibrationStored = true;
172+
} else {
173+
LOGF(fatal, "Calibration information from CL1 multiplicity for run %d corrupted", bc.runNumber());
174+
}
126175
}
127-
if (V0MInfo.mV0MCalibrationStored or SPDInfo.mSPDCalibrationStored) {
176+
if (V0MInfo.mCalibrationStored or SPDTksInfo.mCalibrationStored or SPDClsInfo.mCalibrationStored or CL0Info.mCalibrationStored or CL1Info.mCalibrationStored) {
128177
mRunNumber = bc.runNumber();
129178
}
130179
} else {
@@ -133,23 +182,51 @@ struct CentralityTable {
133182
}
134183
if (estV0M == 1) {
135184
float cV0M = 105.0f;
136-
if (V0MInfo.mV0MCalibrationStored) {
185+
if (V0MInfo.mCalibrationStored) {
137186
float v0m = collision.multV0A() * V0MInfo.mhVtxAmpCorrV0A->GetBinContent(V0MInfo.mhVtxAmpCorrV0A->FindFixBin(collision.posZ())) +
138187
collision.multV0C() * V0MInfo.mhVtxAmpCorrV0C->GetBinContent(V0MInfo.mhVtxAmpCorrV0C->FindFixBin(collision.posZ()));
139-
cV0M = V0MInfo.mhMultSelCalibV0M->GetBinContent(V0MInfo.mhMultSelCalibV0M->FindFixBin(v0m));
188+
cV0M = V0MInfo.mhMultSelCalib->GetBinContent(V0MInfo.mhMultSelCalib->FindFixBin(v0m));
140189
}
141190
LOGF(debug, "centV0M=%.0f", cV0M);
142191
// fill centrality columns
143192
centVOM(cV0M);
144193
}
145-
if (estRun2SPD == 1) {
194+
if (estRun2SPDTrklets == 1) {
195+
float cSPD = 105.0f;
196+
if (SPDTksInfo.mCalibrationStored) {
197+
float spdm = collision.multTracklets() * SPDTksInfo.mhVtxAmpCorr->GetBinContent(SPDTksInfo.mhVtxAmpCorr->FindFixBin(collision.posZ()));
198+
cSPD = SPDTksInfo.mhMultSelCalib->GetBinContent(SPDTksInfo.mhMultSelCalib->FindFixBin(spdm));
199+
}
200+
LOGF(debug, "centSPDTracklets=%.0f", cSPD);
201+
centRun2SPDTracklets(cSPD);
202+
}
203+
if (estRun2SPDClusters == 1) {
146204
float cSPD = 105.0f;
147-
if (SPDInfo.mSPDCalibrationStored) {
148-
float spdm = collision.multTracklets() * SPDInfo.mhVtxAmpCorrSPD->GetBinContent(SPDInfo.mhVtxAmpCorrSPD->FindFixBin(collision.posZ()));
149-
cSPD = SPDInfo.mhMultSelCalibSPD->GetBinContent(SPDInfo.mhMultSelCalibSPD->FindFixBin(spdm));
205+
if (SPDClsInfo.mCalibrationStored) {
206+
float spdm = bc.spdClustersL0() * SPDClsInfo.mhVtxAmpCorrCL0->GetBinContent(SPDClsInfo.mhVtxAmpCorrCL0->FindFixBin(collision.posZ())) +
207+
bc.spdClustersL1() * SPDClsInfo.mhVtxAmpCorrCL1->GetBinContent(SPDClsInfo.mhVtxAmpCorrCL1->FindFixBin(collision.posZ()));
208+
cSPD = SPDClsInfo.mhMultSelCalib->GetBinContent(SPDClsInfo.mhMultSelCalib->FindFixBin(spdm));
209+
}
210+
LOGF(debug, "centSPDClusters=%.0f", cSPD);
211+
centRun2SPDClusters(cSPD);
212+
}
213+
if (estRun2CL0 == 1) {
214+
float cCL0 = 105.0f;
215+
if (CL0Info.mCalibrationStored) {
216+
float cl0m = bc.spdClustersL0() * CL0Info.mhVtxAmpCorr->GetBinContent(CL0Info.mhVtxAmpCorr->FindFixBin(collision.posZ()));
217+
cCL0 = CL0Info.mhMultSelCalib->GetBinContent(CL0Info.mhMultSelCalib->FindFixBin(cl0m));
218+
}
219+
LOGF(debug, "centCL0=%.0f", cCL0);
220+
centRun2CL0(cCL0);
221+
}
222+
if (estRun2CL1 == 1) {
223+
float cCL1 = 105.0f;
224+
if (CL1Info.mCalibrationStored) {
225+
float cl1m = bc.spdClustersL1() * CL1Info.mhVtxAmpCorr->GetBinContent(CL1Info.mhVtxAmpCorr->FindFixBin(collision.posZ()));
226+
cCL1 = CL1Info.mhMultSelCalib->GetBinContent(CL1Info.mhMultSelCalib->FindFixBin(cl1m));
150227
}
151-
LOGF(debug, "centSPD=%.0f", cSPD);
152-
centRun2SPD(cSPD);
228+
LOGF(debug, "centCL1=%.0f", cCL1);
229+
centRun2CL1(cCL1);
153230
}
154231
}
155232
};

Common/Tasks/centralityQa.cxx

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ using namespace o2;
1919
using namespace o2::framework;
2020

2121
struct CentralityQa {
22-
OutputObj<TH1F> hCentV0M{TH1F("hCentV0M", "", 21, 0, 105.)};
23-
void process(soa::Join<aod::Collisions, aod::EvSels, aod::CentV0Ms>::iterator const& col)
22+
OutputObj<TH1F> hCentV0M{TH1F("hCentV0M", "V0M", 21, 0, 105.)};
23+
OutputObj<TH1F> hCentSPDTks{TH1F("hCentSPDTks", "SPD Tracklets", 21, 0, 105.)};
24+
OutputObj<TH1F> hCentSPDCls{TH1F("hCentSPDCls", "SPD Clusters", 21, 0, 105.)};
25+
OutputObj<TH1F> hCentCL0{TH1F("hCentCL0", "CL0", 21, 0, 105.)};
26+
OutputObj<TH1F> hCentCL1{TH1F("hCentCL1", "CL1", 21, 0, 105.)};
27+
void processPP(soa::Join<aod::Collisions, aod::EvSels, aod::CentV0Ms, aod::CentRun2SPDTrks, aod::CentRun2SPDClss>::iterator const& col)
2428
{
2529
if (!col.alias()[kINT7]) {
2630
return;
@@ -30,9 +34,35 @@ struct CentralityQa {
3034
}
3135

3236
LOGF(debug, "centV0M=%.0f", col.centV0M());
37+
LOGF(debug, "centSPDTracklets=%.0f", col.centRun2SPDTracklets());
38+
LOGF(debug, "centSPDClusters=%.0f", col.centRun2SPDClusters());
3339
// fill centrality histos
3440
hCentV0M->Fill(col.centV0M());
41+
hCentSPDTks->Fill(col.centRun2SPDTracklets());
42+
hCentSPDCls->Fill(col.centRun2SPDClusters());
3543
}
44+
PROCESS_SWITCH(CentralityQa, processPP, "Process with SPD clusters centrality/multiplicity estimation", false);
45+
46+
void processPbPb(soa::Join<aod::Collisions, aod::EvSels, aod::CentV0Ms, aod::CentRun2SPDTrks, aod::CentRun2CL0s, aod::CentRun2CL1s>::iterator const& col)
47+
{
48+
if (!col.alias()[kINT7]) {
49+
return;
50+
}
51+
if (!col.sel7()) {
52+
return;
53+
}
54+
55+
LOGF(debug, "centV0M=%.0f", col.centV0M());
56+
LOGF(debug, "centSPDTracklets=%.0f", col.centRun2SPDTracklets());
57+
LOGF(debug, "centCL0=%.0f", col.centRun2CL0());
58+
LOGF(debug, "centCL1=%.0f", col.centRun2CL1());
59+
// fill centrality histos
60+
hCentV0M->Fill(col.centV0M());
61+
hCentSPDTks->Fill(col.centRun2SPDTracklets());
62+
hCentCL0->Fill(col.centRun2CL0());
63+
hCentCL1->Fill(col.centRun2CL1());
64+
}
65+
PROCESS_SWITCH(CentralityQa, processPbPb, "Process with CL0 and CL1 multiplicities centrality/multiplicity estimation", true);
3666
};
3767

3868
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)