9#include <analysis/modules/InclusiveDstarReconstruction/InclusiveDstarReconstructionModule.h>
10#include <analysis/utility/PCmsLabTransform.h>
12#include <analysis/DecayDescriptor/ParticleListName.h>
14#include <framework/gearbox/Const.h>
16#include <TDatabasePDG.h>
31 setDescription(
"Inclusive Dstar reconstruction by estimating the four vector using slow pions");
60 int pion_pdg_code = 0;
64 pion_pdg_code = daughter->getPDGCode();
67 B2ERROR(
"Pion PDG code " << pion_pdg_code <<
" not compatible with D* PDG code " <<
m_dstar_pdg_code);
93 m_d_pdg_mass = TDatabasePDG::Instance()->GetParticle(d_pdg_code)->Mass();
108 for (
unsigned int pion_index = 0; pion_index < num_pions; pion_index++) {
115 if (isnan(dstar_four_vector.P()))
continue;
163 ROOT::Math::PxPyPzEVector vector_pion = pion->
get4Vector();
164 ROOT::Math::PxPyPzEVector vec_dstar = abs_momentum_dstar * vector_pion / vector_pion.P();
165 vec_dstar.SetE(energy_dstar);
172 bool is_compatible =
false;
173 if (pion_pdg_code ==
Const::pi0.getPDGCode()) {
174 is_compatible =
true;
175 }
else if (pion_pdg_code ==
Const::pion.getPDGCode()) {
177 }
else if (pion_pdg_code == -
Const::pion.getPDGCode()) {
180 return is_compatible;
190 if (pion_charge == 0) {
191 return input_dstar_pdg;
196 if (input_dstar_pdg > 0) {
197 return (pion_charge > 0) ? input_dstar_pdg : -input_dstar_pdg;
201 return (pion_charge < 0) ? input_dstar_pdg : -input_dstar_pdg;
int getPDGCode() const
PDG code.
static const ParticleType pi0
neutral pion particle
static const ChargedStable pion
charged pion particle
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
bool init(const std::string &str)
Initialise the DecayDescriptor from given string.
const DecayDescriptor * getDaughter(int i) const
return i-th daughter (0 based index).
const DecayDescriptorParticle * getMother() const
return mother.
static std::unique_ptr< GeneralCut > compile(const std::string &cut)
Creates an instance of a cut and returns a unique_ptr to it, if you need a copy-able object instead y...
std::unique_ptr< Variable::Cut > m_cut_dstar
cut object which performs the cuts
bool pionCompatibleWithDstar(int pion_pdg_code)
Checks if the given pion is list if compatible with the charge of the D* particle.
std::string m_slowPionCut
Cut to select slow pions.
virtual void initialize() override
Initialize the Module.
int m_dstar_pdg_code
PDG code of the given D* particle list.
virtual void event() override
Event Processor.
StoreObjPtr< ParticleList > m_inputPionList
input pion particle list
std::string m_decayString
Input DecayDescriptor string.
StoreArray< Particle > m_particles
StoreArray of Particles.
virtual ~InclusiveDstarReconstructionModule()
Destructor.
float m_d_pdg_mass
PDG mass of the daughter-D
std::string m_DstarCut
Cut for Dstar.
StoreObjPtr< ParticleList > m_outputDstarList
output Dstar particle list
StoreObjPtr< ParticleList > m_outputAntiDstarList
output anti-Dstar particle list
float m_dstar_pdg_mass
PDG mass of the mother-D*.
InclusiveDstarReconstructionModule()
Constructor.
DecayDescriptor m_decaydescriptor
Decay descriptor for parsing the user specified DecayString.
int getDstarOutputPDG(int pion_charge, int input_dstar_pdg)
Helper function to get the correct D* PDG code for the output list, depending on the input (DecayStri...
std::string m_pionListName
Name of the input pion particle list.
ROOT::Math::PxPyPzEVector estimateDstarFourMomentum(const Particle *pion)
Estimates the D* four momentum given a slow pion.
std::unique_ptr< Variable::Cut > m_cut_pion
cut object which performs the cuts
std::string m_outputAntiListName
Name of the output anti-D* particle list.
std::string m_outputListName
Name of the output D* particle list.
void setDescription(const std::string &description)
Sets the description of the module.
Class to store reconstructed particles.
double getEnergy() const
Returns total energy.
TClonesArray * getArrayPointer() const
Returns the pointer to the store array which holds the daughter particles.
double getCharge(void) const
Returns particle charge.
ROOT::Math::PxPyPzEVector get4Vector() const
Returns Lorentz vector.
@ c_Flavored
Is either particle or antiparticle.
@ c_IsIgnoreNeutrino
Is the particle MC matched with the ignore missing neutrino flag set?
@ c_IsIgnoreRadiatedPhotons
Is the particle MC matched with the ignore radiated photon flag set?
@ c_IsIgnoreGamma
Is the particle MC matched with the ignore missing gamma flag set?
@ c_IsIgnoreIntermediate
Is the particle MC matched with the ignore intermediate resonances flag set?
@ c_IsIgnoreMassive
Is the particle MC matched with the ignore missing massive particle flag set?
int getArrayIndex() const
Returns this object's array index (in StoreArray), or -1 if not found.
T * appendNew()
Construct a new T object at the end of the array.
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.