3 #include "G4RunManager.hh"
4 #include "G4Material.hh"
6 #include "G4VTouchable.hh"
7 #include "G4TouchableHistory.hh"
8 #include "G4SDManager.hh"
13 using namespace TelescopeSimulatorLX;
17 collectionName.insert(
"OpticalHits");
28 static int HCID1 = -1;
33 HCID1 = GetCollectionID(0);
40 G4bool status =
false;
41 G4String particleName = aStep->GetTrack()->GetDefinition()->GetParticleName();
43 G4TouchableHistory* theTouchable
44 = (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
49 if (particleName ==
"opticalphoton"){
52 = aStep->GetTrack()->GetDefinition()->GetProcessManager();
53 G4int nprocesses = pm->GetProcessListLength();
54 G4ProcessVector* pv = pm->GetProcessList();
56 for( i=0;i<nprocesses;i++){
57 if ((*pv)[i]->GetProcessName() ==
"OpBoundary"){
67 G4StepPoint* posStepPoint = aStep->GetPostStepPoint();
69 if (posStepPoint->GetStepStatus() == fGeomBoundary) {
70 switch(boundaryStatus){
90 G4Track* track = aStep->GetTrack();
91 G4String particleName = track->GetDefinition()->GetParticleName();
94 G4VPhysicalVolume* fPhysVolume = theTouchable->GetVolume();
95 G4String VolumeName = fPhysVolume->GetName();
96 G4int copyNo = fPhysVolume->GetCopyNo();
98 if (particleName ==
"opticalphoton")
103 G4double fGlobalTOF = track->GetGlobalTime();
104 G4double kineticEnergy = track->GetKineticEnergy();
105 G4double Wavelength = h_Planck*c_light/kineticEnergy;
106 G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
107 G4ThreeVector worldPos = preStepPoint->GetPosition();
108 G4ThreeVector HitPosition =
109 theTouchable->GetHistory()->GetTopTransform().TransformPoint(worldPos);
110 G4ThreeVector HitDirection = aStep->GetPreStepPoint()->GetMomentumDirection();
111 G4ThreeVector SDposition = fPhysVolume->GetObjectTranslation();
112 G4double weight = track->GetWeight();
118 OpticalHit->
SetTime(fGlobalTOF);
135 static G4int HCID = -1;
137 HCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
G4THitsCollection< FDsimG4OpticalHit > FDsimG4OpticalHitsCollection
void SetTime(G4double Ti)
void EndOfEvent(G4HCofThisEvent *)
void SetEnergy(G4double En)
G4bool ProcessHits(G4Step *, G4TouchableHistory *)
FDsimG4OpticalHitsCollection * fOpticalHitsCollection
FDsimG4OpBoundaryProcessStatus
FDsimG4OpBoundaryProcessStatus GetStatus() const
G4bool ProcessOpticalHit(G4Step *, G4TouchableHistory *)
void Initialize(G4HCofThisEvent *)
void SetDirection(G4ThreeVector xyz)
void SetPixelPosition(G4ThreeVector xyz)
void SetWavelength(G4double Wv)
void SetWeight(G4double w)
void SetWorldPosition(G4ThreeVector xyz)
void SetPosition(G4ThreeVector xyz)