3535#include < Framework/HistogramRegistry.h>
3636#include < Framework/HistogramSpec.h>
3737#include < Framework/InitContext.h>
38+ #include < Framework/O2DatabasePDGPlugin.h>
3839#include < Framework/OutputObjHeader.h>
3940#include < Framework/runDataProcessing.h>
4041
41- #include < TDatabasePDG.h>
4242#include < THn.h>
43+ #include < TPDGCode.h>
4344#include < TProfile3D.h>
4445
4546#include < RtypesCore.h>
@@ -60,7 +61,9 @@ using MyTracks = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::T
6061using MyCollisionsMC = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs, aod::McCollisionLabels>;
6162using MyTracksMC = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::McTrackLabels>;
6263
63- struct jEPFlowAnalysis {
64+ struct JEPFlowAnalysis {
65+
66+ Service<o2::framework::O2DatabasePDG> pdg;
6467
6568 HistogramRegistry epFlowHistograms{" EPFlow" , {}, OutputObjHandlingPolicy::AnalysisObject, true , true };
6669 EventPlaneHelper helperEP;
@@ -70,9 +73,9 @@ struct jEPFlowAnalysis {
7073 o2::ccdb::CcdbApi ccdbApi;
7174
7275 struct : ConfigurableGroup {
73- Configurable<std::string> cfgURL{ " cfgURL " ,
76+ Configurable<std::string> cfgUrl{ " cfgUrl " ,
7477 " http://alice-ccdb.cern.ch" , " Address of the CCDB to browse" };
75- Configurable<int64_t > nolaterthan{" ccdb-no-later-than " ,
78+ Configurable<int64_t > nolaterthan{" nolaterthan " ,
7679 std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now ().time_since_epoch ()).count (),
7780 " Latest acceptable timestamp of creation for the object" };
7881 } cfgCcdbParam;
@@ -114,6 +117,7 @@ struct jEPFlowAnalysis {
114117
115118 ConfigurableAxis cfgAxisCent{" cfgAxisCent" , {100 , 0 , 100 }, " " };
116119 ConfigurableAxis cfgAxisPt{" cfgAxisPt" , {VARIABLE_WIDTH, 0.0 , 0.1 , 0.2 , 0.3 , 0.4 , 0.5 , 0.6 , 0.7 , 0.8 , 0.9 , 1.0 , 1.1 , 1.2 , 1.3 , 1.4 , 1.5 , 1.6 , 1.7 , 1.8 , 1.9 , 2.0 , 2.2 , 2.4 , 2.6 , 2.8 , 3.0 , 3.2 , 3.5 , 4.0 , 4.5 , 5.0 , 6.0 , 7.0 , 8.0 , 10.0 , 12.0 , 15.0 , 30.0 , 50.0 , 70.0 , 100.0 }, " " };
120+ ConfigurableAxis cfgAxisEta{" cfgAxisEta" , {20 , -1 , 1 }, " " };
117121 ConfigurableAxis cfgAxisCos{" cfgAxisCos" , {102 , -1.02 , 1.02 }, " " };
118122 ConfigurableAxis cfgAxisQvec{" cfgAxisQvec" , {200 , -5.0 , 5.0 }, " " };
119123
@@ -135,6 +139,8 @@ struct jEPFlowAnalysis {
135139
136140 float cent;
137141
142+ float minQvecAmp = 1e-5 ;
143+ float minChg = 0.1 ;
138144 std::vector<TProfile3D*> shiftprofile{};
139145 std::string fullCCDBShiftCorrPath;
140146
@@ -307,8 +313,8 @@ struct jEPFlowAnalysis {
307313 epFlowHistograms.fill (HIST (" vncos" ), i + 2 , cent, track.pt (), vn, weight);
308314 epFlowHistograms.fill (HIST (" vnsin" ), i + 2 , cent, track.pt (), vnSin, weight);
309315
310- epFlowHistograms.fill (HIST (" SPvnxx" ), i + 2 , cent, track.pt (), (std::cos (track.phi () * static_cast <float >(i + 2 )) * qx_shifted[0 ] + std::sin (track.phi () * static_cast <float >(i + 2 )) * qy_shifted[0 ]), weight);
311- epFlowHistograms.fill (HIST (" SPvnxy" ), i + 2 , cent, track.pt (), (std::sin (track.phi () * static_cast <float >(i + 2 )) * qx_shifted[0 ] - std::cos (track.phi () * static_cast <float >(i + 2 )) * qy_shifted[0 ]), weight);
316+ epFlowHistograms.fill (HIST (" SPvnxx" ), i + 2 , cent, track.pt (), track. eta (), (std::cos (track.phi () * static_cast <float >(i + 2 )) * qx_shifted[0 ] + std::sin (track.phi () * static_cast <float >(i + 2 )) * qy_shifted[0 ]), weight);
317+ epFlowHistograms.fill (HIST (" SPvnxy" ), i + 2 , cent, track.pt (), track. eta (), (std::sin (track.phi () * static_cast <float >(i + 2 )) * qx_shifted[0 ] - std::cos (track.phi () * static_cast <float >(i + 2 )) * qy_shifted[0 ]), weight);
312318 }
313319 }
314320 }
@@ -326,7 +332,7 @@ struct jEPFlowAnalysis {
326332
327333 void init (InitContext const &)
328334 {
329- ccdb->setURL (cfgCcdbParam.cfgURL );
335+ ccdb->setURL (cfgCcdbParam.cfgUrl );
330336 ccdbApi.init (" http://alice-ccdb.cern.ch" );
331337 ccdb->setCaching (true );
332338 ccdb->setLocalObjectValidityChecking ();
@@ -342,6 +348,7 @@ struct jEPFlowAnalysis {
342348
343349 AxisSpec axisCent{cfgAxisCent, " cent" };
344350 AxisSpec axisPt{cfgAxisPt, " pT" };
351+ AxisSpec axisEta{cfgAxisEta, " eta" };
345352 AxisSpec axisCos{cfgAxisCos, " cos" };
346353 AxisSpec axisQvec{cfgAxisQvec, " Qvec" };
347354
@@ -369,8 +376,8 @@ struct jEPFlowAnalysis {
369376 epFlowHistograms.add (" EpResQvecRefARefBxx" , " " , {HistType::kTH3F , {axisMod, axisCent, axisQvec}});
370377 epFlowHistograms.add (" EpResQvecRefARefBxy" , " " , {HistType::kTH3F , {axisMod, axisCent, axisQvec}});
371378
372- epFlowHistograms.add (" SPvnxx" , " " , {HistType::kTHnSparseF , {axisMod, axisCent, axisPt, axisQvec}});
373- epFlowHistograms.add (" SPvnxy" , " " , {HistType::kTHnSparseF , {axisMod, axisCent, axisPt, axisQvec}});
379+ epFlowHistograms.add (" SPvnxx" , " " , {HistType::kTHnSparseF , {axisMod, axisCent, axisPt, axisEta, axisQvec}});
380+ epFlowHistograms.add (" SPvnxy" , " " , {HistType::kTHnSparseF , {axisMod, axisCent, axisPt, axisEta, axisQvec}});
374381
375382 epFlowHistograms.add (" hCentrality" , " " , {HistType::kTH1F , {axisCent}});
376383 epFlowHistograms.add (" hVertex" , " " , {HistType::kTH1F , {axisVertex}});
@@ -416,12 +423,12 @@ struct jEPFlowAnalysis {
416423 }
417424 }
418425
419- if (coll.qvecAmp ()[detId] < 1e-5 || coll.qvecAmp ()[refAId] < 1e-5 || coll.qvecAmp ()[refBId] < 1e-5 )
426+ if (coll.qvecAmp ()[detId] < minQvecAmp || coll.qvecAmp ()[refAId] < minQvecAmp || coll.qvecAmp ()[refBId] < minQvecAmp )
420427 return ;
421428
422429 fillvn (coll, tracks);
423430 }
424- PROCESS_SWITCH (jEPFlowAnalysis , processDefault, " default process" , true );
431+ PROCESS_SWITCH (JEPFlowAnalysis , processDefault, " default process" , true );
425432
426433 void processMCRec (MyCollisionsMC::iterator const & coll, MyTracksMC const & tracks, aod::McParticles const & /* mcParticles*/ , aod::McCollisions const & /* mcCollisions*/ )
427434 {
@@ -445,7 +452,7 @@ struct jEPFlowAnalysis {
445452 }
446453 }
447454
448- for (auto trk : tracks) {
455+ for (const auto & trk : tracks) {
449456 if (!trk.has_mcParticle ()) {
450457 continue ;
451458 }
@@ -461,7 +468,7 @@ struct jEPFlowAnalysis {
461468 }
462469 }
463470 }
464- PROCESS_SWITCH (jEPFlowAnalysis , processMCRec, " process for MC" , false );
471+ PROCESS_SWITCH (JEPFlowAnalysis , processMCRec, " process for MC" , false );
465472
466473 void processMCGen (MyCollisionsMC::iterator const & coll, aod::McParticles const & mcParticles, aod::McCollisions const &)
467474 {
@@ -477,13 +484,13 @@ struct jEPFlowAnalysis {
477484
478485 float cent = coll.centFT0C ();
479486
480- for (auto & mcParticle : mcParticles) {
487+ for (const auto & mcParticle : mcParticles) {
481488 if (std::abs (mcParticle.eta ()) > cfgTrackCuts.cfgEtaMax )
482489 continue ;
483490
484- auto * p = TDatabasePDG::Instance () ->GetParticle (mcParticle.pdgCode ());
485- if (p) {
486- if (std::abs (p->Charge ()) < 1e-1 ) {
491+ auto p = pdg ->GetParticle (mcParticle.pdgCode ());
492+ if (p != nullptr ) {
493+ if (std::abs (p->Charge ()) < minChg ) {
487494 continue ;
488495 }
489496 }
@@ -494,11 +501,11 @@ struct jEPFlowAnalysis {
494501 epFlowHistograms.fill (HIST (" MC/hPartGen" ), cent, mcColl.posZ (), mcParticle.eta (), mcParticle.phi (), mcParticle.pt ());
495502 }
496503 }
497- PROCESS_SWITCH (jEPFlowAnalysis , processMCGen, " process for MC" , false );
504+ PROCESS_SWITCH (JEPFlowAnalysis , processMCGen, " process for MC" , false );
498505};
499506
500507WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
501508{
502509 return WorkflowSpec{
503- adaptAnalysisTask<jEPFlowAnalysis >(cfgc)};
510+ adaptAnalysisTask<JEPFlowAnalysis >(cfgc)};
504511}
0 commit comments