confusionMatrixTree.py
Go to the documentation of this file.
1 import sys
2 import caffe
3 import matplotlib
4 import numpy as np
5 import lmdb
6 import argparse
7 import leveldb
8 import ROOT
9 from collections import defaultdict
10 
12 
13  def __init__(self,fname):
14  self.lmdb_env=lmdb.open(fname)
15  self.lmdb_txn =self.lmdb_env.begin()
16 
17  def RangeIter(self):
18  return self.lmdb_txn.cursor()
19 
20 if __name__ == "__main__":
21 
22  parser = argparse.ArgumentParser()
23 
24  parser.add_argument('--proto', type=str, required=True)
25  parser.add_argument('--model', type=str, required=True)
26 
27  inputParser=parser.add_mutually_exclusive_group(required=True)
28  inputParser.add_argument('--leveldb', type=str)
29  inputParser.add_argument('--lmdb', type=str)
30 
31  args = parser.parse_args()
32 
33  count = 0
34  correct = 0
35  matrix = defaultdict(int) # (real,pred) -> int
36  labels_set = set()
37 
38  net = caffe.Net(args.proto, args.model, caffe.TEST)
39  caffe.set_mode_gpu()
40 
41  db=None
42  if args.leveldb:
43  db = leveldb.LevelDB(args.leveldb)
44  else:
45  db = lmdb_reader(args.lmdb)
46 
47  trueNuMuQEpidNuMuQE = ROOT.TH1D( 'trueNuMuQE_pidNuMuQE', 'pidNuMuQE', 100,0,1)
48  trueNuMuQEpidNuMuRes = ROOT.TH1D( 'trueNuMuQE_pidNuMuRes', 'pidNuMuRes', 100,0,1)
49  trueNuMuQEpidNuMuDIS = ROOT.TH1D( 'trueNuMuQE_pidNuMuDIS', 'pidNuMuDIS', 100,0,1)
50  trueNuMuQEpidNuMuOther = ROOT.TH1D( 'trueNuMuQE_pidNuMuOther', 'pidNuMuOther', 100,0,1)
51  trueNuMuQEpidNueQE = ROOT.TH1D( 'trueNuMuQE_pidNueQE', 'pidNueQE', 100,0,1)
52  trueNuMuQEpidNueRes = ROOT.TH1D( 'trueNuMuQE_pidNueRes', 'pidNueRes', 100,0,1)
53  trueNuMuQEpidNueDIS = ROOT.TH1D( 'trueNuMuQE_pidNueDIS', 'pidNueDIS', 100,0,1)
54  trueNuMuQEpidNueOther = ROOT.TH1D( 'trueNuMuQE_pidNueOther', 'pidNueOther', 100,0,1)
55  trueNuMuQEpidNuTauQE = ROOT.TH1D( 'trueNuMuQE_pidNuTauQE', 'pidNuTauQE', 100,0,1)
56  trueNuMuQEpidNuTaueRes = ROOT.TH1D( 'trueNuMuQE_pidNuTauRes', 'pidNuTauRes', 100,0,1)
57  trueNuMuQEpidNuTauDIS = ROOT.TH1D( 'trueNuMuQE_pidNutauDIS', 'pidNuTauDIS', 100,0,1)
58  trueNuMuQEpidNC = ROOT.TH1D( 'trueNuMuQE_pidNC', 'pidNC', 100,0,1)
59 
60  trueNuMuRespidNuMuQE = ROOT.TH1D( 'trueNuMuRes_pidNuMuQE', 'pidNuMuQE', 100,0,1)
61  trueNuMuRespidNuMuRes = ROOT.TH1D( 'trueNuMuRes_pidNuMuRes', 'pidNuMuRes', 100,0,1)
62  trueNuMuRespidNuMuDIS = ROOT.TH1D( 'trueNuMuRes_pidNuMuDIS', 'pidNuMuDIS', 100,0,1)
63  trueNuMuRespidNuMuOther = ROOT.TH1D( 'trueNuMuRes_pidNuMuOther', 'pidNuMuOther', 100,0,1)
64  trueNuMuRespidNueQE = ROOT.TH1D( 'trueNuMuRes_pidNueQE', 'pidNueQE', 100,0,1)
65  trueNuMuRespidNueRes = ROOT.TH1D( 'trueNuMuRes_pidNueRes', 'pidNueRes', 100,0,1)
66  trueNuMuRespidNueDIS = ROOT.TH1D( 'trueNuMuRes_pidNueDIS', 'pidNueDIS', 100,0,1)
67  trueNuMuRespidNueOther = ROOT.TH1D( 'trueNuMuRes_pidNueOther', 'pidNueOther', 100,0,1)
68  trueNuMuRespidNuTauQE = ROOT.TH1D( 'trueNuMuRes_pidNuTauQE', 'pidNuTauQE', 100,0,1)
69  trueNuMuRespidNuTaueRes = ROOT.TH1D( 'trueNuMuRes_pidNuTauRes', 'pidNuTauRes', 100,0,1)
70  trueNuMuRespidNuTauDIS = ROOT.TH1D( 'trueNuMuRes_pidNutauDIS', 'pidNuTauDIS', 100,0,1)
71  trueNuMuRespidNC = ROOT.TH1D( 'trueNuMuRes_pidNC', 'pidNC', 100,0,1)
72 
73  trueNuMuDISpidNuMuQE = ROOT.TH1D( 'trueNuMuDIS_pidNuMuQE', 'pidNuMuQE', 100,0,1)
74  trueNuMuDISpidNuMuRes = ROOT.TH1D( 'trueNuMuDIS_pidNuMuRes', 'pidNuMuRes', 100,0,1)
75  trueNuMuDISpidNuMuDIS = ROOT.TH1D( 'trueNuMuDIS_pidNuMuDIS', 'pidNuMuDIS', 100,0,1)
76  trueNuMuDISpidNuMuOther = ROOT.TH1D( 'trueNuMuDIS_pidNuMuOther', 'pidNuMuOther', 100,0,1)
77  trueNuMuDISpidNueQE = ROOT.TH1D( 'trueNuMuDIS_pidNueQE', 'pidNueQE', 100,0,1)
78  trueNuMuDISpidNueRes = ROOT.TH1D( 'trueNuMuDIS_pidNueRes', 'pidNueRes', 100,0,1)
79  trueNuMuDISpidNueDIS = ROOT.TH1D( 'trueNuMuDIS_pidNueDIS', 'pidNueDIS', 100,0,1)
80  trueNuMuDISpidNueOther = ROOT.TH1D( 'trueNuMuDIS_pidNueOther', 'pidNueOther', 100,0,1)
81  trueNuMuDISpidNuTauQE = ROOT.TH1D( 'trueNuMuDIS_pidNuTauQE', 'pidNuTauQE', 100,0,1)
82  trueNuMuDISpidNuTaueRes = ROOT.TH1D( 'trueNuMuDIS_pidNuTauRes', 'pidNuTauRes', 100,0,1)
83  trueNuMuDISpidNuTauDIS = ROOT.TH1D( 'trueNuMuDIS_pidNutauDIS', 'pidNuTauDIS', 100,0,1)
84  trueNuMuDISpidNC = ROOT.TH1D( 'trueNuMuDIS_pidNC', 'pidNC', 100,0,1)
85 
86  trueNuMuOtherpidNuMuQE = ROOT.TH1D( 'trueNuMuOther_pidNuMuQE', 'pidNuMuQE', 100,0,1)
87  trueNuMuOtherpidNuMuRes = ROOT.TH1D( 'trueNuMuOther_pidNuMuRes', 'pidNuMuRes', 100,0,1)
88  trueNuMuOtherpidNuMuDIS = ROOT.TH1D( 'trueNuMuOther_pidNuMuDIS', 'pidNuMuDIS', 100,0,1)
89  trueNuMuOtherpidNuMuOther = ROOT.TH1D( 'trueNuMuOther_pidNuMuOther', 'pidNuMuOther', 100,0,1)
90  trueNuMuOtherpidNueQE = ROOT.TH1D( 'trueNuMuOther_pidNueQE', 'pidNueQE', 100,0,1)
91  trueNuMuOtherpidNueRes = ROOT.TH1D( 'trueNuMuOther_pidNueRes', 'pidNueRes', 100,0,1)
92  trueNuMuOtherpidNueDIS = ROOT.TH1D( 'trueNuMuOther_pidNueDIS', 'pidNueDIS', 100,0,1)
93  trueNuMuOtherpidNueOther = ROOT.TH1D( 'trueNuMuOther_pidNueOther', 'pidNueOther', 100,0,1)
94  trueNuMuOtherpidNuTauQE = ROOT.TH1D( 'trueNuMuOther_pidNuTauQE', 'pidNuTauQE', 100,0,1)
95  trueNuMuOtherpidNuTaueRes = ROOT.TH1D( 'trueNuMuOther_pidNuTauRes', 'pidNuTauRes', 100,0,1)
96  trueNuMuOtherpidNuTauDIS = ROOT.TH1D( 'trueNuMuOther_pidNutauDIS', 'pidNuTauDIS', 100,0,1)
97  trueNuMuOtherpidNC = ROOT.TH1D( 'trueNuMuOther_pidNC', 'pidNC', 100,0,1)
98 
99  trueNueQEpidNuMuQE = ROOT.TH1D( 'trueNueQE_pidNuMuQE', 'pidNuMuQE', 100,0,1)
100  trueNueQEpidNuMuRes = ROOT.TH1D( 'trueNueQE_pidNuMuRes', 'pidNuMuRes', 100,0,1)
101  trueNueQEpidNuMuDIS = ROOT.TH1D( 'trueNueQE_pidNuMuDIS', 'pidNuMuDIS', 100,0,1)
102  trueNueQEpidNuMuOther = ROOT.TH1D( 'trueNueQE_pidNuMuOther', 'pidNuMuOther', 100,0,1)
103  trueNueQEpidNueQE = ROOT.TH1D( 'trueNueQE_pidNueQE', 'pidNueQE', 100,0,1)
104  trueNueQEpidNueRes = ROOT.TH1D( 'trueNueQE_pidNueRes', 'pidNueRes', 100,0,1)
105  trueNueQEpidNueDIS = ROOT.TH1D( 'trueNueQE_pidNueDIS', 'pidNueDIS', 100,0,1)
106  trueNueQEpidNueOther = ROOT.TH1D( 'trueNueQE_pidNueOther', 'pidNueOther', 100,0,1)
107  trueNueQEpidNuTauQE = ROOT.TH1D( 'trueNueQE_pidNuTauQE', 'pidNuTauQE', 100,0,1)
108  trueNueQEpidNuTaueRes = ROOT.TH1D( 'trueNueQE_pidNuTauRes', 'pidNuTauRes', 100,0,1)
109  trueNueQEpidNuTauDIS = ROOT.TH1D( 'trueNueQE_pidNutauDIS', 'pidNuTauDIS', 100,0,1)
110  trueNueQEpidNC = ROOT.TH1D( 'trueNueQE_pidNC', 'pidNC', 100,0,1)
111 
112  trueNueRespidNuMuQE = ROOT.TH1D( 'trueNueRes_pidNuMuQE', 'pidNuMuQE', 100,0,1)
113  trueNueRespidNuMuRes = ROOT.TH1D( 'trueNueRes_pidNuMuRes', 'pidNuMuRes', 100,0,1)
114  trueNueRespidNuMuDIS = ROOT.TH1D( 'trueNueRes_pidNuMuDIS', 'pidNuMuDIS', 100,0,1)
115  trueNueRespidNuMuOther = ROOT.TH1D( 'trueNueRes_pidNuMuOther', 'pidNuMuOther', 100,0,1)
116  trueNueRespidNueQE = ROOT.TH1D( 'trueNueRes_pidNueQE', 'pidNueQE', 100,0,1)
117  trueNueRespidNueRes = ROOT.TH1D( 'trueNueRes_pidNueRes', 'pidNueRes', 100,0,1)
118  trueNueRespidNueDIS = ROOT.TH1D( 'trueNueRes_pidNueDIS', 'pidNueDIS', 100,0,1)
119  trueNueRespidNueOther = ROOT.TH1D( 'trueNueRes_pidNueOther', 'pidNueOther', 100,0,1)
120  trueNueRespidNuTauQE = ROOT.TH1D( 'trueNueRes_pidNuTauQE', 'pidNuTauQE', 100,0,1)
121  trueNueRespidNuTaueRes = ROOT.TH1D( 'trueNueRes_pidNuTauRes', 'pidNuTauRes', 100,0,1)
122  trueNueRespidNuTauDIS = ROOT.TH1D( 'trueNueRes_pidNutauDIS', 'pidNuTauDIS', 100,0,1)
123  trueNueRespidNC = ROOT.TH1D( 'trueNueRes_pidNC', 'pidNC', 100,0,1)
124 
125  trueNueDISpidNuMuQE = ROOT.TH1D( 'trueNueDIS_pidNuMuQE', 'pidNuMuQE', 100,0,1)
126  trueNueDISpidNuMuRes = ROOT.TH1D( 'trueNueDIS_pidNuMuRes', 'pidNuMuRes', 100,0,1)
127  trueNueDISpidNuMuDIS = ROOT.TH1D( 'trueNueDIS_pidNuMuDIS', 'pidNuMuDIS', 100,0,1)
128  trueNueDISpidNuMuOther = ROOT.TH1D( 'trueNueDIS_pidNuMuOther', 'pidNuMuOther', 100,0,1)
129  trueNueDISpidNueQE = ROOT.TH1D( 'trueNueDIS_pidNueQE', 'pidNueQE', 100,0,1)
130  trueNueDISpidNueRes = ROOT.TH1D( 'trueNueDIS_pidNueRes', 'pidNueRes', 100,0,1)
131  trueNueDISpidNueDIS = ROOT.TH1D( 'trueNueDIS_pidNueDIS', 'pidNueDIS', 100,0,1)
132  trueNueDISpidNueOther = ROOT.TH1D( 'trueNueDIS_pidNueOther', 'pidNueOther', 100,0,1)
133  trueNueDISpidNuTauQE = ROOT.TH1D( 'trueNueDIS_pidNuTauQE', 'pidNuTauQE', 100,0,1)
134  trueNueDISpidNuTaueRes = ROOT.TH1D( 'trueNueDIS_pidNuTauRes', 'pidNuTauRes', 100,0,1)
135  trueNueDISpidNuTauDIS = ROOT.TH1D( 'trueNueDIS_pidNutauDIS', 'pidNuTauDIS', 100,0,1)
136  trueNueDISpidNC = ROOT.TH1D( 'trueNueDIS_pidNC', 'pidNC', 100,0,1)
137 
138  trueNueOtherpidNuMuQE = ROOT.TH1D( 'trueNueOther_pidNuMuQE', 'pidNuMuQE', 100,0,1)
139  trueNueOtherpidNuMuRes = ROOT.TH1D( 'trueNueOther_pidNuMuRes', 'pidNuMuRes', 100,0,1)
140  trueNueOtherpidNuMuDIS = ROOT.TH1D( 'trueNueOther_pidNuMuDIS', 'pidNuMuDIS', 100,0,1)
141  trueNueOtherpidNuMuOther = ROOT.TH1D( 'trueNueOther_pidNuMuOther', 'pidNuMuOther', 100,0,1)
142  trueNueOtherpidNueQE = ROOT.TH1D( 'trueNueOther_pidNueQE', 'pidNueQE', 100,0,1)
143  trueNueOtherpidNueRes = ROOT.TH1D( 'trueNueOther_pidNueRes', 'pidNueRes', 100,0,1)
144  trueNueOtherpidNueDIS = ROOT.TH1D( 'trueNueOther_pidNueDIS', 'pidNueDIS', 100,0,1)
145  trueNueOtherpidNueOther = ROOT.TH1D( 'trueNueOther_pidNueOther', 'pidNueOther', 100,0,1)
146  trueNueOtherpidNuTauQE = ROOT.TH1D( 'trueNueOther_pidNuTauQE', 'pidNuTauQE', 100,0,1)
147  trueNueOtherpidNuTaueRes = ROOT.TH1D( 'trueNueOther_pidNuTauRes', 'pidNuTauRes', 100,0,1)
148  trueNueOtherpidNuTauDIS = ROOT.TH1D( 'trueNueOther_pidNutauDIS', 'pidNuTauDIS', 100,0,1)
149  trueNueOtherpidNC = ROOT.TH1D( 'trueNueOther_pidNC', 'pidNC', 100,0,1)
150 
151  trueNuTauQEpidNuMuQE = ROOT.TH1D( 'trueNuTauQE_pidNuMuQE', 'pidNuMuQE', 100,0,1)
152  trueNuTauQEpidNuMuRes = ROOT.TH1D( 'trueNuTauQE_pidNuMuRes', 'pidNuMuRes', 100,0,1)
153  trueNuTauQEpidNuMuDIS = ROOT.TH1D( 'trueNuTauQE_pidNuMuDIS', 'pidNuMuDIS', 100,0,1)
154  trueNuTauQEpidNuMuOther = ROOT.TH1D( 'trueNuTauQE_pidNuMuOther', 'pidNuMuOther', 100,0,1)
155  trueNuTauQEpidNueQE = ROOT.TH1D( 'trueNuTauQE_pidNueQE', 'pidNueQE', 100,0,1)
156  trueNuTauQEpidNueRes = ROOT.TH1D( 'trueNuTauQE_pidNueRes', 'pidNueRes', 100,0,1)
157  trueNuTauQEpidNueDIS = ROOT.TH1D( 'trueNuTauQE_pidNueDIS', 'pidNueDIS', 100,0,1)
158  trueNuTauQEpidNueOther = ROOT.TH1D( 'trueNuTauQE_pidNueOther', 'pidNueOther', 100,0,1)
159  trueNuTauQEpidNuTauQE = ROOT.TH1D( 'trueNuTauQE_pidNuTauQE', 'pidNuTauQE', 100,0,1)
160  trueNuTauQEpidNuTaueRes = ROOT.TH1D( 'trueNuTauQE_pidNuTauRes', 'pidNuTauRes', 100,0,1)
161  trueNuTauQEpidNuTauDIS = ROOT.TH1D( 'trueNuTauQE_pidNutauDIS', 'pidNuTauDIS', 100,0,1)
162  trueNuTauQEpidNC = ROOT.TH1D( 'trueNuTauQE_pidNC', 'pidNC', 100,0,1)
163 
164  trueNuTauRespidNuMuQE = ROOT.TH1D( 'trueNuTauRes_pidNuMuQE', 'pidNuMuQE', 100,0,1)
165  trueNuTauRespidNuMuRes = ROOT.TH1D( 'trueNuTauRes_pidNuMuRes', 'pidNuMuRes', 100,0,1)
166  trueNuTauRespidNuMuDIS = ROOT.TH1D( 'trueNuTauRes_pidNuMuDIS', 'pidNuMuDIS', 100,0,1)
167  trueNuTauRespidNuMuOther = ROOT.TH1D( 'trueNuTauRes_pidNuMuOther', 'pidNuMuOther', 100,0,1)
168  trueNuTauRespidNueQE = ROOT.TH1D( 'trueNuTauRes_pidNueQE', 'pidNueQE', 100,0,1)
169  trueNuTauRespidNueRes = ROOT.TH1D( 'trueNuTauRes_pidNueRes', 'pidNueRes', 100,0,1)
170  trueNuTauRespidNueDIS = ROOT.TH1D( 'trueNuTauRes_pidNueDIS', 'pidNueDIS', 100,0,1)
171  trueNuTauRespidNueOther = ROOT.TH1D( 'trueNuTauRes_pidNueOther', 'pidNueOther', 100,0,1)
172  trueNuTauRespidNuTauQE = ROOT.TH1D( 'trueNuTauRes_pidNuTauQE', 'pidNuTauQE', 100,0,1)
173  trueNuTauRespidNuTaueRes = ROOT.TH1D( 'trueNuTauRes_pidNuTauRes', 'pidNuTauRes', 100,0,1)
174  trueNuTauRespidNuTauDIS = ROOT.TH1D( 'trueNuTauRes_pidNutauDIS', 'pidNuTauDIS', 100,0,1)
175  trueNuTauRespidNC = ROOT.TH1D( 'trueNuTauRes_pidNC', 'pidNC', 100,0,1)
176 
177  trueNuTauDISpidNuMuQE = ROOT.TH1D( 'trueNuTauDIS_pidNuMuQE', 'pidNuMuQE', 100,0,1)
178  trueNuTauDISpidNuMuRes = ROOT.TH1D( 'trueNuTauDIS_pidNuMuRes', 'pidNuMuRes', 100,0,1)
179  trueNuTauDISpidNuMuDIS = ROOT.TH1D( 'trueNuTauDIS_pidNuMuDIS', 'pidNuMuDIS', 100,0,1)
180  trueNuTauDISpidNuMuOther = ROOT.TH1D( 'trueNuTauDIS_pidNuMuOther', 'pidNuMuOther', 100,0,1)
181  trueNuTauDISpidNueQE = ROOT.TH1D( 'trueNuTauDIS_pidNueQE', 'pidNueQE', 100,0,1)
182  trueNuTauDISpidNueRes = ROOT.TH1D( 'trueNuTauDIS_pidNueRes', 'pidNueRes', 100,0,1)
183  trueNuTauDISpidNueDIS = ROOT.TH1D( 'trueNuTauDIS_pidNueDIS', 'pidNueDIS', 100,0,1)
184  trueNuTauDISpidNueOther = ROOT.TH1D( 'trueNuTauDIS_pidNueOther', 'pidNueOther', 100,0,1)
185  trueNuTauDISpidNuTauQE = ROOT.TH1D( 'trueNuTauDIS_pidNuTauQE', 'pidNuTauQE', 100,0,1)
186  trueNuTauDISpidNuTaueRes = ROOT.TH1D( 'trueNuTauDIS_pidNuTauRes', 'pidNuTauRes', 100,0,1)
187  trueNuTauDISpidNuTauDIS = ROOT.TH1D( 'trueNuTauDIS_pidNutauDIS', 'pidNuTauDIS', 100,0,1)
188  trueNuTauDISpidNC = ROOT.TH1D( 'trueNuTauDIS_pidNC', 'pidNC', 100,0,1)
189 
190  trueNCpidNuMuQE = ROOT.TH1D( 'trueNC_pidNuMuQE', 'pidNuMuQE', 100,0,1)
191  trueNCpidNuMuRes = ROOT.TH1D( 'trueNC_pidNuMuRes', 'pidNuMuRes', 100,0,1)
192  trueNCpidNuMuDIS = ROOT.TH1D( 'trueNC_pidNuMuDIS', 'pidNuMuDIS', 100,0,1)
193  trueNCpidNuMuOther = ROOT.TH1D( 'trueNC_pidNuMuOther', 'pidNuMuOther', 100,0,1)
194  trueNCpidNueQE = ROOT.TH1D( 'trueNC_pidNueQE', 'pidNueQE', 100,0,1)
195  trueNCpidNueRes = ROOT.TH1D( 'trueNC_pidNueRes', 'pidNueRes', 100,0,1)
196  trueNCpidNueDIS = ROOT.TH1D( 'trueNC_pidNueDIS', 'pidNueDIS', 100,0,1)
197  trueNCpidNueOther = ROOT.TH1D( 'trueNC_pidNueOther', 'pidNueOther', 100,0,1)
198  trueNCpidNuTauQE = ROOT.TH1D( 'trueNC_pidNuTauQE', 'pidNuTauQE', 100,0,1)
199  trueNCpidNuTaueRes = ROOT.TH1D( 'trueNC_pidNuTauRes', 'pidNuTauRes', 100,0,1)
200  trueNCpidNuTauDIS = ROOT.TH1D( 'trueNC_pidNutauDIS', 'pidNuTauDIS', 100,0,1)
201  trueNCpidNC = ROOT.TH1D( 'trueNC_pidNC', 'pidNC', 100,0,1)
202 
203  t = ROOT.TTree( 't1', 'tree with histos' )
204  fout = ROOT.TFile("output.root", "RECREATE")
205  fout.cd()
206 
207 
208  arrpidNuMuQE=np.zeros(1, dtype=float)
209  arrpidNuMuDIS=np.zeros(1, dtype=float)
210  arrpidNuMuRes=np.zeros(1, dtype=float)
211  arrpidNuMuOther=np.zeros(1, dtype=float)
212  arrpidNueQE=np.zeros(1, dtype=float)
213  arrpidNueDIS=np.zeros(1, dtype=float)
214  arrpidNueRes=np.zeros(1, dtype=float)
215  arrpidNueOther=np.zeros(1, dtype=float)
216  arrpidNuTauQE=np.zeros(1, dtype=float)
217  arrpidNuTauDIS=np.zeros(1, dtype=float)
218  arrpidNuTauRes=np.zeros(1, dtype=float)
219  arrpidNC=np.zeros(1, dtype=float)
220 
221 
222  truelabel = np.zeros(1, dtype=int)
223  chosenlabel = np.zeros(1, dtype=int)
224 
225  t.Branch( 'truelabel', truelabel, 'truelabel/I' )
226  t.Branch( 'chosenlabel', chosenlabel, 'chosenlabel/I' )
227  t.Branch( 'numuqe', arrpidNuMuQE, 'numuqe/D' )
228  t.Branch( 'numudis', arrpidNuMuDIS, 'numudis/D' )
229  t.Branch( 'numures', arrpidNuMuRes, 'numures/D' )
230  t.Branch( 'numuother', arrpidNuMuOther, 'numuother/D' )
231 
232  t.Branch( 'nueqe', arrpidNueQE, 'nueqe/D' )
233  t.Branch( 'nuedis', arrpidNueDIS, 'nuedis/D' )
234  t.Branch( 'nueres', arrpidNueRes, 'nueres/D' )
235  t.Branch( 'nueother', arrpidNueOther, 'nueother/D' )
236 
237  t.Branch( 'nutauqe', arrpidNuTauQE, 'nutauqe/D' )
238  t.Branch( 'nutaudis', arrpidNuTauDIS, 'nutaudis/D' )
239  t.Branch( 'nutaures', arrpidNuTauRes, 'nutaures/D' )
240  t.Branch( 'nc', arrpidNC, 'nc/D' )
241 
242 
243  for key, value in db.RangeIter():
244  if count > 3431748:
245  break
246 
247  datum = caffe.proto.caffe_pb2.Datum()
248  datum.ParseFromString(value)
249  label = int(datum.label)
250  truelabel[0]=label
251  image = caffe.io.datum_to_array(datum)
252  image = image.astype(np.uint8)
253 
254  out = net.forward_all(data=np.asarray([image]))
255  plabel = int(out['prob'][0].argmax(axis=0))
256  chosenlabel[0]=plabel
257  pidNuMuQE=float(out['prob'][0][0])
258  pidNuMuRes=float(out['prob'][0][1])
259  pidNuMuDIS=float(out['prob'][0][2])
260  pidNuMuOther=float(out['prob'][0][3])
261  pidNueQE=float(out['prob'][0][4])
262  pidNueRes=float(out['prob'][0][5])
263  pidNueDIS=float(out['prob'][0][6])
264  pidNueOther=float(out['prob'][0][7])
265  pidNuTauQE=float(out['prob'][0][8])
266  pidNuTauRes=float(out['prob'][0][9])
267  pidNuTauDIS=float(out['prob'][0][10])
268  pidNC=float(out['prob'][0][13])
269 
270  arrpidNuMuQE[0]=float(out['prob'][0][0])
271  arrpidNuMuRes[0]=float(out['prob'][0][1])
272  arrpidNuMuDIS[0]=float(out['prob'][0][2])
273  arrpidNuMuOther[0]=float(out['prob'][0][3])
274  arrpidNueQE[0]=float(out['prob'][0][4])
275  arrpidNueRes[0]=float(out['prob'][0][5])
276  arrpidNueDIS[0]=float(out['prob'][0][6])
277  arrpidNueOther[0]=float(out['prob'][0][7])
278  arrpidNuTauQE[0]=float(out['prob'][0][8])
279  arrpidNuTauRes[0]=float(out['prob'][0][9])
280  arrpidNuTauDIS[0]=float(out['prob'][0][10])
281  arrpidNC[0]=float(out['prob'][0][13])
282 
283  t.Fill()
284 
285  if label==0:
286  trueNuMuQEpidNuMuQE.Fill(pidNuMuQE)
287  trueNuMuQEpidNuMuRes.Fill(pidNuMuRes)
288  trueNuMuQEpidNuMuDIS.Fill(pidNuMuDIS)
289  trueNuMuQEpidNuMuOther.Fill(pidNuMuOther)
290  trueNuMuQEpidNueQE.Fill(pidNueQE)
291  trueNuMuQEpidNueRes.Fill(pidNueRes)
292  trueNuMuQEpidNueDIS.Fill(pidNueDIS)
293  trueNuMuQEpidNueOther.Fill(pidNueOther)
294  trueNuMuQEpidNuTauQE.Fill(pidNuTauQE)
295  trueNuMuQEpidNuTaueRes.Fill(pidNuTauRes)
296  trueNuMuQEpidNuTauDIS.Fill(pidNuTauDIS)
297  trueNuMuQEpidNC.Fill(pidNC)
298 
299  if label==1:
300  trueNuMuRespidNuMuQE.Fill(pidNuMuQE)
301  trueNuMuRespidNuMuRes.Fill(pidNuMuRes)
302  trueNuMuRespidNuMuDIS.Fill(pidNuMuDIS)
303  trueNuMuRespidNuMuOther.Fill(pidNuMuOther)
304  trueNuMuRespidNueQE.Fill(pidNueQE)
305  trueNuMuRespidNueRes.Fill(pidNueRes)
306  trueNuMuRespidNueDIS.Fill(pidNueDIS)
307  trueNuMuRespidNueOther.Fill(pidNueOther)
308  trueNuMuRespidNuTauQE.Fill(pidNuTauQE)
309  trueNuMuRespidNuTaueRes.Fill(pidNuTauRes)
310  trueNuMuRespidNuTauDIS.Fill(pidNuTauDIS)
311  trueNuMuRespidNC.Fill(pidNC)
312 
313  if label==2:
314  trueNuMuDISpidNuMuQE.Fill(pidNuMuQE)
315  trueNuMuDISpidNuMuRes.Fill(pidNuMuRes)
316  trueNuMuDISpidNuMuDIS.Fill(pidNuMuDIS)
317  trueNuMuDISpidNuMuOther.Fill(pidNuMuOther)
318  trueNuMuDISpidNueQE.Fill(pidNueQE)
319  trueNuMuDISpidNueRes.Fill(pidNueRes)
320  trueNuMuDISpidNueDIS.Fill(pidNueDIS)
321  trueNuMuDISpidNueOther.Fill(pidNueOther)
322  trueNuMuDISpidNuTauQE.Fill(pidNuTauQE)
323  trueNuMuDISpidNuTaueRes.Fill(pidNuTauRes)
324  trueNuMuDISpidNuTauDIS.Fill(pidNuTauDIS)
325  trueNuMuDISpidNC.Fill(pidNC)
326 
327  if label==3:
328  trueNuMuOtherpidNuMuQE.Fill(pidNuMuQE)
329  trueNuMuOtherpidNuMuRes.Fill(pidNuMuRes)
330  trueNuMuOtherpidNuMuDIS.Fill(pidNuMuDIS)
331  trueNuMuOtherpidNuMuOther.Fill(pidNuMuOther)
332  trueNuMuOtherpidNueQE.Fill(pidNueQE)
333  trueNuMuOtherpidNueRes.Fill(pidNueRes)
334  trueNuMuOtherpidNueDIS.Fill(pidNueDIS)
335  trueNuMuOtherpidNueOther.Fill(pidNueOther)
336  trueNuMuOtherpidNuTauQE.Fill(pidNuTauQE)
337  trueNuMuOtherpidNuTaueRes.Fill(pidNuTauRes)
338  trueNuMuOtherpidNuTauDIS.Fill(pidNuTauDIS)
339  trueNuMuOtherpidNC.Fill(pidNC)
340 
341  if label==4:
342  trueNueQEpidNuMuQE.Fill(pidNuMuQE)
343  trueNueQEpidNuMuRes.Fill(pidNuMuRes)
344  trueNueQEpidNuMuDIS.Fill(pidNuMuDIS)
345  trueNueQEpidNuMuOther.Fill(pidNuMuOther)
346  trueNueQEpidNueQE.Fill(pidNueQE)
347  trueNueQEpidNueRes.Fill(pidNueRes)
348  trueNueQEpidNueDIS.Fill(pidNueDIS)
349  trueNueQEpidNueOther.Fill(pidNueOther)
350  trueNueQEpidNuTauQE.Fill(pidNuTauQE)
351  trueNueQEpidNuTaueRes.Fill(pidNuTauRes)
352  trueNueQEpidNuTauDIS.Fill(pidNuTauDIS)
353  trueNueQEpidNC.Fill(pidNC)
354 
355  if label==5:
356  trueNueRespidNuMuQE.Fill(pidNuMuQE)
357  trueNueRespidNuMuRes.Fill(pidNuMuRes)
358  trueNueRespidNuMuDIS.Fill(pidNuMuDIS)
359  trueNueRespidNuMuOther.Fill(pidNuMuOther)
360  trueNueRespidNueQE.Fill(pidNueQE)
361  trueNueRespidNueRes.Fill(pidNueRes)
362  trueNueRespidNueDIS.Fill(pidNueDIS)
363  trueNueRespidNueOther.Fill(pidNueOther)
364  trueNueRespidNuTauQE.Fill(pidNuTauQE)
365  trueNueRespidNuTaueRes.Fill(pidNuTauRes)
366  trueNueRespidNuTauDIS.Fill(pidNuTauDIS)
367  trueNueRespidNC.Fill(pidNC)
368 
369  if label==6:
370  trueNueDISpidNuMuQE.Fill(pidNuMuQE)
371  trueNueDISpidNuMuRes.Fill(pidNuMuRes)
372  trueNueDISpidNuMuDIS.Fill(pidNuMuDIS)
373  trueNueDISpidNuMuOther.Fill(pidNuMuOther)
374  trueNueDISpidNueQE.Fill(pidNueQE)
375  trueNueDISpidNueRes.Fill(pidNueRes)
376  trueNueDISpidNueDIS.Fill(pidNueDIS)
377  trueNueDISpidNueOther.Fill(pidNueOther)
378  trueNueDISpidNuTauQE.Fill(pidNuTauQE)
379  trueNueDISpidNuTaueRes.Fill(pidNuTauRes)
380  trueNueDISpidNuTauDIS.Fill(pidNuTauDIS)
381  trueNueDISpidNC.Fill(pidNC)
382 
383  if label==7:
384  trueNueOtherpidNuMuQE.Fill(pidNuMuQE)
385  trueNueOtherpidNuMuRes.Fill(pidNuMuRes)
386  trueNueOtherpidNuMuDIS.Fill(pidNuMuDIS)
387  trueNueOtherpidNuMuOther.Fill(pidNuMuOther)
388  trueNueOtherpidNueQE.Fill(pidNueQE)
389  trueNueOtherpidNueRes.Fill(pidNueRes)
390  trueNueOtherpidNueDIS.Fill(pidNueDIS)
391  trueNueOtherpidNueOther.Fill(pidNueOther)
392  trueNueOtherpidNuTauQE.Fill(pidNuTauQE)
393  trueNueOtherpidNuTaueRes.Fill(pidNuTauRes)
394  trueNueOtherpidNuTauDIS.Fill(pidNuTauDIS)
395  trueNueOtherpidNC.Fill(pidNC)
396 
397  if label==8:
398  trueNuTauQEpidNuMuQE.Fill(pidNuMuQE)
399  trueNuTauQEpidNuMuRes.Fill(pidNuMuRes)
400  trueNuTauQEpidNuMuDIS.Fill(pidNuMuDIS)
401  trueNuTauQEpidNuMuOther.Fill(pidNuMuOther)
402  trueNuTauQEpidNueQE.Fill(pidNueQE)
403  trueNuTauQEpidNueRes.Fill(pidNueRes)
404  trueNuTauQEpidNueDIS.Fill(pidNueDIS)
405  trueNuTauQEpidNueOther.Fill(pidNueOther)
406  trueNuTauQEpidNuTauQE.Fill(pidNuTauQE)
407  trueNuTauQEpidNuTaueRes.Fill(pidNuTauRes)
408  trueNuTauQEpidNuTauDIS.Fill(pidNuTauDIS)
409  trueNuTauQEpidNC.Fill(pidNC)
410 
411  if label==9:
412  trueNuTauRespidNuMuQE.Fill(pidNuMuQE)
413  trueNuTauRespidNuMuRes.Fill(pidNuMuRes)
414  trueNuTauRespidNuMuDIS.Fill(pidNuMuDIS)
415  trueNuTauRespidNuMuOther.Fill(pidNuMuOther)
416  trueNuTauRespidNueQE.Fill(pidNueQE)
417  trueNuTauRespidNueRes.Fill(pidNueRes)
418  trueNuTauRespidNueDIS.Fill(pidNueDIS)
419  trueNuTauRespidNueOther.Fill(pidNueOther)
420  trueNuTauRespidNuTauQE.Fill(pidNuTauQE)
421  trueNuTauRespidNuTaueRes.Fill(pidNuTauRes)
422  trueNuTauRespidNuTauDIS.Fill(pidNuTauDIS)
423  trueNuTauRespidNC.Fill(pidNC)
424 
425  if label==10:
426  trueNuTauDISpidNuMuQE.Fill(pidNuMuQE)
427  trueNuTauDISpidNuMuRes.Fill(pidNuMuRes)
428  trueNuTauDISpidNuMuDIS.Fill(pidNuMuDIS)
429  trueNuTauDISpidNuMuOther.Fill(pidNuMuOther)
430  trueNuTauDISpidNueQE.Fill(pidNueQE)
431  trueNuTauDISpidNueRes.Fill(pidNueRes)
432  trueNuTauDISpidNueDIS.Fill(pidNueDIS)
433  trueNuTauDISpidNueOther.Fill(pidNueOther)
434  trueNuTauDISpidNuTauQE.Fill(pidNuTauQE)
435  trueNuTauDISpidNuTaueRes.Fill(pidNuTauRes)
436  trueNuTauDISpidNuTauDIS.Fill(pidNuTauDIS)
437  trueNuTauDISpidNC.Fill(pidNC)
438 
439  if label==13:
440  trueNCpidNuMuQE.Fill(pidNuMuQE)
441  trueNCpidNuMuRes.Fill(pidNuMuRes)
442  trueNCpidNuMuDIS.Fill(pidNuMuDIS)
443  trueNCpidNuMuOther.Fill(pidNuMuOther)
444  trueNCpidNueQE.Fill(pidNueQE)
445  trueNCpidNueRes.Fill(pidNueRes)
446  trueNCpidNueDIS.Fill(pidNueDIS)
447  trueNCpidNueOther.Fill(pidNueOther)
448  trueNCpidNuTauQE.Fill(pidNuTauQE)
449  trueNCpidNuTaueRes.Fill(pidNuTauRes)
450  trueNCpidNuTauDIS.Fill(pidNuTauDIS)
451  trueNCpidNC.Fill(pidNC)
452 
453  count = count + 1
454 
455  iscorrect = label == plabel
456  correct = correct + (1 if iscorrect else 0)
457  matrix[(label, plabel)] += 1
458  labels_set.update([label, plabel])
459 
460  # if not iscorrect:
461  # print("\rError: key=%s, expected %i but predicted %i" \
462  # % (key, label, plabel))
463 
464  sys.stdout.write("\rAccuracy: %.1f%% Progress: %.2f%%" % (100.*correct/count,100.*count/3431748))
465  sys.stdout.flush()
466 
467  print(str(correct) + " out of " + str(count) + " were classified correctly")
468 
469  print ""
470  print "Confusion matrix:"
471  print "(r , p) | count"
472  for l in labels_set:
473  for pl in labels_set:
474  print "(%i , %i) | %i" % (l, pl, matrix[(l,pl)])
475 
476 
477  fout.WriteTObject(t,"t")
478 
479  fout.WriteTObject(trueNuMuQEpidNuMuQE,"trueNuMuQEpidNuMuQE")
480  fout.WriteTObject(trueNuMuQEpidNuMuRes,"trueNuMuQEpidNuMuRes")
481  fout.WriteTObject(trueNuMuQEpidNuMuDIS,"trueNuMuQEpidNuMuDIS")
482  fout.WriteTObject(trueNuMuQEpidNuMuOther,"trueNuMuQEpidNuMuOther")
483  fout.WriteTObject(trueNuMuQEpidNueQE,"trueNuMuQEpidNueQE")
484  fout.WriteTObject(trueNuMuQEpidNueRes,"trueNuMuQEpidNueRes")
485  fout.WriteTObject(trueNuMuQEpidNueDIS,"trueNuMuQEpidNueDIS")
486  fout.WriteTObject(trueNuMuQEpidNueOther,"trueNuMuQEpidNueOther")
487  fout.WriteTObject(trueNuMuQEpidNuTauQE,"trueNuMuQEpidNuTauQE")
488  fout.WriteTObject(trueNuMuQEpidNuTaueRes,"trueNuMuQEpidNuTaueRes")
489  fout.WriteTObject(trueNuMuQEpidNuTauDIS,"trueNuMuQEpidNuTauDIS")
490  fout.WriteTObject(trueNuMuQEpidNC,"trueNuMuQEpidNC")
491 
492  fout.WriteTObject(trueNuMuRespidNuMuQE,"trueNuMuRespidNuMuQE")
493  fout.WriteTObject(trueNuMuRespidNuMuRes,"trueNuMuRespidNuMuRes")
494  fout.WriteTObject(trueNuMuRespidNuMuDIS,"trueNuMuRespidNuMuDIS")
495  fout.WriteTObject(trueNuMuRespidNuMuOther,"trueNuMuRespidNuMuOther")
496  fout.WriteTObject(trueNuMuRespidNueQE,"trueNuMuRespidNueQE")
497  fout.WriteTObject(trueNuMuRespidNueRes,"trueNuMuRespidNueRes")
498  fout.WriteTObject(trueNuMuRespidNueDIS,"trueNuMuRespidNueDIS")
499  fout.WriteTObject(trueNuMuRespidNueOther,"trueNuMuRespidNueOther")
500  fout.WriteTObject(trueNuMuRespidNuTauQE,"trueNuMuRespidNuTauQE")
501  fout.WriteTObject(trueNuMuRespidNuTaueRes,"trueNuMuRespidNuTaueRes")
502  fout.WriteTObject(trueNuMuRespidNuTauDIS,"trueNuMuRespidNuTauDIS")
503  fout.WriteTObject(trueNuMuRespidNC,"trueNuMuRespidNC")
504 
505  fout.WriteTObject(trueNuMuDISpidNuMuQE,"trueNuMuDISpidNuMuQE")
506  fout.WriteTObject(trueNuMuDISpidNuMuRes,"trueNuMuDISpidNuMuRes")
507  fout.WriteTObject(trueNuMuDISpidNuMuDIS,"trueNuMuDISpidNuMuDIS")
508  fout.WriteTObject(trueNuMuDISpidNuMuOther,"trueNuMuDISpidNuMuOther")
509  fout.WriteTObject(trueNuMuDISpidNueQE,"trueNuMuDISpidNueQE")
510  fout.WriteTObject(trueNuMuDISpidNueRes,"trueNuMuDISpidNueRes")
511  fout.WriteTObject(trueNuMuDISpidNueDIS,"trueNuMuDISpidNueDIS")
512  fout.WriteTObject(trueNuMuDISpidNueOther,"trueNuMuDISpidNueOther")
513  fout.WriteTObject(trueNuMuDISpidNuTauQE,"trueNuMuDISpidNuTauQE")
514  fout.WriteTObject(trueNuMuDISpidNuTaueRes,"trueNuMuDISpidNuTaueRes")
515  fout.WriteTObject(trueNuMuDISpidNuTauDIS,"trueNuMuDISpidNuTauDIS")
516  fout.WriteTObject(trueNuMuDISpidNC,"trueNuMuDISpidNC")
517 
518  fout.WriteTObject(trueNuMuOtherpidNuMuQE,"trueNuMuOtherpidNuMuQE")
519  fout.WriteTObject(trueNuMuOtherpidNuMuRes,"trueNuMuOtherpidNuMuRes")
520  fout.WriteTObject(trueNuMuOtherpidNuMuDIS,"trueNuMuOtherpidNuMuDIS")
521  fout.WriteTObject(trueNuMuOtherpidNuMuOther,"trueNuMuOtherpidNuMuOther")
522  fout.WriteTObject(trueNuMuOtherpidNueQE,"trueNuMuOtherpidNueQE")
523  fout.WriteTObject(trueNuMuOtherpidNueRes,"trueNuMuOtherpidNueRes")
524  fout.WriteTObject(trueNuMuOtherpidNueDIS,"trueNuMuOtherpidNueDIS")
525  fout.WriteTObject(trueNuMuOtherpidNueOther,"trueNuMuOtherpidNueOther")
526  fout.WriteTObject(trueNuMuOtherpidNuTauQE,"trueNuMuOtherpidNuTauQE")
527  fout.WriteTObject(trueNuMuOtherpidNuTaueRes,"trueNuMuOtherpidNuTaueRes")
528  fout.WriteTObject(trueNuMuOtherpidNuTauDIS,"trueNuMuOtherpidNuTauDIS")
529  fout.WriteTObject(trueNuMuOtherpidNC,"trueNuMuOtherpidNC")
530 
531  fout.WriteTObject(trueNueQEpidNuMuQE,"trueNueQEpidNuMuQE")
532  fout.WriteTObject(trueNueQEpidNuMuRes,"trueNueQEpidNuMuRes")
533  fout.WriteTObject(trueNueQEpidNuMuDIS,"trueNueQEpidNuMuDIS")
534  fout.WriteTObject(trueNueQEpidNuMuOther,"trueNueQEpidNuMuOther")
535  fout.WriteTObject(trueNueQEpidNueQE,"trueNueQEpidNueQE")
536  fout.WriteTObject(trueNueQEpidNueRes,"trueNueQEpidNueRes")
537  fout.WriteTObject(trueNueQEpidNueDIS,"trueNueQEpidNueDIS")
538  fout.WriteTObject(trueNueQEpidNueOther,"trueNueQEpidNueOther")
539  fout.WriteTObject(trueNueQEpidNuTauQE,"trueNueQEpidNuTauQE")
540  fout.WriteTObject(trueNueQEpidNuTaueRes,"trueNueQEpidNuTaueRes")
541  fout.WriteTObject(trueNueQEpidNuTauDIS,"trueNueQEpidNuTauDIS")
542  fout.WriteTObject(trueNueQEpidNC,"trueNueQEpidNC")
543 
544  fout.WriteTObject(trueNueRespidNuMuQE,"trueNueRespidNuMuQE")
545  fout.WriteTObject(trueNueRespidNuMuRes,"trueNueRespidNuMuRes")
546  fout.WriteTObject(trueNueRespidNuMuDIS,"trueNueRespidNuMuDIS")
547  fout.WriteTObject(trueNueRespidNuMuOther,"trueNueRespidNuMuOther")
548  fout.WriteTObject(trueNueRespidNueQE,"trueNueRespidNueQE")
549  fout.WriteTObject(trueNueRespidNueRes,"trueNueRespidNueRes")
550  fout.WriteTObject(trueNueRespidNueDIS,"trueNueRespidNueDIS")
551  fout.WriteTObject(trueNueRespidNueOther,"trueNueRespidNueOther")
552  fout.WriteTObject(trueNueRespidNuTauQE,"trueNueRespidNuTauQE")
553  fout.WriteTObject(trueNueRespidNuTaueRes,"trueNueRespidNuTaueRes")
554  fout.WriteTObject(trueNueRespidNuTauDIS,"trueNueRespidNuTauDIS")
555  fout.WriteTObject(trueNueRespidNC,"trueNueRespidNC")
556 
557  fout.WriteTObject(trueNueDISpidNuMuQE,"trueNueDISpidNuMuQE")
558  fout.WriteTObject(trueNueDISpidNuMuRes,"trueNueDISpidNuMuRes")
559  fout.WriteTObject(trueNueDISpidNuMuDIS,"trueNueDISpidNuMuDIS")
560  fout.WriteTObject(trueNueDISpidNuMuOther,"trueNueDISpidNuMuOther")
561  fout.WriteTObject(trueNueDISpidNueQE,"trueNueDISpidNueQE")
562  fout.WriteTObject(trueNueDISpidNueRes,"trueNueDISpidNueRes")
563  fout.WriteTObject(trueNueDISpidNueDIS,"trueNueDISpidNueDIS")
564  fout.WriteTObject(trueNueDISpidNueOther,"trueNueDISpidNueOther")
565  fout.WriteTObject(trueNueDISpidNuTauQE,"trueNueDISpidNuTauQE")
566  fout.WriteTObject(trueNueDISpidNuTaueRes,"trueNueDISpidNuTaueRes")
567  fout.WriteTObject(trueNueDISpidNuTauDIS,"trueNueDISpidNuTauDIS")
568  fout.WriteTObject(trueNueDISpidNC,"trueNueDISpidNC")
569 
570  fout.WriteTObject(trueNueOtherpidNuMuQE,"trueNueOtherpidNuMuQE")
571  fout.WriteTObject(trueNueOtherpidNuMuRes,"trueNueOtherpidNuMuRes")
572  fout.WriteTObject(trueNueOtherpidNuMuDIS,"trueNueOtherpidNuMuDIS")
573  fout.WriteTObject(trueNueOtherpidNuMuOther,"trueNueOtherpidNuMuOther")
574  fout.WriteTObject(trueNueOtherpidNueQE,"trueNueOtherpidNueQE")
575  fout.WriteTObject(trueNueOtherpidNueRes,"trueNueOtherpidNueRes")
576  fout.WriteTObject(trueNueOtherpidNueDIS,"trueNueOtherpidNueDIS")
577  fout.WriteTObject(trueNueOtherpidNueOther,"trueNueOtherpidNueOther")
578  fout.WriteTObject(trueNueOtherpidNuTauQE,"trueNueOtherpidNuTauQE")
579  fout.WriteTObject(trueNueOtherpidNuTaueRes,"trueNueOtherpidNuTaueRes")
580  fout.WriteTObject(trueNueOtherpidNuTauDIS,"trueNueOtherpidNuTauDIS")
581  fout.WriteTObject(trueNueOtherpidNC,"trueNueOtherpidNC")
582 
583  fout.WriteTObject(trueNuTauQEpidNuMuQE,"trueNuTauQEpidNuMuQE")
584  fout.WriteTObject(trueNuTauQEpidNuMuRes,"trueNuTauQEpidNuMuRes")
585  fout.WriteTObject(trueNuTauQEpidNuMuDIS,"trueNuTauQEpidNuMuDIS")
586  fout.WriteTObject(trueNuTauQEpidNuMuOther,"trueNuTauQEpidNuMuOther")
587  fout.WriteTObject(trueNuTauQEpidNueQE,"trueNuTauQEpidNueQE")
588  fout.WriteTObject(trueNuTauQEpidNueRes,"trueNuTauQEpidNueRes")
589  fout.WriteTObject(trueNuTauQEpidNueDIS,"trueNuTauQEpidNueDIS")
590  fout.WriteTObject(trueNuTauQEpidNueOther,"trueNuTauQEpidNueOther")
591  fout.WriteTObject(trueNuTauQEpidNuTauQE,"trueNuTauQEpidNuTauQE")
592  fout.WriteTObject(trueNuTauQEpidNuTaueRes,"trueNuTauQEpidNuTaueRes")
593  fout.WriteTObject(trueNuTauQEpidNuTauDIS,"trueNuTauQEpidNuTauDIS")
594  fout.WriteTObject(trueNuTauQEpidNC,"trueNuTauQEpidNC")
595 
596  fout.WriteTObject(trueNuTauRespidNuMuQE,"trueNuTauRespidNuMuQE")
597  fout.WriteTObject(trueNuTauRespidNuMuRes,"trueNuTauRespidNuMuRes")
598  fout.WriteTObject(trueNuTauRespidNuMuDIS,"trueNuTauRespidNuMuDIS")
599  fout.WriteTObject(trueNuTauRespidNuMuOther,"trueNuTauRespidNuMuOther")
600  fout.WriteTObject(trueNuTauRespidNueQE,"trueNuTauRespidNueQE")
601  fout.WriteTObject(trueNuTauRespidNueRes,"trueNuTauRespidNueRes")
602  fout.WriteTObject(trueNuTauRespidNueDIS,"trueNuTauRespidNueDIS")
603  fout.WriteTObject(trueNuTauRespidNueOther,"trueNuTauRespidNueOther")
604  fout.WriteTObject(trueNuTauRespidNuTauQE,"trueNuTauRespidNuTauQE")
605  fout.WriteTObject(trueNuTauRespidNuTaueRes,"trueNuTauRespidNuTaueRes")
606  fout.WriteTObject(trueNuTauRespidNuTauDIS,"trueNuTauRespidNuTauDIS")
607  fout.WriteTObject(trueNuTauRespidNC,"trueNuTauRespidNC")
608 
609  fout.WriteTObject(trueNuTauDISpidNuMuQE,"trueNuTauDISpidNuMuQE")
610  fout.WriteTObject(trueNuTauDISpidNuMuRes,"trueNuTauDISpidNuMuRes")
611  fout.WriteTObject(trueNuTauDISpidNuMuDIS,"trueNuTauDISpidNuMuDIS")
612  fout.WriteTObject(trueNuTauDISpidNuMuOther,"trueNuTauDISpidNuMuOther")
613  fout.WriteTObject(trueNuTauDISpidNueQE,"trueNuTauDISpidNueQE")
614  fout.WriteTObject(trueNuTauDISpidNueRes,"trueNuTauDISpidNueRes")
615  fout.WriteTObject(trueNuTauDISpidNueDIS,"trueNuTauDISpidNueDIS")
616  fout.WriteTObject(trueNuTauDISpidNueOther,"trueNuTauDISpidNueOther")
617  fout.WriteTObject(trueNuTauDISpidNuTauQE,"trueNuTauDISpidNuTauQE")
618  fout.WriteTObject(trueNuTauDISpidNuTaueRes,"trueNuTauDISpidNuTaueRes")
619  fout.WriteTObject(trueNuTauDISpidNuTauDIS,"trueNuTauDISpidNuTauDIS")
620  fout.WriteTObject(trueNuTauDISpidNC,"trueNuTauDISpidNC")
621 
622  fout.WriteTObject(trueNCpidNuMuQE,"trueNCpidNuMuQE")
623  fout.WriteTObject(trueNCpidNuMuRes,"trueNCpidNuMuRes")
624  fout.WriteTObject(trueNCpidNuMuDIS,"trueNCpidNuMuDIS")
625  fout.WriteTObject(trueNCpidNuMuOther,"trueNCpidNuMuOther")
626  fout.WriteTObject(trueNCpidNueQE,"trueNCpidNueQE")
627  fout.WriteTObject(trueNCpidNueRes,"trueNCpidNueRes")
628  fout.WriteTObject(trueNCpidNueDIS,"trueNCpidNueDIS")
629  fout.WriteTObject(trueNCpidNueOther,"trueNCpidNueOther")
630  fout.WriteTObject(trueNCpidNuTauQE,"trueNCpidNuTauQE")
631  fout.WriteTObject(trueNCpidNuTaueRes,"trueNCpidNuTaueRes")
632  fout.WriteTObject(trueNCpidNuTauDIS,"trueNCpidNuTauDIS")
633  fout.WriteTObject(trueNCpidNC,"trueNCpidNC")
634 
635 
636 
637 
bool print