Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
GFlashHitMaker Class Reference

#include <GFlashHitMaker.hh>

Public Member Functions

 GFlashHitMaker ()
 
 ~GFlashHitMaker ()
 
void make (GFlashEnergySpot *aSpot, const G4FastTrack *aT)
 

Detailed Description

Definition at line 52 of file GFlashHitMaker.hh.

Constructor & Destructor Documentation

GFlashHitMaker::GFlashHitMaker ( )

Definition at line 46 of file GFlashHitMaker.cc.

47 {
48  fTouchableHandle = new G4TouchableHistory(); // talk to ?@@@
49  fpNavigator = new G4Navigator();
50  fNaviSetup = false;
51 }
GFlashHitMaker::~GFlashHitMaker ( )

Definition at line 53 of file GFlashHitMaker.cc.

54 {
55  delete fpNavigator;
56 }

Member Function Documentation

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

Navigator

Definition at line 58 of file GFlashHitMaker.cc.

References FatalException, G4cerr, G4cout, G4endl, G4Exception(), G4LogicalVolume::GetFastSimulationManager(), G4VPhysicalVolume::GetLogicalVolume(), GFlashEnergySpot::GetPosition(), G4LogicalVolume::GetSensitiveDetector(), G4TransportationManager::GetTransportationManager(), G4VTouchable::GetVolume(), and G4VGFlashSensitiveDetector::Hit().

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

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