10#include <analysis/modules/KlongDecayReconstructor/KlongDecayReconstructorExpertModule.h>
13#include <framework/logging/Logger.h>
16#include <analysis/DecayDescriptor/DecayDescriptorParticle.h>
17#include <analysis/DecayDescriptor/ParticleListName.h>
20#include <analysis/ParticleCombiner/ParticleCombiner.h>
22#include <Math/Vector4D.h>
47This module is used to employ kinematic constraints to determine the momentum
48of Klongs for two body B decays containing a K_L0 and something else. The
49module creates a list of K_L0 candidates whose K_L0 momentum is reconstructed
50by combining the reconstructed direction (from either the ECL or KLM) of the
51K_L0 and kinematic constraints of the initial state.
57 "Input DecayDescriptor string.");
60 "Don't reconstruct channel if more candidates than given are produced.", 10000);
61 addParam(
"decayMode",
m_decayModeID,
"User-specified decay mode identifier (saved in 'decayModeID' extra-info for each Particle)",
64 "If true, the output ParticleList will be saved by RootOutput. If false, it will be ignored when writing the file.",
false);
66 "Suffix attached to the original K_L input list to identify the output list of the FindKlongMomentum module; this is the input for this module, if not defined it is set to '_reco' \n",
67 std::string(
"_reco"));
93 std::string newDecayString;
94 std::string kListName;
100 for (
int i = 0; i < nProducts; ++i) {
102 if (daughter->getPDGCode() ==
Const::Klong.getPDGCode()) {
104 B2FATAL(
"More than one K_L is detected! This module accepts only one K_L in the final state.");
107 kListName = daughter->getFullName() +
m_recoList;
111 newDecayString = newDecayString + daughter->getFullName() +
" ";
116 B2FATAL(
"This module is meant to reconstruct decays with a K_L0 in the final state. There is no K_L0 in this decay!");
118 newDecayString = newDecayString + kListName;
146 int numberOfCandidates = 0;
151 bool is_physical =
true;
153 const std::vector<Particle*> daughters = particle.getDaughters();
155 if (daughters.size() < 2)
156 B2FATAL(
"Reconstructing particle as a daughter of a decay with less than 2 daughters!");
158 if (daughters.size() > 3)
159 B2FATAL(
"Higher multiplicity (>2) missing momentum decays not implemented yet!");
162 ROOT::Math::PxPyPzEVector pDaughters;
163 for (
auto daughter : daughters) {
164 if (daughter->getPDGCode() !=
Const::Klong.getPDGCode()) {
165 pDaughters += daughter->get4Vector();
166 e_check = daughter->getArrayIndex() + e_check * 100;
171 ROOT::Math::PxPyPzEVector klDaughters;
172 for (
auto daughter : daughters) {
173 if (daughter->getPDGCode() ==
Const::Klong.getPDGCode()) {
174 klDaughters += daughter->get4Vector();
175 if (e_check != daughter->getExtraInfo(
"permID")) {
180 double m_b = particle.getPDGMass();
182 ROOT::Math::PxPyPzEVector mom = pDaughters + klDaughters;
183 mom.SetE(TMath::Sqrt(mom.P2() + m_b * m_b));
184 if ((!std::isnan(mom.P())) && is_physical)
185 particle.set4Vector(mom);
186 if (std::isnan(mom.P()))
189 if (!
m_cut->check(&particle))
195 numberOfCandidates++;
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.
int getPDGCode() const
Return PDG code.
std::string getFullName() const
returns the full name of the particle full_name = name:label
static std::unique_ptr< GeneralCut > compile(const std::string &cut)
bool m_isSelfConjugatedParticle
flag that indicates whether an anti-particle mother does not exist and should not be reconstructed as...
int m_maximumNumberOfCandidates
drop all candidates if more candidates than this parameter are produced
std::string m_antiListName
output anti-particle list name
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_listName
output particle list name
StoreObjPtr< ParticleList > m_outputAntiList
output anti-particle list
StoreArray< Particle > m_particles
StoreArray of Particles.
std::string m_recoList
suffix for input K_L0 list name
StoreObjPtr< ParticleList > m_outputList
output particle list
std::unique_ptr< ParticleGenerator > m_generator
Generates the combinations.
std::unique_ptr< Variable::Cut > m_cut
cut object which performs the cuts
int m_decayModeID
user specified decay mode identifier
KlongDecayReconstructorExpertModule()
Constructor.
std::string m_cutParameter
selection criteria
DecayDescriptor m_decaydescriptor
Decay descriptor of the decay being reconstructed.
bool m_writeOut
toggle output particle list btw.
int m_pdgCode
PDG code of the combined mother particle.
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.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
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.
std::string antiParticleListName(const std::string &listName)
Returns name of anti-particle-list corresponding to listName.
Abstract base class for different kinds of events.