@@ -41,7 +41,7 @@ using namespace o2::constants::physics;
4141using LorentzVectorPxPyPzMVector = ROOT::Math::PxPyPzMVector;
4242using LorentzVectorPxPyPzEVector = ROOT::Math::PxPyPzEVector;
4343
44- enum class TrackPIDMode {
44+ enum class TrackPIDMode : int {
4545 TPCOrTOF = 0 ,
4646 OnlyTPC = 1 ,
4747 Combined = 2 ,
@@ -86,7 +86,7 @@ struct rho770analysis {
8686 Configurable<double > cMaxTPCnSigmaPion{" cMaxTPCnSigmaPion" , 5.0 , " TPC nSigma cut for Pion" }; // TPC
8787 Configurable<double > cMaxTPCnSigmaPionnoTOF{" cMaxTPCnSigmaPionnoTOF" , 3.0 , " TPC nSigma cut for Pion in no TOF case" }; // TPC
8888 Configurable<double > nsigmaCutCombinedPion{" nsigmaCutCombinedPion" , 3.0 , " Combined nSigma cut for Pion" };
89- Configurable<TrackPIDMode> selectType {" selectType" , TrackPIDMode::OnlyTPC, " Pion PID selection mode" };
89+ Configurable<int > selectTypeInt {" selectType" , static_cast < int >( TrackPIDMode::OnlyTPC) , " Pion PID selection mode: 0=TPCOrTOF, 1=OnlyTPC, 2=Combined, 3=TPCWithTOFVeto " };
9090
9191 // Axis
9292 ConfigurableAxis massAxis{" massAxis" , {400 , 0.2 , 2.2 }, " Invariant mass axis" };
@@ -175,19 +175,21 @@ struct rho770analysis {
175175 template <typename TrackType>
176176 bool selPion (const TrackType track)
177177 {
178- if (selectType == TrackPIDMode::TPCOrTOF) { // TPC or TOF
178+ const auto mode = static_cast <TrackPIDMode>(selectTypeInt.value );
179+
180+ if (mode == TrackPIDMode::TPCOrTOF) { // TPC or TOF
179181 if (std::fabs (track.tpcNSigmaPi ()) >= cMaxTPCnSigmaPion || std::fabs (track.tofNSigmaPi ()) >= cMaxTOFnSigmaPion)
180182 return false ;
181183 }
182- if (selectType == TrackPIDMode::OnlyTPC) { // only TPC
184+ if (mode == TrackPIDMode::OnlyTPC) { // only TPC
183185 if (std::fabs (track.tpcNSigmaPi ()) >= cMaxTPCnSigmaPion)
184186 return false ;
185187 }
186- if (selectType == TrackPIDMode::Combined) { // combining
188+ if (mode == TrackPIDMode::Combined) { // combining
187189 if (track.tpcNSigmaPi () * track.tpcNSigmaPi () + track.tofNSigmaPi () * track.tofNSigmaPi () >= nsigmaCutCombinedPion * nsigmaCutCombinedPion)
188190 return false ;
189191 }
190- if (selectType == TrackPIDMode::TPCWithTOFVeto) { // TPC TOF veto
192+ if (mode == TrackPIDMode::TPCWithTOFVeto) { // TPC TOF veto
191193 if (track.hasTOF ()) {
192194 if (std::fabs (track.tpcNSigmaPi ()) >= cMaxTPCnSigmaPion || std::fabs (track.tofNSigmaPi ()) >= cMaxTOFnSigmaPion)
193195 return false ;
@@ -202,19 +204,21 @@ struct rho770analysis {
202204 template <typename TrackType>
203205 bool selKaon (const TrackType track)
204206 {
205- if (selectType == TrackPIDMode::TPCOrTOF) {
207+ const auto mode = static_cast <TrackPIDMode>(selectTypeInt.value );
208+
209+ if (mode == TrackPIDMode::TPCOrTOF) {
206210 if (std::fabs (track.tpcNSigmaKa ()) >= cMaxTPCnSigmaPion || std::fabs (track.tofNSigmaKa ()) >= cMaxTOFnSigmaPion)
207211 return false ;
208212 }
209- if (selectType == TrackPIDMode::OnlyTPC) {
213+ if (mode == TrackPIDMode::OnlyTPC) {
210214 if (std::fabs (track.tpcNSigmaKa ()) >= cMaxTPCnSigmaPion)
211215 return false ;
212216 }
213- if (selectType == TrackPIDMode::Combined) {
217+ if (mode == TrackPIDMode::Combined) {
214218 if (track.tpcNSigmaKa () * track.tpcNSigmaKa () + track.tofNSigmaKa () * track.tofNSigmaKa () >= nsigmaCutCombinedPion * nsigmaCutCombinedPion)
215219 return false ;
216220 }
217- if (selectType == TrackPIDMode::TPCWithTOFVeto) {
221+ if (mode == TrackPIDMode::TPCWithTOFVeto) {
218222 if (track.hasTOF ()) {
219223 if (std::fabs (track.tpcNSigmaKa ()) >= cMaxTPCnSigmaPion || std::fabs (track.tofNSigmaKa ()) >= cMaxTOFnSigmaPion)
220224 return false ;
0 commit comments