10 #include <online_book/awesome/modules/AWESOMEBasic/AWESOMEBasicModule.h>
13 #include <framework/logging/Logger.h>
23 using namespace Belle2::AWESOME;
38 setDescription(
"Here you can enter a description of the module which can be displayed during runtime.");
42 addParam(
"intParameter", m_intParameter,
43 "Useless parameter of type integer", 0);
44 addParam(
"doubleParameter", m_doubleParameter,
45 "Useless parameter of type double", 0.0);
46 addParam(
"stringParameter", m_stringParameter,
47 "Useless parameter of type string", std::string{
""});
48 addParam(
"doubleListParameter", m_doubleListParameter,
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.
The AWESOME basic module.
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.
void beginRun() override
Called for each begin of run.
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.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
bool requireRelationTo(const StoreArray< TO > &toArray, DataStore::EDurability durability=DataStore::c_Event, const std::string &namedRelation="") const
Produce error if no relation from this array to 'toArray' has been registered.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.