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++) {
59 const double m_b = particle->getPDGMass();
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!");
80 particle->set4Vector(BMomentum);
83 for (
auto daughter : daughters) {
86 copyKlong->set4Vector(KMomentum);
87 copyKlong->writeExtraInfo(
"permID", idx);
88 particle->replaceDaughter(daughter, copyKlong);
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.
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.