Belle II Software light-2509-fornax
ParticleLoaderModule.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <framework/core/Module.h>
12
13#include <analysis/DecayDescriptor/DecayDescriptor.h>
14
15// framework - DataStore
16#include <framework/datastore/StoreArray.h>
17#include <framework/datastore/StoreObjPtr.h>
18
19// dataobjects
20#include <mdst/dataobjects/V0.h>
21#include <mdst/dataobjects/Kink.h>
22#include <mdst/dataobjects/ECLCluster.h>
23#include <mdst/dataobjects/KLMCluster.h>
24#include <mdst/dataobjects/MCParticle.h>
25#include <mdst/dataobjects/Track.h>
26#include <mdst/dataobjects/TrackFitResult.h>
27#include <mdst/dataobjects/PIDLikelihood.h>
28
29#include <analysis/dataobjects/RestOfEvent.h>
30#include <analysis/dataobjects/Particle.h>
31#include <analysis/dataobjects/ParticleExtraInfoMap.h>
32
33#include <vector>
34#include <tuple>
35#include <string>
36
37namespace Belle2 {
42
80
85 typedef std::tuple<int, std::string, std::string, bool> PList;
90 c_PListPDGCode, c_PListName, c_AntiPListName, c_IsPListSelfConjugated
91 };
92
93 public:
94
99
104 virtual void initialize() override;
105
109 virtual void event() override;
110
115 virtual void terminate() override;
116
117 private:
118
119
124
129
133 void tracksToParticles();
134
139
143 bool isValidECLCluster(const ECLCluster* cluster, const int pdgCode, bool onlyNeutral) const;
144
148 void assignMCParticleFromECLCluster(Particle* newPart, const ECLCluster* cluster) const;
149
154
158 void v0sToParticles();
159
163 void kinksToParticles();
164
168 void roeToParticles();
169
173 void addROEToParticleList(RestOfEvent* roe, int mdstIndex, int pdgCode = 0, bool isSelfConjugatedParticle = true);
174
178 void dummyToParticles();
179
183 bool isValidPDGCode(const int pdgCode);
184
189
201
203
205
207
210
213
214 std::vector<std::string> m_decayStrings;
215
216 std::vector<PList> m_MCParticles2Plists;
217 std::vector<PList> m_Tracks2Plists;
218 std::vector<PList> m_V02Plists;
219 std::vector<PList> m_Kink2Plists;
220 std::vector<PList> m_ROE2Plists;
221 std::vector<PList>
223 std::vector<PList> m_Dummies2Plists;
224 std::vector<PList> m_ChargedCluster2Plists;
225
226
232 std::string m_roeMaskName;
236
240
242 false;
243
244 std::vector<int> m_chargeZeroTrackCounts;
246 };
247
249} // Belle2 namespace
The DecayDescriptor stores information about a decay tree or parts of a decay tree.
ECL cluster data.
Definition ECLCluster.h:27
Module()
Constructor.
Definition Module.cc:30
std::vector< PList > m_ECLKLMClusters2Plists
Collection of PLists that will collect Particles created from ECLClusters and KLMClusters.
void mcParticlesToParticles()
Loads specified MCParticles as Particle to StoreArray<Particle>
void v0sToParticles()
Loads V0 object as Particle of specified type to StoreArray<Particle> and adds it to the ParticleList...
StoreArray< TrackFitResult > m_trackfitresults
StoreArray of TrackFitResults.
std::tuple< int, std::string, std::string, bool > PList
tuple for collecting everything we know about the ParticlList to be created.
std::vector< PList > m_Dummies2Plists
Collection of PLists that will collect Particles created from Dummies.
void kinksToParticles()
Loads Kink object as Particle of specified type to StoreArray<Particle> and adds it to the ParticleLi...
StoreArray< Kink > m_kinks
StoreArray of Kinks.
std::vector< std::string > m_decayStrings
Input decay strings specifying the particles being created/loaded.
void roeToParticles()
Loads ROE object as Particle of specified type to StoreArray<Particle> and adds it to the ParticleLis...
bool m_dummyTreatAsInvisible
should treeFitter treat the particle as invisible?
virtual void initialize() override
Initialize the Module.
int m_trackHypothesis
pdg code for track hypothesis that should be used to create the particle
StoreArray< KLMCluster > m_klmclusters
StoreArray of KLMCluster.
std::vector< int > m_sameChargeDaughtersV0Counts
internally used to count the number of V0s with same charge daughters
StoreArray< V0 > m_v0s
StoreArray of V0s.
void addROEToParticleList(RestOfEvent *roe, int mdstIndex, int pdgCode=0, bool isSelfConjugatedParticle=true)
Helper method to load ROE object as Particle.
virtual void event() override
Event processor.
std::string m_sourceParticleListName
Particle list name from which we need to get related ROEs.
bool isValidPDGCode(const int pdgCode)
returns true if the PDG code determined from the decayString is valid
void mdstToParticle()
Loads specified MSDT object as Particle to StoreArray<Particle>
PListIndex
Enum for describing each element in the above tuple.
StoreArray< MCParticle > m_mcparticles
StoreArray of MCParticles.
bool m_skipInitial
toggle skip of initial MC particles
StoreArray< Particle > m_particles
StoreArray of Particles.
int m_dummyMDSTIndex
mdst index for dummy particles
std::string m_roeMaskName
ROE mask name to load.
virtual void terminate() override
Terminate the Module.
void tracksToParticles()
Loads Track object as Particle to StoreArray<Particle> and adds it to the ParticleList.
std::vector< PList > m_Kink2Plists
Collection of PLists that will collect Particles created from Kink.
StoreObjPtr< ParticleExtraInfoMap > m_particleExtraInfoMap
object pointer to extra info map
double m_dummyCovMatrix
diag value of cov matrix for dummy particles
bool m_addDaughters
toggle addition of the bottom part of the particle's decay chain
StoreArray< PIDLikelihood > m_pidlikelihoods
StoreArray of PIDLikelihoods.
bool m_skipNonPrimaryDaughters
toggle skip of secondary MC daughters
StoreArray< Track > m_tracks
StoreArray of Tracks.
bool m_enforceFitHypothesis
If true, a Particle is only created if a track fit with the particle hypothesis passed to the Particl...
std::vector< PList > m_ROE2Plists
Collection of PLists that will collect Particles created from V0.
StoreArray< RestOfEvent > m_roes
StoreArray of ROEs.
bool isValidECLCluster(const ECLCluster *cluster, const int pdgCode, bool onlyNeutral) const
Checks if the given ECLCluster is valid for the pdgCode.
std::vector< PList > m_ChargedCluster2Plists
Collection of PLists that will collect Particles created from charged-cluster.
void appendDaughtersRecursive(Particle *mother)
recursively append bottom of a particle's decay chain (daughters of mother, granddaughters of daughte...
std::vector< PList > m_MCParticles2Plists
Collection of PLists that will collect Particles created from MCParticles.
void dummyToParticles()
Loads dummy object as Particle of specified type to StoreArray<Particle> and adds it to the ParticleL...
std::vector< PList > m_V02Plists
Collection of PLists that will collect Particles created from V0.
DecayDescriptor m_decaydescriptor
Decay descriptor for parsing the user specified DecayString.
bool m_useDummy
Switch to load dummy as Particle.
bool m_writeOut
toggle particle list btw.
std::vector< int > m_chargeZeroTrackCounts
internally used to count number of tracks with charge zero
bool m_useOnlyMostEnergeticECLCluster
If true, only the most energetic ECLCluster is used.
std::vector< PList > m_Tracks2Plists
Collection of PLists that will collect Particles created from Tracks.
StoreArray< ECLCluster > m_eclclusters
StoreArray of ECLCluster.
bool m_skipNonPrimary
toggle skip of secondary MC particle
int m_properties
Particle property to be assigned only on V0s.
void chargedClustersToParticles()
Loads ECLCluster and KLMCluster objects that are being matched with Track as Particle to StoreArray<P...
void assignMCParticleFromECLCluster(Particle *newPart, const ECLCluster *cluster) const
Assigns the MCParticle relation to the newPart.
bool m_useROEs
Switch to load ROE as Particle.
bool m_loadChargedCluster
Switch to load charged-cluster.
bool m_useMissing
Use missing momentum to build a particle.
void eclAndKLMClustersToParticles()
Loads ECLCluster and KLMCluster object as Particle to StoreArray<Particle> and adds it to the Particl...
bool m_useMCParticles
Load MCParticle as Particle instead of the corresponding MDST dataobject.
Class to store reconstructed particles.
Definition Particle.h:76
This is a general purpose class for collecting reconstructed MDST data objects that are not used in r...
Definition RestOfEvent.h:55
Accessor to arrays stored in the data store.
Definition StoreArray.h:113
Type-safe access to single objects in the data store.
Definition StoreObjPtr.h:96
Abstract base class for different kinds of events.