9 #include <analysis/modules/SelectDaughters/SelectDaughtersModule.h>
12 #include <analysis/dataobjects/Particle.h>
13 #include <analysis/dataobjects/ParticleList.h>
16 #include <framework/geometry/BFieldManager.h>
34 setDescription(
"SelectDaughters");
37 addParam(
"listName", m_listName,
"name of particle list",
string(
""));
38 addParam(
"decayString", m_decayString,
"specifies which daughter particles will remain",
string(
""));
42 void SelectDaughtersModule::initialize()
44 if (m_decayString !=
"") {
45 m_decaydescriptor.init(m_decayString);
49 void SelectDaughtersModule::event()
54 B2ERROR(
"ParticleList " << m_listName <<
" not found");
57 if (m_decayString ==
"") {
58 B2ERROR(
"decay descriptor cannot be empty");
62 unsigned int n = plist->getListSize();
63 for (
unsigned i = 0; i < n; i++) {
64 Particle* particle = plist->getParticle(i);
66 std::vector<Particle*> daughters = particle->getDaughters();
67 std::vector<const Particle*> selParticles = m_decaydescriptor.getSelectionParticles(particle);
69 for (
auto& daughter : daughters) {
71 for (
auto& selParticle : selParticles) {
72 if (daughter == selParticle) isSel =
true;
74 if (!isSel) particle->removeDaughter(daughter);
Class to store reconstructed particles.
Redefine (select) the daughters of a particle.
Type-safe access to single objects in the data store.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.