Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4TouchableHistory Class Reference

G4TouchableHistory is an object representing a touchable detector element, and its history in the geometrical hierarchy, including its net resultant local->global transform. A touchable is a geometrical volume (solid) which has a unique placement in a detector description. More...

#include <G4TouchableHistory.hh>

Inheritance diagram for G4TouchableHistory:

Public Member Functions

 G4TouchableHistory ()
virtual ~G4TouchableHistory ()=default
 G4TouchableHistory (const G4NavigationHistory &history)
G4VPhysicalVolumeGetVolume (G4int depth=0) const
G4VSolidGetSolid (G4int depth=0) const
const G4ThreeVectorGetTranslation (G4int depth=0) const
const G4RotationMatrixGetRotation (G4int depth=0) const
G4int GetReplicaNumber (G4int depth=0) const
G4int GetCopyNumber (G4int depth=0) const
G4int GetHistoryDepth () const
G4int MoveUpHistory (G4int num_levels=1)
void UpdateYourself (G4VPhysicalVolume *pPhysVol, const G4NavigationHistory *history=nullptr)
const G4NavigationHistoryGetHistory () const
void * operator new (std::size_t)
void operator delete (void *aTH)

Detailed Description

G4TouchableHistory is an object representing a touchable detector element, and its history in the geometrical hierarchy, including its net resultant local->global transform. A touchable is a geometrical volume (solid) which has a unique placement in a detector description.

Definition at line 106 of file G4TouchableHistory.hh.

Constructor & Destructor Documentation

◆ G4TouchableHistory() [1/2]

G4TouchableHistory::G4TouchableHistory ( )

Default Constructor. It produces a touchable-history of 'zero-depth', i.e. an "unphysical" and not very usable one; for initialisation only.

Definition at line 39 of file G4TouchableHistory.cc.

40 : ftlate(G4ThreeVector(0.,0.,0.))
41
42{
43 fhistory.SetFirstEntry(nullptr);
44}
CLHEP::Hep3Vector G4ThreeVector

◆ ~G4TouchableHistory()

virtual G4TouchableHistory::~G4TouchableHistory ( )
virtualdefault

Default Destructor. Virtual, as it is a reference-counted object, but there is no provision for this class to be subclassed; if subclassed, it may fail and not give explicit errors!

◆ G4TouchableHistory() [2/2]

G4TouchableHistory::G4TouchableHistory ( const G4NavigationHistory & history)

Copy constructor.

Definition at line 46 of file G4TouchableHistory.cc.

47 : fhistory(history)
48{
49 const G4AffineTransform& tf = fhistory.GetTopTransform();
50 ftlate = tf.InverseNetTranslation();
51 frot = tf.InverseNetRotation();
52}
G4ThreeVector InverseNetTranslation() const
G4RotationMatrix InverseNetRotation() const

Member Function Documentation

◆ GetCopyNumber()

G4int G4TouchableHistory::GetCopyNumber ( G4int depth = 0) const
inline

◆ GetHistory()

◆ GetHistoryDepth()

G4int G4TouchableHistory::GetHistoryDepth ( ) const
inline

◆ GetReplicaNumber()

◆ GetRotation()

const G4RotationMatrix * G4TouchableHistory::GetRotation ( G4int depth = 0) const

Definition at line 71 of file G4TouchableHistory.cc.

72{
73 // The value returned will change at the next call
74 // Copy it if you want to use it!
75 //
76 static G4ThreadLocal G4RotationMatrix* rotM = nullptr;
77 if ( rotM == nullptr ) { rotM = new G4RotationMatrix; }
78
79 if(depth==0.0)
80 {
81 return &frot;
82 }
83 *rotM = fhistory.GetTransform(CalculateHistoryIndex(depth)).NetRotation();
84 return rotM;
85}
CLHEP::HepRotation G4RotationMatrix
#define G4ThreadLocal
Definition tls.hh:77

Referenced by G4Channeling::PosToLattice(), G4Channeling::PostStepDoIt(), G4ElNeutrinoNucleusProcess::PostStepDoIt(), G4MuNeutrinoNucleusProcess::PostStepDoIt(), G4NeutrinoElectronProcess::PostStepDoIt(), G4TauNeutrinoNucleusProcess::PostStepDoIt(), and G4VXTRenergyLoss::PostStepDoIt().

◆ GetSolid()

G4VSolid * G4TouchableHistory::GetSolid ( G4int depth = 0) const
inline

◆ GetTranslation()

const G4ThreeVector & G4TouchableHistory::GetTranslation ( G4int depth = 0) const

Definition at line 55 of file G4TouchableHistory.cc.

56{
57 // The value returned will change at the next call
58 // Copy it if you want to use it!
59 //
60 static G4ThreadLocal G4ThreeVector* ctrans = nullptr;
61 if ( ctrans == nullptr ) { ctrans = new G4ThreeVector; }
62 if(depth==0.0)
63 {
64 return ftlate;
65 }
66 *ctrans = fhistory.GetTransform(CalculateHistoryIndex(depth)).NetTranslation();
67 return *ctrans;
68}

Referenced by G4Channeling::PosToLattice(), G4ElNeutrinoNucleusProcess::PostStepDoIt(), G4MuNeutrinoNucleusProcess::PostStepDoIt(), G4NeutrinoElectronProcess::PostStepDoIt(), G4TauNeutrinoNucleusProcess::PostStepDoIt(), and G4VXTRenergyLoss::PostStepDoIt().

◆ GetVolume()

◆ MoveUpHistory()

G4int G4TouchableHistory::MoveUpHistory ( G4int num_levels = 1)

◆ operator delete()

void G4TouchableHistory::operator delete ( void * aTH)
inline

◆ operator new()

void * G4TouchableHistory::operator new ( std::size_t )
inline

Operators overriding new/delete for use by G4Allocator.

◆ UpdateYourself()


The documentation for this class was generated from the following files: