@@ -112,10 +112,12 @@ struct FlowEventPlane {
112112 // Global objects
113113 float cent = 0 ., mult = 0 .;
114114 float posX = 0 ., posY = 0 ., posZ = 0 .;
115+
115116 std::array<float , 4 > znaXWeigthEnergy = {1 ., 1 ., 1 ., 1 .};
116117 std::array<float , 4 > znaYWeigthEnergy = {1 ., 1 ., 1 ., 1 .};
117118 std::array<float , 4 > zncXWeigthEnergy = {1 ., 1 ., 1 ., 1 .};
118119 std::array<float , 4 > zncYWeigthEnergy = {1 ., 1 ., 1 ., 1 .};
120+
119121 std::vector<std::vector<std::string>> vCoarseCorrHistNames = {
120122 {" hXZNAVsCentVxVyVz" },
121123 {" hYZNAVsCentVxVyVz" },
@@ -126,8 +128,18 @@ struct FlowEventPlane {
126128 {" hYZNAVsCent" , " hYZNAVsVx" , " hYZNAVsVy" , " hYZNAVsVz" },
127129 {" hXZNCVsCent" , " hXZNCVsVx" , " hXZNCVsVy" , " hXZNCVsVz" },
128130 {" hYZNCVsCent" , " hYZNCVsVx" , " hYZNCVsVy" , " hYZNCVsVz" }};
131+
132+ // Map for Correction Type and Histogram Names
129133 std::map<CorrectionType, std::vector<std::vector<std::string>>> corrTypeHistNameMap = {{kFineCorr , vFineCorrHistNames}, {kCoarseCorr , vCoarseCorrHistNames}};
130134
135+ // Structure to hold CCDB objects
136+ struct CcdbObjects {
137+ TList* ccdbList;
138+ TObject* obj;
139+ TProfile* hp;
140+ THnSparseF* hn;
141+ } ccdbObjects;
142+
131143 void init (InitContext const &)
132144 {
133145 // Set CCDB url
@@ -181,14 +193,14 @@ struct FlowEventPlane {
181193 histos.add (" QA/hZNCSignalSector2" , " ZNC Signal Sector 2" , kTH1F , {axisZDCEnergy});
182194 histos.add (" QA/hZNCSignalSector3" , " ZNC Signal Sector 3" , kTH1F , {axisZDCEnergy});
183195 histos.add (" QA/hZNCSignalSector4" , " ZNC Signal Sector 4" , kTH1F , {axisZDCEnergy});
184- histos.add (" CorrHist/hWtXZNA" , " X^{ZNA}_{1}" , kTHnF , {axisCoarseCent, axisCoarseVx, axisCoarseVy, axisCoarseVz});
185- histos.add (" CorrHist/hWtYZNA" , " Y^{ZNA}_{1}" , kTHnF , {axisCoarseCent, axisCoarseVx, axisCoarseVy, axisCoarseVz});
186- histos.add (" CorrHist/hWtXZNC" , " X^{ZNC}_{1}" , kTHnF , {axisCoarseCent, axisCoarseVx, axisCoarseVy, axisCoarseVz});
187- histos.add (" CorrHist/hWtYZNC" , " Y^{ZNC}_{1}" , kTHnF , {axisCoarseCent, axisCoarseVx, axisCoarseVy, axisCoarseVz});
188- histos.add (" CorrHist/hUWtXZNA" , " X^{ZNA}_{1}" , kTHnF , {axisCoarseCent, axisCoarseVx, axisCoarseVy, axisCoarseVz});
189- histos.add (" CorrHist/hUWtYZNA" , " Y^{ZNA}_{1}" , kTHnF , {axisCoarseCent, axisCoarseVx, axisCoarseVy, axisCoarseVz});
190- histos.add (" CorrHist/hUWtXZNC" , " X^{ZNC}_{1}" , kTHnF , {axisCoarseCent, axisCoarseVx, axisCoarseVy, axisCoarseVz});
191- histos.add (" CorrHist/hUWtYZNC" , " Y^{ZNC}_{1}" , kTHnF , {axisCoarseCent, axisCoarseVx, axisCoarseVy, axisCoarseVz});
196+ histos.add (" CorrHist/hWtXZNA" , " X^{ZNA}_{1}" , kTHnSparseF , {axisCoarseCent, axisCoarseVx, axisCoarseVy, axisCoarseVz});
197+ histos.add (" CorrHist/hWtYZNA" , " Y^{ZNA}_{1}" , kTHnSparseF , {axisCoarseCent, axisCoarseVx, axisCoarseVy, axisCoarseVz});
198+ histos.add (" CorrHist/hWtXZNC" , " X^{ZNC}_{1}" , kTHnSparseF , {axisCoarseCent, axisCoarseVx, axisCoarseVy, axisCoarseVz});
199+ histos.add (" CorrHist/hWtYZNC" , " Y^{ZNC}_{1}" , kTHnSparseF , {axisCoarseCent, axisCoarseVx, axisCoarseVy, axisCoarseVz});
200+ histos.add (" CorrHist/hUWtXZNA" , " X^{ZNA}_{1}" , kTHnSparseF , {axisCoarseCent, axisCoarseVx, axisCoarseVy, axisCoarseVz});
201+ histos.add (" CorrHist/hUWtYZNA" , " Y^{ZNA}_{1}" , kTHnSparseF , {axisCoarseCent, axisCoarseVx, axisCoarseVy, axisCoarseVz});
202+ histos.add (" CorrHist/hUWtXZNC" , " X^{ZNC}_{1}" , kTHnSparseF , {axisCoarseCent, axisCoarseVx, axisCoarseVy, axisCoarseVz});
203+ histos.add (" CorrHist/hUWtYZNC" , " Y^{ZNC}_{1}" , kTHnSparseF , {axisCoarseCent, axisCoarseVx, axisCoarseVy, axisCoarseVz});
192204 histos.add (" CorrHist/hXZNAVsCent" , " X^{ZNA}_{1} Vs Cent" , kTProfile , {axisFineCent});
193205 histos.add (" CorrHist/hXZNAVsVx" , " X^{ZNA}_{1} Vs V_{x}" , kTProfile , {axisFineVx});
194206 histos.add (" CorrHist/hXZNAVsVy" , " X^{ZNA}_{1} Vs V_{y}" , kTProfile , {axisFineVy});
@@ -214,6 +226,8 @@ struct FlowEventPlane {
214226 histos.add (" TrackQA/hPtDcaXY" , " DCA_{XY} vs p_{T}" , kTH2F , {axisTrackPt, axisTrackDcaXY});
215227 histos.add (" TrackQA/hPtDcaZ" , " DCA_{Z} vs p_{T}" , kTH2F , {axisTrackPt, axisTrackDcaZ});
216228 histos.add (" DF/hQaQc" , " X^{A}_{1}X^{C}_{1} + Y^{A}_{1}Y^{C}_{1}" , kTProfile , {axisCent});
229+ histos.add (" DF/hAQu" , " u_{x}X^{A}_{1} + u_{y}Y^{A}_{1}" , kTH3F , {axisCent, axisV1, axisTrackEta});
230+ histos.add (" DF/hCQu" , " u_{x}X^{C}_{1} + u_{y}Y^{C}_{1}" , kTH3F , {axisCent, axisV1, axisTrackEta});
217231 histos.add (" DF/hAQuPos" , " u_{x}X^{A}_{1} + u_{y}Y^{A}_{1}" , kTH3F , {axisCent, axisV1, axisTrackEta});
218232 histos.add (" DF/hCQuPos" , " u_{x}X^{C}_{1} + u_{y}Y^{C}_{1}" , kTH3F , {axisCent, axisV1, axisTrackEta});
219233 histos.add (" DF/hAQuNeg" , " u_{x}X^{A}_{1} + u_{y}Y^{A}_{1}" , kTH3F , {axisCent, axisV1, axisTrackEta});
@@ -303,16 +317,18 @@ struct FlowEventPlane {
303317 for (auto const & x : vHistNames) {
304318 int cntry = 0 ;
305319 for (auto const & y : x) {
306- TObject* obj = reinterpret_cast <TObject*>(ccdbObject->FindObject (y.c_str ()));
320+ ccdbObjects. obj = reinterpret_cast <TObject*>(ccdbObject->FindObject (y.c_str ()));
307321 if (corrType == kFineCorr ) {
308- TProfile* hp = reinterpret_cast <TProfile*>(obj->Clone ());
309- vAvgOutput[cntrx] += hp->GetBinContent (hp->GetXaxis ()->FindBin (vCollParam[cntry]));
322+ ccdbObjects.hp = reinterpret_cast <TProfile*>(ccdbObjects.obj ->Clone ());
323+ vAvgOutput[cntrx] += ccdbObjects.hp ->GetBinContent (ccdbObjects.hp ->GetXaxis ()->FindBin (vCollParam[cntry]));
324+ delete ccdbObjects.hp ;
310325 } else {
311- THnF* hn = reinterpret_cast <THnF *>(obj->Clone ());
326+ ccdbObjects. hn = reinterpret_cast <THnSparseF *>(ccdbObjects. obj ->Clone ());
312327 for (int i = 0 ; i < static_cast <int >(vHistNames.size ()); ++i) {
313- binarray[i] = hn->GetAxis (i)->FindBin (vCollParam[i]);
328+ binarray[i] = ccdbObjects. hn ->GetAxis (i)->FindBin (vCollParam[i]);
314329 }
315- vAvgOutput[cntrx] += hn->GetBinContent (hn->GetBin (binarray));
330+ vAvgOutput[cntrx] += ccdbObjects.hn ->GetBinContent (ccdbObjects.hn ->GetBin (binarray));
331+ delete ccdbObjects.hn ;
316332 }
317333 ++cntry;
318334 }
@@ -345,16 +361,16 @@ struct FlowEventPlane {
345361 ccdbPath = static_cast <std::string>(cCcdbPath) + " /CorrItr_" + std::to_string (i + 1 ) + " /Run" + std::to_string (runNumber);
346362
347363 // Get object from CCDB
348- auto ccdbObj = ccdbService->getForTimeStamp <TList>(ccdbPath, -1 );
364+ ccdbObjects. ccdbList = ccdbService->getForTimeStamp <TList>(ccdbPath, -1 );
349365
350366 // Check CCDB Object
351- if (!ccdbObj ) {
367+ if (!ccdbObjects. ccdbList ) {
352368 LOGF (warning, " CCDB OBJECT NOT FOUND" );
353369 return ;
354370 }
355371
356372 // Get averages
357- std::vector<float > vAvg = getAvgCorrFactors (ccdbObj , corrType, inputParam);
373+ std::vector<float > vAvg = getAvgCorrFactors (ccdbObjects. ccdbList , corrType, inputParam);
358374
359375 // Apply correction
360376 outputParam[kXa ] -= vAvg[kXa ];
@@ -514,6 +530,8 @@ struct FlowEventPlane {
514530 v1c = ux * vSP[kXc ] + uy * vSP[kYc ];
515531
516532 // Fill histogram
533+ histos.fill (HIST (" DF/hAQu" ), cent, v1a, track.eta ());
534+ histos.fill (HIST (" DF/hCQu" ), cent, v1c, track.eta ());
517535 if (track.sign () > 0 ) {
518536 histos.fill (HIST (" DF/hAQuPos" ), cent, v1a, track.eta ());
519537 histos.fill (HIST (" DF/hCQuPos" ), cent, v1c, track.eta ());
0 commit comments