3737#include < vector>
3838#include < set>
3939#include < cmath>
40-
40+ # include < TPDGCode.h >
4141//
4242namespace extConfPar
4343{
44- static constexpr int nParDCA = 1 ;
45- static constexpr int nParVaDCA = 2 ;
44+ static constexpr int NParDCA = 1 ;
45+ static constexpr int NParVaDCA = 2 ;
4646static const std::vector<std::string> parClassDCA{" TrVtx" };
4747static const std::vector<std::string> parNameDCA{" dcaXY" , " dcaZ" };
48- static const float parTableDCA[nParDCA][nParVaDCA]{{9999 .f , 99999 .f }};
49- static constexpr int nParPID = 2 ;
50- static constexpr int nParVaPID = 6 ;
48+ static const float parTableDCA[NParDCA][NParVaDCA]{{9999 .f , 99999 .f }};
49+ static constexpr int NParPID = 2 ;
50+ static constexpr int NParVaPID = 6 ;
51+ static constexpr int kNumberOfITSLayers = 7 ;
52+
5153static const std::vector<std::string> parClassPID{" TPC" , " TOF" };
5254static const std::vector<std::string> parNamePID{" nSigPionMin" , " nSigPionMax" , " nSigKaonMin" , " nSigKaonMax" , " nSigProtonMin" , " nSigProtonMax" };
53- static const float parTablePID[nParPID][nParVaPID ]{
55+ static const float parTablePID[NParPID][NParVaPID ]{
5456 {-99999 .f , 999999 .f , -99999 .f , 999999 .f , -99999 .f , 999999 .f },
5557 {-99999 .f , 999999 .f , -99999 .f , 999999 .f , -99999 .f , 999999 .f }};
5658} // namespace extConfPar
@@ -130,8 +132,8 @@ struct qaMatchEff {
130132 //
131133 //
132134 // DCA and PID cuts
133- Configurable<LabeledArray<float >> dcaMaxCut{" dcaMaxCut" , {parTableDCA[0 ], nParDCA, nParVaDCA , parClassDCA, parNameDCA}, " Track DCA cuts" };
134- Configurable<LabeledArray<float >> nSigmaPID{" nSigmaPID" , {parTablePID[0 ], nParPID, nParVaPID , parClassPID, parNamePID}, " PID nSigma cuts TPC and TOF" };
135+ Configurable<LabeledArray<float >> dcaMaxCut{" dcaMaxCut" , {parTableDCA[0 ], NParDCA, NParVaDCA , parClassDCA, parNameDCA}, " Track DCA cuts" };
136+ Configurable<LabeledArray<float >> nSigmaPID{" nSigmaPID" , {parTablePID[0 ], NParPID, NParVaPID , parClassPID, parNamePID}, " PID nSigma cuts TPC and TOF" };
135137 // TPC
136138 Configurable<int > tpcNClusterMin{" tpcNClusterMin" , 0 , " Minimum number of clusters in TPC" };
137139 Configurable<int > tpcNCrossedRowsMin{" tpcNCrossedRowsMin" , 70 , " Minimum number of crossed rows in TPC" };
@@ -248,7 +250,7 @@ struct qaMatchEff {
248250 cutObject.SetMaxChi2PerClusterITS (itsChi2Max);
249251 // ITS hitmap
250252 std::set<uint8_t > set_customITShitmap; // = {};
251- for (int index_ITSlayer = 0 ; index_ITSlayer < 7 ; index_ITSlayer++) {
253+ for (int index_ITSlayer = 0 ; index_ITSlayer < kNumberOfITSLayers ; index_ITSlayer++) {
252254 if ((customITShitmap & (1 << index_ITSlayer)) > 0 ) {
253255 set_customITShitmap.insert (static_cast <uint8_t >(index_ITSlayer));
254256 }
@@ -287,7 +289,7 @@ struct qaMatchEff {
287289 }
288290 if (customAnaTrkSel.isChangeAnalysisITSHitmap ) {
289291 std::set<uint8_t > set_customITShitmap; // = {};
290- for (int index_ITSlayer = 0 ; index_ITSlayer < 7 ; index_ITSlayer++) {
292+ for (int index_ITSlayer = 0 ; index_ITSlayer < kNumberOfITSLayers ; index_ITSlayer++) {
291293 if ((customITShitmap & (1 << index_ITSlayer)) > 0 ) {
292294 set_customITShitmap.insert (static_cast <uint8_t >(index_ITSlayer));
293295 }
@@ -1502,7 +1504,7 @@ struct qaMatchEff {
15021504 float hasdet = -999 .f ;
15031505 //
15041506 //
1505- for (auto & track : tracks) {
1507+ for (const auto & track : tracks) {
15061508 // choose if we keep the track according to the TRD presence requirement
15071509 if ((isTRDThere == 1 ) && !track.hasTRD ())
15081510 continue ;
@@ -1598,22 +1600,22 @@ struct qaMatchEff {
15981600 int sayPrim = -99 , specind = -9999 ;
15991601 if constexpr (IS_MC) {
16001602 auto mcpart = track.mcParticle ();
1601- auto siPDGCode = mcpart.pdgCode ();
1602- auto tpPDGCode = std::abs (siPDGCode);
1603- if (mcpart.isPhysicalPrimary ()) {
1603+ siPDGCode = mcpart.pdgCode ();
1604+ tpPDGCode = std::abs (siPDGCode);
1605+ // if (mcpart.isPhysicalPrimary()) {
16041606 // histos.get<TH1>(HIST("MC/control/etahist_diff"))->Fill(mcpart.eta() - track.eta());
1605- auto delta = RecoDecay::constrainAngle (mcpart.phi () - track.phi (), -o2::constants::math::PI );
1606- if (delta > o2::constants::math::PI) {
1607- delta -= o2::constants::math::TwoPI;
1608- }
1609- if (delta < o2::constants::math::PI) {
1610- delta += o2::constants::math::TwoPI;
1611- }
1607+ // auto delta = RecoDecay::constrainAngle(mcpart.phi() - track.phi());
1608+ // if (delta > o2::constants::math::PI) {
1609+ // delta -= o2::constants::math::TwoPI;
1610+ // }
1611+ // if (delta < o2::constants::math::PI) {
1612+ // delta += o2::constants::math::TwoPI;
1613+ // }
16121614 // histos.get<TH1>(HIST("MC/control/phihist_diff"))->Fill(delta);
1613- }
1615+ // }
16141616
16151617 // / MC info for THnSparse filling
1616- sayPrim = -99 ;
1618+ int sayPrim = -99 ;
16171619 specind = -9999 ;
16181620 if (mcpart.isPhysicalPrimary ())
16191621 sayPrim = 0 ;
@@ -1683,7 +1685,7 @@ struct qaMatchEff {
16831685 if (makethn) {
16841686 if constexpr (IS_MC) {
16851687 histos.fill (HIST (" MC/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), specind, signOfTrack, hasdet);
1686- if (siPDGCode == 211 || siPDGCode == 321 ) // pions and kaons together
1688+ if (siPDGCode == PDG_t:: kPiPlus || siPDGCode == PDG_t:: kKPlus ) // pions and kaons together
16871689 histos.fill (HIST (" MC/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), 10 , signOfTrack, hasdet);
16881690 } else {
16891691 histos.fill (HIST (" data/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), specind, signOfTrack, hasdet);
@@ -1700,7 +1702,7 @@ struct qaMatchEff {
17001702 if (makethn) {
17011703 if constexpr (IS_MC) {
17021704 histos.fill (HIST (" MC/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), specind, signOfTrack, hasdet);
1703- if (siPDGCode == 211 || siPDGCode == 321 ) // pions and kaons together
1705+ if (siPDGCode == PDG_t:: kPiPlus || siPDGCode == PDG_t:: kKPlus ) // pions and kaons together
17041706 histos.fill (HIST (" MC/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), 10 , signOfTrack, hasdet);
17051707 } else {
17061708 histos.fill (HIST (" data/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), specind, signOfTrack, hasdet);
@@ -1717,7 +1719,7 @@ struct qaMatchEff {
17171719 if (makethn) {
17181720 if constexpr (IS_MC) {
17191721 histos.fill (HIST (" MC/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), specind, signOfTrack, hasdet);
1720- if (siPDGCode == 211 || siPDGCode == 321 ) // pions and kaons together
1722+ if (siPDGCode == PDG_t:: kPiPlus || siPDGCode == PDG_t:: kKPlus ) // pions and kaons together
17211723 histos.fill (HIST (" MC/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), 10 , signOfTrack, hasdet);
17221724 } else {
17231725 histos.fill (HIST (" data/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), specind, signOfTrack, hasdet);
@@ -1734,7 +1736,7 @@ struct qaMatchEff {
17341736 if (makethn) {
17351737 if constexpr (IS_MC) {
17361738 histos.fill (HIST (" MC/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), specind, signOfTrack, hasdet);
1737- if (siPDGCode == 211 || siPDGCode == 321 ) // pions and kaons together
1739+ if (siPDGCode == PDG_t:: kPiPlus || siPDGCode == PDG_t:: kKPlus ) // pions and kaons together
17381740 histos.fill (HIST (" MC/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), 10 , signOfTrack, hasdet);
17391741 } else {
17401742 histos.fill (HIST (" data/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), specind, signOfTrack, hasdet);
@@ -1751,7 +1753,7 @@ struct qaMatchEff {
17511753 if (makethn) {
17521754 if constexpr (IS_MC) {
17531755 histos.fill (HIST (" MC/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), specind, signOfTrack, hasdet);
1754- if (siPDGCode == 211 || siPDGCode == 321 ) // pions and kaons together
1756+ if (siPDGCode == PDG_t:: kPiPlus || siPDGCode == PDG_t:: kKPlus ) // pions and kaons together
17551757 histos.fill (HIST (" MC/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), 10 , signOfTrack, hasdet);
17561758 } else {
17571759 histos.fill (HIST (" data/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), specind, signOfTrack, hasdet);
@@ -1768,7 +1770,7 @@ struct qaMatchEff {
17681770 if (makethn) {
17691771 if constexpr (IS_MC) {
17701772 histos.fill (HIST (" MC/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), specind, signOfTrack, hasdet);
1771- if (siPDGCode == 211 || siPDGCode == 321 ) // pions and kaons together
1773+ if (siPDGCode == PDG_t:: kPiPlus || siPDGCode == PDG_t:: kKPlus ) // pions and kaons together
17721774 histos.fill (HIST (" MC/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), 10 , signOfTrack, hasdet);
17731775 } else {
17741776 histos.fill (HIST (" data/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), specind, signOfTrack, hasdet);
@@ -1785,7 +1787,7 @@ struct qaMatchEff {
17851787 if (makethn) {
17861788 if constexpr (IS_MC) {
17871789 histos.fill (HIST (" MC/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), specind, signOfTrack, hasdet);
1788- if (siPDGCode == 211 || siPDGCode == 321 ) // pions and kaons together
1790+ if (siPDGCode == PDG_t:: kPiPlus || siPDGCode == PDG_t:: kKPlus ) // pions and kaons together
17891791 histos.fill (HIST (" MC/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), 10 , signOfTrack, hasdet);
17901792 } else {
17911793 histos.fill (HIST (" data/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), specind, signOfTrack, hasdet);
@@ -1802,7 +1804,7 @@ struct qaMatchEff {
18021804 if (makethn) {
18031805 if constexpr (IS_MC) {
18041806 histos.fill (HIST (" MC/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), specind, signOfTrack, hasdet);
1805- if (siPDGCode == 211 || siPDGCode == 321 ) // pions and kaons together
1807+ if (siPDGCode == PDG_t:: kPiPlus || siPDGCode == PDG_t:: kKPlus ) // pions and kaons together
18061808 histos.fill (HIST (" MC/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), 10 , signOfTrack, hasdet);
18071809 } else {
18081810 histos.fill (HIST (" data/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), specind, signOfTrack, hasdet);
@@ -1819,7 +1821,7 @@ struct qaMatchEff {
18191821 if (makethn) {
18201822 if constexpr (IS_MC) {
18211823 histos.fill (HIST (" MC/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), specind, signOfTrack, hasdet);
1822- if (siPDGCode == 211 || siPDGCode == 321 ) // pions and kaons together
1824+ if (siPDGCode == PDG_t:: kPiPlus || siPDGCode == PDG_t:: kKPlus ) // pions and kaons together
18231825 histos.fill (HIST (" MC/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), 10 , signOfTrack, hasdet);
18241826 } else {
18251827 histos.fill (HIST (" data/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), specind, signOfTrack, hasdet);
@@ -1836,7 +1838,7 @@ struct qaMatchEff {
18361838 if (makethn) {
18371839 if constexpr (IS_MC) {
18381840 histos.fill (HIST (" MC/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), specind, signOfTrack, hasdet);
1839- if (siPDGCode == 211 || siPDGCode == 321 ) // pions and kaons together
1841+ if (siPDGCode == PDG_t:: kPiPlus || siPDGCode == PDG_t:: kKPlus ) // pions and kaons together
18401842 histos.fill (HIST (" MC/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), 10 , signOfTrack, hasdet);
18411843 } else {
18421844 histos.fill (HIST (" data/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), specind, signOfTrack, hasdet);
@@ -1853,7 +1855,7 @@ struct qaMatchEff {
18531855 if (makethn) {
18541856 if constexpr (IS_MC) {
18551857 histos.fill (HIST (" MC/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), specind, signOfTrack, hasdet);
1856- if (siPDGCode == 211 || siPDGCode == 321 ) // pions and kaons together
1858+ if (siPDGCode == PDG_t:: kPiPlus || siPDGCode == PDG_t:: kKPlus ) // pions and kaons together
18571859 histos.fill (HIST (" MC/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), 10 , signOfTrack, hasdet);
18581860 } else {
18591861 histos.fill (HIST (" data/sparse/thnsforfrac" ), track.dcaXY (), track.dcaZ (), trackPt, track.eta (), sayPrim, track.phi (), specind, signOfTrack, hasdet);
@@ -1888,19 +1890,19 @@ struct qaMatchEff {
18881890
18891891 // TPC clusters all pions MC truth
18901892 //
1891- if (tpPDGCode == 211 ) {
1893+ if (tpPDGCode == PDG_t:: kPiPlus ) {
18921894 histos.get <TH1>(HIST (" MC/TPCclust/tpcNClsFound_piMC" ))->Fill (clustpc);
18931895 // histos.get<TH1>(HIST("MC/TPCclust/tpcNClsFindable_piMC"))->Fill(findcltpc);
18941896 // histos.get<TH1>(HIST("MC/TPCclust/tpcCrossedRows_piMC"))->Fill(crowstpc);
18951897 // histos.get<TH1>(HIST("MC/TPCclust/tpcsFindableMinusCrossedRows_piMC"))->Fill(crowstpc);
18961898 }
1897- if (tpPDGCode == 321 ) {
1899+ if (tpPDGCode == PDG_t:: kKPlus ) {
18981900 histos.get <TH1>(HIST (" MC/TPCclust/tpcNClsFound_kaMC" ))->Fill (clustpc);
18991901 // histos.get<TH1>(HIST("MC/TPCclust/tpcNClsFindable_kaMC"))->Fill(findcltpc);
19001902 // histos.get<TH1>(HIST("MC/TPCclust/tpcCrossedRows_kaMC"))->Fill(crowstpc);
19011903 // histos.get<TH1>(HIST("MC/TPCclust/tpcsFindableMinusCrossedRows_kaMC"))->Fill(crowstpc);
19021904 }
1903- if (tpPDGCode == 2212 ) {
1905+ if (tpPDGCode == PDG_t:: kProton ) {
19041906 histos.get <TH1>(HIST (" MC/TPCclust/tpcNClsFound_prMC" ))->Fill (clustpc);
19051907 // histos.get<TH1>(HIST("MC/TPCclust/tpcNClsFindable_prMC"))->Fill(findcltpc);
19061908 // histos.get<TH1>(HIST("MC/TPCclust/tpcCrossedRows_prMC"))->Fill(crowstpc);
@@ -2941,7 +2943,7 @@ struct qaMatchEff {
29412943 } // end if secondaries from material
29422944 //
29432945 // protons only
2944- if (tpPDGCode == 2212 ) {
2946+ if (tpPDGCode == PDG_t:: kProton ) {
29452947 if (trkWTPC && isTrackSelectedTPCCuts (track)) {
29462948 //
29472949 // TPC clusters
@@ -3009,7 +3011,7 @@ struct qaMatchEff {
30093011 }
30103012 //
30113013 // pions only
3012- if (tpPDGCode == 211 ) {
3014+ if (tpPDGCode == PDG_t:: kPiPlus ) {
30133015 if (trkWTPC && isTrackSelectedTPCCuts (track)) {
30143016 //
30153017 // TPC clusters
@@ -3119,7 +3121,7 @@ struct qaMatchEff {
31193121 } // end pions only
31203122 //
31213123 // no primary/sec-d pions
3122- if (!((tpPDGCode == 211 ) && (mcpart.isPhysicalPrimary ()))) {
3124+ if (!((tpPDGCode == PDG_t:: kPiPlus ) && (mcpart.isPhysicalPrimary ()))) {
31233125 // gets the pdg code and finds its index in our vector
31243126 itr_pdg = std::find (pdgChoice.begin (), pdgChoice.end (), tpPDGCode);
31253127 if (itr_pdg != pdgChoice.cend ())
@@ -3144,7 +3146,7 @@ struct qaMatchEff {
31443146 } // end if not prim/sec-d pi
31453147 //
31463148 // kaons only
3147- if (tpPDGCode == 321 ) {
3149+ if (tpPDGCode == PDG_t:: kKPlus ) {
31483150 if (trkWTPC && isTrackSelectedTPCCuts (track)) {
31493151 //
31503152 // TPC clusters
@@ -3212,7 +3214,7 @@ struct qaMatchEff {
32123214 }
32133215 //
32143216 // pions and kaons together
3215- if (tpPDGCode == 211 || tpPDGCode == 321 ) {
3217+ if (tpPDGCode == PDG_t:: kPiPlus || tpPDGCode == PDG_t:: kKPlus ) {
32163218 if (trkWTPC && isTrackSelectedTPCCuts (track)) {
32173219 histos.get <TH1>(HIST (" MC/PID/pthist_tpc_piK" ))->Fill (trackPt);
32183220 histos.get <TH1>(HIST (" MC/PID/phihist_tpc_piK" ))->Fill (track.phi ());
0 commit comments