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;
65 double runresol;
66 TTree *rungtree = (TTree*)
m_inFile -> Get(
"runcalib");
71 int N = rungtree -> GetEntries();
72 tmpObject -> setrunNO(N);
73
74 for(i=0; i<N; i++){
76
77 tmpObject -> setrung(rungain,0,i);
78 tmpObject -> setrung(runmean,1,i);
79 tmpObject -> setrung(runno,2,i);
80 tmpObject -> setrung(runresol,3,i);
81 }
82
83
84
85
86 double ddg0[43];
87 double ddg1[43];
88 double ddg2[43];
89 double ddg3[43];
90 double id_doca[1600];
91 double iner_chi[1600];
92 double iner_gain[1600];
93 double iner_hits[1600];
94 double ip_eangle[1600];
95 double out_chi[1600];
96 double out_gain[1600];
97 double out_hits[1600];
98
99 TTree *ddgtree = (TTree*)
m_inFile -> Get(
"ddgcalib");
104 TBranch *bbb = ddgtree->FindBranch("Id_doca");
105 if(bbb){
114 }
116 for(i=0; i<43; i++){
117 tmpObject -> setddg(ddg0[i],0,i);
118 tmpObject -> setddg(ddg1[i],1,i);
119 tmpObject -> setddg(ddg2[i],2,i);
120 tmpObject -> setddg(ddg3[i],3,i);
121 }
122
123 for(i=0; i<1600; i++){
124 if(!bbb){
125 id_doca[i]=0;
126 iner_chi[i]=0;
127 iner_gain[i]=0;
128 iner_hits[i]=0;
129 ip_eangle[i]=0;
130 out_chi[i]=0;
131 out_gain[i]=0;
132 out_hits[i]=0;
133 }
134 tmpObject -> set_id_doca(id_doca[i],i);
135 tmpObject -> set_iner_chi(iner_chi[i],i);
136 tmpObject -> set_iner_gain(iner_gain[i],i);
137 tmpObject -> set_iner_hits(iner_hits[i],i);
138 tmpObject -> set_ip_eangle(ip_eangle[i],i);
139 tmpObject -> set_out_chi(out_chi[i],i);
140 tmpObject -> set_out_gain(out_gain[i],i);
141 tmpObject -> set_out_hits(out_hits[i],i);
142 }
143
144
145 double entra0[43];
146 double entra1[43];
147 double entra2[43];
148 double entra3[43];
149 double engle[100];
150 int engle_no;
151 TTree *entratree = (TTree*)
m_inFile -> Get(
"entracalib");
159 for(i=0; i<43; i++){
160 tmpObject -> setenta(entra0[i],0,i);
161 tmpObject -> setenta(entra1[i],1,i);
162 tmpObject -> setenta(entra2[i],2,i);
163 tmpObject -> setenta(entra3[i],3,i);
164 }
165 tmpObject -> set_enanglesize(engle_no);
166 for(i=0; i<engle_no; i++){
167 tmpObject -> set_enangle(engle[i],i);
168 }
169
170
171
172
173 double ggs0[43];
174 double ggs1[43];
175 double ggs2[43];
176 double ggs3[43];
177 double gcostheta[80];
178 int hadron_entry;
179 double hadron[20];
180 TTree *ggstree = (TTree*)
m_inFile -> Get(
"ggscalib");
187 if(bbb){
189 }
191 for(i=0; i<43;i++){
192 tmpObject -> setggs(ggs0[i],0,i);
193 tmpObject -> setggs(ggs1[i],1,i);
194 tmpObject -> setggs(ggs2[i],2,i);
195 tmpObject -> setggs(ggs3[i],3,i);
196 }
197
198 for(i=0; i<80;i++){
199 if(!bbb) gcostheta[i]=0;
201 }
202
203 if(hadron_entry>20){
204 log<<MSG::FATAL<<"hadron entry is larger than 20, larger than designed"<<endreq;
205 return StatusCode::FAILURE;
206 }
207
209
210 for(i=0;i<hadron_entry;i++){
212 }
213
214
215
216 double zdep0[43];
217 double zdep1[43];
218 double zdep2[43];
219 double zdep3[43];
220 TTree *zdeptree = (TTree*)
m_inFile -> Get(
"zdepcalib");
226
227 for(i=0; i<43;i++){
228 tmpObject -> setzdep(zdep0[i],0,i);
229 tmpObject -> setzdep(zdep1[i],1,i);
230 tmpObject -> setzdep(zdep2[i],2,i);
231 tmpObject -> setzdep(zdep3[i],3,i);
232 }
233
234
235 double gain;
236 double gt0[35],gdedx[35];
237 TTree *gaintree = (TTree*)
m_inFile -> Get(
"gaincalib");
239 if(bbb){
242 }
244 tmpObject -> setgain(gain);
245 for(i=0; i<35;i++){
246 if(!bbb){
247 gt0[i]=0;
248 gdedx[i]=0;
249 }
250 tmpObject->
set_t0(gt0[i],i);
252 }
253
254
255 double resol;
256 TTree *resoltree = (TTree*)
m_inFile -> Get(
"resolcalib");
259 tmpObject -> setresol(resol);
260
261
262 double wireg[6796];
263 TTree *wiregtree = (TTree*)
m_inFile -> Get(
"wiregcalib");
266 for(i=0;i<6796;i++){
267 tmpObject -> setwireg(wireg[i],i);
268 }
269
270
271 double layerg[43];
272 TTree *layergtree = (TTree*)
m_inFile -> Get(
"layergcalib");
275
276 for(i=0;i<43;i++){
277 tmpObject -> setlayerg(layerg[i],i);
278 }
279
280 refpObject=tmpObject;
281
282
283
284
285
286
287 return StatusCode::SUCCESS;
288}
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)