summaryrefslogtreecommitdiff
path: root/io/root.C
diff options
context:
space:
mode:
authorStan Seibert <stan@mtrr.org>2011-08-09 15:43:36 -0400
committerStan Seibert <stan@mtrr.org>2011-08-09 15:43:36 -0400
commit06ece999c3866f2d19acfd0f23b2f62d02b50577 (patch)
treef9bb7d591c69b7848d764e5055b2d167382c6337 /io/root.C
parent135ad2ca5b5ade4c52ae98f8fc7545fcc88fb449 (diff)
downloadchroma-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.C13
1 files changed, 8 insertions, 5 deletions
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);
}
}