@@ -69,38 +69,38 @@ using namespace o2::framework::expressions;
6969using namespace o2 ::aod::track;
7070using namespace o2 ::aod::rctsel;
7171
72- AxisSpec ptAxis = {2001 , -0.005 , 20.005 };
73- AxisSpec deltazAxis = {6100 , -6.1 , 6.1 };
74- AxisSpec zAxis = {3001 , -30.1 , 30.1 };
75- AxisSpec phiAxis = {629 , 0 , o2::constants::math::TwoPI, " Rad" , " phi axis" };
76- AxisSpec etaAxis = {18 , -4.6 , -1 .};
77- // AxisSpec dcaXyAxis = {2000, -10, 10};
78- // AxisSpec dcaZAxis = {2000, -10, 10};
79- // AxisSpec dcaXAxis = {2000, -10, 10};
80- // AxisSpec dcaYAxis = {2000, -10, 10};// previous AxisSpec dcaYAxis = {2000, -10, 10};
81-
82- AxisSpec dcaXyAxis = {6000 , -30 , 30 };
83- AxisSpec dcaZAxis = {6000 , -30 , 30 };
84- AxisSpec dcaXAxis = {6000 , -30 , 30 };
85- AxisSpec dcaYAxis = {6000 , -30 , 30 }; // previous AxisSpec dcaYAxis = {2000, -10, 10};
86- // AxisSpec dcaXyAxis = {600, -0.15f, 0.15f};
87- // AxisSpec dcaZAxis = {600, -0.15f, 0.15f};
88- // AxisSpec dcaXAxis = {600, -0.15f, 0.15f};
89- // AxisSpec dcaYAxis = {600, -0.15f, 0.15f};
72+ const AxisSpec ptAxis = {2001 , -0.005 , 20.005 };
73+ const AxisSpec deltazAxis = {6100 , -6.1 , 6.1 };
74+ const AxisSpec zAxis = {3001 , -30.1 , 30.1 };
75+ const AxisSpec phiAxis = {629 , 0 , o2::constants::math::TwoPI, " Rad" , " phi axis" };
76+ const AxisSpec etaAxis = {18 , -4.6 , -1 .};
77+ // const AxisSpec dcaXyAxis = {2000, -10, 10};
78+ // const AxisSpec dcaZAxis = {2000, -10, 10};
79+ // const AxisSpec dcaXAxis = {2000, -10, 10};
80+ // const AxisSpec dcaYAxis = {2000, -10, 10};// previous AxisSpec dcaYAxis = {2000, -10, 10};
81+
82+ const AxisSpec dcaXyAxis = {6000 , -30 , 30 };
83+ const AxisSpec dcaZAxis = {6000 , -30 , 30 };
84+ const AxisSpec dcaXAxis = {6000 , -30 , 30 };
85+ const AxisSpec dcaYAxis = {6000 , -30 , 30 }; // previous AxisSpec dcaYAxis = {2000, -10, 10};
86+ // const AxisSpec dcaXyAxis = {600, -0.15f, 0.15f};
87+ // const AxisSpec dcaZAxis = {600, -0.15f, 0.15f};
88+ // const AxisSpec dcaXAxis = {600, -0.15f, 0.15f};
89+ // const AxisSpec dcaYAxis = {600, -0.15f, 0.15f};
9090// bin width 0.0005 cm: range [-30, 30] cm => 60/0.0005 = 120000 bins
9191// Keep bin width = 0.0005 cm (5 um): range [-1, 1] cm => 2.0/0.0005 = 4000 bins
92- // AxisSpec axisBinsDCA = {600, -0.15f, 0.15f, "#it{dca}_{xy} (cm)"};
93- AxisSpec centAxis = {{0 , 10 , 20 , 30 , 40 , 50 , 60 , 70 , 80 , 100 }};
92+ // const AxisSpec axisBinsDCA = {600, -0.15f, 0.15f, "#it{dca}_{xy} (cm)"};
93+ const AxisSpec centAxis = {{0 , 10 , 20 , 30 , 40 , 50 , 60 , 70 , 80 , 100 }};
9494
9595// Vertex position axes (cm)
96- AxisSpec vxAxis = {200 , -0.5 , 0.5 , " V_{x} (cm)" };
97- AxisSpec vyAxis = {200 , -0.5 , 0.5 , " V_{y} (cm)" };
96+ const AxisSpec vxAxis = {200 , -0.5 , 0.5 , " V_{x} (cm)" };
97+ const AxisSpec vyAxis = {200 , -0.5 , 0.5 , " V_{y} (cm)" };
9898// Status axis for reco/truth (1=reco, 2=true)
99- AxisSpec recoTruthStatusAxis = {2 , 0.5 , 2.5 , " status" };
99+ const AxisSpec recoTruthStatusAxis = {2 , 0.5 , 2.5 , " status" };
100100
101101// Delta-vertex axes (reco - true) in cm
102- AxisSpec deltaVxAxis = {400 , -0.5 , 0.5 , " #DeltaV_{x} = V_{x}^{rec}-V_{x}^{true} (cm)" };
103- AxisSpec deltaVyAxis = {400 , -0.5 , 0.5 , " #DeltaV_{y} = V_{y}^{rec}-V_{y}^{true} (cm)" };
102+ const AxisSpec deltaVxAxis = {400 , -0.5 , 0.5 , " #DeltaV_{x} = V_{x}^{rec}-V_{x}^{true} (cm)" };
103+ const AxisSpec deltaVyAxis = {400 , -0.5 , 0.5 , " #DeltaV_{y} = V_{y}^{rec}-V_{y}^{true} (cm)" };
104104
105105static constexpr TrackSelectionFlags::flagtype TrackSelectionIts =
106106 TrackSelectionFlags::kITSNCls | TrackSelectionFlags::kITSChi2NDF |
@@ -153,10 +153,10 @@ struct PseudorapidityDensityMFT {
153153 Preslice<aod::McParticles> perMcCol = aod::mcparticle::mcCollisionId;
154154 Preslice<aod::Tracks> perColCentral = aod::track::collisionId;
155155
156- Service<o2::framework::O2DatabasePDG> pdg;
156+ Service<o2::framework::O2DatabasePDG> pdg{} ;
157157
158158 // --- CCDB magnetic field (needed for propagateToDCAhelix in this device) ---
159- Service<o2::ccdb::BasicCCDBManager> ccdbMgr;
159+ Service<o2::ccdb::BasicCCDBManager> ccdbMgr{} ;
160160 Configurable<std::string> ccdburlMag{" ccdburlMag" , " http://alice-ccdb.cern.ch" ,
161161 " CCDB url for GRPMagField" };
162162 Configurable<std::string> grpmagPathMag{" grpmagPathMag" , " GLO/Config/GRPMagField" ,
@@ -165,7 +165,7 @@ struct PseudorapidityDensityMFT {
165165 int magRunNumber = -1 ;
166166 float bzMFT = 0 .f;
167167 o2::parameters::GRPMagField* grpmag = nullptr ;
168- static constexpr double CenterMft[ 3 ] = {0 ., 0 ., -61.4 };
168+ static constexpr std::array< double , 3 > CenterMft {0 ., 0 ., -61.4 };
169169
170170 enum class GenRecoCutBin : int {
171171 AllRecoCollisions = 1 ,
@@ -315,9 +315,10 @@ struct PseudorapidityDensityMFT {
315315 o2::base::Propagator::initFieldFromGRP (grpmag);
316316 magRunNumber = bc.runNumber ();
317317
318- auto * field = static_cast <o2::field::MagneticField*>(TGeoGlobalMagField::Instance ()->GetField ());
318+ auto * field = dynamic_cast <o2::field::MagneticField*>(
319+ TGeoGlobalMagField::Instance ()->GetField ());
319320 if (field) {
320- bzMFT = field->getBz (CenterMft);
321+ bzMFT = field->getBz (CenterMft. data () );
321322 LOGP (info, " Initialized magnetic field for run {}: bzMFT={} kG" , magRunNumber, bzMFT);
322323 } else {
323324 LOGF (warning, " TGeoGlobalMagField has no field even after initFieldFromGRP; bzMFT=0" );
@@ -1534,8 +1535,9 @@ struct PseudorapidityDensityMFT {
15341535 ((phi > o2::constants::math::PI - cfgPhiCut) && (phi < o2::constants::math::PI + cfgPhiCut)) ||
15351536 (phi > o2::constants::math::TwoPI - cfgPhiCut) ||
15361537 ((phi > ((o2::constants::math::PIHalf - 0.1 ) * o2::constants::math::PI ) - cfgPhiCut) &&
1537- (phi < ((o2::constants::math::PIHalf - 0.1 ) * o2::constants::math::PI ) + cfgPhiCut)))
1538+ (phi < ((o2::constants::math::PIHalf - 0.1 ) * o2::constants::math::PI ) + cfgPhiCut))) {
15381539 continue ;
1540+ }
15391541 }
15401542
15411543 registry.fill (HIST (" TracksEtaZvtx" ), track.eta (), z);
@@ -1617,7 +1619,7 @@ struct PseudorapidityDensityMFT {
16171619 const auto passEventSelection = [&](auto const & collision) {
16181620 struct EvSelStep {
16191621 bool enabled{false };
1620- decltype (aod::evsel::kIsTriggerTVX ) bit;
1622+ decltype (aod::evsel::kIsTriggerTVX ) bit{} ;
16211623 DataCutBin bin{DataCutBin::All};
16221624 };
16231625
@@ -1874,8 +1876,9 @@ struct PseudorapidityDensityMFT {
18741876 ((phi > o2::constants::math::PI - cfgPhiCut) && (phi < o2::constants::math::PI + cfgPhiCut)) ||
18751877 (phi > o2::constants::math::TwoPI - cfgPhiCut) ||
18761878 ((phi > ((o2::constants::math::PIHalf - 0.1 ) * o2::constants::math::PI ) - cfgPhiCut) &&
1877- (phi < ((o2::constants::math::PIHalf - 0.1 ) * o2::constants::math::PI ) + cfgPhiCut)))
1879+ (phi < ((o2::constants::math::PIHalf - 0.1 ) * o2::constants::math::PI ) + cfgPhiCut))) {
18781880 continue ;
1881+ }
18791882 }
18801883
18811884 registry.fill (HIST (" Tracks/Centrality/EtaZvtx" ), track.eta (), z, c);
@@ -2016,12 +2019,14 @@ struct PseudorapidityDensityMFT {
20162019 if (usePhiCut) {
20172020 if ((phi <= PhiVetoLow) ||
20182021 ((phi >= PhiVetoPiMin) && (phi <= PhiVetoPiMax)) ||
2019- (phi >= PhiVetoHigh))
2022+ (phi >= PhiVetoHigh)) {
20202023 continue ;
2024+ }
20212025 }
20222026 if (usePtCut) {
2023- if (ptCut > cfgnPt)
2027+ if (ptCut > cfgnPt) {
20242028 continue ;
2029+ }
20252030 }
20262031 if (cfgnEta1 < particle.eta () && particle.eta () < cfgnEta2 && (phi > cfgPhiCut1 && phi < cfgPhiCut2)) {
20272032 registry.fill (HIST (" TracksEtaZvtxGen_t" ), particle.eta (),
@@ -2198,7 +2203,7 @@ struct PseudorapidityDensityMFT {
21982203 const auto countAndPassEvSelGenReco = [&](auto const & collision) {
21992204 struct EvSelStep {
22002205 bool enabled{false };
2201- decltype (aod::evsel::kIsTriggerTVX ) bit;
2206+ decltype (aod::evsel::kIsTriggerTVX ) bit{} ;
22022207 GenRecoCutBin bin{GenRecoCutBin::AllRecoCollisions};
22032208 };
22042209
@@ -2330,7 +2335,7 @@ struct PseudorapidityDensityMFT {
23302335 }
23312336
23322337 const int recoCol = track.collisionId ();
2333- if (acceptedRecoCols.find (recoCol) == acceptedRecoCols. end ( )) {
2338+ if (! acceptedRecoCols.contains (recoCol)) {
23342339 continue ;
23352340 }
23362341
@@ -2505,7 +2510,7 @@ struct PseudorapidityDensityMFT {
25052510 const auto countAndPassEvSelGenReco = [&](auto const & collision) {
25062511 struct EvSelStep {
25072512 bool enabled{false };
2508- decltype (aod::evsel::kIsTriggerTVX ) bit;
2513+ decltype (aod::evsel::kIsTriggerTVX ) bit{} ;
25092514 GenRecoCutBin bin{GenRecoCutBin::AllRecoCollisions};
25102515 };
25112516
@@ -2716,7 +2721,7 @@ struct PseudorapidityDensityMFT {
27162721 // std::cout << " track.collisionId() " << track.collisionId() << "track.bestCollisionId()" << track.bestCollisionId() << std::endl; // " track.globalIndex() "<<track.globalIndex() This is track id
27172722
27182723 const int recoCol = originalTrack.collisionId ();
2719- if (acceptedRecoCols.find (recoCol) == acceptedRecoCols. end ( )) {
2724+ if (! acceptedRecoCols.contains (recoCol)) {
27202725 continue ;
27212726 }
27222727
@@ -2840,11 +2845,11 @@ struct PseudorapidityDensityMFT {
28402845 const int mcOfTrack = isTrueByLabel ? track.mcParticle ().mcCollisionId () : InvalidCollisionId;
28412846
28422847 const bool foundRecoColInRecoList =
2843- recoCollisionIds.find (recoCol) != recoCollisionIds. end ( );
2848+ recoCollisionIds.contains (recoCol);
28442849 const bool foundBestColInRecoList =
2845- recoCollisionIds.find (bestColID) != recoCollisionIds. end ( );
2850+ recoCollisionIds.contains (bestColID);
28462851 const bool foundInMCTrueList =
2847- isTrueByLabel && ( trueMCCollisionIds.find (mcOfTrack) != trueMCCollisionIds. end () );
2852+ isTrueByLabel && trueMCCollisionIds.contains (mcOfTrack);
28482853
28492854 static constexpr int RecoColMissingBin = 1 ;
28502855 static constexpr int BestRecoColMissingBin = 2 ;
@@ -3240,12 +3245,14 @@ struct PseudorapidityDensityMFT {
32403245 if (usePhiCut) {
32413246 if ((phi <= PhiVetoLow) ||
32423247 ((phi >= PhiVetoPiMin) && (phi <= PhiVetoPiMax)) ||
3243- (phi >= PhiVetoHigh))
3248+ (phi >= PhiVetoHigh)) {
32443249 continue ;
3250+ }
32453251 }
32463252 if (usePtCut) {
3247- if (ptCut > cfgnPt)
3253+ if (ptCut > cfgnPt) {
32483254 continue ;
3255+ }
32493256 }
32503257 if (cfgnEta1 < particle.eta () && particle.eta () < cfgnEta2 && (phi > cfgPhiCut1 && phi < cfgPhiCut2)) {
32513258 if (onlyVz) {
0 commit comments