@@ -82,7 +82,7 @@ struct FlowEseTask {
8282 " http://alice-ccdb.cern.ch" , " Address of the CCDB to browse" };
8383 Configurable<int64_t > ccdbNoLaterThan{" ccdbNoLaterThan" , std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now ().time_since_epoch ()).count (), " Latest acceptable timestamp of creation for the object" };
8484 } cfgCcdbParam;
85- Service<o2::ccdb::BasicCCDBManager> ccdb;
85+ Service<o2::ccdb::BasicCCDBManager> ccdb{} ;
8686 o2::ccdb::CcdbApi ccdbApi;
8787
8888 Configurable<float > cfgCentSel{" cfgCentSel" , 80 ., " Centrality selection" };
@@ -204,7 +204,7 @@ struct FlowEseTask {
204204
205205 int currentRunNumber = -999 ;
206206 int lastRunNumber = -999 ;
207- std::vector<TProfile3D*> shiftprofile{} ;
207+ std::vector<TProfile3D*> shiftprofile;
208208 TProfile2D* effMap = nullptr ;
209209 TProfile2D* accMap = nullptr ;
210210
@@ -213,23 +213,25 @@ struct FlowEseTask {
213213 template <typename T>
214214 int getDetId (const T& name)
215215 {
216- if (name.value == " FT0C" ) {
217- return 0 ;
218- } else if (name.value == " FT0A" ) {
216+ if (name.value == " FT0A" ) {
219217 return 1 ;
220- } else if (name.value == " FT0M" ) {
218+ }
219+ if (name.value == " FT0M" ) {
221220 return 2 ;
222- } else if (name.value == " FV0A" ) {
221+ }
222+ if (name.value == " FV0A" ) {
223223 return 3 ;
224- } else if (name.value == " TPCpos" ) {
224+ }
225+ if (name.value == " TPCpos" ) {
225226 return 4 ;
226- } else if (name.value == " TPCneg" ) {
227+ }
228+ if (name.value == " TPCneg" ) {
227229 return 5 ;
228- } else if (name.value == " TPCall" ) {
230+ }
231+ if (name.value == " TPCall" ) {
229232 return 6 ;
230- } else {
231- return 0 ;
232233 }
234+ return 0 ;
233235 }
234236
235237 int q2CentBin (float cent) const
@@ -242,7 +244,7 @@ struct FlowEseTask {
242244
243245 const char * q2GroupSuffix (int group) const
244246 {
245- static constexpr const char * Q2GroupSuffixes[] = {
247+ static constexpr std::array< const char *, NQ2Groups> Q2GroupSuffixes = {
246248 " q2p00_10" , " q2p10_20" , " q2p20_30" , " q2p30_40" , " q2p40_50" ,
247249 " q2p50_60" , " q2p60_70" , " q2p70_80" , " q2p80_90" , " q2p90_100" };
248250 if (group < 0 || group >= NQ2Groups) {
@@ -269,10 +271,10 @@ struct FlowEseTask {
269271 template <typename TCollision>
270272 double getQ2 (TCollision const & collision)
271273 {
272- if (cfgMultCor)
274+ if (cfgMultCor) {
273275 return std::sqrt (collision.qvecFT0CReVec ()[0 ] * collision.qvecFT0CReVec ()[0 ] + collision.qvecFT0CImVec ()[0 ] * collision.qvecFT0CImVec ()[0 ]) * collision.sumAmplFT0C () / std::sqrt (collision.multFT0C ());
274- else
275- return std::sqrt (collision.qvecFT0CReVec ()[0 ] * collision.qvecFT0CReVec ()[0 ] + collision.qvecFT0CImVec ()[0 ] * collision.qvecFT0CImVec ()[0 ]) * std::sqrt (collision.sumAmplFT0C ());
276+ }
277+ return std::sqrt (collision.qvecFT0CReVec ()[0 ] * collision.qvecFT0CReVec ()[0 ] + collision.qvecFT0CImVec ()[0 ] * collision.qvecFT0CImVec ()[0 ]) * std::sqrt (collision.sumAmplFT0C ());
276278 }
277279
278280 void init (o2::framework::InitContext&)
@@ -300,8 +302,10 @@ struct FlowEseTask {
300302
301303 AxisSpec shiftAxis = {10 , 0 , 10 , " shift" };
302304 AxisSpec basisAxis = {20 , 0 , 20 , " basis" };
305+ AxisSpec q2GroupAxis = {10 , 0.0 , 10.0 , " q_{2} percentile group" };
303306
304307 histos.add (" histQvecCent" , " " , {HistType::kTH2F , {q2QaAxis, centQaAxis}});
308+ histos.add (" histEventCountQ2Group" , " " , {HistType::kTH2F , {centQaAxis, q2GroupAxis}});
305309 histos.add (Form (" histVertex" ), " " , {HistType::kTHnSparseF , {vertexAxis, vertexAxis, vertexAxis, centAxis}});
306310 for (int iGroup = 0 ; iGroup < NQ2Groups; ++iGroup) {
307311 histos.add (Form (" histV2_%s" , q2GroupSuffix (iGroup)), " " , {HistType::kTHnSparseF , {centAxis, ptAxis, cosAxis}});
@@ -434,6 +438,13 @@ struct FlowEseTask {
434438 histos.add (Form (" psi%d/QA/EPRes_Det_RefA" , i), " " , {HistType::kTH2F , {centQaAxis, cosAxis}});
435439 histos.add (Form (" psi%d/QA/EPRes_Det_RefB" , i), " " , {HistType::kTH2F , {centQaAxis, cosAxis}});
436440 histos.add (Form (" psi%d/QA/EPRes_RefA_RefB" , i), " " , {HistType::kTH2F , {centQaAxis, cosAxis}});
441+ if (i == CorrLevel[0 ]) {
442+ for (int iGroup = 0 ; iGroup < NQ2Groups; ++iGroup) {
443+ histos.add (Form (" psi2/QA/EPRes_Det_RefA_%s" , q2GroupSuffix (iGroup)), " " , {HistType::kTH2F , {centQaAxis, cosAxis}});
444+ histos.add (Form (" psi2/QA/EPRes_Det_RefB_%s" , q2GroupSuffix (iGroup)), " " , {HistType::kTH2F , {centQaAxis, cosAxis}});
445+ histos.add (Form (" psi2/QA/EPRes_RefA_RefB_%s" , q2GroupSuffix (iGroup)), " " , {HistType::kTH2F , {centQaAxis, cosAxis}});
446+ }
447+ }
437448 histos.add (Form (" psi%d/QA/EP_FT0C_shifted" , i), " " , {HistType::kTH2F , {centQaAxis, epQaAxis}});
438449 histos.add (Form (" psi%d/QA/EP_FT0A_shifted" , i), " " , {HistType::kTH2F , {centQaAxis, epQaAxis}});
439450 histos.add (Form (" psi%d/QA/EP_FV0A_shifted" , i), " " , {HistType::kTH2F , {centQaAxis, epQaAxis}});
@@ -490,7 +501,7 @@ struct FlowEseTask {
490501 ROOT ::Math::PxPyPzMVector protonVec, pionVec, LambdaVec, protonBoostedVec, pionBoostedVec;
491502
492503 template <typename TCollision>
493- bool eventSelected (TCollision collision)
504+ bool eventSelected (TCollision const & collision)
494505 {
495506 if (!collision.sel8 ()) {
496507 return 0 ;
@@ -582,14 +593,16 @@ struct FlowEseTask {
582593
583594 double safeATan2 (double y, double x)
584595 {
585- if (x != 0 )
596+ if (x != 0 ) {
586597 return std::atan2 (y, x);
587- if (y == 0 )
598+ }
599+ if (y == 0 ) {
588600 return 0 ;
589- if (y > 0 )
601+ }
602+ if (y > 0 ) {
590603 return o2::constants::math::PIHalf;
591- else
592- return -o2::constants::math::PIHalf;
604+ }
605+ return -o2::constants::math::PIHalf;
593606 }
594607
595608 template <typename TrackType>
@@ -682,6 +695,63 @@ struct FlowEseTask {
682695 histos.fill (HIST (" psi2/QA/EPRes_Det_RefA" ), centrality, std::cos (std::atan2 (collision.qvecIm ()[qvecDetInd], collision.qvecRe ()[qvecDetInd]) - std::atan2 (collision.qvecIm ()[qvecRefAInd], collision.qvecRe ()[qvecRefAInd])));
683696 histos.fill (HIST (" psi2/QA/EPRes_Det_RefB" ), centrality, std::cos (std::atan2 (collision.qvecIm ()[qvecDetInd], collision.qvecRe ()[qvecDetInd]) - std::atan2 (collision.qvecIm ()[qvecRefBInd], collision.qvecRe ()[qvecRefBInd])));
684697 histos.fill (HIST (" psi2/QA/EPRes_RefA_RefB" ), centrality, std::cos (std::atan2 (collision.qvecIm ()[qvecRefAInd], collision.qvecRe ()[qvecRefAInd]) - std::atan2 (collision.qvecIm ()[qvecRefBInd], collision.qvecRe ()[qvecRefBInd])));
698+ const double epResDetRefA = std::cos (std::atan2 (collision.qvecIm ()[qvecDetInd], collision.qvecRe ()[qvecDetInd]) - std::atan2 (collision.qvecIm ()[qvecRefAInd], collision.qvecRe ()[qvecRefAInd]));
699+ const double epResDetRefB = std::cos (std::atan2 (collision.qvecIm ()[qvecDetInd], collision.qvecRe ()[qvecDetInd]) - std::atan2 (collision.qvecIm ()[qvecRefBInd], collision.qvecRe ()[qvecRefBInd]));
700+ const double epResRefARefB = std::cos (std::atan2 (collision.qvecIm ()[qvecRefAInd], collision.qvecRe ()[qvecRefAInd]) - std::atan2 (collision.qvecIm ()[qvecRefBInd], collision.qvecRe ()[qvecRefBInd]));
701+ switch (q2Group (centrality, getQ2 (collision))) {
702+ case 0 :
703+ histos.fill (HIST (" psi2/QA/EPRes_Det_RefA_q2p00_10" ), centrality, epResDetRefA);
704+ histos.fill (HIST (" psi2/QA/EPRes_Det_RefB_q2p00_10" ), centrality, epResDetRefB);
705+ histos.fill (HIST (" psi2/QA/EPRes_RefA_RefB_q2p00_10" ), centrality, epResRefARefB);
706+ break ;
707+ case 1 :
708+ histos.fill (HIST (" psi2/QA/EPRes_Det_RefA_q2p10_20" ), centrality, epResDetRefA);
709+ histos.fill (HIST (" psi2/QA/EPRes_Det_RefB_q2p10_20" ), centrality, epResDetRefB);
710+ histos.fill (HIST (" psi2/QA/EPRes_RefA_RefB_q2p10_20" ), centrality, epResRefARefB);
711+ break ;
712+ case 2 :
713+ histos.fill (HIST (" psi2/QA/EPRes_Det_RefA_q2p20_30" ), centrality, epResDetRefA);
714+ histos.fill (HIST (" psi2/QA/EPRes_Det_RefB_q2p20_30" ), centrality, epResDetRefB);
715+ histos.fill (HIST (" psi2/QA/EPRes_RefA_RefB_q2p20_30" ), centrality, epResRefARefB);
716+ break ;
717+ case 3 :
718+ histos.fill (HIST (" psi2/QA/EPRes_Det_RefA_q2p30_40" ), centrality, epResDetRefA);
719+ histos.fill (HIST (" psi2/QA/EPRes_Det_RefB_q2p30_40" ), centrality, epResDetRefB);
720+ histos.fill (HIST (" psi2/QA/EPRes_RefA_RefB_q2p30_40" ), centrality, epResRefARefB);
721+ break ;
722+ case 4 :
723+ histos.fill (HIST (" psi2/QA/EPRes_Det_RefA_q2p40_50" ), centrality, epResDetRefA);
724+ histos.fill (HIST (" psi2/QA/EPRes_Det_RefB_q2p40_50" ), centrality, epResDetRefB);
725+ histos.fill (HIST (" psi2/QA/EPRes_RefA_RefB_q2p40_50" ), centrality, epResRefARefB);
726+ break ;
727+ case 5 :
728+ histos.fill (HIST (" psi2/QA/EPRes_Det_RefA_q2p50_60" ), centrality, epResDetRefA);
729+ histos.fill (HIST (" psi2/QA/EPRes_Det_RefB_q2p50_60" ), centrality, epResDetRefB);
730+ histos.fill (HIST (" psi2/QA/EPRes_RefA_RefB_q2p50_60" ), centrality, epResRefARefB);
731+ break ;
732+ case 6 :
733+ histos.fill (HIST (" psi2/QA/EPRes_Det_RefA_q2p60_70" ), centrality, epResDetRefA);
734+ histos.fill (HIST (" psi2/QA/EPRes_Det_RefB_q2p60_70" ), centrality, epResDetRefB);
735+ histos.fill (HIST (" psi2/QA/EPRes_RefA_RefB_q2p60_70" ), centrality, epResRefARefB);
736+ break ;
737+ case 7 :
738+ histos.fill (HIST (" psi2/QA/EPRes_Det_RefA_q2p70_80" ), centrality, epResDetRefA);
739+ histos.fill (HIST (" psi2/QA/EPRes_Det_RefB_q2p70_80" ), centrality, epResDetRefB);
740+ histos.fill (HIST (" psi2/QA/EPRes_RefA_RefB_q2p70_80" ), centrality, epResRefARefB);
741+ break ;
742+ case 8 :
743+ histos.fill (HIST (" psi2/QA/EPRes_Det_RefA_q2p80_90" ), centrality, epResDetRefA);
744+ histos.fill (HIST (" psi2/QA/EPRes_Det_RefB_q2p80_90" ), centrality, epResDetRefB);
745+ histos.fill (HIST (" psi2/QA/EPRes_RefA_RefB_q2p80_90" ), centrality, epResRefARefB);
746+ break ;
747+ case 9 :
748+ histos.fill (HIST (" psi2/QA/EPRes_Det_RefA_q2p90_100" ), centrality, epResDetRefA);
749+ histos.fill (HIST (" psi2/QA/EPRes_Det_RefB_q2p90_100" ), centrality, epResDetRefB);
750+ histos.fill (HIST (" psi2/QA/EPRes_RefA_RefB_q2p90_100" ), centrality, epResRefARefB);
751+ break ;
752+ default :
753+ break ;
754+ }
685755 } else if (nmode == CorrLevel[1 ]) {
686756 histos.fill (HIST (" psi3/QA/EP_Det" ), centrality, std::atan2 (collision.qvecIm ()[qvecDetInd], collision.qvecRe ()[qvecDetInd]) / static_cast <float >(nmode));
687757 histos.fill (HIST (" psi3/QA/EP_RefA" ), centrality, std::atan2 (collision.qvecIm ()[qvecRefAInd], collision.qvecRe ()[qvecRefAInd]) / static_cast <float >(nmode));
@@ -1212,6 +1282,10 @@ struct FlowEseTask {
12121282 histos.fill (HIST (" QA/CentDist" ), centrality, 1.0 );
12131283 histos.fill (HIST (" QA/PVzDist" ), collision.posZ (), 1.0 );
12141284 histos.fill (HIST (" histQvecCent" ), getQ2 (collision), centrality);
1285+ const int q2PercentileGroup = q2Group (centrality, getQ2 (collision));
1286+ if (q2PercentileGroup >= 0 ) {
1287+ histos.fill (HIST (" histEventCountQ2Group" ), centrality, q2PercentileGroup + 0.5 );
1288+ }
12151289
12161290 if (cfgShiftCorr) {
12171291 auto bc = collision.bc_as <aod::BCsWithTimestamps>();
0 commit comments