|
28 | 28 | #include "Common/DataModel/PIDResponseTPC.h" |
29 | 29 | #include "Common/DataModel/PIDResponseTOF.h" |
30 | 30 |
|
| 31 | +using namespace o2::constants::physics; |
| 32 | + |
| 33 | +HfHelper hfHelper; |
| 34 | + |
31 | 35 | namespace o2::analysis::hf_correlations |
32 | 36 | { |
33 | 37 | enum Region { |
@@ -119,6 +123,74 @@ bool passPIDSelection(Atrack const& track, SpeciesContainer const mPIDspecies, |
119 | 123 | return true; // Passed all checks |
120 | 124 | } |
121 | 125 |
|
| 126 | +template <bool isScCand, typename McParticle> |
| 127 | +bool matchCandAndMass(McParticle const& particle, double& massCand) { |
| 128 | + const auto pdgCand = std::abs(particle.pdgCode()); |
| 129 | + const auto matchGenFlag = std::abs(particle.flagMcMatchGen()); |
| 130 | + |
| 131 | + // Validate PDG code based on candidate type |
| 132 | + if constexpr (isScCand) { |
| 133 | + if (!(pdgCand == Pdg::kSigmaC0 || |
| 134 | + pdgCand == Pdg::kSigmaCPlusPlus || |
| 135 | + pdgCand == Pdg::kSigmaCStar0 || |
| 136 | + pdgCand == Pdg::kSigmaCStarPlusPlus)) { |
| 137 | + return false; |
| 138 | + } |
| 139 | + } else { |
| 140 | + if (pdgCand != Pdg::kLambdaCPlus) { |
| 141 | + return false; |
| 142 | + } |
| 143 | + } |
| 144 | + //std::cout<<matchGenFlag<<" "<<aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi<<" "<<BIT(aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi)<<" "<<hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi<<" "<<BIT(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi)<<std::endl; |
| 145 | + |
| 146 | + // Map decay type to mass |
| 147 | + switch (matchGenFlag) { |
| 148 | + case BIT(aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi): |
| 149 | + massCand = o2::constants::physics::MassSigmaC0; |
| 150 | + return true; |
| 151 | + |
| 152 | + case BIT(aod::hf_cand_sigmac::DecayType::ScStar0ToPKPiPi): |
| 153 | + massCand = o2::constants::physics::MassSigmaCStar0; |
| 154 | + return true; |
| 155 | + |
| 156 | + case BIT(aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi): |
| 157 | + massCand = o2::constants::physics::MassSigmaCStarPlusPlus; |
| 158 | + return true; |
| 159 | + |
| 160 | + case BIT(aod::hf_cand_sigmac::DecayType::ScStarPlusPlusToPKPiPi): |
| 161 | + massCand = o2::constants::physics::MassSigmaCStarPlusPlus; |
| 162 | + return true; |
| 163 | + |
| 164 | + case hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi: |
| 165 | + massCand = o2::constants::physics::MassLambdaCPlus; |
| 166 | + return true; |
| 167 | + |
| 168 | + default: |
| 169 | + return false; |
| 170 | + } |
| 171 | +} |
| 172 | + |
| 173 | + |
| 174 | + template <bool isCandSc, typename CandType> |
| 175 | + double estimateY(CandType const& candidate) |
| 176 | + { |
| 177 | + double y = -999.; |
| 178 | + const int chargeScZero = 0; |
| 179 | + if constexpr (isCandSc) { |
| 180 | + int8_t chargeCand = candidate.charge(); |
| 181 | + |
| 182 | + if (chargeCand == chargeScZero) { |
| 183 | + y = hfHelper.ySc0(candidate); |
| 184 | + } else { |
| 185 | + y = hfHelper.yScPlusPlus(candidate); |
| 186 | + } |
| 187 | + |
| 188 | + } else { |
| 189 | + y = hfHelper.yLc(candidate); |
| 190 | + } |
| 191 | + return y; |
| 192 | + } |
| 193 | + |
122 | 194 | // ========= Find Leading Particle ============== |
123 | 195 | template <typename TTracks, typename T1> //// FIXME: 14 days |
124 | 196 | int findLeadingParticle(TTracks const& tracks, T1 const etaTrackMax) |
|
0 commit comments