1212// / \file rho770analysis.cxx
1313// / \brief rho(770)0 analysis in pp 13 & 13.6 TeV
1414// / \author Hyunji Lim (hyunji.lim@cern.ch)
15- // / \since 12 /01/2026
15+ // / \since 14 /01/2026
1616
1717#include < Framework/Configurable.h>
1818#include " Math/Vector4D.h"
@@ -42,11 +42,14 @@ using namespace o2::constants::physics;
4242using LorentzVectorPxPyPzMVector = ROOT::Math::PxPyPzMVector;
4343using LorentzVectorPxPyPzEVector = ROOT::Math::PxPyPzEVector;
4444
45- enum {
46- kKstar
45+ enum class TrackPIDMode {
46+ TPCOrTOF = 0 ,
47+ OnlyTPC = 1 ,
48+ Combined = 2 ,
49+ TPCWithTOFVeto = 3
4750};
4851
49- struct rho770analysis {
52+ struct Rho770Analysis {
5053 SliceCache cache;
5154 HistogramRegistry histos{" histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
5255
@@ -84,7 +87,7 @@ struct rho770analysis {
8487 Configurable<double > cMaxTPCnSigmaPion{" cMaxTPCnSigmaPion" , 5.0 , " TPC nSigma cut for Pion" }; // TPC
8588 Configurable<double > cMaxTPCnSigmaPionnoTOF{" cMaxTPCnSigmaPionnoTOF" , 3.0 , " TPC nSigma cut for Pion in no TOF case" }; // TPC
8689 Configurable<double > nsigmaCutCombinedPion{" nsigmaCutCombinedPion" , 3.0 , " Combined nSigma cut for Pion" };
87- Configurable<int > selectType{" selectType" , 1 , " PID selection type " };
90+ Configurable<PionPIDMode > selectType{" selectType" , TrackPIDMode::OnlyTPC , " Pion PID selection mode " };
8891
8992 // Axis
9093 ConfigurableAxis massAxis{" massAxis" , {400 , 0.2 , 2.2 }, " Invariant mass axis" };
@@ -173,19 +176,19 @@ struct rho770analysis {
173176 template <typename TrackType>
174177 bool selPion (const TrackType track)
175178 {
176- if (selectType == 0 ) { // TPC or TOF
179+ if (selectType == TrackPIDMode::TPCOrTOF ) { // TPC or TOF
177180 if (std::fabs (track.tpcNSigmaPi ()) >= cMaxTPCnSigmaPion || std::fabs (track.tofNSigmaPi ()) >= cMaxTOFnSigmaPion)
178181 return false ;
179182 }
180- if (selectType == 1 ) { // only TPC
183+ if (selectType == TrackPIDMode::OnlyTPC ) { // only TPC
181184 if (std::fabs (track.tpcNSigmaPi ()) >= cMaxTPCnSigmaPion)
182185 return false ;
183186 }
184- if (selectType == 2 ) { // combining
187+ if (selectType == TrackPIDMode::Combined ) { // combining
185188 if (track.tpcNSigmaPi () * track.tpcNSigmaPi () + track.tofNSigmaPi () * track.tofNSigmaPi () >= nsigmaCutCombinedPion * nsigmaCutCombinedPion)
186189 return false ;
187190 }
188- if (selectType == 3 ) { // TPC TOF veto
191+ if (selectType == TrackPIDMode::TPCWithTOFVeto ) { // TPC TOF veto
189192 if (track.hasTOF ()) {
190193 if (std::fabs (track.tpcNSigmaPi ()) >= cMaxTPCnSigmaPion || std::fabs (track.tofNSigmaPi ()) >= cMaxTOFnSigmaPion)
191194 return false ;
@@ -200,19 +203,19 @@ struct rho770analysis {
200203 template <typename TrackType>
201204 bool selKaon (const TrackType track)
202205 {
203- if (selectType == 0 ) {
206+ if (selectType == TrackPIDMode::TPCOrTOF ) {
204207 if (std::fabs (track.tpcNSigmaKa ()) >= cMaxTPCnSigmaPion || std::fabs (track.tofNSigmaKa ()) >= cMaxTOFnSigmaPion)
205208 return false ;
206209 }
207- if (selectType == 1 ) {
210+ if (selectType == TrackPIDMode::OnlyTPC ) {
208211 if (std::fabs (track.tpcNSigmaKa ()) >= cMaxTPCnSigmaPion)
209212 return false ;
210213 }
211- if (selectType == 2 ) {
214+ if (selectType == TrackPIDMode::Combined ) {
212215 if (track.tpcNSigmaKa () * track.tpcNSigmaKa () + track.tofNSigmaKa () * track.tofNSigmaKa () >= nsigmaCutCombinedPion * nsigmaCutCombinedPion)
213216 return false ;
214217 }
215- if (selectType == 3 ) {
218+ if (selectType == TrackPIDMode::TPCWithTOFVeto ) {
216219 if (track.hasTOF ()) {
217220 if (std::fabs (track.tpcNSigmaKa ()) >= cMaxTPCnSigmaPion || std::fabs (track.tofNSigmaKa ()) >= cMaxTOFnSigmaPion)
218221 return false ;
@@ -274,7 +277,7 @@ struct rho770analysis {
274277 histos.fill (HIST (" MCL/hpT_K0s_REC" ), reco.M (), reco.Pt (), multiplicity);
275278 histos.fill (HIST (" MCL/hpT_K0s_pipi_REC" ), reco.M (), reco.Pt (), multiplicity);
276279 }
277- } else if ((std::abs (trk1.pdgCode ()) == kPiPlus && std::abs (trk2.pdgCode ()) == 321 ) || (std::abs (trk1.pdgCode ()) == 321 && std::abs (trk2.pdgCode ()) == kPiPlus )) {
280+ } else if ((std::abs (trk1.pdgCode ()) == kPiPlus && std::abs (trk2.pdgCode ()) == kKPlus ) || (std::abs (trk1.pdgCode ()) == kKPlus && std::abs (trk2.pdgCode ()) == kPiPlus )) {
278281 if (std::abs (trk1.motherPDG ()) == kK0Star892 ) {
279282 histos.fill (HIST (" MCL/hpT_Kstar_REC" ), reco.M (), reco.Pt (), multiplicity);
280283 }
@@ -308,8 +311,8 @@ struct rho770analysis {
308311 if constexpr (IsMC) {
309312 if (trk1.motherId () != trk2.motherId ())
310313 continue ;
311- if ((std::abs (trk1.pdgCode ()) == kPiPlus && std::abs (trk2.pdgCode ()) == 321 ) || (std::abs (trk1.pdgCode ()) == 321 && std::abs (trk2.pdgCode ()) == kPiPlus )) {
312- if (std::abs (trk1.motherPDG ()) == 313 ) {
314+ if ((std::abs (trk1.pdgCode ()) == kPiPlus && std::abs (trk2.pdgCode ()) == kKPlus ) || (std::abs (trk1.pdgCode ()) == kKPlus && std::abs (trk2.pdgCode ()) == kPiPlus )) {
315+ if (std::abs (trk1.motherPDG ()) == kK0Star892 ) {
313316 histos.fill (HIST (" MCL/hpT_Kstar_Kpi_REC" ), reco.M (), reco.Pt (), multiplicity);
314317 }
315318 }
0 commit comments