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(
"MirrorHits");
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();
72 if(particleName ==
"opticalphoton"){HitID=1;}
else{HitID=10;}
74 G4double fGlobalTOF = aStep->GetTrack()->GetGlobalTime() ;
75 G4double kineticEnergy = aStep->GetTrack()->GetKineticEnergy() ;
76 G4double Wavelength = h_Planck*c_light/kineticEnergy ;
79 G4StepPoint* posStepPoint ;
81 posStepPoint = aStep->GetPostStepPoint();
83 G4ThreeVector worldPos = posStepPoint->GetPosition();
84 G4ThreeVector localPos = theTouchable->GetHistory()->GetTopTransform().TransformPoint(worldPos);
86 G4ThreeVector HitPosition = localPos;
89 G4ThreeVector HitDirection = posStepPoint->GetMomentumDirection() ;
90 G4ThreeVector SDposition = fPhysVolume->GetObjectTranslation() ;
112 G4cerr << fPhysVolume->GetObjectTranslation() <<
" "
113 << fPhysVolume->GetFrameTranslation() <<
" "
114 << fPhysVolume->GetTranslation() << G4endl ;
116 G4cerr << fPhysVolume->GetMultiplicity() <<
" "
117 << fPhysVolume->GetCopyNo() << G4endl ;
130 static G4int HCID = -1;
133 HCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
G4THitsCollection< FDsimG4OpticalHit > FDsimG4OpticalHitsCollection
void SetTime(G4double Ti)
void SetEnergy(G4double En)
void Initialize(G4HCofThisEvent *)
FDsimG4MirrorSD(G4String)
FDsimG4OpticalHitsCollection * MirrorHitsCollection
void SetDirection(G4ThreeVector xyz)
void SetPixelPosition(G4ThreeVector xyz)
void SetWavelength(G4double Wv)
void SetWorldPosition(G4ThreeVector xyz)
void EndOfEvent(G4HCofThisEvent *)
G4bool ProcessHits(G4Step *, G4TouchableHistory *)
void SetPosition(G4ThreeVector xyz)