Belle II Software
development
EventAction.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/datastore/StoreObjPtr.h>
12
#include <mdst/dataobjects/MCParticleGraph.h>
13
14
#include <G4UserEventAction.hh>
15
16
#include <fstream>
17
18
class
G4Event;
19
20
namespace
Belle2
{
25
26
class
EventMetaData
;
27
28
namespace
Simulation {
29
34
class
EventAction
:
public
G4UserEventAction {
35
36
public
:
42
EventAction
(
const
std::string& mcCollectionName,
MCParticleGraph
& mcParticleGraph);
43
47
virtual
~EventAction
();
48
54
void
BeginOfEventAction
(
const
G4Event* event);
55
61
void
EndOfEventAction
(
const
G4Event* event);
62
66
std::ofstream*
getVREventStream
()
const
{
return
m_VREventStream
; }
67
68
protected
:
69
70
std::string
m_mcCollectionName
;
71
MCParticleGraph
&
m_mcParticleGraph
;
72
73
private
:
74
75
bool
m_writeSimSteps
{
false
};
76
std::ofstream*
m_VREventStream
{
nullptr
};
77
StoreObjPtr<EventMetaData>
m_evtMetaData
;
78
79
};
80
81
}
// end namespace Simulation
83
}
// end namespace Belle2
Belle2::EventMetaData
Store event, run, and experiment numbers.
Definition
EventMetaData.h:33
Belle2::MCParticleGraph
Class to build, validate and sort a particle decay chain.
Definition
MCParticleGraph.h:37
Belle2::Simulation::EventAction::m_mcCollectionName
std::string m_mcCollectionName
The name of the MCParticle collection to which the MCParticles should be written.
Definition
EventAction.h:70
Belle2::Simulation::EventAction::m_VREventStream
std::ofstream * m_VREventStream
Output stream for writing each step of event's history for the Virtual Reality.
Definition
EventAction.h:76
Belle2::Simulation::EventAction::m_mcParticleGraph
MCParticleGraph & m_mcParticleGraph
Reference to the MCParticle graph which is converted to a MCParticle list by this class.
Definition
EventAction.h:71
Belle2::Simulation::EventAction::m_writeSimSteps
bool m_writeSimSteps
Flag for writing out the simulation steps.
Definition
EventAction.h:75
Belle2::Simulation::EventAction::~EventAction
virtual ~EventAction()
Destructor.
Definition
EventAction.cc:37
Belle2::Simulation::EventAction::m_evtMetaData
StoreObjPtr< EventMetaData > m_evtMetaData
Event metadata.
Definition
EventAction.h:77
Belle2::Simulation::EventAction::EventAction
EventAction(const std::string &mcCollectionName, MCParticleGraph &mcParticleGraph)
Constructor.
Definition
EventAction.cc:24
Belle2::Simulation::EventAction::getVREventStream
std::ofstream * getVREventStream() const
This method gets the output stream for the event-history steps.
Definition
EventAction.h:66
Belle2::Simulation::EventAction::EndOfEventAction
void EndOfEventAction(const G4Event *event)
This method is invoked at the very end of event processing.
Definition
EventAction.cc:65
Belle2::Simulation::EventAction::BeginOfEventAction
void BeginOfEventAction(const G4Event *event)
This method is invoked before converting the primary particles to G4Track objects.
Definition
EventAction.cc:47
Belle2::StoreObjPtr
Type-safe access to single objects in the data store.
Definition
StoreObjPtr.h:96
Belle2
Abstract base class for different kinds of events.
Definition
MillepedeAlgorithm.h:17
simulation
kernel
include
EventAction.h
Generated on Sun Sep 21 2025 02:55:46 for Belle II Software by
1.13.2