10#include <analysis/modules/KlongDecayReconstructor/KlongMomentumCalculatorExpertModule.h>
13#include <framework/logging/Logger.h>
15#include <framework/datastore/StoreArray.h>
18#include <analysis/dataobjects/Particle.h>
21#include <analysis/DecayDescriptor/DecayDescriptorParticle.h>
24#include <analysis/ParticleCombiner/ParticleCombiner.h>
27#include <analysis/utility/ParticleCopy.h>
28#include <analysis/utility/KlongCalculatorUtils.h>
30#include <Math/Vector4D.h>
53This module is used to employ kinematic constraints to determine the momentum of Klongs for two
54body decays containing a K_L0 and something else. The module creates a list of K_L0 candidates whose K_L0 momentum is
55reconstructed by combining the reconstructed direction of the K_L0 (either from the ECL or the KLM cluster) and
56kinematic constraints of the initial state.
62 "Input DecayDescriptor string.");
64 "Don't reconstruct channel if more candidates than given are produced.", 10000);
66 "If true, the output ParticleList will be saved by RootOutput. If false, it will be ignored when writing the file.",
false);
68 "Suffix attached to the output K_L list, if not defined it is set to '_reco' \n", std::string(
"_reco"));
86 B2FATAL(
"The module currently only works for final states with exactly two particles!");
88 for (
int i = 0; i < nProducts; ++i) {
92 if (daughter->getPDGCode() ==
Const::Klong.getPDGCode()) {
94 B2FATAL(
"More than one K_L is detected! This module accepts only one K_L in the final state.");
102 B2FATAL(
"This module is meant to reconstruct decays with a K_L0 in the final state. There is no K_L0 in this decay!");
117 int numberOfCandidates = 0;
121 const double motherMass = particle.getPDGMass();
122 const std::vector<Particle*> daughters = particle.getDaughters();
124 ROOT::Math::PxPyPzEVector MotherMomentum;
125 ROOT::Math::PxPyPzEVector KMomentum;
132 numberOfCandidates++;
139 for (
auto daughter : daughters) {
140 if (daughter->getPDGCode() ==
Const::Klong.getPDGCode()) {
static const ParticleType Klong
K^0_L particle.
EStoreFlags
Flags describing behaviours of objects etc.
@ c_WriteOut
Object/array should be saved by output modules.
@ c_DontWriteOut
Object/array should be NOT saved by output modules.
Represents a particle in the DecayDescriptor.
StoreObjPtr< ParticleList > m_koutputList
Klong output particle list.
int m_maximumNumberOfCandidates
drop all candidates if more candidates than this parameter are produced
virtual void initialize() override
Initialize the Module.
virtual void event() override
Event processor.
std::string m_decayString
Input DecayString specifying the decay being reconstructed.
std::string m_recoList
Suffix attached to the output K_L list, if not defined it is set to '_reco'.
std::unique_ptr< ParticleGenerator > m_generator
Generates the combinations.
KlongMomentumCalculatorExpertModule()
Constructor.
DecayDescriptor m_decaydescriptor
Decay descriptor of the decay being reconstructed.
bool m_writeOut
toggle output particle list btw.
std::string m_klistName
output K_L0 particle list name
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 addExtraInfo(const std::string &name, double value)
Sets the user-defined data of given name to the given value.
void set4Vector(const ROOT::Math::PxPyPzEVector &p4)
Sets Lorentz vector.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
Accessor to arrays stored in the data store.
Type-safe access to single objects in the data store.
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.