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>
17 #include <TDatabasePDG.h>
32 setDescription(
"Inclusive Dstar reconstruction by estimating the four vector using slow pions");
35 addParam(
"decayString", m_decayString,
"Input DecayDescriptor string", std::string(
""));
36 addParam(
"slowPionCut", m_slowPionCut,
"Cut for slow pions", std::string(
"useCMSFrame(p) < 0.2"));
37 addParam(
"DstarCut", m_DstarCut,
"Cut for Dstar", std::string(
""));
61 int pion_pdg_code = 0;
65 pion_pdg_code = daughter->getPDGCode();
68 B2ERROR(
"Pion PDG code " << pion_pdg_code <<
" not compatible with D* PDG code " <<
m_dstar_pdg_code);
94 m_d_pdg_mass = TDatabasePDG::Instance()->GetParticle(d_pdg_code)->Mass();
109 for (
unsigned int pion_index = 0; pion_index < num_pions; pion_index++) {
116 if (isnan(dstar_four_vector.P()))
continue;
128 int particle_properties = Particle::PropertyFlags::c_IsIgnoreRadiatedPhotons
129 + Particle::PropertyFlags::c_IsIgnoreIntermediate
130 + Particle::PropertyFlags::c_IsIgnoreMassive
131 + Particle::PropertyFlags::c_IsIgnoreNeutrino
132 + Particle::PropertyFlags::c_IsIgnoreGamma;
164 TVector3 momentum_vector_pion = pion->
getMomentum();
165 TVector3 momentum_vec_dstar = abs_momentum_dstar * momentum_vector_pion.Unit();
167 return TLorentzVector(momentum_vec_dstar, 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.
bool init(const std::string &str)
Initialise the DecayDescriptor from given string.
const DecayDescriptorParticle * getMother() const
return mother.
const DecayDescriptor * getDaughter(int i) const
return i-th daughter (0 based index).
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...
Inclusive D* reconstruction module.
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*.
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...
TLorentzVector estimateDstarFourMomentum(const Particle *pion)
Estimates the D* four momentum given a slow pion.
std::string m_pionListName
Name of the input pion particle list.
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.
Class to store reconstructed particles.
float getEnergy() const
Returns total energy.
TClonesArray * getArrayPointer() const
Returns the pointer to the store array which holds the daughter particles.
TVector3 getMomentum() const
Returns momentum vector.
float getCharge(void) const
Returns particle charge.
int getArrayIndex() const
Returns this object's array index (in StoreArray), or -1 if not found.
#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.