50 G4ThreeVector pos = aStep->GetTrack()->GetPosition();
51 G4ThreeVector momentum = aStep->GetPreStepPoint()->GetMomentum();
56 if (aStep->GetTrack()->GetDefinition() != G4OpticalPhoton::OpticalPhotonDefinition()){
64 if (momentum.y() < 0.0){
65 aStep->GetTrack()->SetTrackStatus(fStopAndKill);
73 G4StepPoint *endPoint = aStep->GetPostStepPoint();
74 if (endPoint->GetStepStatus() != fGeomBoundary)
84 G4MaterialPropertiesTable *MPT = aStep->GetPreStepPoint()->GetMaterial()->GetMaterialPropertiesTable();
87 G4MaterialPropertyVector *RindexMPV = MPT->GetProperty(kRINDEX);
93 double photonEnergy = aStep->GetTrack()->GetDynamicParticle()->GetTotalMomentum();
94 Rindex = RindexMPV->Value(photonEnergy,
index);
97 G4ThreeVector momDir = aStep->GetPreStepPoint()->GetMomentumDirection();
98 G4double angleFromY = atan(sqrt(1 - pow(momDir.y(), 2.0)) / momDir.y());
102 if (angleFromY > asin(1.0 / Rindex)){
103 aStep->GetTrack()->SetTrackStatus(fStopAndKill);
112 G4bool isTIR =
false;
113 G4ProcessVector *postStepDoItVector = G4OpticalPhoton::OpticalPhotonDefinition()->GetProcessManager()->GetPostStepProcessVector(typeDoIt);
114 G4int n_proc = postStepDoItVector->entries();
115 for (G4int i = 0; i < n_proc; ++i){
116 G4OpBoundaryProcess *opProc =
dynamic_cast<G4OpBoundaryProcess *
>((*postStepDoItVector)[i]);
117 if (opProc && opProc->GetStatus() == TotalInternalReflection){
124 aStep->GetTrack()->SetTrackStatus(fStopAndKill);
133 G4MaterialPropertyVector *AbsMPV = MPT->GetProperty(kABSLENGTH);
134 G4double Absorption = AbsMPV->Value(aStep->GetTrack()->GetDynamicParticle()->GetTotalMomentum(),
index);
136 G4double pathLength = (
m_readoutPos - pos.y()) / cos(angleFromY);
137 G4double absChance = 1 - exp(-pathLength / Absorption);
140 if (CLHEP::RandFlat::shoot(0.0, 1.0) < absChance){
141 aStep->GetTrack()->SetTrackStatus(fStopAndKill);
150 id = aStep->GetPreStepPoint()->GetPhysicalVolume()->GetCopyNo();
156 aStep->GetTrack()->SetTrackStatus(fStopAndKill);