10#include <online_book/awesome/modules/AWESOMEBasic/AWESOMEBasicModule.h>
13#include <framework/logging/Logger.h>
23using namespace Belle2::AWESOME;
38 setDescription(
"Here you can enter a description of the module which can be displayed during runtime.");
43 "Useless parameter of type integer", 0);
45 "Useless parameter of type double", 0.0);
47 "Useless parameter of type string", std::string{
""});
49 "Useless parameter of type vector<double>", std::vector<double> {3, 0});
56 B2INFO(
"AWESOMEBasic: initialize.");
73 B2INFO(
"AWESOMEBasic: begin of new run.");
82 B2INFO(
"AWESOMEBasic: event is being processed.");
89 int mcArrayIndex = -1;
95 pdgCode = mcParticle->
getPDG();
97 B2INFO(
"AWESOMESimHit #" << hit.getArrayIndex()
98 <<
" has an energy deposition of " << hit.getEnergyDep()
99 <<
" and is related to MCParticle #" << mcArrayIndex
100 <<
" which has a PDG code " << pdgCode);
110 B2INFO(
"MCParticle #" << mcParticle.getArrayIndex()
111 <<
" which has a PDG code " << mcParticle.getPDG()
112 <<
" created the AWESOMESimHit #" << hit.getArrayIndex()
113 <<
" which has an energy deposition of " << hit.getEnergyDep());
119 B2INFO(
"AWESOMEBasic: end of run.");
126 B2INFO(
"AWESOMEBasic: terminate.");
A Geant4 simulated hit for the AWESOME detector.
std::string m_stringParameter
Useless variable showing how to create string parameters.
void initialize() override
Initialize the module.
void event() override
Called for each event.
void endRun() override
Called for each end of run.
void terminate() override
Called on termination.
StoreArray< AWESOMESimHit > m_SimHits
AWESOME simulated hits.
AWESOMEBasicModule()
Default constructor.
void beginRun() override
Called for each begin of run.
double m_doubleParameter
Useless variable showing how to create double parameters.
int m_intParameter
Useless variable showing how to create integer parameters.
std::vector< double > m_doubleListParameter
Useless variable showing how to create array parameters.
StoreArray< MCParticle > m_MCParticles
MC particles.
A Class to store the Monte Carlo particle information.
int getArrayIndex() const
Get 0-based index of the particle in the corresponding MCParticle list.
int getPDG() const
Return PDG code of particle.
void setDescription(const std::string &description)
Sets the description of the module.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.