Commit 15178ec6 authored by Chad Lantz's avatar Chad Lantz
Browse files

Changed absorption chance calculation to reflect the terminology

parent b31a0864
......@@ -176,8 +176,8 @@ G4bool FiberSD::ProcessHits(G4Step* aStep,G4TouchableHistory*){
G4ThreeVector momDir = aStep->GetPreStepPoint()->GetMomentumDirection();
//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 absChance = exp(-pathLength/Absorption);
if(CLHEP::RandFlat::shoot(0.0,1.0) < absChance){//This check amounts to if(!absorbed)
G4double absChance = 1 - exp(-pathLength/Absorption);
if(CLHEP::RandFlat::shoot(0.0,1.0) > absChance){//This check amounts to if(!absorbed)
//Finally, record the ouput
if(REDUCED_TREE){
m_cherenkovVec->at(rodNum)++;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment