From 06ece999c3866f2d19acfd0f23b2f62d02b50577 Mon Sep 17 00:00:00 2001 From: Stan Seibert Date: Tue, 9 Aug 2011 15:43:36 -0400 Subject: Store a photon history for each hit channel. If multiple photons hit the same channel, their history bits are OR'ed together. --- io/root.C | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'io/root.C') diff --git a/io/root.C b/io/root.C index 43f4e73..096811a 100644 --- a/io/root.C +++ b/io/root.C @@ -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); } } -- cgit