Belle II Software  release-05-02-19
PrintMCParticlesModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Martin Ritter *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <framework/core/Module.h>
14 #include <framework/datastore/StoreArray.h>
15 
16 #include <string>
17 #include <vector>
18 
19 namespace Belle2 {
25  class MCParticle;
26 
34  class PrintMCParticlesModule : public Module {
35 
36  public:
37 
43 
45  virtual ~PrintMCParticlesModule() {}
46 
48  virtual void initialize() override;
50  virtual void event() override;
51 
52  protected:
53 
58  void printTree(const MCParticle& mc, int level = 0);
59 
60  std::string m_particleList;
61  std::vector<bool> m_seen;
62  bool m_onlyPrimaries;
63  int m_maxLevel;
65  };
66 
68 } // end namespace Belle2
Belle2::PrintMCParticlesModule::m_maxLevel
int m_maxLevel
Show only up to specified depth level.
Definition: PrintMCParticlesModule.h:71
Belle2::PrintMCParticlesModule::m_particleList
std::string m_particleList
The name of the MCParticle collection.
Definition: PrintMCParticlesModule.h:68
Belle2::PrintMCParticlesModule::m_mcparticles
StoreArray< MCParticle > m_mcparticles
store array for the MCParticles
Definition: PrintMCParticlesModule.h:72
Belle2::PrintMCParticlesModule::initialize
virtual void initialize() override
init.
Definition: PrintMCParticlesModule.cc:42
Belle2::PrintMCParticlesModule::m_onlyPrimaries
bool m_onlyPrimaries
Print only primary particles.
Definition: PrintMCParticlesModule.h:70
Belle2::PrintMCParticlesModule::PrintMCParticlesModule
PrintMCParticlesModule()
Constructor.
Definition: PrintMCParticlesModule.cc:31
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::PrintMCParticlesModule::printTree
void printTree(const MCParticle &mc, int level=0)
Loops recursively over the MCParticle list and prints information about each particle.
Definition: PrintMCParticlesModule.cc:62
Belle2::MCParticle
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:43
Belle2::StoreArray< MCParticle >
Belle2::PrintMCParticlesModule::m_seen
std::vector< bool > m_seen
Tag the particles which were already visited using their index.
Definition: PrintMCParticlesModule.h:69
Belle2::PrintMCParticlesModule::~PrintMCParticlesModule
virtual ~PrintMCParticlesModule()
Destructor.
Definition: PrintMCParticlesModule.h:53
Belle2::PrintMCParticlesModule::event
virtual void event() override
Method is called for each event.
Definition: PrintMCParticlesModule.cc:47