#include <GFlashHitMaker.hh>
Public Member Functions | |
GFlashHitMaker () | |
~GFlashHitMaker () | |
void | make (GFlashEnergySpot *aSpot, const G4FastTrack *aT) |
Definition at line 52 of file GFlashHitMaker.hh.
GFlashHitMaker::GFlashHitMaker | ( | ) |
Definition at line 46 of file GFlashHitMaker.cc.
00047 { 00048 fTouchableHandle = new G4TouchableHistory(); // talk to ?@@@ 00049 fpNavigator = new G4Navigator(); 00050 fNaviSetup = false; 00051 }
GFlashHitMaker::~GFlashHitMaker | ( | ) |
void GFlashHitMaker::make | ( | GFlashEnergySpot * | aSpot, | |
const G4FastTrack * | aT | |||
) |
Definition at line 58 of file GFlashHitMaker.cc.
References FatalException, G4cerr, G4cout, G4endl, G4Exception(), G4LogicalVolume::GetFastSimulationManager(), G4VPhysicalVolume::GetLogicalVolume(), GFlashEnergySpot::GetPosition(), G4LogicalVolume::GetSensitiveDetector(), G4TransportationManager::GetTransportationManager(), and G4VGFlashSensitiveDetector::Hit().
00059 { 00060 // Locate the spot 00061 if (!fNaviSetup) 00062 { 00063 fpNavigator-> 00064 SetWorldVolume(G4TransportationManager::GetTransportationManager()-> 00065 GetNavigatorForTracking()->GetWorldVolume() ); 00066 fpNavigator-> 00067 LocateGlobalPointAndUpdateTouchable(aSpot->GetPosition(), 00068 fTouchableHandle(), false); 00069 fNaviSetup = true; 00070 } 00071 else 00072 { 00073 fpNavigator-> 00074 LocateGlobalPointAndUpdateTouchable(aSpot->GetPosition(), 00075 fTouchableHandle()); 00076 } 00077 00078 //-------------------------------------- 00079 // Fills attribute of the G4Step needed 00080 // by our sensitive detector: 00081 //------------------------------------- 00082 // set spot information: 00083 G4GFlashSpot theSpot(aSpot, aT, fTouchableHandle); 00085 //-------------------------------------- 00086 // Produce Hits 00087 // call sensitive part: taken/adapted from the stepping: 00088 // Send G4Step information to Hit/Dig if the volume is sensitive 00089 //--------------G4TouchableHistory---------------------------------------- 00090 00091 G4VPhysicalVolume* pCurrentVolume = fTouchableHandle()->GetVolume(); 00092 G4VSensitiveDetector* pSensitive; 00093 if( pCurrentVolume != 0 ) 00094 { 00095 pSensitive = pCurrentVolume->GetLogicalVolume()->GetSensitiveDetector(); 00096 G4VGFlashSensitiveDetector * gflashSensitive = 00097 dynamic_cast<G4VGFlashSensitiveDetector * > (pSensitive); 00098 if( gflashSensitive ) 00099 { 00100 gflashSensitive->Hit(&theSpot); 00101 } 00102 else if ( (!gflashSensitive ) && 00103 ( pSensitive ) && 00104 ( pCurrentVolume->GetLogicalVolume()->GetFastSimulationManager() ) 00105 ) // Using gflash without implementing the 00106 // gflashSensitive detector interface -> not allowed! 00107 00108 { 00109 G4cerr << "ERROR - GFlashHitMaker::make()" << G4endl 00110 << " It is required to implement the "<< G4endl 00111 << " G4VGFlashSensitiveDetector interface in "<< G4endl 00112 << " addition to the usual SensitiveDetector class." 00113 << G4endl; 00114 G4Exception("GFlashHitMaker::make()", "InvalidSetup", FatalException, 00115 "G4VGFlashSensitiveDetector interface not implemented."); 00116 } 00117 } 00118 else 00119 { 00120 #ifdef GFLASH_DEBUG 00121 G4cout << "GFlashHitMaker::Out of volume "<< G4endl; 00122 #endif 00123 } 00124 }