From e8f7f1cb5bba52600c05a110b3605232a28744ab Mon Sep 17 00:00:00 2001 From: Stan Seibert Date: Thu, 31 Jan 2013 11:14:42 -0500 Subject: Add method to show total charge in event --- chroma/io/root.C | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/chroma/io/root.C b/chroma/io/root.C index 2b39b1b..9e7ef39 100644 --- a/chroma/io/root.C +++ b/chroma/io/root.C @@ -42,6 +42,14 @@ struct Event { unsigned int nchannels; Vertex primary_vertex; + + double TotalQ() const { + double sum = 0.0; + for (unsigned int i=0; i < channels.size(); i++) + sum += channels[i].q; + return sum; + } + std::vector vertices; std::vector photons_beg; -- cgit