Skip to content

Commit 5d7ea35

Browse files
junleekimjunleekim
authored andcommitted
Adding CCDB connection
1 parent b0607c8 commit 5d7ea35

2 files changed

Lines changed: 98 additions & 38 deletions

File tree

Common/TableProducer/qVectorsTable.cxx

Lines changed: 83 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ struct qVectorsTable {
7474
Configurable<int> cfgCentEsti{"cfgCentEsti",
7575
2, "Centrality estimator (Run3): 0 = FT0M, 1 = FT0A, 2 = FT0C, 3 = FV0A"};
7676

77+
Configurable<int> cfgCCDBConst{"cfgCCDBConst", 1, "Using constants in CCDB, 1 = CCDB, 2= Configurable"};
78+
7779
// LOKI: We have here all centrality estimators for Run 3 (except FDDM and NTPV),
7880
// but the Q-vectors are calculated only for some of them.
7981
// FIXME: 6 correction factors for each centrality and 8 centrality intervals are hard-coded.
@@ -147,30 +149,88 @@ struct qVectorsTable {
147149
LOGF(fatal, "Could not get the alignment parameters for FV0.");
148150
}
149151

150-
if (cfgFT0CCorr->size() < 48) {
151-
LOGF(fatal, "No proper correction factor assigned for FT0C");
152-
}
153-
if (cfgFT0ACorr->size() < 48) {
154-
LOGF(fatal, "No proper correction factor assigned for FT0A");
155-
}
156-
if (cfgFT0MCorr->size() < 48) {
157-
LOGF(fatal, "No proper correction factor assigned for FT0M");
158-
}
159-
if (cfgFV0ACorr->size() < 48) {
160-
LOGF(fatal, "No proper correction factor assigned for FV0A");
161-
}
162-
if (cfgBPosCorr->size() < 48) {
163-
LOGF(fatal, "No proper correction factor assigned for positive TPC tracks");
152+
if (cfgCCDBConst==1) {
153+
if (!(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/FT0C",cfgCcdbParam.nolaterthan.value))->empty())
154+
cfgCorr.push_back(*(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/FT0C",cfgCcdbParam.nolaterthan.value)));
155+
else {
156+
if (cfgFT0CCorr->size() < 48)
157+
LOGF(fatal, "No proper correction factor assigned for FT0C");
158+
else {
159+
cfgCorr.push_back(cfgFT0CCorr);
160+
}
161+
}
162+
if (!(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/FT0A",cfgCcdbParam.nolaterthan.value))->empty())
163+
cfgCorr.push_back(*(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/FT0A",cfgCcdbParam.nolaterthan.value)));
164+
else {
165+
if (cfgFT0ACorr->size() < 48)
166+
LOGF(fatal, "No proper correction factor assigned for FT0A");
167+
else {
168+
cfgCorr.push_back(cfgFT0ACorr);
169+
}
170+
}
171+
if (!(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/FT0M",cfgCcdbParam.nolaterthan.value))->empty())
172+
cfgCorr.push_back(*(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/FT0M",cfgCcdbParam.nolaterthan.value)));
173+
else {
174+
if (cfgFT0MCorr->size() < 48)
175+
LOGF(fatal, "No proper correction factor assigned for FT0M");
176+
else {
177+
cfgCorr.push_back(cfgFT0MCorr);
178+
}
179+
}
180+
if (!(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/FT0C",cfgCcdbParam.nolaterthan.value))->empty())
181+
cfgCorr.push_back(*(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/FT0C",cfgCcdbParam.nolaterthan.value)));
182+
else {
183+
if (cfgFV0ACorr->size() < 48)
184+
LOGF(fatal, "No proper correction factor assigned for FV0A");
185+
else {
186+
cfgCorr.push_back(cfgFV0ACorr);
187+
}
188+
} // no FV0A
189+
if (!(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/BPos",cfgCcdbParam.nolaterthan.value))->empty())
190+
cfgCorr.push_back(*(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/BPos",cfgCcdbParam.nolaterthan.value)));
191+
else {
192+
if (cfgBPosCorr->size() < 48)
193+
LOGF(fatal, "No proper correction factor assigned for BPos");
194+
else {
195+
cfgCorr.push_back(cfgBPosCorr);
196+
}
197+
}
198+
if (!(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/BNeg",cfgCcdbParam.nolaterthan.value))->empty())
199+
cfgCorr.push_back(*(ccdb->getForTimeStamp<std::vector<float>>("Analysis/EventPlane/QVecCorrections/BNeg",cfgCcdbParam.nolaterthan.value)));
200+
else {
201+
if (cfgBNegCorr->size() < 48)
202+
LOGF(fatal, "No proper correction factor assigned for BNeg");
203+
else {
204+
cfgCorr.push_back(cfgBNegCorr);
205+
}
206+
}
207+
} else if (cfgCCDBConst==2) {
208+
if (cfgFT0CCorr->size() < 48) {
209+
LOGF(fatal, "No proper correction factor assigned for FT0C");
210+
}
211+
if (cfgFT0ACorr->size() < 48) {
212+
LOGF(fatal, "No proper correction factor assigned for FT0A");
213+
}
214+
if (cfgFT0MCorr->size() < 48) {
215+
LOGF(fatal, "No proper correction factor assigned for FT0M");
216+
}
217+
if (cfgFV0ACorr->size() < 48) {
218+
LOGF(fatal, "No proper correction factor assigned for FV0A");
219+
}
220+
if (cfgBPosCorr->size() < 48) {
221+
LOGF(fatal, "No proper correction factor assigned for positive TPC tracks");
222+
}
223+
if (cfgBNegCorr->size() < 48) {
224+
LOGF(fatal, "No proper correction factor assigned for negative TPC tracks");
225+
} // will be replaced with method that call constants from CCDB
226+
227+
cfgCorr.push_back(cfgFT0CCorr);
228+
cfgCorr.push_back(cfgFT0ACorr);
229+
cfgCorr.push_back(cfgFT0MCorr);
230+
cfgCorr.push_back(cfgFV0ACorr);
231+
cfgCorr.push_back(cfgBPosCorr);
232+
cfgCorr.push_back(cfgBNegCorr);
164233
}
165-
if (cfgBNegCorr->size() < 48) {
166-
LOGF(fatal, "No proper correction factor assigned for negative TPC tracks");
167-
} // will be replaced with method that call constants from CCDB
168-
cfgCorr.push_back(cfgFT0CCorr);
169-
cfgCorr.push_back(cfgFT0ACorr);
170-
cfgCorr.push_back(cfgFT0MCorr);
171-
cfgCorr.push_back(cfgFV0ACorr);
172-
cfgCorr.push_back(cfgBPosCorr);
173-
cfgCorr.push_back(cfgBNegCorr);
174234

175235
/* // Debug printing.
176236
printf("Offset for FT0A: x = %.3f y = %.3f\n", (*offsetFT0)[0].getX(), (*offsetFT0)[0].getY());

Common/Tasks/qVectorsCorrection.cxx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ struct qVectorsCorrection {
168168
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecTwist"), vec.qvecRe()[DetId * 4 + 2], vec.qvecIm()[DetId * 4 + 2]);
169169
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecFinal"), vec.qvecRe()[DetId * 4 + 3], vec.qvecIm()[DetId * 4 + 3]);
170170

171-
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlUncor"), helperEP.GetEventPlane(vec.qvecRe()[DetId * 4], vec.qvecIm()[DetId * 4], 2));
172-
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRectr"), helperEP.GetEventPlane(vec.qvecRe()[DetId * 4 + 1], vec.qvecIm()[DetId * 4 + 1], 2));
173-
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlTwist"), helperEP.GetEventPlane(vec.qvecRe()[DetId * 4 + 2], vec.qvecIm()[DetId * 4 + 2], 2));
174-
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlFinal"), helperEP.GetEventPlane(vec.qvecRe()[DetId * 4 + 3], vec.qvecIm()[DetId * 4 + 3], 2));
171+
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlUncor"), helperEP.GetEventPlane(vec.qvecRe()[DetId * 4], vec.qvecIm()[DetId * 4], cfgnMod));
172+
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRectr"), helperEP.GetEventPlane(vec.qvecRe()[DetId * 4 + 1], vec.qvecIm()[DetId * 4 + 1], cfgnMod));
173+
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlTwist"), helperEP.GetEventPlane(vec.qvecRe()[DetId * 4 + 2], vec.qvecIm()[DetId * 4 + 2], cfgnMod));
174+
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlFinal"), helperEP.GetEventPlane(vec.qvecRe()[DetId * 4 + 3], vec.qvecIm()[DetId * 4 + 3], cfgnMod));
175175
}
176176

177177
if (vec.qvecAmp()[RefAId] > 1e-8) {
@@ -180,10 +180,10 @@ struct qVectorsCorrection {
180180
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecRefATwist"), vec.qvecRe()[RefAId * 4 + 2], vec.qvecIm()[RefAId * 4 + 2]);
181181
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecRefAFinal"), vec.qvecRe()[RefAId * 4 + 3], vec.qvecIm()[RefAId * 4 + 3]);
182182

183-
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefAUncor"), helperEP.GetEventPlane(vec.qvecRe()[RefAId * 4], vec.qvecIm()[RefAId * 4], 2));
184-
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefARectr"), helperEP.GetEventPlane(vec.qvecRe()[RefAId * 4 + 1], vec.qvecIm()[RefAId * 4 + 1], 2));
185-
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefATwist"), helperEP.GetEventPlane(vec.qvecRe()[RefAId * 4 + 2], vec.qvecIm()[RefAId * 4 + 2], 2));
186-
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefAFinal"), helperEP.GetEventPlane(vec.qvecRe()[RefAId * 4 + 3], vec.qvecIm()[RefAId * 4 + 3], 2));
183+
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefAUncor"), helperEP.GetEventPlane(vec.qvecRe()[RefAId * 4], vec.qvecIm()[RefAId * 4], cfgnMod));
184+
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefARectr"), helperEP.GetEventPlane(vec.qvecRe()[RefAId * 4 + 1], vec.qvecIm()[RefAId * 4 + 1], cfgnMod));
185+
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefATwist"), helperEP.GetEventPlane(vec.qvecRe()[RefAId * 4 + 2], vec.qvecIm()[RefAId * 4 + 2], cfgnMod));
186+
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefAFinal"), helperEP.GetEventPlane(vec.qvecRe()[RefAId * 4 + 3], vec.qvecIm()[RefAId * 4 + 3], cfgnMod));
187187
}
188188

189189
if (vec.qvecAmp()[RefBId] > 1e-8) {
@@ -192,17 +192,17 @@ struct qVectorsCorrection {
192192
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecRefBTwist"), vec.qvecRe()[RefBId * 4 + 2], vec.qvecIm()[RefBId * 4 + 2]);
193193
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histQvecRefBFinal"), vec.qvecRe()[RefBId * 4 + 3], vec.qvecIm()[RefBId * 4 + 3]);
194194

195-
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefBUncor"), helperEP.GetEventPlane(vec.qvecRe()[RefBId * 4], vec.qvecIm()[RefBId * 4], 2));
196-
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefBRectr"), helperEP.GetEventPlane(vec.qvecRe()[RefBId * 4 + 1], vec.qvecIm()[RefBId * 4 + 1], 2));
197-
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefBTwist"), helperEP.GetEventPlane(vec.qvecRe()[RefBId * 4 + 2], vec.qvecIm()[RefBId * 4 + 2], 2));
198-
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefBFinal"), helperEP.GetEventPlane(vec.qvecRe()[RefBId * 4 + 3], vec.qvecIm()[RefBId * 4 + 3], 2));
195+
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefBUncor"), helperEP.GetEventPlane(vec.qvecRe()[RefBId * 4], vec.qvecIm()[RefBId * 4], cfgnMod));
196+
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefBRectr"), helperEP.GetEventPlane(vec.qvecRe()[RefBId * 4 + 1], vec.qvecIm()[RefBId * 4 + 1], cfgnMod));
197+
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefBTwist"), helperEP.GetEventPlane(vec.qvecRe()[RefBId * 4 + 2], vec.qvecIm()[RefBId * 4 + 2], cfgnMod));
198+
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRefBFinal"), helperEP.GetEventPlane(vec.qvecRe()[RefBId * 4 + 3], vec.qvecIm()[RefBId * 4 + 3], cfgnMod));
199199
}
200200

201201
if (vec.qvecAmp()[DetId] > 1e-8 && vec.qvecAmp()[RefAId] > 1e-8 && vec.qvecAmp()[RefBId] > 1e-8) {
202202
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlResolution"), helperEP.GetResolution(
203-
helperEP.GetEventPlane(vec.qvecRe()[RefAId * 4 + 3], vec.qvecIm()[RefAId * 4 + 3], 2),
204-
helperEP.GetEventPlane(vec.qvecRe()[RefBId * 4 + 3], vec.qvecIm()[RefBId * 4 + 3], 2),
205-
helperEP.GetEventPlane(vec.qvecRe()[DetId * 4 + 3], vec.qvecIm()[DetId * 4 + 3], 2), 2));
203+
helperEP.GetEventPlane(vec.qvecRe()[RefAId * 4 + 3], vec.qvecIm()[RefAId * 4 + 3], cfgnMod),
204+
helperEP.GetEventPlane(vec.qvecRe()[RefBId * 4 + 3], vec.qvecIm()[RefBId * 4 + 3], cfgnMod),
205+
helperEP.GetEventPlane(vec.qvecRe()[DetId * 4 + 3], vec.qvecIm()[DetId * 4 + 3], cfgnMod), cfgnMod));
206206
}
207207
}
208208

0 commit comments

Comments
 (0)