ATLAS Offline Software
Loading...
Searching...
No Matches
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"
11
12#include <memory>
13#include <vector>
14
15class G4Track;
16class G4VPhysicalVolume;
17class G4FieldTrack;
18
24class 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 // Deleter for the unique_ptr managing the G4PropagatorInField
40 struct Deleter {
41 void operator()(G4PropagatorInField*) const;
42 };
43
44 // Get the world volume in which the particle transport is performed
45 G4VPhysicalVolume* getWorldVolume();
46 // Create and return a new propagator
47 G4PropagatorInField* makePropagator();
48 // Advance track by single Geant4 step in geometry
49 void doStep(G4FieldTrack& fieldTrack);
50 // Pointer to the physical volume of the world (either simplified or full geometry)
51 G4VPhysicalVolume* m_worldVolume{};
52
53 // Whether to use simplified geometry for particle transport
54 Gaudi::Property<bool> m_useSimplifiedGeo{this, "UseSimplifiedGeo", true, "Use simplified geometry for particle transport"};
55 // Name of the logical volume of the simplified world as defined in the loaded GDML file
56 Gaudi::Property<std::string> m_simplifiedWorldLogName{this, "SimplifiedWorldLogName", "Name of the logical volume of the simplified world"};
57 // Name of volume until which the particle is tracked in transport
58 Gaudi::Property<std::string> m_transportLimitVolume{this, "TransportLimitVolume", "Name of the volume until which the particle is transported"};
59 // Maximum number of steps in particle transport
60 Gaudi::Property<unsigned int> m_maxSteps{this, "MaxSteps", 100, "Maximum number of steps in particle transport"};
61 // Thread local propagator
62 static thread_local std::unique_ptr<G4PropagatorInField, Deleter> s_propagator;
63
64
65}; // class G4CaloTransportTool
66
67
68#endif // G4ATLASTOOLS_G4CALOTRANSPORTTOOL_H
void doStep(G4FieldTrack &fieldTrack)
StatusCode initializePropagator() override final
Gaudi::Property< bool > m_useSimplifiedGeo
Gaudi::Property< std::string > m_transportLimitVolume
virtual StatusCode finalize() override final
static thread_local std::unique_ptr< G4PropagatorInField, Deleter > s_propagator
G4VPhysicalVolume * m_worldVolume
Gaudi::Property< std::string > m_simplifiedWorldLogName
virtual std::vector< G4FieldTrack > transport(const G4Track &G4InputTrack) override final
G4VPhysicalVolume * getWorldVolume()
G4CaloTransportTool(const std::string &, const std::string &, const IInterface *)
Gaudi::Property< unsigned int > m_maxSteps
G4PropagatorInField * makePropagator()
void operator()(G4PropagatorInField *) const