Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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.

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);
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 (( pSensitive ) &&
103  ( pCurrentVolume->GetLogicalVolume()->GetFastSimulationManager() )
104  ) // Using gflash without implementing the
105  // gflashSensitive detector interface -> not allowed!
106 
107  {
108  G4cerr << "ERROR - GFlashHitMaker::make()" << G4endl
109  << " It is required to implement the "<< G4endl
110  << " G4VGFlashSensitiveDetector interface in "<< G4endl
111  << " addition to the usual SensitiveDetector class."
112  << G4endl;
113  G4Exception("GFlashHitMaker::make()", "InvalidSetup", FatalException,
114  "G4VGFlashSensitiveDetector interface not implemented.");
115  }
116  }
117  else
118  {
119  #ifdef GFLASH_DEBUG
120  G4cout << "GFlashHitMaker::Out of volume "<< G4endl;
121  #endif
122  }
123 }
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

Here is the call graph for this function:


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