1 |
#include <TTree.h> |
2 |
|
3 |
void settrklev1(TTree *tree, Tracklev1 & trklev1){ |
4 |
tree->SetBranchAddress("good1",&trklev1.good1); |
5 |
tree->SetBranchAddress("nev1",&trklev1.nev1); |
6 |
tree->SetBranchAddress("whic_calib1",&trklev1.whic_calib1); |
7 |
tree->SetBranchAddress("swcode1",&trklev1.swcode1); |
8 |
tree->SetBranchAddress("crc1",trklev1.crc1); |
9 |
tree->SetBranchAddress("pkt_type1",&trklev1.pkt_type1); |
10 |
tree->SetBranchAddress("pkt_num1",&trklev1.pkt_num1); |
11 |
tree->SetBranchAddress("obt1",&trklev1.obt1); |
12 |
tree->SetBranchAddress("cpu_crc1",&trklev1.cpu_crc1); |
13 |
tree->SetBranchAddress("nclstr1",&trklev1.nclstr1); |
14 |
tree->SetBranchAddress("view",trklev1.view); |
15 |
tree->SetBranchAddress("ladder",trklev1.ladder); |
16 |
tree->SetBranchAddress("maxs",trklev1.maxs); |
17 |
tree->SetBranchAddress("mult",trklev1.mult); |
18 |
tree->SetBranchAddress("dedx",trklev1.dedx); |
19 |
tree->SetBranchAddress("indstart",trklev1.indstart); |
20 |
tree->SetBranchAddress("indmax",trklev1.indmax); |
21 |
tree->SetBranchAddress("totcllength",&trklev1.totcllength); |
22 |
tree->SetBranchAddress("clsignal",trklev1.clsignal); |
23 |
tree->SetBranchAddress("cnev",trklev1.cnev); |
24 |
} |
25 |
|
26 |
void accesstrklev1(Tracklev1 & trklev1, CTracklev1 & ctrklev1){ |
27 |
ctrklev1.good1 = trklev1.good1; |
28 |
ctrklev1.nev1 = trklev1.nev1; |
29 |
ctrklev1.whic_calib1 = trklev1.whic_calib1; |
30 |
ctrklev1.swcode1 = trklev1.swcode1; |
31 |
ctrklev1.pkt_type1 = trklev1.pkt_type1; |
32 |
ctrklev1.pkt_num1 = trklev1.pkt_num1; |
33 |
ctrklev1.cpu_crc1 = trklev1.cpu_crc1; |
34 |
ctrklev1.obt1 = trklev1.obt1; |
35 |
ctrklev1.nclstr1 = trklev1.nclstr1; |
36 |
for (Int_t i = 0; i<trklev1.nclstr1; i++){ |
37 |
ctrklev1.view[i] = trklev1.view[i]; |
38 |
ctrklev1.ladder[i] = trklev1.ladder[i]; |
39 |
ctrklev1.maxs[i] = trklev1.maxs[i]; |
40 |
ctrklev1.mult[i] = trklev1.mult[i]; |
41 |
ctrklev1.dedx[i] = trklev1.dedx[i]; |
42 |
ctrklev1.indstart[i] = trklev1.indstart[i]; |
43 |
ctrklev1.indmax[i] = trklev1.indmax[i]; |
44 |
}; |
45 |
ctrklev1.totcllength = trklev1.totcllength; |
46 |
for (Int_t i = 0; i<trklev1.totcllength; i++){ |
47 |
ctrklev1.clsignal[i] = trklev1.clsignal[i]; |
48 |
}; |
49 |
for (Int_t i = 0; i<12; i++){ |
50 |
ctrklev1.crc1[i] = trklev1.crc1[i]; |
51 |
for (Int_t j = 0; j<24; j++){ |
52 |
ctrklev1.cnev[i][j] = trklev1.cnev[j][i]; |
53 |
}; |
54 |
}; |
55 |
} |
56 |
|
57 |
void settrklev2(TTree *tree, Tracklev2 & trklev2){ |
58 |
// GENERAL |
59 |
tree->SetBranchAddress("good2",&trklev2.good2); |
60 |
tree->SetBranchAddress("nev2",&trklev2.nev2); |
61 |
tree->SetBranchAddress("which_calib",&trklev2.which_calib); |
62 |
tree->SetBranchAddress("swcode",&trklev2.swcode); |
63 |
tree->SetBranchAddress("crc",trklev2.crc); |
64 |
// CPU |
65 |
tree->SetBranchAddress("pkt_type",&trklev2.pkt_type); |
66 |
tree->SetBranchAddress("pkt_num",&trklev2.pkt_num); |
67 |
tree->SetBranchAddress("obt",&trklev2.obt); |
68 |
tree->SetBranchAddress("cpu_crc",&trklev2.cpu_crc); |
69 |
// TRACKS |
70 |
tree->SetBranchAddress("ntrk",&trklev2.ntrk); |
71 |
tree->SetBranchAddress("image",trklev2.image); |
72 |
tree->SetBranchAddress("xm",trklev2.xm); |
73 |
tree->SetBranchAddress("ym",trklev2.ym); |
74 |
tree->SetBranchAddress("zm",trklev2.zm); |
75 |
tree->SetBranchAddress("resx",trklev2.resx); |
76 |
tree->SetBranchAddress("resy",trklev2.resy); |
77 |
tree->SetBranchAddress("al",trklev2.al); |
78 |
tree->SetBranchAddress("coval",trklev2.coval); |
79 |
tree->SetBranchAddress("chi2",trklev2.chi2); |
80 |
tree->SetBranchAddress("xgood",trklev2.xgood); |
81 |
tree->SetBranchAddress("ygood",trklev2.ygood); |
82 |
tree->SetBranchAddress("xv",trklev2.xv); |
83 |
tree->SetBranchAddress("yv",trklev2.yv); |
84 |
tree->SetBranchAddress("zv",trklev2.zv); |
85 |
tree->SetBranchAddress("axv",trklev2.axv); |
86 |
tree->SetBranchAddress("ayv",trklev2.ayv); |
87 |
tree->SetBranchAddress("dedx_x",trklev2.dedx_x); |
88 |
tree->SetBranchAddress("dedx_y",trklev2.dedx_y); |
89 |
tree->SetBranchAddress("bdl",trklev2.bdl); |
90 |
// SINGLETX |
91 |
tree->SetBranchAddress("nclsx",&trklev2.nclsx); |
92 |
tree->SetBranchAddress("planex",trklev2.planex); |
93 |
tree->SetBranchAddress("xs",trklev2.xs); |
94 |
tree->SetBranchAddress("sgnlxs",trklev2.sgnlxs); |
95 |
// SINGLETY |
96 |
tree->SetBranchAddress("nclsy",&trklev2.nclsy); |
97 |
tree->SetBranchAddress("planey",trklev2.planey); |
98 |
tree->SetBranchAddress("ys",trklev2.ys); |
99 |
tree->SetBranchAddress("sgnlys",trklev2.sgnlys); |
100 |
} |
101 |
|
102 |
void accesstrklev2(Tracklev2 & trklev2, CTracklev2 & ctrklev2){ |
103 |
ctrklev2.good2 = trklev2.good2; |
104 |
ctrklev2.nev2 = trklev2.nev2; |
105 |
ctrklev2.swcode = trklev2.swcode; |
106 |
ctrklev2.pkt_type = trklev2.pkt_type; |
107 |
ctrklev2.pkt_num = trklev2.pkt_num; |
108 |
ctrklev2.obt = trklev2.obt; |
109 |
ctrklev2.which_calib = trklev2.which_calib; |
110 |
ctrklev2.cpu_crc = trklev2.cpu_crc; |
111 |
ctrklev2.ntrk = trklev2.ntrk; |
112 |
ctrklev2.nclsx = trklev2.nclsx; |
113 |
ctrklev2.nclsy = trklev2.nclsy; |
114 |
for (Int_t i = 0; i<12; i++){ |
115 |
ctrklev2.crc[i] = trklev2.crc[i]; |
116 |
} |
117 |
for (Int_t i = 0; i<trklev2.nclsx; i++){ |
118 |
ctrklev2.sgnlxs[i] = trklev2.sgnlxs[i]; |
119 |
ctrklev2.planex[i] = trklev2.planex[i]; |
120 |
for (Int_t j = 0; j<2; j++){ |
121 |
ctrklev2.xs[j][i] = trklev2.xs[i][j]; |
122 |
}; |
123 |
} |
124 |
for (Int_t i = 0; i<trklev2.nclsy; i++){ |
125 |
ctrklev2.sgnlys[i] = trklev2.sgnlys[i]; |
126 |
ctrklev2.planey[i] = trklev2.planey[i]; |
127 |
for (Int_t j = 0; j<2; j++){ |
128 |
ctrklev2.ys[j][i] = trklev2.ys[i][j]; |
129 |
}; |
130 |
} |
131 |
for (Int_t i = 0; i<trklev2.ntrk; i++){ |
132 |
ctrklev2.bdl[i] = trklev2.bdl[i]; |
133 |
ctrklev2.chi2[i] = trklev2.chi2[i]; |
134 |
ctrklev2.image[i] = trklev2.image[i]; |
135 |
for (Int_t j = 0; j<6; j++){ |
136 |
ctrklev2.xm[j][i] = trklev2.xm[i][j]; |
137 |
ctrklev2.ym[j][i] = trklev2.ym[i][j]; |
138 |
ctrklev2.zm[j][i] = trklev2.zm[i][j]; |
139 |
ctrklev2.resx[j][i] = trklev2.resx[i][j]; |
140 |
ctrklev2.resy[j][i] = trklev2.resy[i][j]; |
141 |
ctrklev2.dedx_x[j][i] = trklev2.dedx_x[i][j]; |
142 |
ctrklev2.dedx_y[j][i] = trklev2.dedx_y[i][j]; |
143 |
if ( j<5 ) { |
144 |
ctrklev2.al[j][i] = trklev2.al[i][j]; |
145 |
for (Int_t jp = 0; jp<5; jp++){ |
146 |
ctrklev2.coval[j][jp][i] = trklev2.coval[i][jp][j]; |
147 |
}; |
148 |
}; |
149 |
ctrklev2.xgood[j][i] = trklev2.xgood[i][j]; |
150 |
ctrklev2.ygood[j][i] = trklev2.ygood[i][j]; |
151 |
ctrklev2.xv[j][i] = trklev2.xv[i][j]; |
152 |
ctrklev2.yv[j][i] = trklev2.yv[i][j]; |
153 |
ctrklev2.zv[j][i] = trklev2.zv[i][j]; |
154 |
ctrklev2.axv[j][i] = trklev2.axv[i][j]; |
155 |
ctrklev2.ayv[j][i] = trklev2.ayv[i][j]; |
156 |
}; |
157 |
}; |
158 |
} |