diff options
author | Stan Seibert <stan@mtrr.org> | 2013-01-31 11:14:42 -0500 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2021-05-09 08:42:39 -0700 |
commit | e8f7f1cb5bba52600c05a110b3605232a28744ab (patch) | |
tree | 9e2ea91b7395ec969b99e8251bfbab3c7cd17cf2 | |
parent | 411fb45b8068541f5f40a595621af0b7d1765eb8 (diff) | |
download | chroma-e8f7f1cb5bba52600c05a110b3605232a28744ab.tar.gz chroma-e8f7f1cb5bba52600c05a110b3605232a28744ab.tar.bz2 chroma-e8f7f1cb5bba52600c05a110b3605232a28744ab.zip |
Add method to show total charge in event
-rw-r--r-- | chroma/io/root.C | 8 |
1 files changed, 8 insertions, 0 deletions
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<Vertex> vertices; std::vector<Photon> photons_beg; |