Belle II Software development
StepTiming.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#ifndef SIMULATION_KERNEL_STEPTIMING_H
11#define SIMULATION_KERNEL_STEPTIMING_H
12
13#include <G4VSteppingVerbose.hh>
14#include <G4LogicalVolume.hh>
15#include <G4Track.hh>
16
17namespace Belle2 {
22 namespace Simulation {
34 class StepTiming: public G4VSteppingVerbose {
35 public:
37 typedef std::function<void (G4Track*, G4LogicalVolume*, double)> callbackType;
39 explicit StepTiming(const callbackType& callback): G4VSteppingVerbose(), m_callback(callback) {}
41 virtual void NewStep();
43 virtual void StepInfo();
45 virtual void AtRestDoItInvoked() {};
47 virtual void AlongStepDoItAllDone() {};
49 virtual void PostStepDoItAllDone() {};
51 virtual void AlongStepDoItOneByOne() {};
53 virtual void PostStepDoItOneByOne() {};
55 virtual void TrackingStarted() {};
57 virtual void DPSLStarted() {};
59 virtual void DPSLUserLimit() {};
61 virtual void DPSLPostStep() {};
63 virtual void DPSLAlongStep() {};
65 virtual void VerboseTrack() {};
67 virtual void VerboseParticleChange() {};
68 private:
72 double m_startTime {0};
73 };
74
75 } //Simulation namespace
77} //Belle2 namespace
78#endif // SIMULATION_KERNEL_STEPTIMING_H
Class to perform more detailed timing studies of the Geant4 simulation.
Definition: StepTiming.h:34
virtual void AtRestDoItInvoked()
ignored, empty stub only implemented because it's pure virtual in base class
Definition: StepTiming.h:45
virtual void PostStepDoItAllDone()
ignored, empty stub only implemented because it's pure virtual in base class
Definition: StepTiming.h:49
virtual void AlongStepDoItOneByOne()
ignored, empty stub only implemented because it's pure virtual in base class
Definition: StepTiming.h:51
virtual void DPSLAlongStep()
ignored, empty stub only implemented because it's pure virtual in base class
Definition: StepTiming.h:63
virtual void DPSLStarted()
ignored, empty stub only implemented because it's pure virtual in base class
Definition: StepTiming.h:57
virtual void VerboseParticleChange()
ignored, empty stub only implemented because it's pure virtual in base class
Definition: StepTiming.h:67
StepTiming(const callbackType &callback)
Constructor: create an instance with a given callback function.
Definition: StepTiming.h:39
double m_startTime
start time of the step
Definition: StepTiming.h:72
virtual void TrackingStarted()
ignored, empty stub only implemented because it's pure virtual in base class
Definition: StepTiming.h:55
std::function< void(G4Track *, G4LogicalVolume *, double)> callbackType
Signature of the callback function.
Definition: StepTiming.h:37
virtual void DPSLPostStep()
ignored, empty stub only implemented because it's pure virtual in base class
Definition: StepTiming.h:61
virtual void NewStep()
Start timing a new step.
Definition: StepTiming.cc:19
virtual void AlongStepDoItAllDone()
ignored, empty stub only implemented because it's pure virtual in base class
Definition: StepTiming.h:47
virtual void PostStepDoItOneByOne()
ignored, empty stub only implemented because it's pure virtual in base class
Definition: StepTiming.h:53
virtual void StepInfo()
Step finished, call callback function.
Definition: StepTiming.cc:24
virtual void VerboseTrack()
ignored, empty stub only implemented because it's pure virtual in base class
Definition: StepTiming.h:65
callbackType m_callback
callback function to call
Definition: StepTiming.h:70
virtual void DPSLUserLimit()
ignored, empty stub only implemented because it's pure virtual in base class
Definition: StepTiming.h:59
Abstract base class for different kinds of events.