ATLAS Offline Software
Loading...
Searching...
No Matches
G4StepLimitationTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5// class header
7
8// G4 headers
9#include "G4StepLimiter.hh"
10#include "G4ParticleDefinition.hh"
11#include "G4ProcessManager.hh"
12#include "G4Version.hh"
13
14//-----------------------------------------------------------------------------
15// Implementation file for class : G4StepLimitationTool
16//
17// 03-08-2015 : Edoardo Farina
18//-----------------------------------------------------------------------------
19
20#if G4VERSION_NUMBER > 1029
21#define PARTICLEITERATOR (this->GetParticleIterator())
22#elif G4VERSION_NUMBER > 1009
23#define PARTICLEITERATOR aParticleIterator
24#else
25#define PARTICLEITERATOR theParticleIterator
26#endif
27
28//=============================================================================
29// Standard constructor, initializes variables
30//=============================================================================
32 const std::string& name,
33 const IInterface* parent)
34 : base_class(type, name, parent) {
35 m_physicsOptionType = G4AtlasPhysicsOption::Type::GlobalProcesses;
36}
37
38//=============================================================================
39// Destructor
40//=============================================================================
41
45
46//=============================================================================
47// Initialize
48//=============================================================================
50{
51 ATH_MSG_VERBOSE("G4StepLimitationTool initialize( )");
52
53 return StatusCode::SUCCESS;
54}
55
56auto G4StepLimitationTool::GetPhysicsOption() -> UPPhysicsConstructor {
57 return std::make_unique<G4StepLimitationTool::PhysicsConstructor>(name(), this->msgLevel());
58}
59
61
63
64 ATH_MSG_DEBUG(" ConstructProcess for G4StepLimiter being run");
65 PARTICLEITERATOR->reset();
66 while( (*PARTICLEITERATOR)() )
67 {
68 G4ParticleDefinition* particle = PARTICLEITERATOR->value();
69 G4ProcessManager* pmanager = particle->GetProcessManager();
70 pmanager->AddProcess(new G4StepLimiter, -1,-1,3);
71 }
72}
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
#define PARTICLEITERATOR
virtual ~G4StepLimitationTool()
Destructor.
UPPhysicsConstructor GetPhysicsOption() override
Implements.
G4StepLimitationTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
virtual StatusCode initialize() override
Initialize method.