Belle II Software development
KlongCalculatorUtils Struct Reference

Utility class to calculate the Klong kinematics. More...

#include <KlongCalculatorUtils.h>

Static Public Member Functions

static bool calculateBtoKlongX (ROOT::Math::PxPyPzEVector &BMomentum, ROOT::Math::PxPyPzEVector &KMomentum, const std::vector< Particle * > daughters, const double m_b, int &idx)
 Calculate kinematics of two body B decays containing a K_L0.
 

Detailed Description

Utility class to calculate the Klong kinematics.

Definition at line 32 of file KlongCalculatorUtils.h.

Member Function Documentation

◆ calculateBtoKlongX()

static bool calculateBtoKlongX ( ROOT::Math::PxPyPzEVector &  BMomentum,
ROOT::Math::PxPyPzEVector &  KMomentum,
const std::vector< Particle * >  daughters,
const double  m_b,
int &  idx 
)
inlinestatic

Calculate kinematics of two body B decays containing a K_L0.

Parameters
BMomentum4-vector of B-meson that will be updated by this function
KMomentum4-vector of Klong that will be updated by this function
daughtersOriginal daughters of the B-meson
m_bPDG-mass of the B-meson
idxArray index of the other daughter. This will be assigned to the extraInfo, permID, of Klong.
Returns
true if the kinematics is physical

Definition at line 42 of file KlongCalculatorUtils.h.

47 {
48
49 bool k_check = false;
50 ROOT::Math::PxPyPzEVector klDaughters; // 4-vector of K_L
51 ROOT::Math::PxPyPzEVector pDaughters; // 4-vector of other daughters
52 double m_j = 0;
53 for (auto daughter : daughters) {
54 if (daughter->getPDGCode() == Const::Klong.getPDGCode()) {
55 if (k_check)
56 B2FATAL("More than one K_L is detected! This tool accepts only one K_L in the final state.");
57
58 const Belle2::KLMCluster* klm_cluster = daughter->getKLMCluster();
59 if (klm_cluster)
60 klDaughters = klm_cluster->getMomentum();
61 else {
62 const Belle2::ECLCluster* ecl_cluster = daughter->getECLCluster();
63 if (ecl_cluster) {
64 ClusterUtils clutls;
65 klDaughters = clutls.Get4MomentumFromCluster(ecl_cluster, ECLCluster::EHypothesisBit::c_neutralHadron);
66 } else {
67 B2ERROR("K_L candidate must have related KLM or ECL cluster!");
68 }
69 }
70 k_check = true;
71 } else {
72 pDaughters += daughter->get4Vector();
73
74 // if there is only two daughter (e.g. K_L J/psi), use the PDG mass of the other daughter.
75 m_j = daughter->getPDGMass();
76 idx = daughter->getArrayIndex() + idx * 100;
77 }
78 }
79
80 if (!k_check)
81 B2FATAL("This tool is meant to reconstruct decays with a K_L0 in the final state. There is no K_L0 in this decay!");
82
83 // if there are more than two daughters, use the invariant mass of sum of the other daughters.
84 if (daughters.size() == 3) {
85 m_j = pDaughters.M();
86 }
87
88 const double m_k2 = Const::Klong.getMass() * Const::Klong.getMass();
89
90 const double s_p = (klDaughters.Vect().Unit()).Dot(pDaughters.Vect());
91 const double m_sum = (m_b * m_b) - (m_j * m_j) - m_k2;
92
93 const double s_p2 = s_p * s_p;
94 const double m_sum2 = m_sum * m_sum;
95 const double s_pm = s_p * m_sum;
96 const double e_j2 = pDaughters.E() * pDaughters.E();
97
98 const double k_mag1 = (s_pm + std::sqrt(s_p2 * m_sum2 - 4 * (e_j2 - s_p2) * (e_j2 * m_k2 - m_sum2 / 4))) / (2 *
99 (e_j2 - s_p2));
100 const double k_mag2 = (s_pm - std::sqrt(s_p2 * m_sum2 - 4 * (e_j2 - s_p2) * (e_j2 * m_k2 - m_sum2 / 4))) / (2 *
101 (e_j2 - s_p2));
102
103
104 ROOT::Math::PxPyPzEVector missDaughters;
105
106 if (k_mag1 > 0)
107 missDaughters = k_mag1 * klDaughters / klDaughters.P();
108 else
109 missDaughters = k_mag2 * klDaughters / klDaughters.P();
110
111 missDaughters.SetE(std::sqrt(m_k2 + missDaughters.P2()));
112
113 if (std::isnan(missDaughters.P()))
114 return false;
115
116 ROOT::Math::PxPyPzEVector mom = pDaughters + missDaughters;
117 mom.SetE(std::sqrt(m_b * m_b + mom.P2()));
118 if (std::isnan(mom.P()))
119 return false;
120
121 KMomentum = missDaughters;
122 BMomentum = mom;
123
124 return true;
125 };
int getPDGCode() const
PDG code.
Definition: Const.h:473
double getMass() const
Particle mass.
Definition: UnitConst.cc:353
static const ParticleType Klong
K^0_L particle.
Definition: Const.h:678
ECL cluster data.
Definition: ECLCluster.h:27
@ c_neutralHadron
CR is reconstructed as a neutral hadron (N2)
KLM cluster data.
Definition: KLMCluster.h:28

The documentation for this struct was generated from the following file: