FlatRecoTree.cxx
Go to the documentation of this file.
1 /*
2  * FlatRecoTree.cxx
3  *
4  * Created on: Feb 9, 2021
5  * Author: chilgenb
6  */
7 
9 #include <utility>
10 
11 using namespace std; //::vector;
12 using namespace garana;
13 
14 FlatRecoTree::FlatRecoTree(TTree* tree)
15 {
16  SetupRead(tree);
17 }
18 
19 FlatRecoTree::FlatRecoTree(TTree* tree, char opt)
20 {
21  CheckOpt(opt);//sets TreeReader::fOpt
22 
23  if(fOpt=='r'){
24  std::cout << "constructed FlatRecoTree object in read-only mode" << std::endl;
25  SetupRead(tree);
26  SetBranchAddresses();
27  }
28  else {
29  std::cout << "constructed FlatRecoTree object in write mode" << std::endl;
30  fTreeIn = tree;
31  SetBranchAddresses();
32  SetVecs();
33  }
34 
35 }
36 
37 bool FlatRecoTree::SetBranchAddresses(){
38 
39 std::cout << "FlatRecoTree SetBranchAddresses()" << std::endl;
40 
41  if(fOpt=='r'){
42  fTreeIn->SetBranchAddress("Event", &fEvent, &b_Event );
43  fTreeIn->SetBranchAddress("TrkLenFwd", &fTrkLenFwd, &b_TrkLenFwd );
44  fTreeIn->SetBranchAddress("TrkLenBac", &fTrkLenBac, &b_TrkLenBac );
45  fTreeIn->SetBranchAddress("TrkMomBeg", &fTrkMomBeg, &b_TrkMomBeg );
46  fTreeIn->SetBranchAddress("TrkMomEnd", &fTrkMomEnd, &b_TrkMomEnd );
47  fTreeIn->SetBranchAddress("TrkVtxX", &fTrkVtxX, &b_TrkVtxX );
48  fTreeIn->SetBranchAddress("TrkVtxY", &fTrkVtxY, &b_TrkVtxY );
49  fTreeIn->SetBranchAddress("TrkVtxZ", &fTrkVtxZ, &b_TrkVtxZ );
50  fTreeIn->SetBranchAddress("TrkVtxT", &fTrkVtxT, &b_TrkVtxT );
51  fTreeIn->SetBranchAddress("TrkEndX", &fTrkEndX, &b_TrkEndX );
52  fTreeIn->SetBranchAddress("TrkEndY", &fTrkEndY, &b_TrkEndY );
53  fTreeIn->SetBranchAddress("TrkEndZ", &fTrkEndZ, &b_TrkEndZ );
54  fTreeIn->SetBranchAddress("TrkEndT", &fTrkEndT, &b_TrkEndT );
55 
56  fTreeIn->SetBranchAddress("TrkVtxDirX", &fTrkVtxDirX, &b_TrkVtxDirX );
57  fTreeIn->SetBranchAddress("TrkVtxDirY", &fTrkVtxDirY, &b_TrkVtxDirY );
58  fTreeIn->SetBranchAddress("TrkVtxDirZ", &fTrkVtxDirZ, &b_TrkVtxDirZ );
59  fTreeIn->SetBranchAddress("TrkEndDirX", &fTrkEndDirX, &b_TrkEndDirX );
60  fTreeIn->SetBranchAddress("TrkEndDirY", &fTrkEndDirY, &b_TrkEndDirY );
61  fTreeIn->SetBranchAddress("TrkEndDirZ", &fTrkEndDirZ, &b_TrkEndDirZ );
62  fTreeIn->SetBranchAddress("TrkChiFwd", &fTrkChiFwd, &b_TrkChiFwd );
63  fTreeIn->SetBranchAddress("TrkChiBac", &fTrkChiBac, &b_TrkChiBac );
64  fTreeIn->SetBranchAddress("TrkNHits", &fTrkNHits, &b_TrkNHits );
65 
66  fTreeIn->SetBranchAddress("TrackXBeg", &fTrackXBeg, &b_TrackXBeg );
67  fTreeIn->SetBranchAddress("TrackYBeg", &fTrackYBeg, &b_TrackYBeg );
68  fTreeIn->SetBranchAddress("TrackZBeg", &fTrackZBeg, &b_TrackZBeg );
69  fTreeIn->SetBranchAddress("TrackCurvBeg", &fTrackCurvBeg, &b_TrackCurvBeg );
70  fTreeIn->SetBranchAddress("TrackPhiBeg", &fTrackPhiBeg, &b_TrackPhiBeg );
71  fTreeIn->SetBranchAddress("TrackLambBeg", &fTrackLambBeg, &b_TrackLambBeg );
72  fTreeIn->SetBranchAddress("TrackXEnd", &fTrackXEnd, &b_TrackXEnd );
73  fTreeIn->SetBranchAddress("TrackYEnd", &fTrackYEnd, &b_TrackYEnd );
74  fTreeIn->SetBranchAddress("TrackZEnd", &fTrackZEnd, &b_TrackZEnd );
75  fTreeIn->SetBranchAddress("TrackCurvEnd", &fTrackCurvEnd, &b_TrackCurvEnd );
76  fTreeIn->SetBranchAddress("TrackPhiEnd ", &fTrackPhiEnd , &b_TrackPhiEnd );
77  fTreeIn->SetBranchAddress("TrackLambEnd", &fTrackLambEnd, &b_TrackLambEnd );
78  fTreeIn->SetBranchAddress("TrkCovMat1Beg", &fTrkCovMat1Beg, &b_TrkCovMat1Beg );
79  fTreeIn->SetBranchAddress("TrkCovMat2Beg", &fTrkCovMat2Beg, &b_TrkCovMat2Beg );
80  fTreeIn->SetBranchAddress("TrkCovMat3Beg", &fTrkCovMat3Beg, &b_TrkCovMat3Beg );
81  fTreeIn->SetBranchAddress("TrkCovMat4Beg", &fTrkCovMat4Beg, &b_TrkCovMat4Beg );
82  fTreeIn->SetBranchAddress("TrkCovMat5Beg", &fTrkCovMat5Beg, &b_TrkCovMat5Beg );
83  fTreeIn->SetBranchAddress("TrkCovMat6Beg", &fTrkCovMat6Beg, &b_TrkCovMat6Beg );
84  fTreeIn->SetBranchAddress("TrkCovMat7Beg", &fTrkCovMat7Beg, &b_TrkCovMat7Beg );
85  fTreeIn->SetBranchAddress("TrkCovMat8Beg", &fTrkCovMat8Beg, &b_TrkCovMat8Beg );
86  fTreeIn->SetBranchAddress("TrkCovMat9Beg", &fTrkCovMat9Beg, &b_TrkCovMat9Beg );
87  fTreeIn->SetBranchAddress("TrkCovMat10Beg", &fTrkCovMat10Beg, &b_TrkCovMat10Beg );
88  fTreeIn->SetBranchAddress("TrkCovMat11Beg", &fTrkCovMat11Beg, &b_TrkCovMat11Beg );
89  fTreeIn->SetBranchAddress("TrkCovMat12Beg", &fTrkCovMat12Beg, &b_TrkCovMat12Beg );
90  fTreeIn->SetBranchAddress("TrkCovMat13Beg", &fTrkCovMat13Beg, &b_TrkCovMat13Beg );
91  fTreeIn->SetBranchAddress("TrkCovMat14Beg", &fTrkCovMat14Beg, &b_TrkCovMat14Beg );
92  fTreeIn->SetBranchAddress("TrkCovMat15Beg", &fTrkCovMat15Beg, &b_TrkCovMat15Beg );
93  fTreeIn->SetBranchAddress("TrkCovMat1End", &fTrkCovMat1End, &b_TrkCovMat1End );
94  fTreeIn->SetBranchAddress("TrkCovMat2End", &fTrkCovMat2End, &b_TrkCovMat2End );
95  fTreeIn->SetBranchAddress("TrkCovMat3End", &fTrkCovMat3End, &b_TrkCovMat3End );
96  fTreeIn->SetBranchAddress("TrkCovMat4End", &fTrkCovMat4End, &b_TrkCovMat4End );
97  fTreeIn->SetBranchAddress("TrkCovMat5End", &fTrkCovMat5End, &b_TrkCovMat5End );
98  fTreeIn->SetBranchAddress("TrkCovMat6End", &fTrkCovMat6End, &b_TrkCovMat6End );
99  fTreeIn->SetBranchAddress("TrkCovMat7End", &fTrkCovMat7End, &b_TrkCovMat7End );
100  fTreeIn->SetBranchAddress("TrkCovMat8End", &fTrkCovMat8End, &b_TrkCovMat8End );
101  fTreeIn->SetBranchAddress("TrkCovMat9End", &fTrkCovMat9End, &b_TrkCovMat9End );
102  fTreeIn->SetBranchAddress("TrkCovMat10End", &fTrkCovMat10End, &b_TrkCovMat10End );
103  fTreeIn->SetBranchAddress("TrkCovMat11End", &fTrkCovMat11End, &b_TrkCovMat11End );
104  fTreeIn->SetBranchAddress("TrkCovMat12End", &fTrkCovMat12End, &b_TrkCovMat12End );
105  fTreeIn->SetBranchAddress("TrkCovMat13End", &fTrkCovMat13End, &b_TrkCovMat13End );
106  fTreeIn->SetBranchAddress("TrkCovMat14End", &fTrkCovMat14End, &b_TrkCovMat14End );
107  fTreeIn->SetBranchAddress("TrkCovMat15End", &fTrkCovMat15End, &b_TrkCovMat15End );
108 
109  fTreeIn->SetBranchAddress("TrkIonizFwd", &fTrkIonizFwd, &b_TrkIonizFwd );
110  fTreeIn->SetBranchAddress("TrkIonizBac", &fTrkIonizBac, &b_TrkIonizBac );
111  fTreeIn->SetBranchAddress("TrkChgFwd", &fTrkChgFwd, &b_TrkChgFwd );
112  fTreeIn->SetBranchAddress("TrkChgBac", &fTrkChgBac, &b_TrkChgBac );
113 
114  fTreeIn->SetBranchAddress("VeeVtxX", &fVeeVtxX, &b_VeeVtxX );
115  fTreeIn->SetBranchAddress("VeeVtxY", &fVeeVtxY, &b_VeeVtxY );
116  fTreeIn->SetBranchAddress("VeeVtxZ", &fVeeVtxZ, &b_VeeVtxZ );
117  fTreeIn->SetBranchAddress("VeeVtxT", &fVeeVtxT, &b_VeeVtxT );
118  fTreeIn->SetBranchAddress("VeeVtxCovar11", &fVeeVtxCovar11, &b_VeeVtxCovar11 );
119  fTreeIn->SetBranchAddress("VeeVtxCovar12", &fVeeVtxCovar12, &b_VeeVtxCovar12 );
120  fTreeIn->SetBranchAddress("VeeVtxCovar13", &fVeeVtxCovar13, &b_VeeVtxCovar13 );
121  fTreeIn->SetBranchAddress("VeeVtxCovar21", &fVeeVtxCovar21, &b_VeeVtxCovar21 );
122  fTreeIn->SetBranchAddress("VeeVtxCovar22", &fVeeVtxCovar22, &b_VeeVtxCovar22 );
123  fTreeIn->SetBranchAddress("VeeVtxCovar23", &fVeeVtxCovar23, &b_VeeVtxCovar23 );
124  fTreeIn->SetBranchAddress("VeeVtxCovar31", &fVeeVtxCovar31, &b_VeeVtxCovar31 );
125  fTreeIn->SetBranchAddress("VeeVtxCovar32", &fVeeVtxCovar32, &b_VeeVtxCovar32 );
126  fTreeIn->SetBranchAddress("VeeVtxCovar33", &fVeeVtxCovar33, &b_VeeVtxCovar33 );
127 
128  fTreeIn->SetBranchAddress("VeePxKshort", &fVeePxKshort, &b_VeePxKshort );
129  fTreeIn->SetBranchAddress("VeePyKshort", &fVeePyKshort, &b_VeePyKshort );
130  fTreeIn->SetBranchAddress("VeePzKshort", &fVeePzKshort, &b_VeePzKshort );
131  fTreeIn->SetBranchAddress("VeeEKshort", &fVeeEKshort, &b_VeeEKshort );
132  fTreeIn->SetBranchAddress("VeePxLamb1", &fVeePxLamb1, &b_VeePxLamb1 );
133  fTreeIn->SetBranchAddress("VeePyLamb1", &fVeePyLamb1, &b_VeePyLamb1 );
134  fTreeIn->SetBranchAddress("VeePzLamb1", &fVeePzLamb1, &b_VeePzLamb1 );
135  fTreeIn->SetBranchAddress("VeeELamb1", &fVeeELamb1, &b_VeeELamb1 );
136  fTreeIn->SetBranchAddress("VeePxLamb2", &fVeePxLamb2, &b_VeePxLamb2 );
137  fTreeIn->SetBranchAddress("VeePyLamb2", &fVeePyLamb2, &b_VeePyLamb2 );
138  fTreeIn->SetBranchAddress("VeePzLamb2", &fVeePzLamb2, &b_VeePzLamb2 );
139  fTreeIn->SetBranchAddress("VeeELamb2", &fVeeELamb2, &b_VeeELamb2 );
140  fTreeIn->SetBranchAddress("VeeChisqr", &fVeeChisqr, &b_VeeChisqr );
141 
142  fTreeIn->SetBranchAddress("VtxX", &fVtxX, &b_VtxX );
143  fTreeIn->SetBranchAddress("VtxY", &fVtxY, &b_VtxY );
144  fTreeIn->SetBranchAddress("VtxZ", &fVtxZ, &b_VtxZ );
145  fTreeIn->SetBranchAddress("VtxT", &fVtxT, &b_VtxT );
146  fTreeIn->SetBranchAddress("VtxCovar11", &fVtxCovar11, &b_VtxCovar11 );
147  fTreeIn->SetBranchAddress("VtxCovar12", &fVtxCovar12, &b_VtxCovar12 );
148  fTreeIn->SetBranchAddress("VtxCovar13", &fVtxCovar13, &b_VtxCovar13 );
149  fTreeIn->SetBranchAddress("VtxCovar21", &fVtxCovar21, &b_VtxCovar21 );
150  fTreeIn->SetBranchAddress("VtxCovar22", &fVtxCovar22, &b_VtxCovar22 );
151  fTreeIn->SetBranchAddress("VtxCovar23", &fVtxCovar23, &b_VtxCovar23 );
152  fTreeIn->SetBranchAddress("VtxCovar31", &fVtxCovar31, &b_VtxCovar31 );
153  fTreeIn->SetBranchAddress("VtxCovar32", &fVtxCovar32, &b_VtxCovar32 );
154  fTreeIn->SetBranchAddress("VtxCovar33", &fVtxCovar33, &b_VtxCovar33 );
155 
156  fTreeIn->SetBranchAddress("CalClustX", &fCalClustX, &b_CalClustX );
157  fTreeIn->SetBranchAddress("CalClustY", &fCalClustY, &b_CalClustY );
158  fTreeIn->SetBranchAddress("CalClustZ", &fCalClustZ, &b_CalClustZ );
159  fTreeIn->SetBranchAddress("CalClustT", &fCalClustT, &b_CalClustT );
160  fTreeIn->SetBranchAddress("CalClustEnergy", &fCalClustEnergy, &b_CalClustEnergy );
161  fTreeIn->SetBranchAddress("CalClustEnergyError", &fCalClustEnergyError, &b_CalClustEnergyError);
162  fTreeIn->SetBranchAddress("CalClustTdiff", &fCalClustTdiff, &b_CalClustTdiff );
163  fTreeIn->SetBranchAddress("CalClustEllip", &fCalClustEllip, &b_CalClustEllip );
164  fTreeIn->SetBranchAddress("CalClustR1", &fCalClustR1, &b_CalClustR1 );
165  fTreeIn->SetBranchAddress("CalClustR2", &fCalClustR2, &b_CalClustR2 );
166  fTreeIn->SetBranchAddress("CalClustR3", &fCalClustR3, &b_CalClustR3 );
167  fTreeIn->SetBranchAddress("CalClustVol", &fCalClustVol, &b_CalClustVol );
168  fTreeIn->SetBranchAddress("CalClustWidth", &fCalClustWidth, &b_CalClustWidth );
169  fTreeIn->SetBranchAddress("CalClustTheta", &fCalClustTheta, &b_CalClustTheta );
170  fTreeIn->SetBranchAddress("CalClustPhi", &fCalClustPhi, &b_CalClustPhi );
171  fTreeIn->SetBranchAddress("CalClustEigen1X", &fCalClustEigen1X, &b_CalClustEigen1X );
172  fTreeIn->SetBranchAddress("CalClustEigen1Y", &fCalClustEigen1Y, &b_CalClustEigen1Y );
173  fTreeIn->SetBranchAddress("CalClustEigen1Z", &fCalClustEigen1Z, &b_CalClustEigen1Z );
174  fTreeIn->SetBranchAddress("CalClustEigen2X", &fCalClustEigen2X, &b_CalClustEigen2X );
175  fTreeIn->SetBranchAddress("CalClustEigen2Y", &fCalClustEigen2Y, &b_CalClustEigen2Y );
176  fTreeIn->SetBranchAddress("CalClustEigen2Z", &fCalClustEigen2Z, &b_CalClustEigen2Z );
177  fTreeIn->SetBranchAddress("CalClustEigen3X", &fCalClustEigen3X, &b_CalClustEigen3X );
178  fTreeIn->SetBranchAddress("CalClustEigen3Y", &fCalClustEigen3Y, &b_CalClustEigen3Y );
179  fTreeIn->SetBranchAddress("CalClustEigen3Z", &fCalClustEigen3Z, &b_CalClustEigen3Z );
180 
181  fTreeIn->SetBranchAddress("TrackG4PIndices ", &fTrackG4PIndices, &b_TrackG4PIndices );
182  fTreeIn->SetBranchAddress("VertTrackIndices", &fVertTrackIndices, &b_VertTrackIndices );
183  fTreeIn->SetBranchAddress("VeeTrackIndices ", &fVeeTrackIndices, &b_VeeTrackIndices );
184  //fTreeIn->SetBranchAddress("CalTrackIndices ", &fCalTrackIndices, &b_CalTrackIndices );
185  fTreeIn->SetBranchAddress("CalTrackIndices", &fCalClusterTrackIndices , &b_CalClusterTrackIndices );
186  //fTreeIn->SetBranchAddress("CalTrackEnds", &fCalTrackEnds , &b_CalTrackEnds );
187  fTreeIn->SetBranchAddress("CalG4Indices", &fCalClusterG4Indices , &b_CalClusterG4Indices );
188 
189  fTreeIn->SetBranchAddress("VertTrackEnds", &fVertTrackEnds, &b_VertTrackEnds );
190  fTreeIn->SetBranchAddress("VeeTrackEnds", &fVeeTrackEnds, &b_VeeTrackEnds );
191 
192  }
193 
194 
195  if(fOpt=='w'){
196 
197  fTreeIn->Branch("Event", &fEvent, "Event/I" );
198  fTreeIn->Branch("TrkLenFwd", "vector<float>", &fTrkLenFwd );
199  fTreeIn->Branch("TrkLenBac", "vector<float>", &fTrkLenBac );
200  fTreeIn->Branch("TrkMomBeg", "vector<float>", &fTrkMomBeg );
201  fTreeIn->Branch("TrkMomEnd", "vector<float>", &fTrkMomEnd );
202  fTreeIn->Branch("TrkVtxX", "vector<float>", &fTrkVtxX );
203  fTreeIn->Branch("TrkVtxY", "vector<float>", &fTrkVtxY );
204  fTreeIn->Branch("TrkVtxZ", "vector<float>", &fTrkVtxZ );
205  fTreeIn->Branch("TrkVtxT", "vector<float>", &fTrkVtxT );
206  fTreeIn->Branch("TrkEndX", "vector<float>", &fTrkEndX );
207  fTreeIn->Branch("TrkEndY", "vector<float>", &fTrkEndY );
208  fTreeIn->Branch("TrkEndZ", "vector<float>", &fTrkEndZ );
209  fTreeIn->Branch("TrkEndT", "vector<float>", &fTrkEndT );
210 
211  fTreeIn->Branch("TrkVtxDirX", "vector<float>", &fTrkVtxDirX );
212  fTreeIn->Branch("TrkVtxDirY", "vector<float>", &fTrkVtxDirY );
213  fTreeIn->Branch("TrkVtxDirZ", "vector<float>", &fTrkVtxDirZ );
214  fTreeIn->Branch("TrkEndDirX", "vector<float>", &fTrkEndDirX );
215  fTreeIn->Branch("TrkEndDirY", "vector<float>", &fTrkEndDirY );
216  fTreeIn->Branch("TrkEndDirZ", "vector<float>", &fTrkEndDirZ );
217  fTreeIn->Branch("TrkChiFwd", "vector<float>", &fTrkChiFwd );
218  fTreeIn->Branch("TrkChiBac", "vector<float>", &fTrkChiBac );
219  fTreeIn->Branch("TrkNHits", "vector<size_t>", &fTrkNHits );
220 
221  fTreeIn->Branch("TrackXBeg", "vector<float>", &fTrackXBeg );
222  fTreeIn->Branch("TrackYBeg", "vector<float>", &fTrackYBeg );
223  fTreeIn->Branch("TrackZBeg", "vector<float>", &fTrackZBeg );
224  fTreeIn->Branch("TrackCurvBeg", "vector<float>", &fTrackCurvBeg );
225  fTreeIn->Branch("TrackPhiBeg", "vector<float>", &fTrackPhiBeg );
226  fTreeIn->Branch("TrackLambBeg", "vector<float>", &fTrackLambBeg );
227  fTreeIn->Branch("TrackXEnd", "vector<float>", &fTrackXEnd );
228  fTreeIn->Branch("TrackYEnd", "vector<float>", &fTrackYEnd );
229  fTreeIn->Branch("TrackZEnd", "vector<float>", &fTrackZEnd );
230  fTreeIn->Branch("TrackCurvEnd", "vector<float>", &fTrackCurvEnd );
231  fTreeIn->Branch("TrackPhiEnd ", "vector<float>", &fTrackPhiEnd );
232  fTreeIn->Branch("TrackLambEnd", "vector<float>", &fTrackLambEnd );
233  fTreeIn->Branch("TrkCovMat1Beg", "vector<float>", &fTrkCovMat1Beg );
234  fTreeIn->Branch("TrkCovMat2Beg", "vector<float>", &fTrkCovMat2Beg );
235  fTreeIn->Branch("TrkCovMat3Beg", "vector<float>", &fTrkCovMat3Beg );
236  fTreeIn->Branch("TrkCovMat4Beg", "vector<float>", &fTrkCovMat4Beg );
237  fTreeIn->Branch("TrkCovMat5Beg", "vector<float>", &fTrkCovMat5Beg );
238  fTreeIn->Branch("TrkCovMat6Beg", "vector<float>", &fTrkCovMat6Beg );
239  fTreeIn->Branch("TrkCovMat7Beg", "vector<float>", &fTrkCovMat7Beg );
240  fTreeIn->Branch("TrkCovMat8Beg", "vector<float>", &fTrkCovMat8Beg );
241  fTreeIn->Branch("TrkCovMat9Beg", "vector<float>", &fTrkCovMat9Beg );
242  fTreeIn->Branch("TrkCovMat10Beg", "vector<float>", &fTrkCovMat10Beg );
243  fTreeIn->Branch("TrkCovMat11Beg", "vector<float>", &fTrkCovMat11Beg );
244  fTreeIn->Branch("TrkCovMat12Beg", "vector<float>", &fTrkCovMat12Beg );
245  fTreeIn->Branch("TrkCovMat13Beg", "vector<float>", &fTrkCovMat13Beg );
246  fTreeIn->Branch("TrkCovMat14Beg", "vector<float>", &fTrkCovMat14Beg );
247  fTreeIn->Branch("TrkCovMat15Beg", "vector<float>", &fTrkCovMat15Beg );
248  fTreeIn->Branch("TrkCovMat1End", "vector<float>", &fTrkCovMat1End );
249  fTreeIn->Branch("TrkCovMat2End", "vector<float>", &fTrkCovMat2End );
250  fTreeIn->Branch("TrkCovMat3End", "vector<float>", &fTrkCovMat3End );
251  fTreeIn->Branch("TrkCovMat4End", "vector<float>", &fTrkCovMat4End );
252  fTreeIn->Branch("TrkCovMat5End", "vector<float>", &fTrkCovMat5End );
253  fTreeIn->Branch("TrkCovMat6End", "vector<float>", &fTrkCovMat6End );
254  fTreeIn->Branch("TrkCovMat7End", "vector<float>", &fTrkCovMat7End );
255  fTreeIn->Branch("TrkCovMat8End", "vector<float>", &fTrkCovMat8End );
256  fTreeIn->Branch("TrkCovMat9End", "vector<float>", &fTrkCovMat9End );
257  fTreeIn->Branch("TrkCovMat10End", "vector<float>", &fTrkCovMat10End );
258  fTreeIn->Branch("TrkCovMat11End", "vector<float>", &fTrkCovMat11End );
259  fTreeIn->Branch("TrkCovMat12End", "vector<float>", &fTrkCovMat12End );
260  fTreeIn->Branch("TrkCovMat13End", "vector<float>", &fTrkCovMat13End );
261  fTreeIn->Branch("TrkCovMat14End", "vector<float>", &fTrkCovMat14End );
262  fTreeIn->Branch("TrkCovMat15End", "vector<float>", &fTrkCovMat15End );
263 
264  fTreeIn->Branch("TrkIonizFwd", "vector<UInt_t>", &fTrkIonizFwd );
265  fTreeIn->Branch("TrkIonizBac", "vector<UInt_t>", &fTrkIonizBac );
266  fTreeIn->Branch("TrkChgFwd", "vector<UInt_t>", &fTrkChgFwd );
267  fTreeIn->Branch("TrkChgBac", "vector<UInt_t>", &fTrkChgBac );
268 
269  fTreeIn->Branch("VeeVtxX", "vector<float>", &fVeeVtxX );
270  fTreeIn->Branch("VeeVtxY", "vector<float>", &fVeeVtxY );
271  fTreeIn->Branch("VeeVtxZ", "vector<float>", &fVeeVtxZ );
272  fTreeIn->Branch("VeeVtxT", "vector<float>", &fVeeVtxT );
273  fTreeIn->Branch("VeeVtxCovar11", "vector<float>", &fVeeVtxCovar11 );
274  fTreeIn->Branch("VeeVtxCovar12", "vector<float>", &fVeeVtxCovar12 );
275  fTreeIn->Branch("VeeVtxCovar13", "vector<float>", &fVeeVtxCovar13 );
276  fTreeIn->Branch("VeeVtxCovar21", "vector<float>", &fVeeVtxCovar21 );
277  fTreeIn->Branch("VeeVtxCovar22", "vector<float>", &fVeeVtxCovar22 );
278  fTreeIn->Branch("VeeVtxCovar23", "vector<float>", &fVeeVtxCovar23 );
279  fTreeIn->Branch("VeeVtxCovar31", "vector<float>", &fVeeVtxCovar31 );
280  fTreeIn->Branch("VeeVtxCovar32", "vector<float>", &fVeeVtxCovar32 );
281  fTreeIn->Branch("VeeVtxCovar33", "vector<float>", &fVeeVtxCovar33 );
282 
283  fTreeIn->Branch("VeePxKshort", "vector<float>", &fVeePxKshort );
284  fTreeIn->Branch("VeePyKshort", "vector<float>", &fVeePyKshort );
285  fTreeIn->Branch("VeePzKshort", "vector<float>", &fVeePzKshort );
286  fTreeIn->Branch("VeeEKshort", "vector<float>", &fVeeEKshort );
287  fTreeIn->Branch("VeePxLamb1", "vector<float>", &fVeePxLamb1 );
288  fTreeIn->Branch("VeePyLamb1", "vector<float>", &fVeePyLamb1 );
289  fTreeIn->Branch("VeePzLamb1", "vector<float>", &fVeePzLamb1 );
290  fTreeIn->Branch("VeeELamb1", "vector<float>", &fVeeELamb1 );
291  fTreeIn->Branch("VeePxLamb2", "vector<float>", &fVeePxLamb2 );
292  fTreeIn->Branch("VeePyLamb2", "vector<float>", &fVeePyLamb2 );
293  fTreeIn->Branch("VeePzLamb2", "vector<float>", &fVeePzLamb2 );
294  fTreeIn->Branch("VeeELamb2", "vector<float>", &fVeeELamb2 );
295  fTreeIn->Branch("VeeChisqr", "vector<float>", &fVeeChisqr );
296 
297  fTreeIn->Branch("VtxX", "vector<float>", &fVtxX );
298  fTreeIn->Branch("VtxY", "vector<float>", &fVtxY );
299  fTreeIn->Branch("VtxZ", "vector<float>", &fVtxZ );
300  fTreeIn->Branch("VtxT", "vector<float>", &fVtxT );
301  fTreeIn->Branch("VtxCovar11", "vector<float>", &fVtxCovar11 );
302  fTreeIn->Branch("VtxCovar12", "vector<float>", &fVtxCovar12 );
303  fTreeIn->Branch("VtxCovar13", "vector<float>", &fVtxCovar13 );
304  fTreeIn->Branch("VtxCovar21", "vector<float>", &fVtxCovar21 );
305  fTreeIn->Branch("VtxCovar22", "vector<float>", &fVtxCovar22 );
306  fTreeIn->Branch("VtxCovar23", "vector<float>", &fVtxCovar23 );
307  fTreeIn->Branch("VtxCovar31", "vector<float>", &fVtxCovar31 );
308  fTreeIn->Branch("VtxCovar32", "vector<float>", &fVtxCovar32 );
309  fTreeIn->Branch("VtxCovar33", "vector<float>", &fVtxCovar33 );
310 
311  fTreeIn->Branch("CalClustX", "vector<float>", &fCalClustX );
312  fTreeIn->Branch("CalClustY", "vector<float>", &fCalClustY );
313  fTreeIn->Branch("CalClustZ", "vector<float>", &fCalClustZ );
314  fTreeIn->Branch("CalClustT", "vector<float>", &fCalClustT );
315  fTreeIn->Branch("CalClustEnergy", "vector<float>", &fCalClustEnergy );
316  fTreeIn->Branch("CalClustEnergyError", "vector<float>", &fCalClustEnergyError);
317  fTreeIn->Branch("CalClustTdiff", "vector<float>", &fCalClustTdiff );
318  fTreeIn->Branch("CalClustEllip", "vector<float>", &fCalClustEllip );
319  fTreeIn->Branch("CalClustR1", "vector<float>", &fCalClustR1 );
320  fTreeIn->Branch("CalClustR2", "vector<float>", &fCalClustR2 );
321  fTreeIn->Branch("CalClustR3", "vector<float>", &fCalClustR3 );
322  fTreeIn->Branch("CalClustVol", "vector<float>", &fCalClustVol );
323  fTreeIn->Branch("CalClustWidth", "vector<float>", &fCalClustWidth );
324  fTreeIn->Branch("CalClustTheta", "vector<float>", &fCalClustTheta );
325  fTreeIn->Branch("CalClustPhi", "vector<float>", &fCalClustPhi );
326  fTreeIn->Branch("CalClustEigen1X", "vector<float>", &fCalClustEigen1X );
327  fTreeIn->Branch("CalClustEigen1Y", "vector<float>", &fCalClustEigen1Y );
328  fTreeIn->Branch("CalClustEigen1Z", "vector<float>", &fCalClustEigen1Z );
329  fTreeIn->Branch("CalClustEigen2X", "vector<float>", &fCalClustEigen2X );
330  fTreeIn->Branch("CalClustEigen2Y", "vector<float>", &fCalClustEigen2Y );
331  fTreeIn->Branch("CalClustEigen2Z", "vector<float>", &fCalClustEigen2Z );
332  fTreeIn->Branch("CalClustEigen3X", "vector<float>", &fCalClustEigen3X );
333  fTreeIn->Branch("CalClustEigen3Y", "vector<float>", &fCalClustEigen3Y );
334  fTreeIn->Branch("CalClustEigen3Z", "vector<float>", &fCalClustEigen3Z );
335 
336  fTreeIn->Branch("TrackG4PIndices ", "vector<vector<UInt_t>>", &fTrackG4PIndices );
337  fTreeIn->Branch("VertTrackIndices", "vector<vector<UInt_t>>", &fVertTrackIndices );
338  fTreeIn->Branch("VeeTrackIndices ", "vector<vector<UInt_t>>", &fVeeTrackIndices );
339  //fTreeIn->Branch("CalTrackIndices ", "vector<vector<UInt_t>>", &fCalTrackIndices );
340  fTreeIn->Branch("CalTrackIndices", "vector<vector<UInt_t>>", &fCalClusterTrackIndices );
341  //fTreeIn->Branch("CalTrackEnds", &fCalTrackEnds , &b_CalTrackEnds );
342  fTreeIn->Branch("CalG4Indices", "vector<vector<UInt_t>>", &fCalClusterG4Indices );
343 
344  fTreeIn->Branch("VertTrackEnds", "vector<vector<Int_t>>", &fVertTrackEnds );
345  fTreeIn->Branch("VeeTrackEnds", "vector<vector<Int_t>>", &fVeeTrackEnds );
346 
347  }
348 
349  return true;
350 }
351 
352 //implement accessors inherited from RecoTree
353  void FlatRecoTree::SetVecs() {
354 
355  fTrkLenFwd = new vector<float>();
356  fTrkLenBac = new vector<float>();
357  fTrkMomBeg = new vector<float>();
358  fTrkMomEnd = new vector<float>();
359  fTrkVtxX = new vector<float>();
360  fTrkVtxY = new vector<float>();
361  fTrkVtxZ = new vector<float>();
362  fTrkVtxT = new vector<float>();
363  fTrkEndX = new vector<float>();
364  fTrkEndY = new vector<float>();
365  fTrkEndZ = new vector<float>();
366  fTrkEndT = new vector<float>();
367 
368  fTrkVtxDirX = new vector<float>();
369  fTrkVtxDirY = new vector<float>();
370  fTrkVtxDirZ = new vector<float>();
371  fTrkEndDirX = new vector<float>();
372  fTrkEndDirY = new vector<float>();
373  fTrkEndDirZ = new vector<float>();
374  fTrkChiFwd = new vector<float>();
375  fTrkChiBac = new vector<float>();
376  fTrkNHits = new vector<size_t>();
377 
378  fTrackXBeg = new vector<float>();
379  fTrackYBeg = new vector<float>();
380  fTrackZBeg = new vector<float>();
381  fTrackCurvBeg = new vector<float>();
382  fTrackPhiBeg = new vector<float>();
383  fTrackLambBeg = new vector<float>();
384  fTrackXEnd = new vector<float>();
385  fTrackYEnd = new vector<float>();
386  fTrackZEnd = new vector<float>();
387  fTrackCurvEnd = new vector<float>();
388  fTrackPhiEnd = new vector<float>();
389  fTrackLambEnd = new vector<float>();
390  fTrkCovMat1Beg = new vector<float>();
391  fTrkCovMat2Beg = new vector<float>();
392  fTrkCovMat3Beg = new vector<float>();
393  fTrkCovMat4Beg = new vector<float>();
394  fTrkCovMat5Beg = new vector<float>();
395  fTrkCovMat6Beg = new vector<float>();
396  fTrkCovMat7Beg = new vector<float>();
397  fTrkCovMat8Beg = new vector<float>();
398  fTrkCovMat9Beg = new vector<float>();
399  fTrkCovMat10Beg = new vector<float>();
400  fTrkCovMat11Beg = new vector<float>();
401  fTrkCovMat12Beg = new vector<float>();
402  fTrkCovMat13Beg = new vector<float>();
403  fTrkCovMat14Beg = new vector<float>();
404  fTrkCovMat15Beg = new vector<float>();
405  fTrkCovMat1End = new vector<float>();
406  fTrkCovMat2End = new vector<float>();
407  fTrkCovMat3End = new vector<float>();
408  fTrkCovMat4End = new vector<float>();
409  fTrkCovMat5End = new vector<float>();
410  fTrkCovMat6End = new vector<float>();
411  fTrkCovMat7End = new vector<float>();
412  fTrkCovMat8End = new vector<float>();
413  fTrkCovMat9End = new vector<float>();
414  fTrkCovMat10End = new vector<float>();
415  fTrkCovMat11End = new vector<float>();
416  fTrkCovMat12End = new vector<float>();
417  fTrkCovMat13End = new vector<float>();
418  fTrkCovMat14End = new vector<float>();
419  fTrkCovMat15End = new vector<float>();
420 
421  fTrkIonizFwd = new vector<float>();
422  fTrkIonizBac = new vector<float>();
423  fTrkChgFwd = new vector<int>();
424  fTrkChgBac = new vector<int>();
425 
426  fVeeVtxX = new vector<float>();
427  fVeeVtxY = new vector<float>();
428  fVeeVtxZ = new vector<float>();
429  fVeeVtxT = new vector<float>();
430  fVeeVtxCovar11 = new vector<float>();
431  fVeeVtxCovar12 = new vector<float>();
432  fVeeVtxCovar13 = new vector<float>();
433  fVeeVtxCovar21 = new vector<float>();
434  fVeeVtxCovar22 = new vector<float>();
435  fVeeVtxCovar23 = new vector<float>();
436  fVeeVtxCovar31 = new vector<float>();
437  fVeeVtxCovar32 = new vector<float>();
438  fVeeVtxCovar33 = new vector<float>();
439 
440  fVeePxKshort = new vector<float>();
441  fVeePyKshort = new vector<float>();
442  fVeePzKshort = new vector<float>();
443  fVeeEKshort = new vector<float>();
444  fVeePxLamb1 = new vector<float>();
445  fVeePyLamb1 = new vector<float>();
446  fVeePzLamb1 = new vector<float>();
447  fVeeELamb1 = new vector<float>();
448  fVeePxLamb2 = new vector<float>();
449  fVeePyLamb2 = new vector<float>();
450  fVeePzLamb2 = new vector<float>();
451  fVeeELamb2 = new vector<float>();
452  fVeeChisqr = new vector<float>();
453 
454  fVtxX = new vector<float>();
455  fVtxY = new vector<float>();
456  fVtxZ = new vector<float>();
457  fVtxT = new vector<float>();
458  fVtxCovar11 = new vector<float>();
459  fVtxCovar12 = new vector<float>();
460  fVtxCovar13 = new vector<float>();
461  fVtxCovar21 = new vector<float>();
462  fVtxCovar22 = new vector<float>();
463  fVtxCovar23 = new vector<float>();
464  fVtxCovar31 = new vector<float>();
465  fVtxCovar32 = new vector<float>();
466  fVtxCovar33 = new vector<float>();
467 
468  fCalClustX = new vector<float>();
469  fCalClustY = new vector<float>();
470  fCalClustZ = new vector<float>();
471  fCalClustT = new vector<float>();
472  fCalClustEnergy = new vector<float>();
473  fCalClustEnergyError = new vector<float>();
474  fCalClustTdiff = new vector<float>();
475  fCalClustEllip = new vector<float>();
476  fCalClustR1 = new vector<float>();
477  fCalClustR2 = new vector<float>();
478  fCalClustR3 = new vector<float>();
479  fCalClustVol = new vector<float>();
480  fCalClustWidth = new vector<float>();
481  fCalClustTheta = new vector<float>();
482  fCalClustPhi = new vector<float>();
483  fCalClustEigen1X = new vector<float>();
484  fCalClustEigen1Y = new vector<float>();
485  fCalClustEigen1Z = new vector<float>();
486  fCalClustEigen2X = new vector<float>();
487  fCalClustEigen2Y = new vector<float>();
488  fCalClustEigen2Z = new vector<float>();
489  fCalClustEigen3X = new vector<float>();
490  fCalClustEigen3Y = new vector<float>();
491  fCalClustEigen3Z = new vector<float>();
492 
493  fTrackG4PIndices = new vector<vector<UInt_t>>();
494  fVertTrackIndices = new vector<vector<UInt_t>>();
495  fVeeTrackIndices = new vector<vector<UInt_t>>();
496  fCalTrackIndices = new vector<vector<UInt_t>>();
497 
498  fVertTrackEnds = new vector<vector<Int_t>>();
499  fVeeTrackEnds = new vector<vector<Int_t>>();
500 
501  }
502 
503 
504  void FlatRecoTree::ClearVecs() {
505 
506  fTrkLenFwd->clear();
507  fTrkLenBac->clear();
508  fTrkMomBeg->clear();
509  fTrkMomEnd->clear();
510  fTrkVtxX->clear();
511  fTrkVtxY->clear();
512  fTrkVtxZ->clear();
513  fTrkVtxT->clear();
514  fTrkEndX->clear();
515  fTrkEndY->clear();
516  fTrkEndZ->clear();
517  fTrkEndT->clear();
518 
519  fTrkVtxDirX->clear();
520  fTrkVtxDirY->clear();
521  fTrkVtxDirZ->clear();
522  fTrkEndDirX->clear();
523  fTrkEndDirY->clear();
524  fTrkEndDirZ->clear();
525  fTrkChiFwd->clear();
526  fTrkChiBac->clear();
527  fTrkNHits->clear();
528 
529  fTrackXBeg->clear();
530  fTrackYBeg->clear();
531  fTrackZBeg->clear();
532  fTrackCurvBeg->clear();
533  fTrackPhiBeg->clear();
534  fTrackLambBeg->clear();
535  fTrackXEnd->clear();
536  fTrackYEnd->clear();
537  fTrackZEnd->clear();
538  fTrackCurvEnd->clear();
539  fTrackPhiEnd->clear();
540  fTrackLambEnd->clear();
541  fTrkCovMat1Beg->clear();
542  fTrkCovMat2Beg->clear();
543  fTrkCovMat3Beg->clear();
544  fTrkCovMat4Beg->clear();
545  fTrkCovMat5Beg->clear();
546  fTrkCovMat6Beg->clear();
547  fTrkCovMat7Beg->clear();
548  fTrkCovMat8Beg->clear();
549  fTrkCovMat9Beg->clear();
550  fTrkCovMat10Beg->clear();
551  fTrkCovMat11Beg->clear();
552  fTrkCovMat12Beg->clear();
553  fTrkCovMat13Beg->clear();
554  fTrkCovMat14Beg->clear();
555  fTrkCovMat15Beg->clear();
556  fTrkCovMat1End->clear();
557  fTrkCovMat2End->clear();
558  fTrkCovMat3End->clear();
559  fTrkCovMat4End->clear();
560  fTrkCovMat5End->clear();
561  fTrkCovMat6End->clear();
562  fTrkCovMat7End->clear();
563  fTrkCovMat8End->clear();
564  fTrkCovMat9End->clear();
565  fTrkCovMat10End->clear();
566  fTrkCovMat11End->clear();
567  fTrkCovMat12End->clear();
568  fTrkCovMat13End->clear();
569  fTrkCovMat14End->clear();
570  fTrkCovMat15End->clear();
571 
572  fTrkIonizFwd->clear();
573  fTrkIonizBac->clear();
574  fTrkChgFwd->clear();
575  fTrkChgBac->clear();
576 
577  fVeeVtxX->clear();
578  fVeeVtxY->clear();
579  fVeeVtxZ->clear();
580  fVeeVtxT->clear();
581  fVeeVtxCovar11->clear();
582  fVeeVtxCovar12->clear();
583  fVeeVtxCovar13->clear();
584  fVeeVtxCovar21->clear();
585  fVeeVtxCovar22->clear();
586  fVeeVtxCovar23->clear();
587  fVeeVtxCovar31->clear();
588  fVeeVtxCovar32->clear();
589  fVeeVtxCovar33->clear();
590 
591  fVeePxKshort->clear();
592  fVeePyKshort->clear();
593  fVeePzKshort->clear();
594  fVeeEKshort->clear();
595  fVeePxLamb1->clear();
596  fVeePyLamb1->clear();
597  fVeePzLamb1->clear();
598  fVeeELamb1->clear();
599  fVeePxLamb2->clear();
600  fVeePyLamb2->clear();
601  fVeePzLamb2->clear();
602  fVeeELamb2 ->clear();
603  fVeeChisqr->clear();
604 
605  fVtxX->clear();
606  fVtxY->clear();
607  fVtxZ->clear();
608  fVtxT->clear();
609  fVtxCovar11->clear();
610  fVtxCovar12->clear();
611  fVtxCovar13->clear();
612  fVtxCovar21->clear();
613  fVtxCovar22->clear();
614  fVtxCovar23->clear();
615  fVtxCovar31->clear();
616  fVtxCovar32->clear();
617  fVtxCovar33->clear();
618 
619  fCalClustX->clear();
620  fCalClustY->clear();
621  fCalClustZ->clear();
622  fCalClustT->clear();
623  fCalClustEnergy->clear();
624  fCalClustEnergyError->clear();
625  fCalClustTdiff->clear();
626  fCalClustEllip->clear();
627  fCalClustR1->clear();
628  fCalClustR2->clear();
629  fCalClustR3->clear();
630  fCalClustVol->clear();
631  fCalClustWidth->clear();
632  fCalClustTheta->clear();
633  fCalClustPhi->clear();
634  fCalClustEigen1X->clear();
635  fCalClustEigen1Y->clear();
636  fCalClustEigen1Z->clear();
637  fCalClustEigen2X->clear();
638  fCalClustEigen2Y->clear();
639  fCalClustEigen2Z->clear();
640  fCalClustEigen3X->clear();
641  fCalClustEigen3Y->clear();
642  fCalClustEigen3Z->clear();
643 
644  fTrackG4PIndices->clear();
645  fVertTrackIndices->clear();
646  fVeeTrackIndices->clear();
647  fCalTrackIndices->clear();
648 
649  fVertTrackEnds->clear();
650  fVeeTrackEnds->clear();
651 
652  }
653 
654  // sizes
655  const size_t FlatRecoTree::NTrack() const {
656  return fTrkNHits->size();
657  }
658 
659  const size_t FlatRecoTree::NVertex() const {
660  return fVtxX->size();
661  }
662 
663  const size_t FlatRecoTree::NVee() const {
664  return fVeeVtxX->size();
665  }
666 
667  const size_t FlatRecoTree::NCalCluster() const {
668  return fCalClustX->size();
669  }
670 
671  const TLorentzVector* FlatRecoTree::TrackVertex(const size_t& itrack) const {
672  TLorentzVector* v = new TLorentzVector(fTrkVtxX->at(itrack),
673  fTrkVtxY->at(itrack),
674  fTrkVtxZ->at(itrack),
675  fTrkVtxT->at(itrack) );
676  return v;
677  }
678 
679  const TLorentzVector* FlatRecoTree::TrackEnd(const size_t& itrack) const {
680  TLorentzVector* v = new TLorentzVector(fTrkEndX->at(itrack),
681  fTrkEndY->at(itrack),
682  fTrkEndZ->at(itrack),
683  fTrkEndT->at(itrack) );
684  return v;
685  }
686 
687  const size_t FlatRecoTree::NTrackHit(const size_t& itrack) const {
688  return fTrkNHits->at(itrack);
689  }
690 
691  const TVector3* FlatRecoTree::TrackMomBeg(const size_t& itrack) const {
692  TVector3* v = new TVector3(fTrkVtxDirX->at(itrack),
693  fTrkVtxDirX->at(itrack),
694  fTrkVtxDirX->at(itrack) );
695  (*v) *= fTrkMomBeg->at(itrack);
696  return v; //*fTrkMomBeg->at(itrack);
697 
698  }
699 
700  const TVector3* FlatRecoTree::TrackMomEnd(const size_t& itrack) const {
701  TVector3* v = new TVector3(fTrkEndDirX->at(itrack),
702  fTrkEndDirX->at(itrack),
703  fTrkEndDirX->at(itrack) );
704  (*v) *= fTrkMomEnd->at(itrack);
705  return v;//*fTrkMomEnd->at(itrack);
706  }
707 
708  const float FlatRecoTree::TrackVtxDirectionX(const size_t& itrack) const {
709  return fTrkVtxDirX->at(itrack);
710  }
711 
712  const float FlatRecoTree::TrackVtxDirectionY(const size_t& itrack) const {
713  return fTrkVtxDirY->at(itrack);
714  }
715 
716  const float FlatRecoTree::TrackVtxDirectionZ(const size_t& itrack) const {
717  return fTrkVtxDirZ->at(itrack);
718  }
719 
720  const float FlatRecoTree::TrackEndDirectionX(const size_t& itrack) const {
721  return fTrkEndDirX->at(itrack);
722  }
723 
724  const float FlatRecoTree::TrackEndDirectionY(const size_t& itrack) const {
725  return fTrkEndDirY->at(itrack);
726  }
727 
728  const float FlatRecoTree::TrackEndDirectionZ(const size_t& itrack) const {
729  return fTrkEndDirZ->at(itrack);
730  }
731 
732  const float FlatRecoTree::TrackLenFwd(const size_t& itrack) const {
733  return fTrkLenFwd->at(itrack);
734  }
735 
736  const float FlatRecoTree::TrackLenBkd(const size_t& itrack) const {
737  return fTrkLenBac->at(itrack);
738  }
739 
740  const float FlatRecoTree::TrackIonizFwd(const size_t& itrack) const {
741  return fTrkIonizFwd->at(itrack);
742  }
743 
744  const float FlatRecoTree::TrackIonizBkd(const size_t& itrack) const {
745  return fTrkIonizBac->at(itrack);
746  }
747 
748  const int FlatRecoTree::TrackChiSqrFwd(const size_t& itrack) const {
749  return fTrkChiFwd->at(itrack);
750  }
751 
752  const int FlatRecoTree::TrackChiSqrBkd(const size_t& itrack) const {
753  return fTrkChiBac->at(itrack);
754  }
755 
756  const int FlatRecoTree::TrackChgFwd(const size_t& itrack) const {
757  return fTrkChgFwd->at(itrack);
758  }
759 
760  const int FlatRecoTree::TrackChgBkd(const size_t& itrack) const {
761  return fTrkChgBac->at(itrack);
762  }
763 
764  void FlatRecoTree::TrackParBeg(const size_t& itrack, float pars[5]) const {
765 
766  pars[0] = fTrackXBeg ->at(itrack);
767  pars[1] = fTrackYBeg ->at(itrack);
768  pars[2] = fTrackZBeg ->at(itrack);
769  pars[3] = fTrackCurvBeg->at(itrack);
770  pars[4] = fTrackPhiBeg ->at(itrack);
771  pars[5] = fTrackLambBeg->at(itrack);
772  }
773 
774  void FlatRecoTree::TrackParEnd(const size_t& itrack, float pars[5]) const {
775  pars[0] = fTrackXEnd ->at(itrack);
776  pars[1] = fTrackYEnd ->at(itrack);
777  pars[2] = fTrackZEnd ->at(itrack);
778  pars[3] = fTrackCurvEnd->at(itrack);
779  pars[4] = fTrackPhiEnd ->at(itrack);
780  pars[5] = fTrackLambEnd->at(itrack);
781  }
782 
783  void FlatRecoTree::TrackCovarBeg(const size_t& itrack, float covar[15]) const {
784 
785  covar[0] = fTrkCovMat1Beg->at(itrack);
786  covar[1] = fTrkCovMat2Beg->at(itrack);
787  covar[2] = fTrkCovMat3Beg->at(itrack);
788  covar[3] = fTrkCovMat4Beg->at(itrack);
789  covar[4] = fTrkCovMat5Beg->at(itrack);
790  covar[5] = fTrkCovMat6Beg->at(itrack);
791  covar[6] = fTrkCovMat7Beg->at(itrack);
792  covar[7] = fTrkCovMat8Beg->at(itrack);
793  covar[8] = fTrkCovMat9Beg->at(itrack);
794  covar[9] = fTrkCovMat10Beg->at(itrack);
795  covar[10] = fTrkCovMat11Beg->at(itrack);
796  covar[11] = fTrkCovMat12Beg->at(itrack);
797  covar[12] = fTrkCovMat13Beg->at(itrack);
798  covar[13] = fTrkCovMat14Beg->at(itrack);
799  covar[14] = fTrkCovMat15Beg->at(itrack);
800  }
801 
802  void FlatRecoTree::TrackCovarEnd(const size_t& itrack, float covar[15]) const {
803 
804  covar[0] = fTrkCovMat1End->at(itrack);
805  covar[1] = fTrkCovMat2End->at(itrack);
806  covar[2] = fTrkCovMat3End->at(itrack);
807  covar[3] = fTrkCovMat4End->at(itrack);
808  covar[4] = fTrkCovMat5End->at(itrack);
809  covar[5] = fTrkCovMat6End->at(itrack);
810  covar[6] = fTrkCovMat7End->at(itrack);
811  covar[7] = fTrkCovMat8End->at(itrack);
812  covar[8] = fTrkCovMat9End->at(itrack);
813  covar[9] = fTrkCovMat10End->at(itrack);
814  covar[10] = fTrkCovMat11End->at(itrack);
815  covar[11] = fTrkCovMat12End->at(itrack);
816  covar[12] = fTrkCovMat13End->at(itrack);
817  covar[13] = fTrkCovMat14End->at(itrack);
818  covar[14] = fTrkCovMat15End->at(itrack);
819  }
820 
821  // FIXME implement methods
822  const TLorentzVector* FlatRecoTree::TrackTruePosBeg(const size_t& itrack) const {
823  if(itrack)return 0;
824  else return 0;
825  }
826 
827  const TLorentzVector* FlatRecoTree::TrackTruePosEnd(const size_t& itrack) const {
828  if(itrack)return 0;
829  else return 0;
830  }
831 
832  const TLorentzVector* FlatRecoTree::TrackTrueMomBeg(const size_t& itrack) const {
833  if(itrack)return 0;
834  else return 0;
835  }
836 
837  const TLorentzVector* FlatRecoTree::TrackTrueMomEnd(const size_t& itrack) const {
838  if(itrack)return 0;
839  else return 0;
840  }
841 
842  //TODO implement methods
843  const float FlatRecoTree::TrackTrueEnergy(const size_t& itrack) const { return itrack*0+FLT_MAX;}
844  const size_t FlatRecoTree::TrackNTrueTrack(const size_t& itrack) const {return itrack*0+UINT_MAX;}
845  const int FlatRecoTree::TrackTrkIdMaxDeposit(const size_t& itrack)const { return itrack*0+INT_MAX;}
846  const float FlatRecoTree::TrackMaxDeposit(const size_t& itrack) const { return itrack*0+FLT_MAX;}
847  const pair<int,float>* FlatRecoTree::TrackTrueDeposit(const size_t& itrack, size_t& itrue) const { if(itrack&&itrue) return nullptr; else return nullptr;}
848  const vector<pair<int,float>>* FlatRecoTree::TrackTrueDeposits(const size_t& itrack) const{ if(itrack) return nullptr; else return nullptr;}
849  /// ================ vertex ==========================
850  const TLorentzVector* FlatRecoTree::GetVertex(const size_t& ivertex) const {
851 
852 
853  const TLorentzVector* v = new TLorentzVector( fVtxX->at(ivertex),
854  fVtxY->at(ivertex),
855  fVtxZ->at(ivertex),
856  fVtxT->at(ivertex) );
857  return v;
858 
859  }
860 
861  void FlatRecoTree::VertexCovariance(const size_t& ivertex, float covar[][3]) const {
862 
863  covar[0][0] = fVtxCovar11->at(ivertex);
864  covar[0][1] = fVtxCovar12->at(ivertex);
865  covar[0][2] = fVtxCovar13->at(ivertex);
866  covar[1][0] = fVtxCovar21->at(ivertex);
867  covar[1][1] = fVtxCovar22->at(ivertex);
868  covar[1][2] = fVtxCovar23->at(ivertex);
869  covar[2][0] = fVtxCovar31->at(ivertex);
870  covar[2][1] = fVtxCovar32->at(ivertex);
871  covar[2][2] = fVtxCovar33->at(ivertex);
872 
873  }
874 
875  /// =============== Vee =======================
876 
877  const TLorentzVector* FlatRecoTree::VeeVertex(const size_t& ivee) const {
878 
879  return new TLorentzVector(fVeeVtxX->at(ivee), fVeeVtxY->at(ivee), fVeeVtxZ->at(ivee), fVeeVtxT->at(ivee));
880  }
881  void FlatRecoTree::VeeCovariance(const size_t& ivee, float covar[][3]) const {
882 
883  covar[0][0] = fVeeVtxCovar11->at(ivee);
884  covar[0][1] = fVeeVtxCovar12->at(ivee);
885  covar[0][2] = fVeeVtxCovar13->at(ivee);
886  covar[1][0] = fVeeVtxCovar21->at(ivee);
887  covar[1][1] = fVeeVtxCovar22->at(ivee);
888  covar[1][2] = fVeeVtxCovar23->at(ivee);
889  covar[2][0] = fVeeVtxCovar31->at(ivee);
890  covar[2][1] = fVeeVtxCovar32->at(ivee);
891  covar[2][2] = fVeeVtxCovar33->at(ivee);
892  }
893 
894  const vector<TLorentzVector>* FlatRecoTree::VeeMomentumPerHypothesis(const size_t& ivee) const {
895 
896  vector<TLorentzVector>* v = new vector<TLorentzVector>();
897  v->push_back(TLorentzVector(fVeePxKshort->at(ivee),fVeePyKshort->at(ivee),
898  fVeePzKshort->at(ivee),fVeeEKshort->at(ivee)));
899  v->push_back(TLorentzVector(fVeePxLamb1->at(ivee),fVeePyLamb1->at(ivee),
900  fVeePzLamb1->at(ivee),fVeeELamb1->at(ivee)));
901  v->push_back(TLorentzVector(fVeePxLamb2->at(ivee),fVeePyLamb2->at(ivee),
902  fVeePzLamb2->at(ivee),fVeeELamb2->at(ivee)));
903 
904  return v;
905  }
906 
907  const float FlatRecoTree::VeeChiSquared(const size_t& ivee) const {
908  return fVeeChisqr->at(ivee);
909  }
910 
911  /// ================ ECal cluster ======================
912  const TLorentzVector* FlatRecoTree::CalClustPosition(const size_t& icluster) const {
913  return new TLorentzVector(fCalClustX->at(icluster),fCalClustY->at(icluster),
914  fCalClustZ->at(icluster),fCalClustT->at(icluster));
915  }
916 
917  const float FlatRecoTree::CalClustEnergy(const size_t& icluster) const {
918  return fCalClustEnergy->at(icluster);
919  }
920 
921  const float FlatRecoTree::CalClustEnergyError(const size_t& icluster) const {
922  return fCalClustEnergyError->at(icluster);
923  }
924 const float FlatRecoTree::CalClustTrueEnergy(const size_t& icluster) const { //FIXME
925  return icluster;
926 }
927 const size_t FlatRecoTree::CalClustNTrueTrack(const size_t& icluster) const {
928  return icluster;
929 }
930 const int FlatRecoTree::CalClustTrkIdMaxDeposit(const size_t& icluster) const {
931  return icluster;
932 }
933 const float FlatRecoTree::CalClustMaxDeposit(const size_t& icluster) const {
934  return icluster;
935 }
936 const std::pair<int,float>* FlatRecoTree::CalClustTrueDeposit(const size_t& ivee, const size_t& itrack) const {
937  auto b=ivee;
938  auto c = itrack;
939  b++;
940  c++;
941  return nullptr;
942 } //FIXME
943 
944  const float FlatRecoTree::CalClustTimeDifference(const size_t& icluster) const {
945  return fCalClustTdiff->at(icluster);
946  }
947 
948  const float* FlatRecoTree::CalClustShape(const size_t& icluster) const {
949 
950  float* shape = new float[6];
951  shape[0] = fCalClustEllip->at(icluster);
952  shape[1] = fCalClustR1->at(icluster);
953  shape[2] = fCalClustR2->at(icluster);
954  shape[3] = fCalClustR3->at(icluster);
955  shape[4] = fCalClustVol->at(icluster);
956  shape[5] = fCalClustWidth->at(icluster);
957 
958  return shape;
959  }
960 
961  const float FlatRecoTree::CalClustTheta(const size_t& icluster) const {
962  return fCalClustTheta->at(icluster);
963  }
964 
965  const float FlatRecoTree::CalClustPhi(const size_t& icluster) const {
966  return fCalClustPhi->at(icluster);
967  }
968 
969  const vector<TVector3>* FlatRecoTree::CalClustEigenVecs(const size_t& icluster) const{
970 
971  vector<TVector3>* v = new vector<TVector3>();
972  v->push_back(TVector3(fCalClustEigen1X->at(icluster),fCalClustEigen1Y->at(icluster),fCalClustEigen1Z->at(icluster)));
973  v->push_back(TVector3(fCalClustEigen2X->at(icluster),fCalClustEigen2Y->at(icluster),fCalClustEigen2Z->at(icluster)));
974  v->push_back(TVector3(fCalClustEigen3X->at(icluster),fCalClustEigen3Y->at(icluster),fCalClustEigen3Z->at(icluster)));
975 
976  return v;
977  }
int TrackEnd
Definition: Track.h:32
opt
Definition: train.py:196
STL namespace.
static bool * b
Definition: config.cpp:1043
QTextStream & endl(QTextStream &s)