8#include <analysis/modules/TagUniqueSignal/TagUniqueSignalModule.h>
10#include <analysis/dataobjects/Particle.h>
11#include <mdst/dataobjects/MCParticle.h>
12#include <analysis/dataobjects/ParticleList.h>
14#include <framework/datastore/StoreObjPtr.h>
15#include <framework/logging/Logger.h>
31 setDescription(
"Mark true (target=1) candidates from input list via extra-info field. Only the first true candidate associated with an MCParticle is marked.");
38 "Extra-info field added to all particles in the input list. 1 for unique signal, 0 for background or duplicates.",
39 string(
"uniqueSignal"));
50 B2ERROR(
"TagUniqueSignal: Variable::Manager doesn't have variable" <<
m_targetVariable);
61 const int size = inPList->getListSize();
62 std::set<const MCParticle*> foundMCParticles;
63 for (
int i = 0; i < size; i++) {
64 Particle* part = inPList->getParticle(i);
66 float extraInfoValue = 0.0;
71 const bool was_inserted = foundMCParticles.insert(mcp).second;
77 B2WARNING(
"Extra Info with given name is already set! This module can only be used once per particle.");
A Class to store the Monte Carlo particle information.
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.
bool hasExtraInfo(const std::string &name) const
Return whether the extra info with the given name is set.
void addExtraInfo(const std::string &name, double value)
Sets the user-defined data of given name to the given value.
T * getRelated(const std::string &name="", const std::string &namedRelation="") const
Get the object to or from which this object has a relation.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
Type-safe access to single objects in the data store.
virtual void initialize() override
Initialize the Module.
virtual void event() override
Event processor.
std::string m_targetVariable
Variable which defines signal and background.
std::string m_particleList
input ParticleList name
TagUniqueSignalModule()
Constructor.
const Variable::Manager::Var * m_targetVar
Pointer to target variable stored in the variable manager.
std::string m_extraInfoName
output extra-info name
Global list of available variables.
static Manager & Instance()
get singleton instance.
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.
VariableDataType variabletype
data type of variable
FunctionPtr function
Pointer to function.