72 {
73 MsgStream log(
msgSvc(), name());
74
75 log << MSG::INFO << "in initialize()" << endmsg;
76
77 StatusCode status;
78 NTuplePtr nt1(
ntupleSvc(),
"FILE1/mdctrack");
79 if ( nt1 ) m_tuple1 = nt1;
80 else {
81 m_tuple1 =
ntupleSvc()->book (
"FILE1/mdctrack", CLID_ColumnWiseTuple,
"ks N-Tuple example");
82 if ( m_tuple1 ) {
83 status = m_tuple1->addItem ("mdc_vx0", m_vx0);
84 status = m_tuple1->addItem ("mdc_vy0", m_vy0);
85 status = m_tuple1->addItem ("mdc_vz0", m_vz0);
86 status = m_tuple1->addItem ("mdc_pch", m_pch);
87 status = m_tuple1->addItem ("mdc_trackid", m_trackid);
88 status = m_tuple1->addItem ("mdc_charge", m_charge);
89 status = m_tuple1->addItem ("mdc_pxy0", m_pxy0);
90 status = m_tuple1->addItem ("mdc_px0", m_px0);
91 status = m_tuple1->addItem ("mdc_py0", m_py0);
92 status = m_tuple1->addItem ("mdc_pz0", m_pz0);
93 status = m_tuple1->addItem ("mdc_r0", m_r0);
94 status = m_tuple1->addItem ("mdc_phi", m_phi);
95 status = m_tuple1->addItem ("mdc_theta", m_theta);
96 status = m_tuple1->addItem ("mdc_ndof", m_ndof);
97 status = m_tuple1->addItem ("mdc_nster", m_nster);
98 status = m_tuple1->addItem ("mdc_stat", m_stat);
99 status = m_tuple1->addItem ("mdc_angd", m_angd);
100 status = m_tuple1->addItem ("mdc_rvxy0", m_rvxy0);
101 status = m_tuple1->addItem ("mdc_rvz0", m_rvz0);
102 status = m_tuple1->addItem ("mdc_d0", m_d0);
103 status = m_tuple1->addItem ("mdc_phi0", m_phi0);
104 status = m_tuple1->addItem ("mdc_kappa", m_kappa);
105 status = m_tuple1->addItem ("mdc_dz", m_dzhelix);
106 status = m_tuple1->addItem ("mdc_tanlamda", m_tanlamda);
107 status = m_tuple1->addItem ("mdc_err11", m_err11);
108 status = m_tuple1->addItem ("mdc_err21", m_err21);
109 status = m_tuple1->addItem ("mdc_err22", m_err22);
110 status = m_tuple1->addItem ("mdc_err31", m_err31);
111 status = m_tuple1->addItem ("mdc_err32", m_err32);
112 status = m_tuple1->addItem ("mdc_err33", m_err33);
113 status = m_tuple1->addItem ("mdc_err41", m_err41);
114 status = m_tuple1->addItem ("mdc_err42", m_err42);
115 status = m_tuple1->addItem ("mdc_err43", m_err43);
116 status = m_tuple1->addItem ("mdc_err44", m_err44);
117 status = m_tuple1->addItem ("mdc_err51", m_err51);
118 status = m_tuple1->addItem ("mdc_err52", m_err52);
119 status = m_tuple1->addItem ("mdc_err53", m_err53);
120 status = m_tuple1->addItem ("mdc_err54", m_err54);
121 status = m_tuple1->addItem ("mdc_err55", m_err55);
122
123 status = m_tuple1->addItem ("mdc_kal_px", m_mdc_kal_px);
124 status = m_tuple1->addItem ("mdc_kal_py", m_mdc_kal_py);
125 status = m_tuple1->addItem ("mdc_kal_pz", m_mdc_kal_pz);
126 status = m_tuple1->addItem ("mdc_kal_p", m_mdc_kal_p);
127 status = m_tuple1->addItem ("mdc_kal_pxy", m_mdc_kal_pxy);
128 status = m_tuple1->addItem ("mdc_kal_costheta", m_mdc_kal_costheta);
129
130 status = m_tuple1->addItem ("NGch", m_ngch);
131 }
132 else {
133 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple1) << endmsg;
134 return StatusCode::FAILURE;
135 }
136 }
137
138
139
140
141 if(m_checkDedx==1){
142 NTuplePtr nt2(
ntupleSvc(),
"FILE1/dedx");
143 if ( nt2 ) m_tuple2 = nt2;
144 else {
145 m_tuple2 =
ntupleSvc()->book (
"FILE1/dedx", CLID_ColumnWiseTuple,
"ks N-Tuple example");
146 if ( m_tuple2 ) {
147 status = m_tuple2->addItem ("dedx_ptrk", m_ptrk);
148 status = m_tuple2->addItem ("dedx_chie", m_chie);
149 status = m_tuple2->addItem ("dedx_chimu", m_chimu);
150 status = m_tuple2->addItem ("dedx_chipi", m_chipi);
151 status = m_tuple2->addItem ("dedx_chik", m_chik);
152 status = m_tuple2->addItem ("dedx_chip", m_chip);
153 status = m_tuple2->addItem ("dedx_probPH", m_probPH);
154 status = m_tuple2->addItem ("dedx_normPH", m_normPH);
155 status = m_tuple2->addItem ("dedx_ghit", m_ghit);
156 status = m_tuple2->addItem ("dedx_thit", m_thit);
157 }
158 else {
159 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple2) << endmsg;
160 return StatusCode::FAILURE;
161 }
162 }
163 }
164
165
166
167 if(m_checkExt==1){
169 if ( nt3 ) m_tuple3 = nt3;
170 else {
171 m_tuple3 =
ntupleSvc()->book (
"FILE1/ext",CLID_ColumnWiseTuple,
"ks N-Tuple example");
172 if ( m_tuple3 ) {
173
174 status = m_tuple3->addItem ("ext_tof1", m_tof1);
175 status = m_tuple3->addItem ("ext_tof1path", m_tof1path);
176 status = m_tuple3->addItem ("ext_tof1z", m_tof1z);
177 status = m_tuple3->addItem ("ext_tof1t", m_tof1t);
178 status = m_tuple3->addItem ("ext_tof1x", m_tof1x);
179 status = m_tuple3->addItem ("ext_tof1y", m_tof1y);
180
181 status = m_tuple3->addItem ("ext_tof2", m_tof2);
182 status = m_tuple3->addItem ("ext_tof2path", m_tof2path);
183 status = m_tuple3->addItem ("ext_tof2z", m_tof2z);
184 status = m_tuple3->addItem ("ext_tof2t", m_tof2t);
185 status = m_tuple3->addItem ("ext_tof2x", m_tof2x);
186 status = m_tuple3->addItem ("ext_tof2y", m_tof2y);
187
188 status = m_tuple3->addItem ("ext_emctheta", m_emctheta);
189 status = m_tuple3->addItem ("ext_emcphi", m_emcphi);
190 status = m_tuple3->addItem ("ext_emcpath", m_emcpath);
191
192 status = m_tuple3->addItem ("ext_mucz", m_mucz);
193 status = m_tuple3->addItem ("ext_muct", m_muct);
194 status = m_tuple3->addItem ("ext_mucx", m_mucx);
195 status = m_tuple3->addItem ("ext_mucy", m_mucy);
196
197
198 }
199 else {
200 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple3) << endmsg;
201 return StatusCode::FAILURE;
202 }
203 }
204 }
205
206
207
208
209
210 if(m_checkTof==1){
212 if ( nt4 ) m_tuple4 = nt4;
213 else {
214 m_tuple4 =
ntupleSvc()->book (
"FILE1/tof", CLID_ColumnWiseTuple,
"ks N-Tuple example");
215 if ( m_tuple2 ) {
216 status = m_tuple4->addItem ("tof_path", m_path);
217 status = m_tuple4->addItem ("tof_zrhit", m_zrhit);
218 status = m_tuple4->addItem ("tof_ph", m_ph);
219 status = m_tuple4->addItem ("tof_tof", m_tof);
220 status = m_tuple4->addItem ("tof_errtof", m_errtof);
221 status = m_tuple4->addItem ("tof_beta", m_beta);
222 status = m_tuple4->addItem ("tof_texpe", m_texpe);
223 status = m_tuple4->addItem ("tof_texpmu", m_texpmu);
224 status = m_tuple4->addItem ("tof_texppi", m_texppi);
225 status = m_tuple4->addItem ("tof_texpka", m_texpka);
226 status = m_tuple4->addItem ("tof_texppro", m_texppro);
227 status = m_tuple4->addItem ("tof_toffsete", m_toffsete);
228 status = m_tuple4->addItem ("tof_toffsetmu", m_toffsetmu);
229 status = m_tuple4->addItem ("tof_toffsetpi", m_toffsetpi);
230 status = m_tuple4->addItem ("tof_toffsetka", m_toffsetka);
231 status = m_tuple4->addItem ("tof_toffsetpro", m_toffsetpro);
232 status = m_tuple4->addItem ("tof_toffsetatpr", m_toffsetatpr);
233 status = m_tuple4->addItem ("tof_sigmae", m_sigmae);
234 status = m_tuple4->addItem ("tof_sigmamu", m_sigmamu);
235 status = m_tuple4->addItem ("tof_sigmapi", m_sigmapi);
236 status = m_tuple4->addItem ("tof_sigmaka", m_sigmaka);
237 status = m_tuple4->addItem ("tof_sigmapro", m_sigmapro);
238 status = m_tuple4->addItem ("tof_sigmaatpr", m_sigmaatpr);
239 status = m_tuple4->addItem ("tof_quality", m_quality);
240 status = m_tuple4->addItem ("tof_t0", m_t0);
241 status = m_tuple4->addItem ("tof_errt0", m_errt0);
242 status = m_tuple4->addItem ("tof_errz", m_errz);
243 status = m_tuple4->addItem ("tof_phi", m_phitof);
244 status = m_tuple4->addItem ("tof_errphi", m_errphi);
245 status = m_tuple4->addItem ("tof_energy", m_energy);
246 status = m_tuple4->addItem ("tof_errenergy", m_errenergy);
247 }
248 else {
249 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple4) << endmsg;
250 return StatusCode::FAILURE;
251 }
252 }
253 }
254
255
256
257
258 if(m_checkEmc==1){
260 if ( nt5 ) m_tuple5 = nt5;
261 else {
262 m_tuple5 =
ntupleSvc()->book (
"FILE1/emc",CLID_ColumnWiseTuple,
"ks N-Tuple example");
263 if ( m_tuple5 ) {
264
265 status = m_tuple5->addItem ("emc_x", m_x);
266 status = m_tuple5->addItem ("emc_y", m_y);
267 status = m_tuple5->addItem ("emc_z", m_z);
268 status = m_tuple5->addItem ("emc_theta", m_thetaemc);
269 status = m_tuple5->addItem ("emc_phi", m_phiemc);
270 status = m_tuple5->addItem ("emc_dx", m_dx);
271 status = m_tuple5->addItem ("emc_dy", m_dy);
272 status = m_tuple5->addItem ("emc_dz", m_dz);
273 status = m_tuple5->addItem ("emc_dtheta", m_dtheta);
274 status = m_tuple5->addItem ("emc_dphi", m_dphi);
275 status = m_tuple5->addItem ("emc_energy", m_energyemc);
276 status = m_tuple5->addItem ("emc_dE", m_de);
277 status = m_tuple5->addItem ("emc_eseed", m_eseed);
278 status = m_tuple5->addItem ("emc_e3x3", m_e3x3);
279 status = m_tuple5->addItem ("emc_e5x5", m_e5x5);
280 status = m_tuple5->addItem ("emc_secp", m_secp);
281 status = m_tuple5->addItem ("emc_latp", m_latp);
282 }
283 else {
284 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple5) << endmsg;
285 return StatusCode::FAILURE;
286 }
287 }
288 }
289
290
291 if(m_checkMuc==1){
293 if ( nt6 ) m_tuple6 = nt6;
294 else {
295 m_tuple6 =
ntupleSvc()->book (
"FILE1/muc",CLID_ColumnWiseTuple,
"ks N-Tuple example");
296 if ( m_tuple6 ) {
297
298 status = m_tuple6->addItem ("muc_depth", m_depth);
299 status = m_tuple6->addItem ("muc_chi2", m_chi2);
300 status = m_tuple6->addItem ("muc_rms", m_rms);
301 status = m_tuple6->addItem ("muc_xpos", m_xpos);
302 status = m_tuple6->addItem ("muc_ypos", m_ypos);
303 status = m_tuple6->addItem ("muc_zpos", m_zpos);
304 status = m_tuple6->addItem ("muc_xsigma", m_xpossigma);
305 status = m_tuple6->addItem ("muc_ysigma", m_ypossigma);
306 status = m_tuple6->addItem ("muc_zsigma", m_zpossigma);
307 status = m_tuple6->addItem ("muc_px", m_px);
308 status = m_tuple6->addItem ("muc_py", m_py);
309 status = m_tuple6->addItem ("muc_pz", m_pz);
310 status = m_tuple6->addItem ("muc_distance", m_distance);
311 status = m_tuple6->addItem ("muc_deltaphi", m_deltaphi);
312 }
313 else {
314 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple6) << endmsg;
315 return StatusCode::FAILURE;
316 }
317 }
318 }
319
320
321
322
323 NTuplePtr nt7(
ntupleSvc(),
"FILE1/runinfo");
324 if ( nt7 ) m_tuple7 = nt7;
325 else {
326 m_tuple7 =
ntupleSvc()->book (
"FILE1/runinfo",CLID_ColumnWiseTuple,
"ks N-Tuple example");
327 if ( m_tuple7 ) {
328
329 status = m_tuple7->addItem ("runinfo_runNo", m_runNo);
330 status = m_tuple7->addItem ("runinfo_event", m_event);
331 status = m_tuple7->addItem ("runinfo_totcharged", m_totcharged);
332 status = m_tuple7->addItem ("runinfo_totneutral", m_totneutral);
333 status = m_tuple7->addItem ("runinfo_tottracks", m_tottracks);
334 status = m_tuple7->addItem ("runinfo_ngood", m_ngood);
335 status = m_tuple7->addItem ("runinfo_ncharge", m_ncharge);
336 status = m_tuple7->addItem ("kal_n", m_kaln);
337 status = m_tuple7->addItem ("costheta_n", m_costhetan);
338 status = m_tuple7->addItem ("p_n", m_pn);
339 status = m_tuple7->addItem ("charge", m_mat_charge);
340 status = m_tuple7->addItem ("diff_pxy", m_diff_pxy);
341 status = m_tuple7->addItem ("diff_p", m_diff_pch);
342 status = m_tuple7->addItem ("diff_costheta", m_diff_costheta);
343 }
344 else {
345 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple7) << endmsg;
346 return StatusCode::FAILURE;
347 }
348 }
349
350
351
352
353 NTuplePtr nt8(
ntupleSvc(),
"FILE1/mcpart");
354 if ( nt8 ) m_tuple8 = nt8;
355 else {
356 m_tuple8 =
ntupleSvc()->book (
"FILE1/mcpart",CLID_ColumnWiseTuple,
"ks N-Tuple example");
357 if ( m_tuple8 ) {
358 status = m_tuple8->addItem ("mcpart_vx", m_vx);
359 status = m_tuple8->addItem ("mcpart_vy", m_vy);
360 status = m_tuple8->addItem ("mcpart_vz", m_vz);
361 status = m_tuple8->addItem ("mcpart_vr0", m_vr0);
362 status = m_tuple8->addItem ("mcpart_px", m_pxmc);
363 status = m_tuple8->addItem ("mcpart_py", m_pymc);
364 status = m_tuple8->addItem ("mcpart_pz", m_pzmc);
365 status = m_tuple8->addItem ("mcpart_e", m_e);
366 status = m_tuple8->addItem ("mcpart_p", m_p);
367 status = m_tuple8->addItem ("mcpart_pxy", m_pxymc);
368 status = m_tuple8->addItem ("mcpart_theta", m_thetamc);
369 status = m_tuple8->addItem ("mcpart_costheta", m_costhetamc);
370
371 status = m_tuple8->addItem ("mcpart_phi", m_phimc);
372 status = m_tuple8->addItem ("mcpart_m", m_m);
373 status = m_tuple8->addItem ("mcpart_pro", m_pro);
374 status = m_tuple8->addItem ("mcpart_index", m_index);
375 status = m_tuple8->addItem ("totalcharged", m_mctotcharged);
376
377
378 }
379 else {
380 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple8) << endmsg;
381 return StatusCode::FAILURE;
382 }
383 }
384
385
386
387 NTuplePtr nt9(
ntupleSvc(),
"FILE1/pid_kal");
388 if ( nt9 ) m_tuple9 = nt9;
389 else {
390 m_tuple9 =
ntupleSvc()->book (
"FILE1/pid_kal", CLID_ColumnWiseTuple,
"ks N-Tuple example");
391 if ( m_tuple9 ) {
392 status = m_tuple9->addItem ("pid_ptrk", m_ptrk_pid);
393 status = m_tuple9->addItem ("pid_cost", m_cost_pid);
394 status = m_tuple9->addItem ("pid_dedx", m_dedx_pid);
395 status = m_tuple9->addItem ("pid_tof1", m_tof1_pid);
396 status = m_tuple9->addItem ("pid_tof2", m_tof2_pid);
397 status = m_tuple9->addItem ("prob_pion", m_prob_pid_pion);
398 status = m_tuple9->addItem ("prob_kaon", m_prob_pid_kaon);
399 status = m_tuple9->addItem ("prob_proton", m_prob_pid_proton);
400
401 status = m_tuple9->addItem ("kal_px", m_kalpx);
402 status = m_tuple9->addItem ("kal_py", m_kalpy);
403 status = m_tuple9->addItem ("kal_pz", m_kalpz);
404 status = m_tuple9->addItem ("kal_p", m_kalp);
405 status = m_tuple9->addItem ("kal_pxy", m_kalpxy);
406
407 status = m_tuple9->addItem ("kal_costheta", m_kalcostheta);
408
409 status = m_tuple9->addItem ("kal_d0", m_d0kal);
410 status = m_tuple9->addItem ("kal_phi0", m_phi0kal);
411 status = m_tuple9->addItem ("kal_kappa", m_kappakal);
412 status = m_tuple9->addItem ("kal_dz", m_dzhelixkal);
413 status = m_tuple9->addItem ("kal_tanlamda", m_tanlamdakal);
414 status = m_tuple9->addItem ("kal_err11", m_err11kal);
415 status = m_tuple9->addItem ("kal_err21", m_err21kal);
416 status = m_tuple9->addItem ("kal_err22", m_err22kal);
417 status = m_tuple9->addItem ("kal_err31", m_err31kal);
418 status = m_tuple9->addItem ("kal_err32", m_err32kal);
419 status = m_tuple9->addItem ("kal_err33", m_err33kal);
420 status = m_tuple9->addItem ("kal_err41", m_err41kal);
421 status = m_tuple9->addItem ("kal_err42", m_err42kal);
422 status = m_tuple9->addItem ("kal_err43", m_err43kal);
423 status = m_tuple9->addItem ("kal_err44", m_err44kal);
424 status = m_tuple9->addItem ("kal_err51", m_err51kal);
425 status = m_tuple9->addItem ("kal_err52", m_err52kal);
426 status = m_tuple9->addItem ("kal_err53", m_err53kal);
427 status = m_tuple9->addItem ("kal_err54", m_err54kal);
428 status = m_tuple9->addItem ("kal_err55", m_err55kal);
429 status = m_tuple9->addItem ("kal_nn", m_kalnn);
430 status = m_tuple9->addItem ("costheta_nn", m_costhetann);
431 status = m_tuple9->addItem ("p_nn", m_pnn);
432
433 status = m_tuple9->addItem ("comp_costheta", m_comp_costheta);
434
435
436 }
437 else {
438 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple9) << endmsg;
439 return StatusCode::FAILURE;
440 }
441 }
442
443
444
445
446
447
448
449 log << MSG::INFO << "successfully return from initialize()" <<endmsg;
450 return StatusCode::SUCCESS;
451
452}