10#include <analysis/modules/KlongDecayReconstructor/KlongMomentumUpdaterExpertModule.h>
13#include <framework/logging/Logger.h>
16#include <analysis/dataobjects/Particle.h>
19#include <analysis/utility/ParticleCopy.h>
20#include <analysis/utility/KlongCalculatorUtils.h>
37 setDescription(
"This module calculates and updates the kinematics of two body B decays including one Klong");
43 "If true, the output ParticleList will be saved by RootOutput. If false, it will be ignored when writing the file.",
56 unsigned int n =
m_plist->getListSize();
57 for (
unsigned i = 0; i < n; i++) {
60 const std::vector<Particle*> daughters = particle->
getDaughters();
62 if (daughters.size() < 2)
63 B2FATAL(
"Reconstructing particle as a daughter of a decay with less than 2 daughters!");
65 if (daughters.size() > 3)
66 B2FATAL(
"Higher multiplicity (>2) missing momentum decays not implemented yet!");
68 ROOT::Math::PxPyPzEVector BMomentum;
69 ROOT::Math::PxPyPzEVector KMomentum;
74 B2ERROR(
"Recalculation of two body B-decay with Klong gives unphysical results. "
75 "Update of kinematics is skipped!");
83 for (
auto daughter : daughters) {
86 copyKlong->set4Vector(KMomentum);
87 copyKlong->writeExtraInfo(
"permID", idx);
int getPDGCode() const
PDG code.
static const ParticleType Klong
K^0_L particle.
virtual void initialize() override
Initialize the Module.
virtual void event() override
Event processor.
std::string m_listName
name of the input ParticleList
KlongMomentumUpdaterExpertModule()
Constructor.
bool m_writeOut
toggle output particle list btw.
StoreObjPtr< ParticleList > m_plist
the input ParticleList.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Class to store reconstructed particles.
bool replaceDaughter(const Particle *oldDaughter, Particle *newDaughter)
Replace index of given daughter with new daughter, return true if a replacement is made.
std::vector< Belle2::Particle * > getDaughters() const
Returns a vector of pointers to daughter particles.
double getPDGMass(void) const
Returns uncertainty on the invariant mass (requires valid momentum error matrix)
void set4Vector(const ROOT::Math::PxPyPzEVector &p4)
Sets Lorentz vector.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Particle * copyParticle(const Particle *original)
Function takes argument Particle and creates a copy of it and copies of all its (grand-)^n-daughters.
Abstract base class for different kinds of events.
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.