Belle II Software
development
StepTiming.cc
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
#include <simulation/kernel/StepTiming.h>
10
#include <framework/utilities/Utils.h>
11
#include <G4SteppingManager.hh>
12
#include <G4LogicalVolume.hh>
13
#include <G4Track.hh>
14
15
namespace
Belle2
{
20
namespace
Simulation {
21
void
StepTiming::NewStep
()
22
{
23
//Start timing the step
24
m_startTime
=
Utils::getClock
();
25
}
26
void
StepTiming::StepInfo
()
27
{
28
//Step is done, get track and volume
29
fTrack = fManager->GetfTrack();
30
G4LogicalVolume* volume = fTrack->GetStep()->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
31
//calculate elapsed time
32
const
double
time =
Utils::getClock
() -
m_startTime
;
33
//call callback function
34
m_callback
(fTrack, volume, time);
35
}
36
37
}
39
}
//Belle2 namespace
Belle2::Simulation::StepTiming::m_startTime
double m_startTime
start time of the step
Definition
StepTiming.h:71
Belle2::Simulation::StepTiming::NewStep
virtual void NewStep()
Start timing a new step.
Definition
StepTiming.cc:21
Belle2::Simulation::StepTiming::StepInfo
virtual void StepInfo()
Step finished, call callback function.
Definition
StepTiming.cc:26
Belle2::Simulation::StepTiming::m_callback
callbackType m_callback
callback function to call
Definition
StepTiming.h:69
Belle2::Utils::getClock
double getClock()
Return current value of the real-time clock.
Definition
Utils.cc:70
Belle2
Abstract base class for different kinds of events.
Definition
MillepedeAlgorithm.h:17
simulation
kernel
src
StepTiming.cc
Generated on Sun Sep 21 2025 02:55:50 for Belle II Software by
1.13.2