@@ -78,7 +78,7 @@ struct OnTheFlyRichPid {
7878 Produces<aod::UpgradeRichSignal> upgradeRichSignal;
7979
8080 // necessary for particle charges
81- Service<o2::framework::O2DatabasePDG> pdg {};
81+ Service<o2::framework::O2DatabasePDG> pdgDatabase {};
8282 // Necessary for LUTs
8383 Service<o2::ccdb::BasicCCDBManager> ccdb{};
8484
@@ -359,19 +359,19 @@ struct OnTheFlyRichPid {
359359 histos.add (" hSectorID" , " hSectorID" , kTH1F , {axisSector});
360360
361361 const int kNspec = 9 ; // electron, muon, pion, kaon, proton, deuteron, triton, helium3, alpha
362- std::string particleNames1[ kNspec ] = {" #it{e}" , " #it{#mu}" , " #it{#pi}" , " #it{K}" , " #it{p}" , " #it{d}" , " #it{t}" , " ^{3}He" , " #it{#alpha}" };
363- std::string particleNames2[ kNspec ] = {" Elec" , " Muon" , " Pion" , " Kaon" , " Prot" , " Deut" , " Trit" , " He3" , " Al" };
362+ const std::array<std:: string, kNspec > particleNames1 = {" #it{e}" , " #it{#mu}" , " #it{#pi}" , " #it{K}" , " #it{p}" , " #it{d}" , " #it{t}" , " ^{3}He" , " #it{#alpha}" };
363+ const std::array<std:: string, kNspec > particleNames2 = {" Elec" , " Muon" , " Pion" , " Kaon" , " Prot" , " Deut" , " Trit" , " He3" , " Al" };
364364 for (int iTrue = 0 ; iTrue < kNspec ; iTrue++) {
365- std::string nameTitleBarrelTrackRes = " h2dBarrelAngularResTrack" + particleNames2[iTrue] + " VsP" ;
366- std::string nameTitleBarrelTotalRes = " h2dBarrelAngularResTotal" + particleNames2[iTrue] + " VsP" ;
365+ const std::string nameTitleBarrelTrackRes = " h2dBarrelAngularResTrack" + particleNames2[iTrue] + " VsP" ;
366+ const std::string nameTitleBarrelTotalRes = " h2dBarrelAngularResTotal" + particleNames2[iTrue] + " VsP" ;
367367 const AxisSpec axisTrackAngularRes{static_cast <int >(nBinsAngularRes), 0 .0f , +5 .0f , " Track angular resolution - " + particleNames1[iTrue] + " (mrad)" };
368368 const AxisSpec axisTotalAngularRes{static_cast <int >(nBinsAngularRes), 0 .0f , +5 .0f , " Total angular resolution - " + particleNames1[iTrue] + " (mrad)" };
369369 histos.add (nameTitleBarrelTrackRes.c_str (), nameTitleBarrelTrackRes.c_str (), kTH2F , {axisMomentum, axisTrackAngularRes});
370370 histos.add (nameTitleBarrelTotalRes.c_str (), nameTitleBarrelTotalRes.c_str (), kTH2F , {axisMomentum, axisTotalAngularRes});
371371 }
372372 for (int iTrue = 0 ; iTrue < kNspec ; iTrue++) {
373373 for (int iHyp = 0 ; iHyp < kNspec ; iHyp++) {
374- std::string nameTitle = " h2dBarrelNsigmaTrue" + particleNames2[iTrue] + " Vs" + particleNames2[iHyp] + " Hypothesis" ;
374+ const std::string nameTitle = " h2dBarrelNsigmaTrue" + particleNames2[iTrue] + " Vs" + particleNames2[iHyp] + " Hypothesis" ;
375375 if (iTrue == iHyp) {
376376 const AxisSpec axisNsigmaCorrect{static_cast <int >(nBinsNsigmaCorrectSpecies), -10 .0f , +10 .0f , " N#sigma - True " + particleNames1[iTrue] + " vs " + particleNames1[iHyp] + " hypothesis" };
377377 histos.add (nameTitle.c_str (), nameTitle.c_str (), kTH2F , {axisMomentum, axisNsigmaCorrect});
@@ -578,9 +578,9 @@ struct OnTheFlyRichPid {
578578 // float zSecTof = detCenters[iSecor].Z();
579579 const float rSecRichSquared = rSecRich * rSecRich;
580580 const float zSecRichSquared = zSecRich * zSecRich;
581- const float radiusRipple = (rSecRichSquared + zSecRichSquared) / (rSecRich + zSecRich / std::tan (polar));
582- const float zRipple = radiusRipple / std::tan (polar);
583- const float absZ = std::hypot (radiusRipple - rSecRich, zRipple - zSecRich);
581+ const float radRipple = (rSecRichSquared + zSecRichSquared) / (rSecRich + zSecRich / std::tan (polar));
582+ const float zRipple = radRipple / std::tan (polar);
583+ const float absZ = std::hypot (radRipple - rSecRich, zRipple - zSecRich);
584584 float fraction = 1 .;
585585 if (tileZlength / 2 . - absZ < radius) {
586586 fraction = fraction - (1 . / o2::constants::math::PI ) * std::acos ((tileZlength / 2 . - absZ) / radius);
@@ -727,7 +727,7 @@ struct OnTheFlyRichPid {
727727 // First we compute the number of charged particles in the event
728728 float dNdEta = 0 .f ;
729729 if (flagRICHLoadDelphesLUTs) {
730- for (const auto & track : tracks) {
730+ for (const auto & track : tracks) { // We first compute the number of charged particles in the event
731731 if (!track.has_mcParticle ()) {
732732 continue ;
733733 }
@@ -738,7 +738,7 @@ struct OnTheFlyRichPid {
738738 if (mcParticle.has_daughters ()) {
739739 continue ;
740740 }
741- const auto & pdgInfo = pdg ->GetParticle (mcParticle.pdgCode ());
741+ const auto & pdgInfo = pdgDatabase ->GetParticle (mcParticle.pdgCode ());
742742 if (!pdgInfo) {
743743 // LOG(warning) << "PDG code " << mcParticle.pdgCode() << " not found in the database";
744744 continue ;
@@ -772,7 +772,7 @@ struct OnTheFlyRichPid {
772772 }
773773
774774 // get particle to calculate Cherenkov angle and resolution
775- auto pdgInfo = pdg ->GetParticle (mcParticle.pdgCode ());
775+ const & auto pdgInfo = pdgDatabase ->GetParticle (mcParticle.pdgCode ());
776776 if (pdgInfo == nullptr ) {
777777 fillDummyValues ();
778778 continue ;
0 commit comments