Geant4-11
Public Member Functions | Private Member Functions | Private Attributes
GFlashHitMaker Class Reference

#include <GFlashHitMaker.hh>

Public Member Functions

 GFlashHitMaker ()
 
void make (GFlashEnergySpot *aSpot, const G4FastTrack *aT)
 
void SetNameOfWorldWithSD (const G4String &aName)
 
 ~GFlashHitMaker ()
 

Private Member Functions

 GFlashHitMaker (const GFlashHitMaker &)
 
GFlashHitMakeroperator= (const GFlashHitMaker &)
 

Private Attributes

G4bool fNaviSetup
 
G4NavigatorfpNavigator
 
G4TouchableHandle fTouchableHandle
 
G4String fWorldWithSdName
 Name of the world containing the sensitive detector. If empty, default mass world is used. More...
 

Detailed Description

Definition at line 51 of file GFlashHitMaker.hh.

Constructor & Destructor Documentation

◆ GFlashHitMaker() [1/2]

GFlashHitMaker::GFlashHitMaker ( )

Definition at line 45 of file GFlashHitMaker.cc.

46{
47 fTouchableHandle = new G4TouchableHistory(); // talk to ?@@@
49 fNaviSetup = false;
51}
G4Navigator * fpNavigator
G4String fWorldWithSdName
Name of the world containing the sensitive detector. If empty, default mass world is used.
G4TouchableHandle fTouchableHandle

References fNaviSetup, fpNavigator, fTouchableHandle, and fWorldWithSdName.

◆ ~GFlashHitMaker()

GFlashHitMaker::~GFlashHitMaker ( )

Definition at line 53 of file GFlashHitMaker.cc.

54{
55 delete fpNavigator;
56}

References fpNavigator.

◆ GFlashHitMaker() [2/2]

GFlashHitMaker::GFlashHitMaker ( const GFlashHitMaker )
inlineprivate

Definition at line 71 of file GFlashHitMaker.hh.

71{}

Member Function Documentation

◆ make()

void GFlashHitMaker::make ( GFlashEnergySpot aSpot,
const G4FastTrack aT 
)

Navigator

Definition at line 58 of file GFlashHitMaker.cc.

59{
60 // Locate the spot
61 if (!fNaviSetup)
62 {
63 // Choose the world volume that contains the sensitive detector based on its name (empty name for mass geometry)
64 G4VPhysicalVolume* worldWithSD = nullptr;
65 if(fWorldWithSdName.empty()) {
67 } else {
69 }
70 fpNavigator->SetWorldVolume(worldWithSD);
72 LocateGlobalPointAndUpdateTouchable(aSpot->GetPosition(),
73 fTouchableHandle(), false);
74 fNaviSetup = true;
75 }
76 else
77 {
79 LocateGlobalPointAndUpdateTouchable(aSpot->GetPosition(),
81 }
82
83 //--------------------------------------
84 // Fills attribute of the G4Step needed
85 // by our sensitive detector:
86 //-------------------------------------
87 // set spot information:
88 G4GFlashSpot theSpot(aSpot, aT, fTouchableHandle);
90 //--------------------------------------
91 // Produce Hits
92 // call sensitive part: taken/adapted from the stepping:
93 // Send G4Step information to Hit/Dig if the volume is sensitive
94 //--------------G4TouchableHistory----------------------------------------
95
96 G4VPhysicalVolume* pCurrentVolume = fTouchableHandle()->GetVolume();
97 G4VSensitiveDetector* pSensitive;
98 if( pCurrentVolume != 0 )
99 {
100 pSensitive = pCurrentVolume->GetLogicalVolume()->GetSensitiveDetector();
101 G4VGFlashSensitiveDetector * gflashSensitive =
102 dynamic_cast<G4VGFlashSensitiveDetector * > (pSensitive);
103 if( gflashSensitive )
104 {
105 gflashSensitive->Hit(&theSpot);
106 }
107 else if (( pSensitive ) &&
108 ( pCurrentVolume->GetLogicalVolume()->GetFastSimulationManager() )
109 ) // Using gflash without implementing the
110 // gflashSensitive detector interface -> not allowed!
111
112 {
113 G4cerr << "ERROR - GFlashHitMaker::make()" << G4endl
114 << " It is required to implement the "<< G4endl
115 << " G4VGFlashSensitiveDetector interface in "<< G4endl
116 << " addition to the usual SensitiveDetector class."
117 << G4endl;
118 G4Exception("GFlashHitMaker::make()", "InvalidSetup", FatalException,
119 "G4VGFlashSensitiveDetector interface not implemented.");
120 }
121 }
122 else
123 {
124 #ifdef GFLASH_DEBUG
125 G4cout << "GFlashHitMaker::Out of volume "<< G4endl;
126 #endif
127 }
128}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4VSensitiveDetector * GetSensitiveDetector() const
G4FastSimulationManager * GetFastSimulationManager() const
void SetWorldVolume(G4VPhysicalVolume *pWorld)
G4VPhysicalVolume * GetWorldVolume() const
G4VPhysicalVolume * GetParallelWorld(const G4String &worldName)
static G4TransportationManager * GetTransportationManager()
G4Navigator * GetNavigatorForTracking() const
G4bool Hit(G4GFlashSpot *aSpot)
G4LogicalVolume * GetLogicalVolume() const
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
Definition: G4VTouchable.cc:34
G4ThreeVector GetPosition() const

References FatalException, fNaviSetup, fpNavigator, fTouchableHandle, fWorldWithSdName, G4cerr, G4cout, G4endl, G4Exception(), G4LogicalVolume::GetFastSimulationManager(), G4VPhysicalVolume::GetLogicalVolume(), G4TransportationManager::GetNavigatorForTracking(), G4TransportationManager::GetParallelWorld(), GFlashEnergySpot::GetPosition(), G4LogicalVolume::GetSensitiveDetector(), G4TransportationManager::GetTransportationManager(), G4VTouchable::GetVolume(), G4Navigator::GetWorldVolume(), G4VGFlashSensitiveDetector::Hit(), and G4Navigator::SetWorldVolume().

Referenced by GFlashShowerModel::ElectronDoIt().

◆ operator=()

GFlashHitMaker & GFlashHitMaker::operator= ( const GFlashHitMaker )
inlineprivate

Definition at line 72 of file GFlashHitMaker.hh.

73 {
74 return *this;
75 }

◆ SetNameOfWorldWithSD()

void GFlashHitMaker::SetNameOfWorldWithSD ( const G4String aName)
inline

Definition at line 59 of file GFlashHitMaker.hh.

59{fWorldWithSdName = aName;};

References fWorldWithSdName.

Field Documentation

◆ fNaviSetup

G4bool GFlashHitMaker::fNaviSetup
private

Definition at line 65 of file GFlashHitMaker.hh.

Referenced by GFlashHitMaker(), and make().

◆ fpNavigator

G4Navigator* GFlashHitMaker::fpNavigator
private

Definition at line 64 of file GFlashHitMaker.hh.

Referenced by GFlashHitMaker(), make(), and ~GFlashHitMaker().

◆ fTouchableHandle

G4TouchableHandle GFlashHitMaker::fTouchableHandle
private

Definition at line 63 of file GFlashHitMaker.hh.

Referenced by GFlashHitMaker(), and make().

◆ fWorldWithSdName

G4String GFlashHitMaker::fWorldWithSdName
private

Name of the world containing the sensitive detector. If empty, default mass world is used.

Definition at line 67 of file GFlashHitMaker.hh.

Referenced by GFlashHitMaker(), make(), and SetNameOfWorldWithSD().


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