@@ -78,7 +78,7 @@ struct qVectorsCorrection {
7878 Configurable<bool > cfgQAFlowStudy{" cfgQAFlowStudy" , false , " configurable for flow study" };
7979 Configurable<bool > cfgQAOccupancyStudy{" cfgQAOccupancyStudy" , false , " configurable for occupancy study" };
8080 Configurable<bool > cfgAddEvtSelPileup{" cfgAddEvtSelPileup" , false , " configurable for pileup selection" };
81- Configurable<bool > cfgShiftCor{ " cfgShiftCor " , false , " configurable for shift correction" };
81+ Configurable<bool > cfgShiftCorPrep{ " cfgShiftCorPrep " , false , " configurable for shift correction" };
8282
8383 Configurable<float > cfgMinPt{" cfgMinPt" , 0.15 , " Minimum transverse momentum for charged track" };
8484 Configurable<float > cfgMaxEta{" cfgMaxEta" , 0.8 , " Maximum pseudorapidiy for charged track" };
@@ -178,6 +178,9 @@ struct qVectorsCorrection {
178178 AxisSpec axisAzimuth{cfgaxisAzimuth, " relative azimuthal angle" };
179179 AxisSpec axisOccupancy{cfgaxisOccupancy, " Occupancy" };
180180
181+ AxisSpec axisShift = {10 , 0 , 10 , " shift" };
182+ AxisSpec axisBasis = {20 , 0 , 20 , " basis" };
183+
181184 histosQA.add (" histCentFull" , " Centrality distribution for valid events" ,
182185 HistType::kTH1F , {axisCent});
183186
@@ -201,6 +204,10 @@ struct qVectorsCorrection {
201204 histosQA.add (Form (" histQvecRefAFinalV%d" , cfgnMods->at (i)), " " , {HistType::kTH3F , {axisQvec, axisQvec, axisCent}});
202205 histosQA.add (Form (" histQvecRefBFinalV%d" , cfgnMods->at (i)), " " , {HistType::kTH3F , {axisQvec, axisQvec, axisCent}});
203206
207+ if (cfgShiftCorPrep) {
208+ histosQA.add (Form (" histShiftV%d" , cfgnMods->at (i)), " " , {HistType::kTProfile3D , {axisCent, axisBasis, axisShift}});
209+ }
210+
204211 if (cfgQAOccupancyStudy) {
205212 histosQA.add (Form (" histQvecOccFinalV%d" , cfgnMods->at (i)), " " , {HistType::kTHnSparseF , {axisQvecF, axisQvecF, axisCent, axisOccupancy}});
206213 histosQA.add (Form (" histQvecRefAOccFinalV%d" , cfgnMods->at (i)), " " , {HistType::kTHnSparseF , {axisQvecF, axisQvecF, axisCent, axisOccupancy}});
@@ -254,6 +261,49 @@ struct qVectorsCorrection {
254261 }
255262 } // End void init(InitContext const&)
256263
264+ template <typename T>
265+ void fillHistosShiftCor (const T& vec, int nmode)
266+ {
267+ int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2 ) + 3 ;
268+ int RefAInd = RefAId * 4 + cfgnTotalSystem * 4 * (nmode - 2 ) + 3 ;
269+ int RefBInd = RefBId * 4 + cfgnTotalSystem * 4 * (nmode - 2 ) + 3 ;
270+
271+ if (nmode == 2 ) {
272+ for (int ishift = 1 ; ishift <= 10 ; ishift++) {
273+ histosQA.fill (HIST (" histShiftV2" ), vec.cent (), 2.0 * DetId + 0.5 , ishift - 0.5 , TMath::Sin (ishift * static_cast <float >(nmode) * TMath::ATan2 (vec.qvecIm ()[DetInd], vec.qvecRe ()[DetInd]) / static_cast <float >(nmode)));
274+ histosQA.fill (HIST (" histShiftV2" ), vec.cent (), 2.0 * DetId + 1.5 , ishift - 0.5 , TMath::Cos (ishift * static_cast <float >(nmode) * TMath::ATan2 (vec.qvecIm ()[DetInd], vec.qvecRe ()[DetInd]) / static_cast <float >(nmode)));
275+
276+ histosQA.fill (HIST (" histShiftV2" ), vec.cent (), 2.0 * RefAId + 0.5 , ishift - 0.5 , TMath::Sin (ishift * static_cast <float >(nmode) * TMath::ATan2 (vec.qvecIm ()[RefAInd], vec.qvecRe ()[RefAInd]) / static_cast <float >(nmode)));
277+ histosQA.fill (HIST (" histShiftV2" ), vec.cent (), 2.0 * RefAId + 1.5 , ishift - 0.5 , TMath::Cos (ishift * static_cast <float >(nmode) * TMath::ATan2 (vec.qvecIm ()[RefAInd], vec.qvecRe ()[RefAInd]) / static_cast <float >(nmode)));
278+
279+ histosQA.fill (HIST (" histShiftV2" ), vec.cent (), 2.0 * RefBId + 0.5 , ishift - 0.5 , TMath::Sin (ishift * static_cast <float >(nmode) * TMath::ATan2 (vec.qvecIm ()[RefBInd], vec.qvecRe ()[RefBInd]) / static_cast <float >(nmode)));
280+ histosQA.fill (HIST (" histShiftV2" ), vec.cent (), 2.0 * RefBId + 1.5 , ishift - 0.5 , TMath::Cos (ishift * static_cast <float >(nmode) * TMath::ATan2 (vec.qvecIm ()[RefBInd], vec.qvecRe ()[RefBInd]) / static_cast <float >(nmode)));
281+ }
282+ } else if (nmode == 3 ) {
283+ for (int ishift = 1 ; ishift <= 10 ; ishift++) {
284+ histosQA.fill (HIST (" histShiftV3" ), vec.cent (), 2.0 * DetId + 0.5 , ishift - 0.5 , TMath::Sin (ishift * static_cast <float >(nmode) * TMath::ATan2 (vec.qvecIm ()[DetInd], vec.qvecRe ()[DetInd]) / static_cast <float >(nmode)));
285+ histosQA.fill (HIST (" histShiftV3" ), vec.cent (), 2.0 * DetId + 1.5 , ishift - 0.5 , TMath::Cos (ishift * static_cast <float >(nmode) * TMath::ATan2 (vec.qvecIm ()[DetInd], vec.qvecRe ()[DetInd]) / static_cast <float >(nmode)));
286+
287+ histosQA.fill (HIST (" histShiftV3" ), vec.cent (), 2.0 * RefAId + 0.5 , ishift - 0.5 , TMath::Sin (ishift * static_cast <float >(nmode) * TMath::ATan2 (vec.qvecIm ()[RefAInd], vec.qvecRe ()[RefAInd]) / static_cast <float >(nmode)));
288+ histosQA.fill (HIST (" histShiftV3" ), vec.cent (), 2.0 * RefAId + 1.5 , ishift - 0.5 , TMath::Cos (ishift * static_cast <float >(nmode) * TMath::ATan2 (vec.qvecIm ()[RefAInd], vec.qvecRe ()[RefAInd]) / static_cast <float >(nmode)));
289+
290+ histosQA.fill (HIST (" histShiftV3" ), vec.cent (), 2.0 * RefBId + 0.5 , ishift - 0.5 , TMath::Sin (ishift * static_cast <float >(nmode) * TMath::ATan2 (vec.qvecIm ()[RefBInd], vec.qvecRe ()[RefBInd]) / static_cast <float >(nmode)));
291+ histosQA.fill (HIST (" histShiftV3" ), vec.cent (), 2.0 * RefBId + 1.5 , ishift - 0.5 , TMath::Cos (ishift * static_cast <float >(nmode) * TMath::ATan2 (vec.qvecIm ()[RefBInd], vec.qvecRe ()[RefBInd]) / static_cast <float >(nmode)));
292+ }
293+ } else if (nmode == 4 ) {
294+ for (int ishift = 1 ; ishift <= 10 ; ishift++) {
295+ histosQA.fill (HIST (" histShiftV4" ), vec.cent (), 2.0 * DetId + 0.5 , ishift - 0.5 , TMath::Sin (ishift * static_cast <float >(nmode) * TMath::ATan2 (vec.qvecIm ()[DetInd], vec.qvecRe ()[DetInd]) / static_cast <float >(nmode)));
296+ histosQA.fill (HIST (" histShiftV4" ), vec.cent (), 2.0 * DetId + 1.5 , ishift - 0.5 , TMath::Cos (ishift * static_cast <float >(nmode) * TMath::ATan2 (vec.qvecIm ()[DetInd], vec.qvecRe ()[DetInd]) / static_cast <float >(nmode)));
297+
298+ histosQA.fill (HIST (" histShiftV4" ), vec.cent (), 2.0 * RefAId + 0.5 , ishift - 0.5 , TMath::Sin (ishift * static_cast <float >(nmode) * TMath::ATan2 (vec.qvecIm ()[RefAInd], vec.qvecRe ()[RefAInd]) / static_cast <float >(nmode)));
299+ histosQA.fill (HIST (" histShiftV4" ), vec.cent (), 2.0 * RefAId + 1.5 , ishift - 0.5 , TMath::Cos (ishift * static_cast <float >(nmode) * TMath::ATan2 (vec.qvecIm ()[RefAInd], vec.qvecRe ()[RefAInd]) / static_cast <float >(nmode)));
300+
301+ histosQA.fill (HIST (" histShiftV4" ), vec.cent (), 2.0 * RefBId + 0.5 , ishift - 0.5 , TMath::Sin (ishift * static_cast <float >(nmode) * TMath::ATan2 (vec.qvecIm ()[RefBInd], vec.qvecRe ()[RefBInd]) / static_cast <float >(nmode)));
302+ histosQA.fill (HIST (" histShiftV4" ), vec.cent (), 2.0 * RefBId + 1.5 , ishift - 0.5 , TMath::Cos (ishift * static_cast <float >(nmode) * TMath::ATan2 (vec.qvecIm ()[RefBInd], vec.qvecRe ()[RefBInd]) / static_cast <float >(nmode)));
303+ }
304+ }
305+ }
306+
257307 template <typename CollType, typename TrackType>
258308 void fillHistosFlowWithSC (const CollType& coll, const TrackType& track, int nmode)
259309 {
@@ -674,6 +724,12 @@ struct qVectorsCorrection {
674724 return ;
675725 }
676726
727+ if (cfgShiftCorPrep) {
728+ for (uint i = 0 ; i < cfgnMods->size (); i++) {
729+ fillHistosShiftCor (qVec, cfgnMods->at (i));
730+ }
731+ }
732+
677733 for (uint i = 0 ; i < cfgnMods->size (); i++) {
678734 fillHistosQvec (qVec, cfgnMods->at (i));
679735 if (cfgQAFinal && cfgQAFlowStudy) {
@@ -715,7 +771,7 @@ struct qVectorsCorrection {
715771
716772 for (uint i = 0 ; i < cfgnMods->size (); i++) {
717773 fillHistosQvecWithSC (qVec, cfgnMods->at (i));
718- if (cfgQAFlowStudy) {
774+ if (cfgQAFinal && cfgQAFlowStudy) {
719775 fillHistosFlowWithSC (qVec, tracks, cfgnMods->at (i));
720776 }
721777 }
0 commit comments