A tool which transports particles through the Geant4 geometry.
More...
#include <G4CaloTransportTool.h>
|
G4VPhysicalVolume * | m_worldVolume {} |
|
Gaudi::Property< bool > | m_useSimplifiedGeo {this, "UseSimplifiedGeo", true, "Use simplified geometry for particle transport"} |
|
Gaudi::Property< std::string > | m_simplifiedWorldLogName {this, "SimplifiedWorldLogName", "Name of the logical volume of the simplified world"} |
|
Gaudi::Property< std::string > | m_transportLimitVolume {this, "TransportLimitVolume", "Name of the volume until which the particle is transported"} |
|
Gaudi::Property< unsigned int > | m_maxSteps {this, "MaxSteps", 100, "Maximum number of steps in particle transport"} |
|
thread_utils::ThreadLocalHolder< G4PropagatorInField > | m_propagatorHolder |
|
A tool which transports particles through the Geant4 geometry.
- Author
- Joshua Falco Beirer joshu.nosp@m.a.fa.nosp@m.lco.b.nosp@m.eire.nosp@m.r@cer.nosp@m.n.ch
Definition at line 24 of file G4CaloTransportTool.h.
◆ G4CaloTransportTool()
G4CaloTransportTool::G4CaloTransportTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ doStep()
void G4CaloTransportTool::doStep |
( |
G4FieldTrack & |
fieldTrack | ) |
|
|
private |
Definition at line 113 of file G4CaloTransportTool.cxx.
117 auto navigator = propagator->GetNavigatorForPropagating();
119 G4double retSafety = -1.0;
120 G4double currentMinimumStep = 10.0 *
CLHEP::m;
122 G4VPhysicalVolume* currentPhysVol =
123 navigator->LocateGlobalPointAndSetup(fieldTrack.GetPosition(),
nullptr);
125 G4ThreeVector direction = fieldTrack.GetMomentumDirection();
127 navigator->LocateGlobalPointAndSetup(fieldTrack.GetPosition(), &direction);
129 if (fieldTrack.GetCharge() == 0) {
133 G4double stepLength = navigator->ComputeStep(
134 fieldTrack.GetPosition(), fieldTrack.GetMomentumDirection(),
135 currentMinimumStep, retSafety);
138 fieldTrack.SetPosition(fieldTrack.GetPosition() +
140 fieldTrack.GetMomentumDirection().unit());
144 propagator->ComputeStep(fieldTrack, currentMinimumStep, retSafety,
◆ finalize()
StatusCode G4CaloTransportTool::finalize |
( |
| ) |
|
|
finaloverridevirtual |
Definition at line 21 of file G4CaloTransportTool.cxx.
29 delete mapPair.second->GetNavigatorForPropagating();
30 delete mapPair.second;
33 return StatusCode::SUCCESS;
◆ getWorldVolume()
G4VPhysicalVolume * G4CaloTransportTool::getWorldVolume |
( |
| ) |
|
|
private |
Definition at line 70 of file G4CaloTransportTool.cxx.
74 ATH_MSG_INFO(
"Creating simplified world volume for particle transport");
76 G4LogicalVolume* logVol = G4LogicalVolumeStore::GetInstance()->GetVolume(
80 return new G4PVPlacement(
82 G4ThreeVector(0, 0, 0),
84 "simplifiedWorldPhysVol",
91 ATH_MSG_INFO(
"Using full geometry for particle transport");
92 return G4TransportationManager::GetTransportationManager()
93 ->GetNavigatorForTracking()
◆ initializePropagator()
StatusCode G4CaloTransportTool::initializePropagator |
( |
| ) |
|
|
finaloverride |
Definition at line 36 of file G4CaloTransportTool.cxx.
37 ATH_MSG_INFO(
"Initializing G4PropagatorInField for thread "
38 << G4Threading::G4GetThreadId());
45 G4Exception(
"G4CaloTransportTool",
"FailedToGetWorldVolume",
47 "G4CaloTransportTool: Failed to get world volume.");
53 ATH_MSG_INFO(
"Maximum allowed number of steps in particle transport: "
64 ATH_MSG_ERROR(
"G4CaloTransportTool::initializePropagator() Propagator already initialized!");
67 return StatusCode::SUCCESS;
◆ makePropagator()
G4PropagatorInField * G4CaloTransportTool::makePropagator |
( |
| ) |
|
|
private |
Definition at line 98 of file G4CaloTransportTool.cxx.
100 G4Navigator* navigator =
new G4Navigator();
104 G4FieldManager* fieldMgr =
105 G4TransportationManager::GetTransportationManager()->GetFieldManager();
107 G4PropagatorInField* propagator =
108 new G4PropagatorInField(navigator, fieldMgr);
◆ transport()
std::vector< G4FieldTrack > G4CaloTransportTool::transport |
( |
const G4Track & |
G4InputTrack | ) |
|
|
finaloverridevirtual |
Definition at line 151 of file G4CaloTransportTool.cxx.
158 std::vector<G4FieldTrack> outputStepVector;
160 G4FieldTrack tmpFieldTrack(
'0');
161 G4FieldTrackUpdator::Update(&tmpFieldTrack, &G4InputTrack);
163 outputStepVector.push_back(tmpFieldTrack);
166 for (
unsigned int iStep = 0; iStep <
m_maxSteps; iStep++) {
170 outputStepVector.push_back(tmpFieldTrack);
172 auto volumn = navigator->LocateGlobalPointAndSetup(tmpFieldTrack.GetPosition(),
nullptr);
173 if (volumn !=
nullptr) {
174 std::string volName = volumn->GetName();
180 description <<
"at step " << iStep <<
"/" <<
m_maxSteps.value() <<
" with position " << tmpFieldTrack.GetPosition() <<
" and momentum " << tmpFieldTrack.GetMomentum();
181 G4Exception(
"G4CaloTransportTool::transport",
182 "Cannot get LocateGlobalPointAndSetup",
188 return outputStepVector;
◆ m_maxSteps
Gaudi::Property<unsigned int> G4CaloTransportTool::m_maxSteps {this, "MaxSteps", 100, "Maximum number of steps in particle transport"} |
|
private |
◆ m_propagatorHolder
◆ m_simplifiedWorldLogName
Gaudi::Property<std::string> G4CaloTransportTool::m_simplifiedWorldLogName {this, "SimplifiedWorldLogName", "Name of the logical volume of the simplified world"} |
|
private |
◆ m_transportLimitVolume
Gaudi::Property<std::string> G4CaloTransportTool::m_transportLimitVolume {this, "TransportLimitVolume", "Name of the volume until which the particle is transported"} |
|
private |
◆ m_useSimplifiedGeo
Gaudi::Property<bool> G4CaloTransportTool::m_useSimplifiedGeo {this, "UseSimplifiedGeo", true, "Use simplified geometry for particle transport"} |
|
private |
◆ m_worldVolume
G4VPhysicalVolume* G4CaloTransportTool::m_worldVolume {} |
|
private |
The documentation for this class was generated from the following files: