9#include <analysis/modules/SelectDaughters/SelectDaughtersModule.h>
12#include <analysis/dataobjects/Particle.h>
13#include <analysis/dataobjects/ParticleList.h>
15#include <framework/datastore/StoreObjPtr.h>
54 B2ERROR(
"ParticleList " <<
m_listName <<
" not found");
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();
69 for (
auto& daughter : daughters) {
71 for (
auto& selParticle : selParticles) {
72 if (daughter == selParticle) isSel =
true;
74 if (!isSel) particle->removeDaughter(daughter);
bool init(const std::string &str)
Initialise the DecayDescriptor from given string.
std::vector< const Particle * > getSelectionParticles(const Particle *particle)
Get a vector of pointers with selected daughters in the decay tree.
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.
virtual void initialize() override
set up datastore
virtual void event() override
process the event
std::string m_decayString
daughter particles selection
std::string m_listName
name of particle list
SelectDaughtersModule()
constructor
DecayDescriptor m_decaydescriptor
Decay descriptor of decays to look for.
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.
Abstract base class for different kinds of events.