Skip to content

Commit 798d5ae

Browse files
author
Marcello Di Costanzo
committed
Adjust paths for CCDB corrections
1 parent f46af56 commit 798d5ae

1 file changed

Lines changed: 24 additions & 14 deletions

File tree

Common/TableProducer/qVectorsTable.cxx

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ struct qVectorsTable {
114114
Configurable<bool> useCorrectionForRun{"useCorrectionForRun", true, "Get Qvector corrections based on run number instead of timestamp"};
115115
Configurable<std::string> cfgGainEqPath{"cfgGainEqPath", "Users/j/junlee/Qvector/GainEq", "CCDB path for gain equalization constants"};
116116
Configurable<std::string> cfgQvecCalibPath{"cfgQvecCalibPath", "Analysis/EventPlane/QVecCorrections", "CCDB path for Q-vector calibration constants"};
117-
Configurable<std::string> cfgQvecEseCalibPath{"cfgQvecEseCalibPath", "Analysis/EventPlane/QVecEseCorrections", "CCDB path for EsE Q-vector calibration constants"};
118117

119118
Configurable<bool> cfgShiftCorr{"cfgShiftCorr", false, "configurable flag for shift correction"};
120119
Configurable<std::string> cfgShiftPath{"cfgShiftPath", "", "CCDB path for shift correction"};
@@ -188,7 +187,8 @@ struct qVectorsTable {
188187

189188
std::vector<TH3F*> corrsQvecSp{};
190189
std::vector<TH3F*> corrsQvecEse{};
191-
std::vector<TProfile3D*> shiftProfile{};
190+
std::vector<TProfile3D*> shiftProfileSp{};
191+
std::vector<TProfile3D*> shiftProfileEse{};
192192

193193
// Deprecated, will be removed in future after transition time //
194194
Configurable<bool> cfgUseBPos{"cfgUseBPos", false, "Initial value for using BPos. By default obtained from DataModel."};
@@ -312,27 +312,37 @@ struct qVectorsTable {
312312
corrsQvecEse.clear();
313313
for (std::size_t i = 0; i < cfgnMods->size(); i++) {
314314
int ind = cfgnMods->at(i);
315-
fullPath = cfgQvecEseCalibPath;
315+
fullPath = cfgQvecCalibPath;
316316
fullPath += "/eseq";
317317
fullPath += std::to_string(ind);
318318
auto modeCorrQvecEse = getForTsOrRun<TH3F>(fullPath, timestamp, runnumber);
319319
if (!modeCorrQvecEse) {
320-
fullPath = cfgQvecEseCalibPath;
320+
fullPath = cfgQvecCalibPath;
321321
fullPath += "/eseq2";
322322
modeCorrQvecEse = getForTsOrRun<TH3F>(fullPath, timestamp, runnumber);
323323
}
324324
corrsQvecEse.push_back(modeCorrQvecEse);
325325
}
326326

327327
if (cfgShiftCorr) {
328-
shiftProfile.clear();
328+
shiftProfileSp.clear();
329329
for (std::size_t i = 0; i < cfgnMods->size(); i++) {
330330
int ind = cfgnMods->at(i);
331331
fullPath = cfgShiftPath;
332332
fullPath += "/v";
333333
fullPath += std::to_string(ind);
334334
auto objshift = getForTsOrRun<TProfile3D>(fullPath, timestamp, runnumber);
335-
shiftProfile.push_back(objshift);
335+
shiftProfileSp.push_back(objshift);
336+
}
337+
338+
shiftProfileEse.clear();
339+
for (std::size_t i = 0; i < cfgnMods->size(); i++) {
340+
int ind = cfgnMods->at(i);
341+
fullPath = cfgShiftPath;
342+
fullPath += "/eseq"
343+
fullPath += std::to_string(ind);
344+
auto objshift = getForTsOrRun<TProfile3D>(fullPath, timestamp, runnumber);
345+
shiftProfileEse.push_back(objshift);
336346
}
337347
}
338348

@@ -408,7 +418,7 @@ struct qVectorsTable {
408418
/// \param qVecImRaw is the vector with the raw imaginary part of the q-vector for each detector and correction step
409419
/// \param qVecAmp is the vector with the amplitude of the q-vector for each detector and correction step
410420
/// \param normType is the type of normalization to apply to the q-vectors
411-
void normalizeQvec(std::vector<float>& qVecReNorm,
421+
void normalizeQVec(std::vector<float>& qVecReNorm,
412422
std::vector<float>& qVecImNorm,
413423
std::vector<float> qVecReRaw,
414424
std::vector<float> qVecImRaw,
@@ -445,7 +455,7 @@ struct qVectorsTable {
445455
/// \param qVecIm is the vector with the imaginary part of the q-vector for each detector and correction step
446456
/// \param histsCorrs is the vector with the histograms with the correction constants for each detector and correction step
447457
/// \param nMode is the modulation of interest
448-
void correctQvec(float cent, std::vector<float>& qVecRe, std::vector<float>& qVecIm, TH3F* histsCorrs, int nMode)
458+
void correctQVec(float cent, std::vector<float>& qVecRe, std::vector<float>& qVecIm, TH3F* histsCorrs, std::vector<TProfile3D*>& shiftProfile, int nMode)
449459
{
450460
int nCorrections = static_cast<int>(kNCorrections);
451461
if (cent < cfgMaxCentrality) {
@@ -560,7 +570,7 @@ struct qVectorsTable {
560570
/// \param trkTPCNegLabel is the vector with the number of TPC tracks with negative eta
561571
/// \param trkTPCAllLabel is the vector with the number of TPC tracks with any eta
562572
template <typename Nmode, typename CollType, typename TrackType>
563-
void calQvec(const Nmode nMode, const CollType& coll, const TrackType& tracks, std::vector<float>& qVecRe, std::vector<float>& qVecIm, std::vector<float>& qVecAmp, std::vector<int>& trkTPCPosLabel, std::vector<int>& trkTPCNegLabel, std::vector<int>& trkTPCAllLabel)
573+
void calcQVec(const Nmode nMode, const CollType& coll, const TrackType& tracks, std::vector<float>& qVecRe, std::vector<float>& qVecIm, std::vector<float>& qVecAmp, std::vector<int>& trkTPCPosLabel, std::vector<int>& trkTPCNegLabel, std::vector<int>& trkTPCAllLabel)
564574
{
565575
float qVectFT0A[2] = {-999., -999.};
566576
float qVectFT0C[2] = {-999., -999.};
@@ -764,13 +774,13 @@ struct qVectorsTable {
764774
// Raw Q-vectors, no multiplicity normalization and no corrections
765775
std::vector<float> qVecReRaw{};
766776
std::vector<float> qVecImRaw{};
767-
calQvec(nMode, coll, tracks, qVecReRaw, qVecImRaw, qVecAmp, trkTPCPosLabel, trkTPCNegLabel, trkTPCAllLabel);
777+
calcQVec(nMode, coll, tracks, qVecReRaw, qVecImRaw, qVecAmp, trkTPCPosLabel, trkTPCNegLabel, trkTPCAllLabel);
768778

769779
// Scalar Product Q-vectors, normalization by multiplicity/amplitude
770780
std::vector<float> nModeQVecReSp{};
771781
std::vector<float> nModeQVecImSp{};
772-
normalizeQvec(nModeQVecReSp, nModeQVecImSp, qVecReRaw, qVecImRaw, qVecAmp, MultNorms::kScalarProd);
773-
correctQvec(cent, nModeQVecReSp, nModeQVecImSp, corrsQvecSp[id], nMode);
782+
normalizeQVec(nModeQVecReSp, nModeQVecImSp, qVecReRaw, qVecImRaw, qVecAmp, MultNorms::kScalarProd);
783+
correctQVec(cent, nModeQVecReSp, nModeQVecImSp, corrsQvecSp[id], shiftProfileSp, nMode);
774784
// Add to summary vector
775785
qVecReSp.insert(qVecReSp.end(), nModeQVecReSp.begin(), nModeQVecReSp.end());
776786
qVecImSp.insert(qVecImSp.end(), nModeQVecImSp.begin(), nModeQVecImSp.end());
@@ -799,8 +809,8 @@ struct qVectorsTable {
799809
// Ese Q-vectors, normalization by sqrt(multiplicity/amplitude)
800810
std::vector<float> nModeQVecReEse{};
801811
std::vector<float> nModeQVecImEse{};
802-
normalizeQvec(nModeQVecReEse, nModeQVecImEse, qVecReRaw, qVecImRaw, qVecAmp, MultNorms::kEsE);
803-
correctQvec(cent, nModeQVecReEse, nModeQVecImEse, corrsQvecEse[id], nMode);
812+
normalizeQVec(nModeQVecReEse, nModeQVecImEse, qVecReRaw, qVecImRaw, qVecAmp, MultNorms::kEsE);
813+
correctQVec(cent, nModeQVecReEse, nModeQVecImEse, corrsQvecEse[id], shiftProfileEse, nMode);
804814
// Add to summary vector
805815
qVecReEse.insert(qVecReEse.end(), nModeQVecReEse.begin(), nModeQVecReEse.end());
806816
qVecImEse.insert(qVecImEse.end(), nModeQVecImEse.begin(), nModeQVecImEse.end());

0 commit comments

Comments
 (0)