diff options
author | Stan Seibert <stan@mtrr.org> | 2011-08-09 15:43:36 -0400 |
---|---|---|
committer | Stan Seibert <stan@mtrr.org> | 2011-08-09 15:43:36 -0400 |
commit | 06ece999c3866f2d19acfd0f23b2f62d02b50577 (patch) | |
tree | f9bb7d591c69b7848d764e5055b2d167382c6337 /io/root.C | |
parent | 135ad2ca5b5ade4c52ae98f8fc7545fcc88fb449 (diff) | |
download | chroma-06ece999c3866f2d19acfd0f23b2f62d02b50577.tar.gz chroma-06ece999c3866f2d19acfd0f23b2f62d02b50577.tar.bz2 chroma-06ece999c3866f2d19acfd0f23b2f62d02b50577.zip |
Store a photon history for each hit channel. If multiple photons hit the
same channel, their history bits are OR'ed together.
Diffstat (limited to 'io/root.C')
-rw-r--r-- | io/root.C | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -9,7 +9,7 @@ struct Photon { TVector3 dir; TVector3 pol; double wavelength; // nm - int history; + unsigned int history; int last_hit_triangle; }; @@ -29,6 +29,7 @@ struct Channel { int channel_id; double t; double q; + unsigned int mc_history; }; struct Event { @@ -67,17 +68,19 @@ void fill_photons(Event *ev, bool start, } -void fill_hits(Event *ev, unsigned int nchannels, float *channel_times) +void fill_hits(Event *ev, unsigned int nchannels, float *t, + float *q, unsigned int *history) { ev->channel.resize(0); ev->nhit = 0; Channel ch; for (unsigned int i=0; i < nchannels; i++) { - if (channel_times[i] < 1e8) { + if (t[i] < 1e8) { ev->nhit++; ch.channel_id = i; - ch.t = channel_times[i]; - ch.q = 1.0; + ch.t = t[i]; + ch.q = q[i]; + ch.mc_history = history[i]; ev->channel.push_back(ch); } } |