13#include <analysis/modules/DuplicateVertexMarker/DuplicateVertexMarkerModule.h>
15#include <analysis/dataobjects/Particle.h>
17#include <framework/logging/Logger.h>
31 setDescription(
"Identify duplicate vertices (distinct particles, but built from the same daughters) and mark the one with best chi2. Only works if the particle has exactly two daughters. Mainly used to deal when merging V0 vertices with hand-built ones.");
37 "Extra-info field added to all particles in the input list. 1 for the best vertex, 0 for lower ranked ones.",
38 string(
"highQualityVertex"));
40 "If a vertex is a V0, select it over its duplicate even if chi2 is worse.",
51 B2ERROR(
"DuplicateVertexMarker: Variable::Manager doesn't have variable chiProb");
57 const int size =
m_inPList->getListSize();
58 for (
int i = 0; i < size; i++) {
61 B2WARNING(
"Vertex does not have exactly 2 daughters! SKIP.");
66 B2DEBUG(10,
"Extra Info with given name is already set!");
69 for (
int j = 0; j < size; j++) {
71 bool particleFight =
false;
73 if (part == cloneCand)
continue;
89 bool cloneNotV0 = cloneCand->
hasExtraInfo(
"decayModeID");
90 if (partNotV0 != cloneNotV0) {
93 B2DEBUG(10,
"V0: Discarding Particle.");
94 }
else B2DEBUG(10,
"V0: Discarding Clone");
virtual void initialize() override
Initialize the Module.
virtual void event() override
Event processor.
StoreObjPtr< ParticleList > m_inPList
input particle list
DuplicateVertexMarkerModule()
Constructor.
bool m_prioritiseV0
if one of the decay is a V0, prioritise that before checking vertex quality
std::string m_particleList
input ParticleList name
const Variable::Manager::Var * m_targetVar
Pointer to target variable stored in the variable manager.
std::string m_extraInfoName
output extra-info name
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.
const Track * getTrack() const
Returns the pointer to the Track object that was used to create this Particle (ParticleType == c_Trac...
bool hasExtraInfo(const std::string &name) const
Return whether the extra info with the given name is set.
unsigned getNDaughters(void) const
Returns number of daughter particles.
void addExtraInfo(const std::string &name, double value)
Sets the user-defined data of given name to the given value.
const Particle * getDaughter(unsigned i) const
Returns a pointer to the i-th daughter particle.
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.
FunctionPtr function
Pointer to function.