Belle II Software development
PrintMCParticlesModule.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#include <framework/datastore/StoreArray.h>
13#include <framework/datastore/StoreObjPtr.h>
14
15#include <string>
16#include <vector>
17
18namespace Belle2 {
24 class MCParticle;
25 class StringWrapper;
26
32
33 public:
34
40
43
45 virtual void initialize() override;
47 virtual void event() override;
48
49 protected:
50
56 void printTree(const std::vector<MCParticle*>& particles, int level = 1, const std::string& indent = "");
57
59 void filterPrimaryOnly(std::vector<MCParticle*>& particles) const;
60
61 std::stringstream m_output;
62 std::string m_particleList;
72 };
73
75} // end namespace Belle2
Base class for Modules.
Definition: Module.h:72
The PrintMCParticles module.
std::stringstream m_output
Buffer to keep all the output while building the tree.
virtual void initialize() override
init.
bool m_showProperties
Show remaining properties.
virtual void event() override
Method is called for each event.
virtual ~PrintMCParticlesModule()
Destructor.
StoreArray< MCParticle > m_mcparticles
store array for the MCParticles
bool m_showStatus
Show extended status information.
int m_maxLevel
Show only up to specified depth level.
bool m_showVertices
Show particle production vertices.
void filterPrimaryOnly(std::vector< MCParticle * > &particles) const
if m_onlyPrimary is set remove all non primary particles from the given vector inplace
StoreObjPtr< StringWrapper > m_stringWrapper
string wrapper to store the MCDecayString
void printTree(const std::vector< MCParticle * > &particles, int level=1, const std::string &indent="")
Loops recursively over the MCParticle list and prints information about each particle.
bool m_showMomenta
Show particle momenta.
std::string m_particleList
The name of the MCParticle collection.
bool m_suppressPrint
Suppress print the information.
bool m_onlyPrimaries
Print only primary particles.
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.