2 #include "G4RunManager.hh"
3 #include "G4Material.hh"
5 #include "G4VTouchable.hh"
6 #include "G4TouchableHistory.hh"
7 #include "G4SDManager.hh"
11 using namespace TelescopeSimulatorLX ;
16 collectionName.insert(
"FocalSurfaceHits");
18 G4cerr <<
"Created " << name <<
" Sensitive Detector." << G4endl ;
32 static int HCID1 = -1;
40 { HCID1 = GetCollectionID(0); }
49 G4TouchableHistory* theTouchable
50 = (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
55 G4String thisVolume = theTouchable->GetVolume()->GetName() ;
56 G4String particleName = aStep->GetTrack()->GetDefinition()->GetParticleName();
60 G4cerr <<
"Volume name: " << thisVolume << G4endl ;;
66 G4VPhysicalVolume *fPhysVolume = theTouchable->GetVolume() ;
67 G4String VolumeName = fPhysVolume->GetName() ;
68 G4int copyNo = fPhysVolume->GetCopyNo();
70 if(particleName ==
"opticalphoton"){HitID=1;}
else{HitID=10;}
73 G4double fGlobalTOF = aStep->GetTrack()->GetGlobalTime() ;
74 G4double kineticEnergy = aStep->GetTrack()->GetKineticEnergy() ;
75 G4double Wavelength = h_Planck*c_light/kineticEnergy ;
78 G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
79 G4ThreeVector worldPos = preStepPoint->GetPosition();
80 G4ThreeVector localPos = theTouchable->GetHistory()->GetTopTransform().TransformPoint(worldPos);
82 G4ThreeVector HitPosition = localPos;
85 G4ThreeVector HitDirection = aStep->GetPreStepPoint()->GetMomentumDirection() ;
86 G4ThreeVector SDposition = fPhysVolume->GetObjectTranslation() ;
88 if (HitDirection.z() > 0.){
109 G4cerr << fPhysVolume->GetObjectTranslation() <<
" "
110 << fPhysVolume->GetFrameTranslation() <<
" "
111 << fPhysVolume->GetTranslation() << G4endl ;
113 G4cerr << fPhysVolume->GetMultiplicity() <<
" "
114 << fPhysVolume->GetCopyNo() << G4endl ;
127 static G4int HCID = -1;
130 HCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
void Initialize(G4HCofThisEvent *)
G4THitsCollection< FDsimG4OpticalHit > FDsimG4OpticalHitsCollection
void SetTime(G4double Ti)
void SetEnergy(G4double En)
G4bool ProcessHits(G4Step *, G4TouchableHistory *)
FDsimG4FocalSurfaceSD(G4String)
FDsimG4OpticalHitsCollection * OpticalHitsCollection
void EndOfEvent(G4HCofThisEvent *)
void SetDirection(G4ThreeVector xyz)
void SetPixelPosition(G4ThreeVector xyz)
void SetWavelength(G4double Wv)
void SetWorldPosition(G4ThreeVector xyz)
void SetPosition(G4ThreeVector xyz)