|
| 1 | +// Copyright 2019-2022 CERN and copyright holders of ALICE O2. |
| 2 | +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. |
| 3 | +// All rights not expressly granted are reserved. |
| 4 | +// |
| 5 | +// This software is distributed under the terms of the GNU General Public |
| 6 | +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". |
| 7 | +// |
| 8 | +// In applying this license CERN does not waive the privileges and immunities |
| 9 | +// granted to it by virtue of its status as an Intergovernmental Organization |
| 10 | +// or submit itself to any jurisdiction. |
| 11 | + |
| 12 | +/// \file FemtoUniverseSoftPionRemoval.h |
| 13 | +/// \brief FemtoUniverseSoftPionRemoval - Checking the soft pions from D* decay and removing them |
| 14 | +/// \author Katarzyna Gwiździel, WUT, katarzyna.gwizdziel@cern.ch |
| 15 | + |
| 16 | +#ifndef PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSESOFTPIONREMOVAL_H_ |
| 17 | +#define PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSESOFTPIONREMOVAL_H_ |
| 18 | + |
| 19 | +#include <vector> |
| 20 | + |
| 21 | +#include "PWGCF/FemtoUniverse/DataModel/FemtoDerived.h" |
| 22 | +#include "Framework/HistogramRegistry.h" |
| 23 | + |
| 24 | +namespace o2::analysis::femto_universe |
| 25 | +{ |
| 26 | + |
| 27 | +/// \class FemtoUniverseSoftPionRemoval |
| 28 | +/// \brief Class taking care of removing soft pions from D* decays |
| 29 | +/// \tparam partOne Type of particle 1 (Track/D0/...) |
| 30 | +/// \tparam partTwo Type of particle 2 (Track/D0/...) |
| 31 | +template <o2::aod::femtouniverseparticle::ParticleType partOne, o2::aod::femtouniverseparticle::ParticleType partTwo> |
| 32 | +class FemtoUniverseSoftPionRemoval |
| 33 | +{ |
| 34 | + public: |
| 35 | + /// Destructor |
| 36 | + virtual ~FemtoUniverseSoftPionRemoval() = default; |
| 37 | + |
| 38 | + /// Initialization of the QA histograms |
| 39 | + /// \param registry HistogramRegistry |
| 40 | + void init(HistogramRegistry* registry) |
| 41 | + { |
| 42 | + if (registry) { |
| 43 | + mHistogramRegistry = registry; |
| 44 | + mHistogramRegistry->add("SoftPion/softPionMassVsPt", "; M(K#pi#pi-K#pi); p_{T}", kTH2F, {{200, 0.0, 0.2}, {36, 0., 36.}}); |
| 45 | + } |
| 46 | + } |
| 47 | + |
| 48 | + /// Check whether a track is a soft pion from D* decay |
| 49 | + /// \tparam Part Data type of the particle |
| 50 | + /// \tparam Parts Data type of the collection of all particles |
| 51 | + /// \param part1 Particle 1 |
| 52 | + /// \param part2 Particle 2 |
| 53 | + /// \param particles Collection of all particles passed to the task |
| 54 | + /// \return Whether the track is a soft pion |
| 55 | + template <typename Part, typename Parts> |
| 56 | + bool isSoftPion(Part const& part1, Part const& part2, Parts const& particles, bool isD0Cand, bool isD0barCand, double sigma) |
| 57 | + { |
| 58 | + if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kD0) { |
| 59 | + /// Track-D0 combination part1 is hadron and part2 is D0 |
| 60 | + if (part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kD0) { |
| 61 | + LOG(fatal) << "FemtoUniverseSoftPionRemoval: passed arguments don't agree with FemtoUniverseSoftPionRemoval instantiation! Please provide second argument kD0 candidate."; |
| 62 | + return false; |
| 63 | + } |
| 64 | + // Getting D0 (part2) children |
| 65 | + const auto& posChild = particles.iteratorAt(part2.index() - 2); |
| 66 | + const auto& negChild = particles.iteratorAt(part2.index() - 1); |
| 67 | + // Pion and kaon mass |
| 68 | + double massPion = o2::constants::physics::MassPiPlus; |
| 69 | + double massKaon = o2::constants::physics::MassKPlus; |
| 70 | + // D* reconstruction |
| 71 | + double pSum2 = std::pow(posChild.px() + negChild.px() + part1.px(), 2.0) + std::pow(posChild.py() + negChild.py() + part1.py(), 2.0) + std::pow(posChild.pz() + negChild.pz() + part1.pz(), 2.0); |
| 72 | + // Energies of the daughters -> D0->K-pi+ |
| 73 | + double e1Pi = std::sqrt(std::pow(massPion, 2.0) + std::pow(posChild.px(), 2.0) + std::pow(posChild.py(), 2.0) + std::pow(posChild.pz(), 2.0)); |
| 74 | + double e1K = std::sqrt(std::pow(massKaon, 2.0) + std::pow(negChild.px(), 2.0) + std::pow(negChild.py(), 2.0) + std::pow(negChild.pz(), 2.0)); |
| 75 | + // Energies of the daughters -> D0bar->K+pi- |
| 76 | + double e2Pi = std::sqrt(std::pow(massPion, 2.0) + std::pow(negChild.px(), 2.0) + std::pow(negChild.py(), 2.0) + std::pow(negChild.pz(), 2.0)); |
| 77 | + double e2K = std::sqrt(std::pow(massKaon, 2.0) + std::pow(posChild.px(), 2.0) + std::pow(posChild.py(), 2.0) + std::pow(posChild.pz(), 2.0)); |
| 78 | + // Soft pion energy |
| 79 | + auto ePion = RecoDecay::e(massPion, part1.p()); |
| 80 | + // D* masses |
| 81 | + double mDstar1 = std::sqrt(std::pow(e1Pi + e1K + ePion, 2.0) - pSum2); |
| 82 | + double mDstar2 = std::sqrt(std::pow(e2Pi + e2K + ePion, 2.0) - pSum2); |
| 83 | + |
| 84 | + bool isSoftPion = false; |
| 85 | + double softPiMass = 0.14542; // pion mass in D*->D0pi decay |
| 86 | + double lowMassLimitSoftPion = softPiMass - 3.0 * sigma; |
| 87 | + double highMassLimitSoftPion = softPiMass + 3.0 * sigma; |
| 88 | + |
| 89 | + if (isD0Cand) { |
| 90 | + if (mDstar1 - part2.mLambda() > 0.) { |
| 91 | + mHistogramRegistry->fill(HIST("SoftPion/softPionMassVsPt"), mDstar1 - part2.mLambda(), part2.pt()); |
| 92 | + } |
| 93 | + if ((std::abs(mDstar1 - part2.mLambda()) > lowMassLimitSoftPion) && (std::abs(mDstar1 - part2.mLambda()) < highMassLimitSoftPion)) { |
| 94 | + isSoftPion = true; |
| 95 | + } |
| 96 | + } |
| 97 | + |
| 98 | + if (isD0barCand) { |
| 99 | + if (mDstar2 - part2.mAntiLambda() > 0.) { |
| 100 | + mHistogramRegistry->fill(HIST("SoftPion/softPionMassVsPt"), mDstar2 - part2.mAntiLambda(), part2.pt()); |
| 101 | + } |
| 102 | + if ((std::abs(mDstar2 - part2.mAntiLambda()) > lowMassLimitSoftPion) && (std::abs(mDstar2 - part2.mAntiLambda()) < highMassLimitSoftPion)) { |
| 103 | + isSoftPion = true; |
| 104 | + } |
| 105 | + } |
| 106 | + return isSoftPion; |
| 107 | + } else { |
| 108 | + LOG(fatal) << "FemtoUniverseSoftPionRemoval: Combination of objects not defined - quitting!"; |
| 109 | + return false; |
| 110 | + } |
| 111 | + } |
| 112 | + |
| 113 | + private: |
| 114 | + HistogramRegistry* mHistogramRegistry; ///< For QA output |
| 115 | + static constexpr o2::aod::femtouniverseparticle::ParticleType kPartOneType = partOne; ///< Type of particle 1 |
| 116 | + static constexpr o2::aod::femtouniverseparticle::ParticleType kPartTwoType = partTwo; ///< Type of particle 2 |
| 117 | +}; |
| 118 | +} // namespace o2::analysis::femto_universe |
| 119 | + |
| 120 | +#endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSESOFTPIONREMOVAL_H_ |
0 commit comments