9 #include <analysis/modules/V0DaughterMassUpdater/V0DaughterMassUpdaterModule.h>
10 #include <analysis/dataobjects/ParticleList.h>
12 #include <framework/datastore/StoreObjPtr.h>
13 #include <framework/gearbox/Const.h>
24 setDescription(
"This module replaces the mass of two daughters of the selected V0 particles inside the given particleLists with masses of given pdgCode. The particle in selected particleList has to have 2 daughters.");
25 setPropertyFlags(c_ParallelProcessingCertified);
27 addParam(
"particleLists", m_strParticleLists,
"List of ParticleLists", vector<string>());
28 addParam(
"pdgCodeOfV0posDaughter", m_pdg_pos_dau,
"PDG code of daughter with positive charge", Const::electron.getPDGCode());
29 addParam(
"pdgCodeOfV0negDaughter", m_pdg_neg_dau,
"PDG code of daughter with negative charge", Const::electron.getPDGCode());
34 void V0DaughterMassUpdaterModule::event()
38 for (
auto& iList : m_strParticleLists) {
42 B2ERROR(
"ParticleList " << iList <<
" not found");
45 if (particlelist->getListSize() == 0)
continue;
46 for (
unsigned int i = 0; i < particlelist->getListSize(); ++i) {
47 Particle* iParticle = particlelist->getParticle(i);
48 if (iParticle->
getParticleSource() != Particle::EParticleSourceObject::c_Composite)
49 B2FATAL(
"This V0 particle is not a composite particle!");
51 std::vector<Belle2::Particle*> dau = iParticle -> getDaughters();
53 B2FATAL(
"This V0 particle has " << dau.size() <<
" daughters, the number of daughters has to be 2.");
56 bool correctOrder =
true;
57 if (dau[0]->getCharge() < 0 && dau[1]->getCharge() > 0) correctOrder =
false;
59 dau[0]->updateMass(m_pdg_pos_dau);
60 dau[1]->updateMass(m_pdg_neg_dau);
62 dau[0]->updateMass(m_pdg_neg_dau);
63 dau[1]->updateMass(m_pdg_pos_dau);
Class to store reconstructed particles.
EParticleSourceObject getParticleSource() const
Returns particle source as defined with enum EParticleSourceObject.
Type-safe access to single objects in the data store.
This module replaces the mass of two daughters of the selected V0 particles inside the given particle...
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.