ATLAS Offline Software
Functions
G4StepHelper Namespace Reference

helper functions to avoid having to play with the G4Step to retrieve relevant quantities. More...

Functions

G4ThreeVector preStepPosition (const G4Step *theStep)
 TODO. More...
 
G4ThreeVector postStepPosition (const G4Step *theStep)
 TODO. More...
 
std::string particleName (const G4Step *theStep)
 TODO. More...
 
int particlePDGCode (const G4Step *theStep)
 TODO. More...
 
double depositedEnergy (const G4Step *theStep)
 TODO. More...
 
G4LogicalVolume * getPreStepLogicalVolume (const G4Step *theStep, int iLevel=0)
 TODO. More...
 
std::string getPreStepLogicalVolumeName (const G4Step *theStep, int iLevel=0)
 TODO. More...
 
G4VPhysicalVolume * getPreStepPhysicalVolume (const G4Step *theStep, int iLevel=0)
 TODO. More...
 
G4LogicalVolume * getPostStepLogicalVolume (const G4Step *theStep, int iLevel=0)
 TODO. More...
 
std::string getPostStepLogicalVolumeName (const G4Step *theStep, int iLevel=0)
 TODO. More...
 
G4VPhysicalVolume * getPostStepPhysicalVolume (const G4Step *theStep, int iLevel=0)
 TODO. More...
 
int preStepBranchDepth (const G4Step *theStep)
 TODO. More...
 
int postStepBranchDepth (const G4Step *theStep)
 TODO. More...
 
const G4VProcess * getProcess (const G4Step *theStep)
 TODO. More...
 
std::string getProcessName (const G4Step *theStep)
 TODO. More...
 
G4int getProcessSubType (const G4Step *theStep)
 TODO. More...
 

Detailed Description

helper functions to avoid having to play with the G4Step to retrieve relevant quantities.

TODO: These should be standalone functions rather than a class.

Function Documentation

◆ depositedEnergy()

double G4StepHelper::depositedEnergy ( const G4Step *  theStep)

TODO.

Definition at line 34 of file StepHelper.cxx.

35 {
36  assert (theStep!=nullptr);
37  return theStep->GetTotalEnergyDeposit();
38 }

◆ getPostStepLogicalVolume()

G4LogicalVolume * G4StepHelper::getPostStepLogicalVolume ( const G4Step *  theStep,
int  iLevel = 0 
)

TODO.

Definition at line 58 of file StepHelper.cxx.

59 {
60  return getPostStepPhysicalVolume(theStep, iLevel)->GetLogicalVolume();
61 }

◆ getPostStepLogicalVolumeName()

std::string G4StepHelper::getPostStepLogicalVolumeName ( const G4Step *  theStep,
int  iLevel = 0 
)

TODO.

Definition at line 62 of file StepHelper.cxx.

63 {
64  return getPostStepLogicalVolume(theStep, iLevel)->GetName();
65 }

◆ getPostStepPhysicalVolume()

G4VPhysicalVolume * G4StepHelper::getPostStepPhysicalVolume ( const G4Step *  theStep,
int  iLevel = 0 
)

TODO.

Definition at line 66 of file StepHelper.cxx.

67 {
68  const G4TouchableHistory *history
69  = static_cast<const G4TouchableHistory*>(theStep->GetPostStepPoint()->GetTouchable());
70  if (iLevel<=0)
71  {
72  return history->GetVolume(std::abs(iLevel));
73  }
74  const int nLev=history->GetHistoryDepth();
75  return history->GetVolume(nLev-iLevel);
76 }

◆ getPreStepLogicalVolume()

G4LogicalVolume * G4StepHelper::getPreStepLogicalVolume ( const G4Step *  theStep,
int  iLevel = 0 
)

TODO.

Definition at line 39 of file StepHelper.cxx.

40 {
41  return getPreStepPhysicalVolume(theStep, iLevel)->GetLogicalVolume();
42 }

◆ getPreStepLogicalVolumeName()

std::string G4StepHelper::getPreStepLogicalVolumeName ( const G4Step *  theStep,
int  iLevel = 0 
)

TODO.

Definition at line 43 of file StepHelper.cxx.

44 {
45  return getPreStepLogicalVolume(theStep, iLevel)->GetName();
46 }

◆ getPreStepPhysicalVolume()

G4VPhysicalVolume * G4StepHelper::getPreStepPhysicalVolume ( const G4Step *  theStep,
int  iLevel = 0 
)

TODO.

Definition at line 47 of file StepHelper.cxx.

48 {
49  const G4TouchableHistory *history
50  = static_cast<const G4TouchableHistory*>(theStep->GetPreStepPoint()->GetTouchable());
51  if (iLevel<=0)
52  {
53  return history->GetVolume(std::abs(iLevel));
54  }
55  const int nLev=history->GetHistoryDepth();
56  return history->GetVolume(nLev-iLevel);
57 }

◆ getProcess()

const G4VProcess * G4StepHelper::getProcess ( const G4Step *  theStep)

TODO.

Definition at line 87 of file StepHelper.cxx.

88 {
89  return theStep->GetPostStepPoint()->GetProcessDefinedStep();
90 }

◆ getProcessName()

std::string G4StepHelper::getProcessName ( const G4Step *  theStep)

TODO.

Definition at line 92 of file StepHelper.cxx.

93 {
94  return getProcess(theStep)->GetProcessName();
95 }

◆ getProcessSubType()

G4int G4StepHelper::getProcessSubType ( const G4Step *  theStep)

TODO.

Definition at line 97 of file StepHelper.cxx.

98 {
99  return getProcess(theStep)->GetProcessSubType();
100 }

◆ particleName()

std::string G4StepHelper::particleName ( const G4Step *  theStep)

TODO.

Definition at line 24 of file StepHelper.cxx.

25 {
26  assert (theStep!=nullptr);
27  return theStep->GetTrack()->GetDefinition()->GetParticleName();
28 }

◆ particlePDGCode()

int G4StepHelper::particlePDGCode ( const G4Step *  theStep)

TODO.

Definition at line 29 of file StepHelper.cxx.

30 {
31  assert (theStep!=nullptr);
32  return theStep->GetTrack()->GetDefinition()->GetPDGEncoding();
33 }

◆ postStepBranchDepth()

int G4StepHelper::postStepBranchDepth ( const G4Step *  theStep)

TODO.

Definition at line 82 of file StepHelper.cxx.

83 {
84  return static_cast<const G4TouchableHistory*>(theStep->GetPostStepPoint()->
85  GetTouchable())->GetHistoryDepth();
86 }

◆ postStepPosition()

G4ThreeVector G4StepHelper::postStepPosition ( const G4Step *  theStep)

TODO.

Definition at line 19 of file StepHelper.cxx.

20 {
21  assert (theStep!=nullptr);
22  return theStep->GetPostStepPoint()->GetPosition();
23 }

◆ preStepBranchDepth()

int G4StepHelper::preStepBranchDepth ( const G4Step *  theStep)

TODO.

Definition at line 77 of file StepHelper.cxx.

78 {
79  return static_cast<const G4TouchableHistory*>(theStep->GetPreStepPoint()->
80  GetTouchable())->GetHistoryDepth();
81 }

◆ preStepPosition()

G4ThreeVector G4StepHelper::preStepPosition ( const G4Step *  theStep)

TODO.

Definition at line 14 of file StepHelper.cxx.

15 {
16  assert (theStep!=nullptr);
17  return theStep->GetPreStepPoint()->GetPosition();
18 }
G4StepHelper::getProcess
const G4VProcess * getProcess(const G4Step *theStep)
TODO.
Definition: StepHelper.cxx:87
G4StepHelper::getPreStepLogicalVolume
G4LogicalVolume * getPreStepLogicalVolume(const G4Step *theStep, int iLevel=0)
TODO.
Definition: StepHelper.cxx:39
G4StepHelper::getPreStepPhysicalVolume
G4VPhysicalVolume * getPreStepPhysicalVolume(const G4Step *theStep, int iLevel=0)
TODO.
Definition: StepHelper.cxx:47
G4StepHelper::getPostStepLogicalVolume
G4LogicalVolume * getPostStepLogicalVolume(const G4Step *theStep, int iLevel=0)
TODO.
Definition: StepHelper.cxx:58
G4StepHelper::getPostStepPhysicalVolume
G4VPhysicalVolume * getPostStepPhysicalVolume(const G4Step *theStep, int iLevel=0)
TODO.
Definition: StepHelper.cxx:66