ATLAS Offline Software
G4CaloTransportTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef G4ATLASTOOLS_G4CALOTRANSPORTTOOL_H
6 #define G4ATLASTOOLS_G4CALOTRANSPORTTOOL_H
7 
10 #include "G4PropagatorInField.hh"
12 
13 #include <vector>
14 
15 class G4Track;
16 class G4VPhysicalVolume;
17 class G4FieldTrack;
18 
24 class G4CaloTransportTool : virtual public extends<AthAlgTool, IG4CaloTransportTool>
25 {
26 
27  public:
28 
29  G4CaloTransportTool(const std::string&, const std::string&, const IInterface*);
30 
31  // Algorithm finalize at begin of job
32  virtual StatusCode finalize() override final;
33  // Initialize propagator for the current thread
34  StatusCode initializePropagator() override final;
35  // Transport input track through the geometry
36  virtual std::vector<G4FieldTrack> transport(const G4Track& G4InputTrack) override final;
37 
38  private:
39  // Get the world volume in which the particle transport is performed
40  G4VPhysicalVolume* getWorldVolume();
41  // Create and return a new propagator
42  G4PropagatorInField* makePropagator();
43  // Advance track by single Geant4 step in geometry
44  void doStep(G4FieldTrack& fieldTrack);
45  // Pointer to the physical volume of the world (either simplified or full geometry)
46  G4VPhysicalVolume* m_worldVolume{};
47 
48  // Whether to use simplified geometry for particle transport
49  Gaudi::Property<bool> m_useSimplifiedGeo{this, "UseSimplifiedGeo", true, "Use simplified geometry for particle transport"};
50  // Name of the logical volume of the simplified world as defined in the loaded GDML file
51  Gaudi::Property<std::string> m_simplifiedWorldLogName{this, "SimplifiedWorldLogName", "Name of the logical volume of the simplified world"};
52  // Name of volume until which the particle is tracked in transport
53  Gaudi::Property<std::string> m_transportLimitVolume{this, "TransportLimitVolume", "Name of the volume until which the particle is transported"};
54  // Maximum number of steps in particle transport
55  Gaudi::Property<unsigned int> m_maxSteps{this, "MaxSteps", 100, "Maximum number of steps in particle transport"};
56  // Thread local holder for propagators
58 
59 
60 }; // class G4CaloTransportTool
61 
62 
63 #endif // G4ATLASTOOLS_G4CALOTRANSPORTTOOL_H
G4CaloTransportTool::finalize
virtual StatusCode finalize() override final
Definition: G4CaloTransportTool.cxx:21
ThreadLocalHolder.h
Defines template helper classes for thread-local storage.
G4CaloTransportTool::m_transportLimitVolume
Gaudi::Property< std::string > m_transportLimitVolume
Definition: G4CaloTransportTool.h:53
G4CaloTransportTool::m_simplifiedWorldLogName
Gaudi::Property< std::string > m_simplifiedWorldLogName
Definition: G4CaloTransportTool.h:51
G4CaloTransportTool::m_worldVolume
G4VPhysicalVolume * m_worldVolume
Definition: G4CaloTransportTool.h:46
G4CaloTransportTool::m_maxSteps
Gaudi::Property< unsigned int > m_maxSteps
Definition: G4CaloTransportTool.h:55
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
G4CaloTransportTool::G4CaloTransportTool
G4CaloTransportTool(const std::string &, const std::string &, const IInterface *)
Definition: G4CaloTransportTool.cxx:16
G4CaloTransportTool::transport
virtual std::vector< G4FieldTrack > transport(const G4Track &G4InputTrack) override final
Definition: G4CaloTransportTool.cxx:151
G4CaloTransportTool::makePropagator
G4PropagatorInField * makePropagator()
Definition: G4CaloTransportTool.cxx:98
IG4CaloTransportTool.h
G4CaloTransportTool::m_propagatorHolder
thread_utils::ThreadLocalHolder< G4PropagatorInField > m_propagatorHolder
Definition: G4CaloTransportTool.h:57
G4CaloTransportTool::getWorldVolume
G4VPhysicalVolume * getWorldVolume()
Definition: G4CaloTransportTool.cxx:70
G4CaloTransportTool::initializePropagator
StatusCode initializePropagator() override final
Definition: G4CaloTransportTool.cxx:36
G4CaloTransportTool::doStep
void doStep(G4FieldTrack &fieldTrack)
Definition: G4CaloTransportTool.cxx:113
G4CaloTransportTool::m_useSimplifiedGeo
Gaudi::Property< bool > m_useSimplifiedGeo
Definition: G4CaloTransportTool.h:49
G4CaloTransportTool
A tool which transports particles through the Geant4 geometry.
Definition: G4CaloTransportTool.h:25
thread_utils::ThreadLocalHolder< G4PropagatorInField >