203 {
205 Gaudi::svcLocator() -> service(
"MessageSvc",
msgSvc);
206 MsgStream log(
msgSvc,
"MdcCalib");
207 log << MSG::INFO << "MdcCalib::initialize()" << endreq;
208
209 m_hlist = hlist;
210 m_mdcGeomSvc = mdcGeomSvc;
211 m_mdcFunSvc = mdcFunSvc;
212 m_mdcUtilitySvc = mdcUtilitySvc;
213
214 int lay;
215 int iEntr;
216 int lr;
218 char hname[200];
219
220 m_nlayer = m_mdcGeomSvc -> getLayerSize();
221
222 for(lay=0; lay<m_nlayer; lay++){
224 }
230 m_xw[wir] = m_mdcGeomSvc->
Wire(wir)->
Forward().x();
231 m_yw[wir] = m_mdcGeomSvc->
Wire(wir)->
Forward().y();
232 m_zw[wir] = m_mdcGeomSvc->
Wire(wir)->
Forward().z();
233 fwpc << setw(6) << wir << setw(15) << m_xe[wir] << setw(15) << m_ye[wir]
234 << setw(15) << m_ze[wir] << setw(15) << m_xw[wir]
235 << setw(15) << m_yw[wir] << setw(15) << m_zw[wir] << endl;
236 }
237 fwpc.close();
238
239 m_fdcom = new TFolder("common", "common");
240 m_hlist ->
Add(m_fdcom);
241
242 m_effNtrk = new TH1F("effNtrk", "", 43, -0.5, 42.5);
243 m_fdcom->Add(m_effNtrk);
244
245 m_effNtrkRecHit = new TH1F("effNtrkRecHit", "", 43, -0.5, 42.5);
246 m_fdcom->Add(m_effNtrkRecHit);
247
248 m_hresAllInc = new TH1F("HResAllInc", "", 200, -1.0, 1.0);
249 m_fdcom ->
Add(m_hresAllInc);
250
251 m_hresAllExc = new TH1F("HResAllExc", "", 200, -1.0, 1.0);
252 m_fdcom ->
Add(m_hresAllExc);
253
254 m_hresAllAve = new TH1F("HResAllAve", "", 200, -1.0, 1.0);
255 m_fdcom ->
Add(m_hresAllAve);
256
257 m_hresInnInc = new TH1F("HResInnInc", "", 200, -1.0, 1.0);
258 m_fdcom ->
Add(m_hresInnInc);
259
260 m_hresInnExc = new TH1F("HResInnExc", "", 200, -1.0, 1.0);
261 m_fdcom ->
Add(m_hresInnExc);
262
263 m_hresStpInc = new TH1F("HResStpInc", "", 200, -1.0, 1.0);
264 m_fdcom ->
Add(m_hresStpInc);
265
266 m_hresStpExc = new TH1F("HResStpExc", "", 200, -1.0, 1.0);
267 m_fdcom ->
Add(m_hresStpExc);
268
269 m_hresOutInc = new TH1F("HResOutInc", "", 200, -1.0, 1.0);
270 m_fdcom ->
Add(m_hresOutInc);
271
272 m_hresOutExc = new TH1F("HResOutExc", "", 200, -1.0, 1.0);
273 m_fdcom ->
Add(m_hresOutExc);
274
275 m_fdResQ = new TFolder("ResQ", "ResQ");
276 m_hlist->Add(m_fdResQ);
277 for(int i=0; i<14; i++){
278 sprintf(hname,
"resoAll_qbin%02d", i);
279 m_hresAveAllQ[i] = new TH1F(hname, "", 200, -1, 1);
280 m_fdResQ->Add(m_hresAveAllQ[i]);
281
282 sprintf(hname,
"resoOut_qbin%02d", i);
283 m_hresAveOutQ[i] = new TH1F(hname, "", 200, -1, 1);
284 m_fdResQ->Add(m_hresAveOutQ[i]);
285 }
286 for(lay=0; lay<43; lay++){
287 for(int i=0; i<14; i++){
288 sprintf(hname,
"resoLay%02d_qbin%02d", lay, i);
289 m_hresAveLayQ[lay][i] = new TH1F(hname, "", 200, -1, 1);
290 m_fdResQ->Add(m_hresAveLayQ[lay][i]);
291 }
292 }
293
294 for(
int iEs=0; iEs<m_param.
nEsFlag; iEs++){
296 m_hTes[iEs] = new TH1F(hname, "", 750, 0, 1500);
297 m_fdcom->Add(m_hTes[iEs]);
298 }
299
300 m_hbbTrkFlg = new TH1F("BbTrkFlg", "", 100, 0, 6);
301 m_fdcom ->
Add(m_hbbTrkFlg);
302
303 m_hTesAll = new TH1F("TesAll", "", 1000, 0, 2000);
304 m_fdcom ->
Add(m_hTesAll);
305
306 m_hTesGood = new TH1F("TesGood", "", 1000, 0, 2000);
307 m_fdcom ->
Add(m_hTesGood);
308
309 m_hTesAllFlag = new TH1F("TesAllFlag", "", 300, -0.5, 299.5);
310 m_fdcom ->
Add(m_hTesAllFlag);
311
312 m_hTesRec = new TH1F("TesRec", "", 1000, 0, 2000);
313 m_fdcom ->
Add(m_hTesRec);
314
315 m_hTesCalFlag = new TH1F("TesCalFlag", "", 1000, 0, 2000);
316 m_fdcom ->
Add(m_hTesCalFlag);
317
318 m_hTesCalUse = new TH1F("TesCalUse", "", 1000, 0, 2000);
319 m_fdcom ->
Add(m_hTesCalUse);
320
321 m_hnRawHit = new TH1F("nRawHit", "", 6797, -0.5, 6796.5);
322 m_fdcom ->
Add(m_hnRawHit);
323
324 m_hpt = new TH1F("HPt", "", 800, 0, 3);
325 m_fdcom ->
Add(m_hpt);
326
327 m_hptPos = new TH1F("HPtPos", "", 800, 0, 3);
328 m_fdcom ->
Add(m_hptPos);
329
330 m_hptNeg = new TH1F("HPtNeg", "", 800, 0, 3);
331 m_fdcom ->
Add(m_hptNeg);
332
333 m_hp = new TH1F("HP", "", 800, 0, 3);
334 m_fdcom ->
Add(m_hp);
335
336 m_hp_cms = new TH1F("HPCMS", "", 800, 0, 3);
337 m_fdcom ->
Add(m_hp_cms);
338
339 m_hpMax = new TH1F("HPMax", "", 800, 0, 3);
340 m_fdcom ->
Add(m_hpMax);
341
342 m_hpMaxCms = new TH1F("HPMax_Cms", "", 800, 0, 3);
343 m_fdcom ->
Add(m_hpMaxCms);
344
345 m_hpPos = new TH1F("HP_Pos", "", 800, 0, 3);
346 m_fdcom ->
Add(m_hpPos);
347
348 m_hpNeg = new TH1F("HP_Neg", "", 800, 0, 3);
349 m_fdcom ->
Add(m_hpNeg);
350
351 m_hpPoscms = new TH1F("HP_Pos_cms", "", 800, 0, 3);
352 m_fdcom ->
Add(m_hpPoscms);
353
354 m_hpNegcms = new TH1F("HP_Neg_cms", "", 800, 0, 3);
355 m_fdcom ->
Add(m_hpNegcms);
356
357 m_hp_cut = new TH1F("HPCut", "", 800, 0, 3);
358 m_fdcom ->
Add(m_hp_cut);
359
360 m_hchisq = new TH1F("Chisq", "", 10, 0, 100);
361 m_fdcom ->
Add(m_hchisq);
362
363 m_hnTrk = new TH1F("HNtrack", "HNtrack", 10, -0.5, 9.5);
364 m_fdcom ->
Add(m_hnTrk);
365
366 m_hnTrkCal = new TH1F("HNtrackCal", "HNtrackCal", 10, -0.5, 9.5);
367 m_fdcom ->
Add(m_hnTrkCal);
368
369 m_hnhitsRec = new TH1F("HNhitsRec", "", 100, -0.5, 99.5);
370 m_fdcom ->
Add(m_hnhitsRec);
371
372 m_hnhitsRecInn = new TH1F("HNhitsInnRec", "", 60, 0.5, 60.5);
373 m_fdcom ->
Add(m_hnhitsRecInn);
374
375 m_hnhitsRecStp = new TH1F("HNhitsStpRec", "", 60, 0.5, 60.5);
376 m_fdcom ->
Add(m_hnhitsRecStp);
377
378 m_hnhitsRecOut = new TH1F("HNhitsOutRec", "", 60, 0.5, 60.5);
379 m_fdcom ->
Add(m_hnhitsRecOut);
380
381 m_hnhitsCal = new TH1F("HNhitsCal", "", 100, -0.5, 99.5);
382 m_fdcom ->
Add(m_hnhitsCal);
383
384 m_hnhitsCalInn = new TH1F("HNhitsCalInn", "", 60, 0.5, 60.5);
385 m_fdcom ->
Add(m_hnhitsCalInn);
386
387 m_hnhitsCalStp = new TH1F("HNhitsCalStp", "", 60, 0.5, 60.5);
388 m_fdcom ->
Add(m_hnhitsCalStp);
389
390 m_hnhitsCalOut = new TH1F("HNhitsCalOut", "", 60, 0.5, 60.5);
391 m_fdcom ->
Add(m_hnhitsCalOut);
392
393 m_wirehitmap = new TH1F("Wire_HitMap", "Wire_HitMap", 6796, -0.5, 6795.5);
394 m_fdcom ->
Add(m_wirehitmap);
395
396 m_layerhitmap = new TH1F("Layer_HitMap", "Layer_HitMap", 43, -0.5, 42.5);
397 m_fdcom ->
Add(m_layerhitmap);
398
399 m_hnoisephi = new TH1F("phi_noise", "", 100, 0, 6.284);
400 m_fdcom ->
Add(m_hnoisephi);
401
402 m_hnoiselay = new TH1F("Layer_noise", "Layer_noise", 43, -0.5, 42.5);
403 m_fdcom ->
Add(m_hnoiselay);
404
405 m_hnoisenhits = new TH1F("nhits_noise", "nhits_noise", 6796, -0.5, 6795.5);
406 m_fdcom ->
Add(m_hnoisenhits);
407
408 m_hratio = new TH1F("ratio", "", 100, 0, 1);
409 m_fdcom ->
Add(m_hratio);
410
411 m_hdr = new TH1F("dr", "", 500, -500, 500);
412 m_fdcom ->
Add(m_hdr);
413
414 m_hphi0 = new TH1F("phi0", "", 100, 0, 6.284);
415 m_fdcom ->
Add(m_hphi0);
416
417 m_hkap = new TH1F("kappa", "", 400, -50, 50);
418 m_fdcom ->
Add(m_hkap);
419
420 m_hdz = new TH1F("dz", "", 500, -1000, 1000);
421 m_fdcom ->
Add(m_hdz);
422
423 m_htanl = new TH1F("tanl", "", 200, -5, 5);
424 m_fdcom ->
Add(m_htanl);
425
426 m_hcosthe = new TH1F("costheta", "", 200, -1, 1);
427 m_fdcom ->
Add(m_hcosthe);
428
429 m_hcostheNeg = new TH1F("costhetaNeg", "", 200, -1, 1);
430 m_fdcom ->
Add(m_hcostheNeg);
431
432 m_hcosthePos = new TH1F("costhetaPos", "", 200, -1, 1);
433 m_fdcom ->
Add(m_hcosthePos);
434
435 m_hx0 = new TH1F("x0", "", 100, -10, 10);
436 m_fdcom ->
Add(m_hx0);
437
438 m_hy0 = new TH1F("y0", "", 100, -10, 10);
439 m_fdcom ->
Add(m_hy0);
440
441 m_hdelZ0 = new TH1F("delta_z0", "", 100, -50, 50);
442 m_fdcom ->
Add(m_hdelZ0);
443
444 m_grX0Y0 = new TGraph();
445 m_grX0Y0->SetName("x0y0");
446 m_fdcom ->
Add(m_grX0Y0);
447
448 m_hitEffAll = new TH1F("hitEffAll", "", 6800, -0.5, 6799.5);
449 m_fdcom ->
Add(m_hitEffAll);
450
451 m_hitEffRaw = new TH1F("hitEffRaw", "", 6800, -0.5, 6799.5);
452 m_fdcom ->
Add(m_hitEffRaw);
453
454 m_hitEffRec = new TH1F("hitEffRec", "", 6800, -0.5, 6799.5);
455 m_fdcom ->
Add(m_hitEffRec);
456
457
458 m_fdTime = new TFolder("time", "time");
459 m_hlist ->
Add(m_fdTime);
460
461 for(lay=0; lay<m_nlayer; lay++){
462 sprintf(hname,
"Traw%02d", lay);
463 m_htraw[lay] = new TH1F(hname, "", 1000, 0, 2000);
464 m_fdTime ->
Add(m_htraw[lay]);
465
466 sprintf(hname,
"Tdr%02d", lay);
467 m_htdr[lay] = new TH1F(hname, "", 510, -10, 500);
468 m_fdTime ->
Add(m_htdr[lay]);
469
470 for (lr=0; lr<2; lr++){
471 sprintf(hname,
"Tdr%02d_lr%01d", lay, lr);
472 m_htdrlr[lay][lr] = new TH1F(hname, "", 510, -10, 500);
473 m_fdTime ->
Add(m_htdrlr[lay][lr]);
474 }
475 }
476
477
478 m_fdAdc = new TFolder("adc", "adc");
479 m_hlist ->
Add(m_fdAdc);
480
481 for(lay=0; lay<m_nlayer; lay++){
482 sprintf(hname,
"adc%02d", lay);
483 m_hadc[lay] = new TH1F(hname, "", 1500, 0, 3000);
484 m_fdAdc ->
Add(m_hadc[lay]);
485 }
486
487 m_fdres = new TFolder("resolution", "resolution");
488 m_hlist ->
Add(m_fdres);
489
490 m_fdresAve = new TFolder("resAve", "resAve");
491 m_hlist ->
Add(m_fdresAve);
492
493 for(lay=0; lay<m_nlayer; lay++){
494 sprintf(hname,
"Reso%02dInc", lay);
495 m_hresInc[lay] = new TH1F(hname, "", 1000, -5, 5);
496 m_fdres ->
Add(m_hresInc[lay]);
497
498 sprintf(hname,
"Reso%02dExc", lay);
499 m_hresExc[lay] = new TH1F(hname, "", 1000, -5, 5);
500 m_fdres ->
Add(m_hresExc[lay]);
501
502 sprintf(hname,
"Reso%02d", lay);
503 m_hresAve[lay] = new TH1F(hname, "", 1000, -5, 5);
504 m_fdresAve ->
Add(m_hresAve[lay]);
505
506 for (lr=0; lr<2; lr++){
507 sprintf(hname,
"Reso%02dInc_lr%01d", lay, lr);
508
509 m_hreslrInc[lay][lr] = new TH1F(hname, "", 1000, -5, 5);
510 m_fdres->Add(m_hreslrInc[lay][lr]);
511
512 sprintf(hname,
"Reso%02dExc_lr%01d", lay, lr);
513
514 m_hreslrExc[lay][lr] = new TH1F(hname, "", 1000, -5, 5);
515 m_fdres->Add(m_hreslrExc[lay][lr]);
516
517 sprintf(hname,
"Reso%02d_lr%01d", lay, lr);
518
519 m_hreslrAve[lay][lr] = new TH1F(hname, "", 1000, -5, 5);
520 m_fdresAve->Add(m_hreslrAve[lay][lr]);
521 }
522 for(int phi=0; phi<20; phi++){
523 sprintf(hname,
"ResoPhi%02d_phi%02d", lay, phi);
524 m_hresphi[lay][phi] = new TH1F(hname, "", 200, -1, 1);
525 m_fdres->Add(m_hresphi[lay][phi]);
526 }
527 }
528
529
530 m_fdmomPhi = new TFolder("momPhi", "momPhi");
531 m_hlist ->
Add(m_fdmomPhi);
532
533 int thbin;
536 m_ppPhi[
bin] =
new TH1F(hname,
"", 400, 1.0, 2.5);
537 m_fdmomPhi->Add(m_ppPhi[
bin]);
538
540 m_pnPhi[
bin] =
new TH1F(hname,
"", 400, 1.0, 2.5);
541 m_fdmomPhi->Add(m_pnPhi[
bin]);
542
544 m_ppPhiCms[
bin] =
new TH1F(hname,
"", 400, 1.0, 2.5);
545 m_fdmomPhi->Add(m_ppPhiCms[
bin]);
546
548 m_pnPhiCms[
bin] =
new TH1F(hname,
"", 400, 1.0, 2.5);
549 m_fdmomPhi->Add(m_pnPhiCms[
bin]);
550
551 for(thbin=0; thbin<NThetaBin; thbin++){
552 sprintf(hname,
"hPpos_theta%02d_phi%02d", thbin,
bin);
553 m_ppThePhi[thbin][
bin] =
new TH1F(hname,
"", 400, 1.0, 2.5);
554 m_fdmomPhi->Add(m_ppThePhi[thbin][
bin]);
555
556 sprintf(hname,
"hPneg_theta%02d_phi%02d", thbin,
bin);
557 m_pnThePhi[thbin][
bin] =
new TH1F(hname,
"", 400, 1.0, 2.5);
558 m_fdmomPhi->Add(m_pnThePhi[thbin][
bin]);
559
560 sprintf(hname,
"hPposCms_theta%02d_phi%02d", thbin,
bin);
561 m_ppThePhiCms[thbin][
bin] =
new TH1F(hname,
"", 400, 1.0, 2.5);
562 m_fdmomPhi->Add(m_ppThePhiCms[thbin][
bin]);
563
564 sprintf(hname,
"hPnegCms_theta%02d_phi%02d", thbin,
bin);
565 m_pnThePhiCms[thbin][
bin] =
new TH1F(hname,
"", 400, 1.0, 2.5);
566 m_fdmomPhi->Add(m_pnThePhiCms[thbin][
bin]);
567 }
568 }
569 for(thbin=0; thbin<NThetaBin; thbin++){
570 sprintf(hname,
"hPpos_the%02d", thbin);
571 m_ppThe[thbin] = new TH1F(hname, "", 400, 1.0, 2.5);
572 m_fdmomPhi->Add(m_ppThe[thbin]);
573
574 sprintf(hname,
"hPneg_the%02d", thbin);
575 m_pnThe[thbin] = new TH1F(hname, "", 400, 1.0, 2.5);
576 m_fdmomPhi->Add(m_pnThe[thbin]);
577
578 sprintf(hname,
"hPposCms_the%02d", thbin);
579 m_ppTheCms[thbin] = new TH1F(hname, "", 400, 1.0, 2.5);
580 m_fdmomPhi->Add(m_ppTheCms[thbin]);
581
582 sprintf(hname,
"hPnegCms_the%02d", thbin);
583 m_pnTheCms[thbin] = new TH1F(hname, "", 400, 1.0, 2.5);
584 m_fdmomPhi->Add(m_pnTheCms[thbin]);
585 }
586
587
588 m_fdres2d = new TFolder("res2d", "res2d");
589 m_hlist ->
Add(m_fdres2d);
590
591 int hid = 0;
593 TH1F* hist;
594 for(lay=0; lay<m_nlayer; lay++){
596 for(lr=0; lr<2; lr++){
598 sprintf(hname,
"r2d%02d_%02d_%01d_%02dInc", lay, iEntr, lr,
bin);
599 hist = new TH1F(hname, "", 200, -1, 1);
600 m_hr2dInc.push_back(hist);
601 m_fdres2d ->
Add(hist);
602
603 sprintf(hname,
"r2d%02d_%02d_%01d_%02dExc", lay, iEntr, lr,
bin);
604 hist = new TH1F(hname, "", 200, -1, 1);
605 m_hr2dExc.push_back(hist);
606 m_fdres2d ->
Add(hist);
607
608 key = getHresId(lay, iEntr, lr,
bin);
610 hid++;
611 }
612 }
613 }
614 }
615
616 m_fdres2t = new TFolder("res2t", "res2t");
617
618
619 for(lay=0; lay<m_nlayer; lay++){
621 for(lr=0; lr<2; lr++){
623 sprintf(hname,
"r2t%02d_%02d_%01d_%02d", lay, iEntr, lr,
bin);
624 m_hr2t[lay][iEntr][lr][
bin] =
new TH1F(hname,
"", 600, -3, 3);
625 m_fdres2t ->
Add(m_hr2t[lay][iEntr][lr][
bin]);
626 }
627 }
628 }
629 }
630
632 Gaudi::svcLocator() -> service(
"NTupleSvc",
ntupleSvc);
633 for(lay=0; lay<m_nlayer; lay++){
634 sprintf(hname,
"FILE136/xt%02d", lay);
636 if ( nt ) m_xtTuple[lay] = nt;
637 else{
638 m_xtTuple[lay] =
ntupleSvc->book(hname, CLID_ColumnWiseTuple,
"MdcXtNtuple");
639 if( m_xtTuple[lay] ){
640 m_xtTuple[lay]->addItem("cel", m_cel[lay]);
641 m_xtTuple[lay]->addItem("lr", m_lr[lay]);
642 m_xtTuple[lay]->addItem("run", m_run[lay]);
643 m_xtTuple[lay]->addItem("evt", m_evt[lay]);
644 m_xtTuple[lay]->addItem("doca", m_doca[lay]);
645 m_xtTuple[lay]->addItem("dm", m_dm[lay]);
646 m_xtTuple[lay]->addItem("tdr", m_tdr[lay]);
647 m_xtTuple[lay]->addItem("tdc", m_tdc[lay]);
648 m_xtTuple[lay]->addItem("entr", m_entr[lay]);
649 m_xtTuple[lay]->addItem("zhit", m_zhit[lay]);
650 m_xtTuple[lay]->addItem("qhit", m_qhit[lay]);
651 m_xtTuple[lay]->addItem("p", m_p[lay]);
652 m_xtTuple[lay]->addItem("pt", m_pt[lay]);
653 m_xtTuple[lay]->addItem("phi0", m_phi0[lay]);
654 m_xtTuple[lay]->addItem("tanl", m_tanl[lay]);
655 m_xtTuple[lay]->addItem("hitphi", m_hitphi[lay]);
656 } else{
657 log << MSG::FATAL << "Cannot book Xt N-tuple:"
658 << long(m_xtTuple[lay]) << endreq;
659 }
660 }
661 }
662
664 sprintf(hname,
"FILE136/cosmic");
666 if ( nt ) m_cosmic = nt;
667 else{
668 m_cosmic =
ntupleSvc->book(hname, CLID_ColumnWiseTuple,
"MdcXtNtuple");
669 if( m_cosmic ){
670 m_cosmic->addItem("pUp", m_pUpcos);
671 m_cosmic->addItem("pDw", m_pDwcos);
672 m_cosmic->addItem("ptUp", m_ptUpcos);
673 m_cosmic->addItem("ptDw", m_ptDwcos);
674 m_cosmic->addItem("phiUp", m_phiUpcos);
675 m_cosmic->addItem("phiDw", m_phiDwcos);
676 m_cosmic->addItem("drUp", m_drUpcos);
677 m_cosmic->addItem("drDw", m_drDwcos);
678 m_cosmic->addItem("dzUp", m_dzUpcos);
679 m_cosmic->addItem("dzDw", m_dzDwcos);
680 m_cosmic->addItem("ctheUp", m_ctheUpcos);
681 m_cosmic->addItem("ctheDw", m_ctheDwcos);
682 m_cosmic->addItem("nhitUp", m_nhitUpcos);
683 m_cosmic->addItem("nhitDw", m_nhitDwcos);
684 m_cosmic->addItem("char", m_chargecos);
685 m_cosmic->addItem("tesfg", m_tesFlagcos);
686 m_cosmic->addItem("tes", m_tescos);
687 }
688 }
689 }
690}
map< int, int >::value_type valType3
virtual const MdcGeoWire *const Wire(unsigned id)=0
double Radius(void) const
HepPoint3D Forward(void) const
HepPoint3D Backward(void) const
sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=2", j, j)