 |
Belle II Software
release-05-01-25
|
1 #include <tracking/modules/mcMatcher/MCV0MatcherModule.h>
3 #include <framework/datastore/StoreArray.h>
4 #include <framework/gearbox/Const.h>
5 #include <framework/gearbox/Unit.h>
6 #include <framework/logging/Logger.h>
7 #include <mdst/dataobjects/TrackFitResult.h>
8 #include <mdst/dataobjects/MCParticle.h>
9 #include <mdst/dataobjects/V0.h>
17 setDescription(
"A module matching the V0s found by the V0Finder with MCParticles");
22 "Belle2::Track collection name (input). Note that the V0s use "
23 "pointers indices into these arrays, so all hell may break loose "
24 "if you change this.", std::string(
""));
26 "Belle2::TrackFitResult collection name (input). Note that the V0s "
27 "use pointers indices into these arrays, so all hell may break loose "
28 "if you change this.", std::string(
""));
45 trackFitResults.isRequired();
51 mcParticles.isRequired();
53 B2WARNING(
"This module is supposed to be used only for the debugging\n \
54 of the V0Finder module, not as MC matching during analysis.");
65 B2DEBUG(200, (v0s.
getEntries() != 0 ?
"V0s has entries." :
" No V0s."));
67 for (
const auto& v0 : v0s) {
70 const std::pair<Track*, Track*> trackPtrs = v0.getTracks();
75 if (mcV0PartPlus ==
nullptr or mcV0PartMinus ==
nullptr) {
76 B2DEBUG(200,
"At least one track of the V0 does not have a MC related particle. It will be skipped for matching.");
83 if (!mcV0PartPlus->
getMother() or !mcV0PartMinusMother) {
84 B2DEBUG(200,
"At least one track of the V0 does not have a mother MCParticle, skipping.");
88 if (mcV0PartPlusMother != mcV0PartMinusMother) {
89 B2DEBUG(200,
"The V0 is most likely built up from combinatoric background, thus no MC relation can be set.");
94 B2DEBUG(200,
"V0 successfully matched.");
95 v0.addRelationTo(mcV0PartPlusMother);
97 B2DEBUG(200,
"V0 did not match anything.");
101 B2DEBUG(200,
"MC matching finished.");
void beginRun() override
Called once before a new run begins.
bool registerRelationTo(const StoreArray< TO > &toArray, DataStore::EDurability durability=DataStore::c_Event, DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut, const std::string &namedRelation="") const
Register a relation to the given StoreArray.
void setDescription(const std::string &description)
Sets the description of the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
MCV0MatcherModule()
Constructor, for setting module description and parameters.
std::string m_TFRColName
Belle2::TrackFitResult collection name (input).
void initialize() override
Use this to initialize resources or memory your module needs.
TO * getRelatedTo(const std::string &name="", const std::string &namedRelation="") const
Get the object to which this object has a relation.
std::string m_V0ColName
V0 collection name (input).
void terminate() override
Clean up anything you created in initialize().
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
void endRun() override
Called once when a run ends.
Abstract base class for different kinds of events.
int getPDG() const
Return PDG code of particle.
MCParticle * getMother() const
Returns a pointer to the mother particle.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
The ParticleType class for identifying different particle types.
void event() override
Called once for each event.
std::string m_TrackColName
Belle2::Track collection name (input).
A Class to store the Monte Carlo particle information.
Accessor to arrays stored in the data store.
~MCV0MatcherModule()
Destructor (empty).
std::string m_MCParticleColName
MCParticle collection name (input).
int getEntries() const
Get the number of objects in the array.