Create the transient representation of an object, given an opaque address. This and the following update method comprise the core functionality of calibration converters. Convenience routine used by most CAL calibration types, which have a <dimension> element describing how the remainder of the data is laid out. Read from TDS; store information internally in protected members.
Given a pointer to a TDS object which can be cast to "our" type, fill in corresponding information in the corresponding root class
49 {
50
51 MsgStream log(
msgSvc(),
"RootDedxCalibDataCnv");
52 log<<MSG::DEBUG<<"SetProperty"<<endreq;
54 if(!sc)
55 { log<<MSG::ERROR<<"unable to open files"<<endreq;
56 }
57
59
60 int i;
61
62 double rungain;
63 double runmean;
64 int runno, evtfrom, evtto;
65 double runresol;
66 TTree *rungtree = (TTree*)
m_inFile -> Get(
"runcalib");
71 if(rungtree->GetBranchStatus(
"evtfrom")){ rungtree ->
SetBranchAddress(
"evtfrom", &evtfrom); rungtree ->
SetBranchAddress(
"evtto", &evtto); }
else{ evtfrom = 0; evtto = 1000000000; }
72 int N = rungtree -> GetEntries();
73 tmpObject -> setrunNO(N);
74
75 for(i=0; i<N; i++){
77
78 tmpObject -> setrung(rungain,0);
79 tmpObject -> setrung(runmean,1);
80 tmpObject -> setrung(runno,2);
81 tmpObject -> setrung(runresol,3);
82 tmpObject -> setrung(evtfrom,4);
83 tmpObject -> setrung(evtto,5);
84 }
85
86
87
88
89 double ddg0[43];
90 double ddg1[43];
91 double ddg2[43];
92 double ddg3[43];
93 double id_doca[1600];
94 double iner_chi[1600];
95 double iner_gain[1600];
96 double iner_hits[1600];
97 double ip_eangle[1600];
98 double out_chi[1600];
99 double out_gain[1600];
100 double out_hits[1600];
101
102 TTree *ddgtree = (TTree*)
m_inFile -> Get(
"ddgcalib");
107 TBranch *bbb = ddgtree->FindBranch("Id_doca");
108 if(bbb){
117 }
119 for(i=0; i<43; i++){
120 tmpObject -> setddg(ddg0[i],0,i);
121 tmpObject -> setddg(ddg1[i],1,i);
122 tmpObject -> setddg(ddg2[i],2,i);
123 tmpObject -> setddg(ddg3[i],3,i);
124 }
125
126 for(i=0; i<1600; i++){
127 if(!bbb){
128 id_doca[i]=0;
129 iner_chi[i]=0;
130 iner_gain[i]=0;
131 iner_hits[i]=0;
132 ip_eangle[i]=0;
133 out_chi[i]=0;
134 out_gain[i]=0;
135 out_hits[i]=0;
136 }
137 tmpObject -> set_id_doca(id_doca[i],i);
138 tmpObject -> set_iner_chi(iner_chi[i],i);
139 tmpObject -> set_iner_gain(iner_gain[i],i);
140 tmpObject -> set_iner_hits(iner_hits[i],i);
141 tmpObject -> set_ip_eangle(ip_eangle[i],i);
142 tmpObject -> set_out_chi(out_chi[i],i);
143 tmpObject -> set_out_gain(out_gain[i],i);
144 tmpObject -> set_out_hits(out_hits[i],i);
145 }
146
147
148 double entra0[43];
149 double entra1[43];
150 double entra2[43];
151 double entra3[43];
152 double engle[100];
153 int engle_no;
154 TTree *entratree = (TTree*)
m_inFile -> Get(
"entracalib");
162 for(i=0; i<43; i++){
163 tmpObject -> setenta(entra0[i],0,i);
164 tmpObject -> setenta(entra1[i],1,i);
165 tmpObject -> setenta(entra2[i],2,i);
166 tmpObject -> setenta(entra3[i],3,i);
167 }
168 tmpObject -> set_enanglesize(engle_no);
169 for(i=0; i<engle_no; i++){
170 tmpObject -> set_enangle(engle[i],i);
171 }
172
173
174
175
176 double ggs0[43];
177 double ggs1[43];
178 double ggs2[43];
179 double ggs3[43];
180 double gcostheta[80];
181 int hadron_entry;
182 double hadron[20];
183 TTree *ggstree = (TTree*)
m_inFile -> Get(
"ggscalib");
190 if(bbb){
192 }
194 for(i=0; i<43;i++){
195 tmpObject -> setggs(ggs0[i],0,i);
196 tmpObject -> setggs(ggs1[i],1,i);
197 tmpObject -> setggs(ggs2[i],2,i);
198 tmpObject -> setggs(ggs3[i],3,i);
199 }
200
201 for(i=0; i<80;i++){
202 if(!bbb) gcostheta[i]=0;
204 }
205
206 if(hadron_entry>20){
207 log<<MSG::FATAL<<"hadron entry is larger than 20, larger than designed"<<endreq;
208 return StatusCode::FAILURE;
209 }
210
212
213 for(i=0;i<hadron_entry;i++){
215 }
216
217
218
219 double zdep0[43];
220 double zdep1[43];
221 double zdep2[43];
222 double zdep3[43];
223 TTree *zdeptree = (TTree*)
m_inFile -> Get(
"zdepcalib");
229
230 for(i=0; i<43;i++){
231 tmpObject -> setzdep(zdep0[i],0,i);
232 tmpObject -> setzdep(zdep1[i],1,i);
233 tmpObject -> setzdep(zdep2[i],2,i);
234 tmpObject -> setzdep(zdep3[i],3,i);
235 }
236
237
238 double gain;
239 double gt0[35],gdedx[35];
240 TTree *gaintree = (TTree*)
m_inFile -> Get(
"gaincalib");
242 if(bbb){
245 }
247 tmpObject -> setgain(gain);
248 for(i=0; i<35;i++){
249 if(!bbb){
250 gt0[i]=0;
251 gdedx[i]=0;
252 }
253 tmpObject->
set_t0(gt0[i],i);
255 }
256
257
258 double resol;
259 TTree *resoltree = (TTree*)
m_inFile -> Get(
"resolcalib");
262 tmpObject -> setresol(resol);
263
264
265 double wireg[6796];
266 TTree *wiregtree = (TTree*)
m_inFile -> Get(
"wiregcalib");
269 for(i=0;i<6796;i++){
270 tmpObject -> setwireg(wireg[i],i);
271 }
272
273
274 double layerg[43];
275 TTree *layergtree = (TTree*)
m_inFile -> Get(
"layergcalib");
278
279 for(i=0;i<43;i++){
280 tmpObject -> setlayerg(layerg[i],i);
281 }
282
283 refpObject=tmpObject;
284
285
286
287
288
289
290 return StatusCode::SUCCESS;
291}
data SetBranchAddress("time",&time)
void set_costheta(const double aa, int i)
void set_hadronNo(int no)
void set_hadron(const double aa, int i)
void set_t0(const double aa, int i)
void set_dedx(const double aa, int i)
StatusCode openRead(const std::string &fname)