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
13
namespace
Belle2
{
18
namespace
Simulation {
19
void
StepTiming::NewStep
()
20
{
21
//Start timing the step
22
m_startTime
=
Utils::getClock
();
23
}
24
void
StepTiming::StepInfo
()
25
{
26
//Step is done, get track and volume
27
fTrack = fManager->GetfTrack();
28
G4LogicalVolume* volume = fTrack->GetStep()->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
29
//calculate elapsed time
30
const
double
time =
Utils::getClock
() -
m_startTime
;
31
//call callback function
32
m_callback
(fTrack, volume, time);
33
}
34
35
}
37
}
//Belle2 namespace
Belle2::Simulation::StepTiming::m_startTime
double m_startTime
start time of the step
Definition
StepTiming.h:72
Belle2::Simulation::StepTiming::NewStep
virtual void NewStep()
Start timing a new step.
Definition
StepTiming.cc:19
Belle2::Simulation::StepTiming::StepInfo
virtual void StepInfo()
Step finished, call callback function.
Definition
StepTiming.cc:24
Belle2::Simulation::StepTiming::m_callback
callbackType m_callback
callback function to call
Definition
StepTiming.h:70
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 Mon Sep 1 2025 02:55:48 for Belle II Software by
1.13.2