summaryrefslogtreecommitdiff
path: root/io/root.C
diff options
context:
space:
mode:
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);
}
}