13#include <analysis/modules/DuplicateVertexMarker/DuplicateVertexMarkerModule.h>
15#include <analysis/dataobjects/Particle.h>
16#include <analysis/variables/BasicParticleInformation.h>
18#include <framework/logging/Logger.h>
32 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.");
38 "Extra-info field added to all particles in the input list. 1 for the best vertex, 0 for lower ranked ones.",
39 string(
"highQualityVertex"));
41 "If a vertex is a V0, select it over its duplicate even if chi2 is worse.",
52 const int size =
m_inPList->getListSize();
53 for (
int i = 0; i < size; i++) {
56 B2WARNING(
"Vertex does not have exactly 2 daughters! SKIP.");
61 B2DEBUG(10,
"Extra Info with given name is already set!");
64 for (
int j = 0; j < size; j++) {
66 bool particleFight =
false;
68 if (part == cloneCand)
continue;
84 bool cloneNotV0 = cloneCand->
hasExtraInfo(
"decayModeID");
85 if (partNotV0 != cloneNotV0) {
88 B2DEBUG(10,
"V0: Discarding Particle.");
89 }
else B2DEBUG(10,
"V0: Discarding Clone");
94 if (Variable::particlePvalue(part) > Variable::particlePvalue(cloneCand)) {
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
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.
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.