Belle II Software  release-05-02-19
ParticleLoaderModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010-2019 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Marko Staric, Anze Zupanc *
7  * Sam Cunliffe, Torben Ferber *
8  * Frank Meier *
9  * *
10  * This software is provided "as is" without any warranty. *
11  **************************************************************************/
12 
13 #pragma once
14 
15 #include <framework/core/Module.h>
16 
17 #include <analysis/dataobjects/RestOfEvent.h>
18 #include <analysis/DecayDescriptor/DecayDescriptor.h>
19 #include <analysis/VariableManager/Utility.h>
20 
21 #include <vector>
22 #include <tuple>
23 #include <string>
24 #include <memory>
25 
26 namespace Belle2 {
65  class ParticleLoaderModule : public Module {
66 
71  typedef std::tuple<int, std::string, std::string, bool, std::shared_ptr<Variable::Cut>> PList;
75  enum PListIndex {
76  c_PListPDGCode, c_PListName, c_AntiPListName, c_IsPListSelfConjugated, c_CutPointer
77  };
78 
79  public:
80 
85 
90  virtual void initialize() override;
91 
95  virtual void event() override;
96 
101  virtual void terminate() override;
102 
103  private:
104 
108  void mcParticlesToParticles();
109 
113  void mdstToParticle();
114 
118  void tracksToParticles();
119 
123  void eclClustersToParticles();
124 
128  void klmClustersToParticles();
129 
133  void v0sToParticles();
134 
138  void roeToParticles();
139 
143  void addROEToParticleList(RestOfEvent* roe, int pdgCode = 0, bool isSelfConjugatedParticle = true);
144 
148  bool isValidPDGCode(const int pdgCode);
149 
153  void appendDaughtersRecursive(Particle* mother);
154 
155  bool m_useMCParticles;
157  bool m_useROEs;
161  std::vector<std::tuple<std::string, std::string>>
165  std::vector<PList> m_MCParticles2Plists;
166  std::vector<PList> m_Tracks2Plists;
167  std::vector<PList> m_V02Plists;
168  std::vector<PList> m_ROE2Plists;
169  std::vector<PList> m_ECLClusters2Plists;
170  std::vector<PList> m_KLMClusters2Plists;
172  bool m_writeOut;
173  bool m_addDaughters;
175  std::string m_roeMaskName;
181  false;
183  std::vector<int> m_chargeZeroTrackCounts;
184  std::vector<int> m_sameChargeDaughtersV0Counts;
185  };
186 
188 } // Belle2 namespace
Belle2::ParticleLoaderModule::appendDaughtersRecursive
void appendDaughtersRecursive(Particle *mother)
recursively append bottom of a particle's decay chain (daughters of mother, granddaughters of daughte...
Definition: ParticleLoaderModule.cc:896
Belle2::ParticleLoaderModule::m_enforceFitHypothesis
bool m_enforceFitHypothesis
If true, a Particle is only created if a track fit with the particle hypothesis passed to the Particl...
Definition: ParticleLoaderModule.h:190
Belle2::ParticleLoaderModule::eclClustersToParticles
void eclClustersToParticles()
Loads ECLCluster object as Particle to StoreArray<Particle> and adds it to the ParticleList.
Definition: ParticleLoaderModule.cc:629
Belle2::ParticleLoaderModule::m_roeMaskName
std::string m_roeMaskName
ROE mask name to load.
Definition: ParticleLoaderModule.h:185
Belle2::ParticleLoaderModule::m_addDaughters
bool m_addDaughters
toggle addition of the bottom part of the particle's decay chain
Definition: ParticleLoaderModule.h:183
Belle2::ParticleLoaderModule::m_Tracks2Plists
std::vector< PList > m_Tracks2Plists
Collection of PLists that will collect Particles created from Tracks.
Definition: ParticleLoaderModule.h:176
Belle2::ParticleLoaderModule::m_useROEs
bool m_useROEs
Switch to load ROE as Particle.
Definition: ParticleLoaderModule.h:167
Belle2::ParticleLoaderModule::roeToParticles
void roeToParticles()
Loads ROE object as Particle of specified type to StoreArray<Particle> and adds it to the ParticleLis...
Definition: ParticleLoaderModule.cc:309
Belle2::ParticleLoaderModule::event
virtual void event() override
Event processor.
Definition: ParticleLoaderModule.cc:269
Belle2::ParticleLoaderModule::m_V02Plists
std::vector< PList > m_V02Plists
Collection of PLists that will collect Particles created from V0.
Definition: ParticleLoaderModule.h:177
Belle2::RestOfEvent
This is a general purpose class for collecting reconstructed MDST data objects that are not used in r...
Definition: RestOfEvent.h:59
Belle2::ParticleLoaderModule::m_trackHypothesis
int m_trackHypothesis
pdg code for track hypothesis that should be used to create the particle
Definition: ParticleLoaderModule.h:188
Belle2::ParticleLoaderModule::mcParticlesToParticles
void mcParticlesToParticles()
Loads specified MCParticles as Particle to StoreArray<Particle>
Definition: ParticleLoaderModule.cc:816
Belle2::ParticleLoaderModule::addROEToParticleList
void addROEToParticleList(RestOfEvent *roe, int pdgCode=0, bool isSelfConjugatedParticle=true)
Helper method to load ROE object as Particle.
Definition: ParticleLoaderModule.cc:353
Belle2::ParticleLoaderModule::initialize
virtual void initialize() override
Initialize the Module.
Definition: ParticleLoaderModule.cc:109
Belle2::ParticleLoaderModule::m_KLMClusters2Plists
std::vector< PList > m_KLMClusters2Plists
Collection of PLists that will collect Particles created from KLMClusters.
Definition: ParticleLoaderModule.h:180
Belle2::ParticleLoaderModule::m_ECLClusters2Plists
std::vector< PList > m_ECLClusters2Plists
Collection of PLists that will collect Particles created from ECLClusters.
Definition: ParticleLoaderModule.h:179
Belle2::ParticleLoaderModule::v0sToParticles
void v0sToParticles()
Loads V0 object as Particle of specified type to StoreArray<Particle> and adds it to the ParticleList...
Definition: ParticleLoaderModule.cc:386
Belle2::ParticleLoaderModule::m_chargeZeroTrackCounts
std::vector< int > m_chargeZeroTrackCounts
internally used to count number of tracks with charge zero
Definition: ParticleLoaderModule.h:193
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ParticleLoaderModule::isValidPDGCode
bool isValidPDGCode(const int pdgCode)
returns true if the PDG code determined from the decayString is valid
Definition: ParticleLoaderModule.cc:870
Belle2::ParticleLoaderModule::terminate
virtual void terminate() override
Terminate the Module.
Definition: ParticleLoaderModule.cc:289
Belle2::ParticleLoaderModule::klmClustersToParticles
void klmClustersToParticles()
Loads KLMCluster object as Particle to StoreArray<Particle> and adds it to the ParticleList.
Definition: ParticleLoaderModule.cc:751
Belle2::ParticleLoaderModule::mdstToParticle
void mdstToParticle()
Loads specified MSDT object as Particle to StoreArray<Particle>
Belle2::ParticleLoaderModule::m_writeOut
bool m_writeOut
toggle particle list btw.
Definition: ParticleLoaderModule.h:182
Belle2::ParticleLoaderModule::tracksToParticles
void tracksToParticles()
Loads Track object as Particle to StoreArray<Particle> and adds it to the ParticleList.
Definition: ParticleLoaderModule.cc:535
Belle2::ParticleLoaderModule::m_MCParticles2Plists
std::vector< PList > m_MCParticles2Plists
Collection of PLists that will collect Particles created from MCParticles.
Definition: ParticleLoaderModule.h:175
Belle2::ParticleLoaderModule::m_sourceParticleListName
std::string m_sourceParticleListName
Particle list name from which we need to get related ROEs.
Definition: ParticleLoaderModule.h:186
Belle2::Particle
Class to store reconstructed particles.
Definition: Particle.h:77
Belle2::ParticleLoaderModule::m_decaydescriptor
DecayDescriptor m_decaydescriptor
Decay descriptor for parsing the user specified DecayString.
Definition: ParticleLoaderModule.h:169
Belle2::ParticleLoaderModule::ParticleLoaderModule
ParticleLoaderModule()
Constructor.
Definition: ParticleLoaderModule.cc:61
Belle2::DecayDescriptor
The DecayDescriptor stores information about a decay tree or parts of a decay tree.
Definition: DecayDescriptor.h:43
Belle2::ParticleLoaderModule::m_skipNonPrimaryDaughters
bool m_skipNonPrimaryDaughters
toggle skip of secondary MC daughters
Definition: ParticleLoaderModule.h:184
Belle2::ParticleLoaderModule::m_useMissing
bool m_useMissing
Use missing momentum to build a particle.
Definition: ParticleLoaderModule.h:187
Belle2::ParticleLoaderModule::m_sameChargeDaughtersV0Counts
std::vector< int > m_sameChargeDaughtersV0Counts
internally used to count the number of V0s with same charge daughters
Definition: ParticleLoaderModule.h:194
Belle2::ParticleLoaderModule::PList
std::tuple< int, std::string, std::string, bool, std::shared_ptr< Variable::Cut > > PList
tuple for collecting everything we know about the ParticlList to be created.
Definition: ParticleLoaderModule.h:81
Belle2::ParticleLoaderModule::m_ROE2Plists
std::vector< PList > m_ROE2Plists
Collection of PLists that will collect Particles created from V0.
Definition: ParticleLoaderModule.h:178
Belle2::ParticleLoaderModule::m_decayStringsWithCuts
std::vector< std::tuple< std::string, std::string > > m_decayStringsWithCuts
Input DecayString specifying the particle being created/loaded.
Definition: ParticleLoaderModule.h:172
Belle2::ParticleLoaderModule::m_useMCParticles
bool m_useMCParticles
Load MCParticle as Particle instead of the corresponding MDST dataobject.
Definition: ParticleLoaderModule.h:165
Belle2::ParticleLoaderModule::PListIndex
PListIndex
Enum for describing each element in the above tuple.
Definition: ParticleLoaderModule.h:85