Skip to content
Snippets Groups Projects
Commit 15178ec6 authored by Chad Lantz's avatar Chad Lantz
Browse files

Changed absorption chance calculation to reflect the terminology

parent b31a0864
No related branches found
No related tags found
No related merge requests found
...@@ -176,8 +176,8 @@ G4bool FiberSD::ProcessHits(G4Step* aStep,G4TouchableHistory*){ ...@@ -176,8 +176,8 @@ G4bool FiberSD::ProcessHits(G4Step* aStep,G4TouchableHistory*){
G4ThreeVector momDir = aStep->GetPreStepPoint()->GetMomentumDirection(); G4ThreeVector momDir = aStep->GetPreStepPoint()->GetMomentumDirection();
//pathLength = (distance to top of fiber)/sin(polarAngle); polarAngle = atan(y/sqrt(x^2 + z^2)); //pathLength = (distance to top of fiber)/sin(polarAngle); polarAngle = atan(y/sqrt(x^2 + z^2));
G4double pathLength = (m_topOfVolume - pos.y())/sin( atan(momDir.y()/sqrt( pow(momDir.x(),2.0) + pow(momDir.z(),2.0) ) ) ); G4double pathLength = (m_topOfVolume - pos.y())/sin( atan(momDir.y()/sqrt( pow(momDir.x(),2.0) + pow(momDir.z(),2.0) ) ) );
G4double absChance = exp(-pathLength/Absorption); G4double absChance = 1 - exp(-pathLength/Absorption);
if(CLHEP::RandFlat::shoot(0.0,1.0) < absChance){//This check amounts to if(!absorbed) if(CLHEP::RandFlat::shoot(0.0,1.0) > absChance){//This check amounts to if(!absorbed)
//Finally, record the ouput //Finally, record the ouput
if(REDUCED_TREE){ if(REDUCED_TREE){
m_cherenkovVec->at(rodNum)++; m_cherenkovVec->at(rodNum)++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment