summaryrefslogtreecommitdiff
path: root/src/G4chroma.cc
diff options
context:
space:
mode:
authorStan Seibert <stan@mtrr.org>2011-10-05 17:37:26 -0400
committerStan Seibert <stan@mtrr.org>2011-10-05 17:37:26 -0400
commite4ea02720991b5e923e0b7b1045709aff0d6b0c0 (patch)
tree461db2be1fdb4e3b543837c2f3832e0e50f7f7ca /src/G4chroma.cc
parentc309d251232c45bb497da4859eb8cf1b2ab47417 (diff)
downloadchroma-e4ea02720991b5e923e0b7b1045709aff0d6b0c0.tar.gz
chroma-e4ea02720991b5e923e0b7b1045709aff0d6b0c0.tar.bz2
chroma-e4ea02720991b5e923e0b7b1045709aff0d6b0c0.zip
Epic port of Chroma from units of meters/seconds/MeV to
millimeters/nanoseconds/MeV in order to match GEANT4, and also avoid huge discrepancies in magnitude caused by values like 10e-9 sec. Along the way, cleaned up a few things: * Switch the PI and SPEED_OF_LIGHT constants from double to single precision. This avoid some unnecessary double precision calculations in the GPU code. * Fixed a silly problem in the definition of the spherical spiral. Now the demo detector looks totally awesome. Also wrapped it in a black surface. Demo detector now has 10055 PMTs. * Updated the test_ray_intersection data file to reflect the new units. * Fix a missing import in chroma.gpu.tools
Diffstat (limited to 'src/G4chroma.cc')
-rw-r--r--src/G4chroma.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/G4chroma.cc b/src/G4chroma.cc
index 340cc4c..c0817a1 100644
--- a/src/G4chroma.cc
+++ b/src/G4chroma.cc
@@ -107,11 +107,11 @@ void PhotonTrackingAction::PreUserTrackingAction(const G4Track *track)
{
G4ParticleDefinition *particle = track->GetDefinition();
if (particle->GetParticleName() == "opticalphoton") {
- pos.push_back(track->GetPosition()/m);
+ pos.push_back(track->GetPosition()/mm);
dir.push_back(track->GetMomentumDirection());
pol.push_back(track->GetPolarization());
wavelength.push_back( (h_Planck * c_light / track->GetKineticEnergy()) / nanometer );
- t0.push_back(track->GetGlobalTime() / s);
+ t0.push_back(track->GetGlobalTime() / ns);
const_cast<G4Track *>(track)->SetTrackStatus(fStopAndKill);
}
}