10#include <analysis/modules/ParticleSelector/ParticleSelectorModule.h>
13#include <framework/logging/Logger.h>
16#include <analysis/dataobjects/Particle.h>
33 setDescription(
"Removes Particles from given ParticleList that do not pass specified selection criteria.");
38 "Input ParticleList name (see :ref:`DecayString`).");
41 "Selection criteria to be applied, see `cut_strings_selections`",
50 B2ERROR(
"ParticleSelectorModule::initialize Invalid input DecayString: " <<
m_decayString);
54 B2ERROR(
"ParticleSelectorModule::initialize Invalid input DecayString " <<
m_decayString
55 <<
". DecayString should not contain any daughters, only the mother particle.");
61 string listLabel = mother->
getLabel();
70 B2FATAL(
"You are trying to apply a cut on the list " <<
m_listName <<
71 " but the label 'all' is protected for lists of final-state particles." <<
72 " It could introduce *very* dangerous bugs.");
73 }
else if (listLabel ==
"V0") {
75 B2FATAL(
"You are trying to apply a cut on the list " <<
m_listName <<
76 " but the label " << listLabel <<
" is protected and can not be reduced.");
94 std::vector<unsigned int> toRemove;
96 for (
unsigned i = 0; i < n; i++) {
The ParticleType class for identifying different particle types.
static const ParticleSet finalStateParticlesSet
set of final set particles that can be created by the ParticleLoader
static const ParticleType photon
photon 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
std::string getLabel() const
The label of this particle, "default" returned, when no label set.
bool init(const std::string &str)
Initialise the DecayDescriptor from given string.
int getNDaughters() const
return number of direct daughters.
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...
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...
virtual void initialize() override
Initialize the Module.
virtual void event() override
Event processor.
std::string m_decayString
Input DecayString specifying the particle being selected.
std::string m_listName
output particle list name
std::unique_ptr< Variable::Cut > m_cut
cut object which performs the cuts
bool m_exceptionForGammaAll
true if the particleList is gamma:all and cut is isFromECL
std::string m_cutParameter
selection criteria
DecayDescriptor m_decaydescriptor
Decay descriptor of the particle being selected.
ParticleSelectorModule()
Constructor.
StoreObjPtr< ParticleList > m_particleList
particle list
Class to store reconstructed particles.
int getArrayIndex() const
Returns this object's array index (in StoreArray), or -1 if not found.
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.