45 #include "TPostScript.h"
72 static const int mapx1[6][3]={{1,4,8}, {12,7,3}, {5,9,13}, {11,6,2}, {16,15,14}, {19,18,17}};
74 static const int mapx2[6][3]={{1,4,8}, {12,7,3}, {5,9,13}, {11,6,2}, {16,15,14}, {-1,-1,-1}};
76 static const int mapx0p[9][2]={{3,1}, {7,4}, {6,5}, {12,8}, {0,0}, {11,9}, {16,13}, {15,14}, {19,17}};
77 static const int mapx0m[9][2]={{17,19}, {14,15}, {13,16}, {9,11}, {0,0}, {8,12}, {5,6}, {4,7}, {1,3}};
79 static const int etamap[4][21]={{-1, 0,3,1, 0,2,3, 1,0,2, -1, 3,1,2, 4,4,4, -1,-1,-1, -1},
80 {-1, 0,3,1, 0,2,3, 1,0,2, -1, 3,1,2, 4,4,4, 5,5,5, -1},
81 {-1, 0,-1,0, 1,2,2, 1,3,5, -1, 5,3,6, 7,7,6, 8,-1,8, -1},
82 {-1, 8,-1,8, 7,6,6, 7,5,3, -1, 3,5,2, 1,1,2, 0,-1,0, -1}};
84 static const int phimap[4][21] ={{-1, 0,2,2, 1,0,1, 1,2,1, -1, 0,0,2, 2,1,0, 2,1,0, -1},
85 {-1, 0,2,2, 1,0,1, 1,2,1, -1, 0,0,2, 2,1,0, 2,1,0, -1},
86 {-1, 1,-1,0, 1,1,0, 0,1,1, -1, 0,0,1, 1,0,0, 1,-1,0, -1},
87 {-1, 0,-1,1, 0,0,1, 1,0,0, -1, 1,1,0, 0,1,1, 0,-1,1, -1}};
90 static const int npixleft[21]={0, 0, 1, 2, 0, 4, 5, 6, 0, 8, 0, 0,11, 0,13,14,15, 0,17,18,0};
91 static const int npixrigh[21]={0, 2, 3, 0, 5, 6, 7, 0, 9, 0, 0,12, 0,14,15,16, 0,18,19, 0,0};
92 static const int npixlebt[21]={0, 0, 0, 0, 0, 1, 2, 3, 0, 4, 0, 6, 7, 8, 9, 0,11,13,14,15,0};
93 static const int npixribt[21]={0, 0, 0, 0, 1, 2, 3, 0, 4, 5, 0, 7, 0, 9, 0,11,12,14,15,16,0};
94 static const int npixleup[21]={0, 4, 5, 6, 8, 9, 0,11, 0,13, 0,15,16, 0,17,18,19, 0, 0, 0,0};
95 static const int npixriup[21]={0, 5, 6, 7, 9, 0,11,12,13,14, 0,16, 0,17,18,19, 0, 0, 0, 0,0};
113 Double_t
gausX(Double_t*
x, Double_t* par){
114 return par[0]*(TMath::Gaus(x[0], par[1], par[2], kTRUE));
131 Double_t invsq2pi = 0.3989422804014;
132 Double_t mpshift = -0.22278298;
149 mpc = par[1] - mpshift * par[0]*par[1];
152 xlow = x[0] - sc * par[3];
153 xupp = x[0] + sc * par[3];
155 step = (xupp-xlow) / np;
158 for(i=1.0; i<=np/2; i++) {
159 xx = xlow + (i-.5) *
step;
160 fland = TMath::Landau(xx,mpc,par[0]*par[1], kTRUE);
161 sum += fland * TMath::Gaus(x[0],xx,par[3]);
162 xx = xupp - (i-.5) *
step;
163 fland = TMath::Landau(xx,mpc,par[0]*par[1], kTRUE);
164 sum += fland * TMath::Gaus(x[0],xx,par[3]);
167 return (par[2] * step * sum * invsq2pi / par[3]);
174 void fcnbg(Int_t &npar, Double_t* gin, Double_t &
f, Double_t* par, Int_t
flag) {
176 double fval = -par[0];
179 fval +=
log(
max(1.
e-30,par[0]*TMath::Gaus(xval, par[1], par[2], 1)));
185 void fcnsg(Int_t &npar, Double_t* gin, Double_t &
f, Double_t* par, Int_t
flag) {
188 double fval = -(par[0]+par[5]);
228 virtual void endJob() ;
249 static const int ncut = 13;
250 static const int mypow_2_ncut = 8192;
349 static const int ringmx=5;
350 static const int sectmx=12;
351 static const int routmx=36;
352 static const int rout12mx=24;
353 static const int neffip=6;
356 TProfile* com_hotime[ringmx][sectmx];
357 TProfile* com_hopedtime[ringmx][sectmx];
360 TProfile* com_hbtime[ringmx][sectmx];
363 TH1F* com_corrsglb[ringmx][sectmx];
364 TH1F* com_corrsgrb[ringmx][sectmx];
365 TH1F* com_corrsglu[ringmx][sectmx];
366 TH1F* com_corrsgru[ringmx][sectmx];
367 TH1F* com_corrsgall[ringmx][sectmx];
369 TH1F* com_corrsgl[ringmx][sectmx];
370 TH1F* com_corrsgr[ringmx][sectmx];
373 TH1F* com_corrsgc[ringmx][sectmx];
376 TH1F* com_sigrsg[ringmx][routmx+1];
377 TH1F* com_crossg[ringmx][routmx+1];
378 float com_invang[ringmx][routmx+1];
410 TH1F* const_hpdrm[ringmx];
413 TH1F* peak_hpdrm[ringmx];
419 TH2F* sig_effi[neffip];
425 TProfile* sigvsevt[15][ncut];
429 int irun, ievt, itrg1, itrg2, isect, ndof,
nmuon;
430 float trkdr, trkdz, trkvx, trkvy,
trkvz, trkmm, trkth, trkph, chisq, therr, pherr, hodx, hody,
431 hoang, htime, hosig[9], hocorsig[18], hocro, hbhesig[9], caloen[3];
487 theFile =
new TFile(theRootFileName.c_str(),
"RECREATE");
490 T1 =
new TTree(
"T1",
"DT+CSC+HO");
492 T1->Branch(
"irun",&irun,
"irun/I");
493 T1->Branch(
"ievt",&ievt,
"ievt/I");
494 T1->Branch(
"itrg1",&itrg1,
"itrg1/I");
495 T1->Branch(
"itrg2",&itrg2,
"itrg2/I");
497 T1->Branch(
"isect",&isect,
"isect/I");
499 T1->Branch(
"ndof",&ndof,
"ndof/I");
500 T1->Branch(
"nmuon",&nmuon,
"nmuon/I");
502 T1->Branch(
"trkdr",&trkdr,
"trkdr/F");
503 T1->Branch(
"trkdz",&trkdz,
"trkdz/F");
505 T1->Branch(
"trkvx",&trkvx,
"trkvx/F");
506 T1->Branch(
"trkvy",&trkvy,
"trkvy/F");
507 T1->Branch(
"trkvz",&trkvz,
"trkvz/F");
508 T1->Branch(
"trkmm",&trkmm,
"trkmm/F");
509 T1->Branch(
"trkth",&trkth,
"trkth/F");
510 T1->Branch(
"trkph",&trkph,
"trkph/F");
512 T1->Branch(
"chisq",&chisq,
"chisq/F");
513 T1->Branch(
"therr",&therr,
"therr/F");
514 T1->Branch(
"pherr",&pherr,
"pherr/F");
515 T1->Branch(
"hodx",&hodx,
"hodx/F");
516 T1->Branch(
"hody",&hody,
"hody/F");
517 T1->Branch(
"hoang",&hoang,
"hoang/F");
519 T1->Branch(
"htime",&htime,
"htime/F");
520 T1->Branch(
"hosig",hosig,
"hosig[9]/F");
521 T1->Branch(
"hocro",&hocro,
"hocro/F");
522 T1->Branch(
"hocorsig",hocorsig,
"hocorsig[18]/F");
523 T1->Branch(
"caloen",caloen,
"caloen[3]/F");
526 T1->Branch(
"hbhesig",hbhesig,
"hbhesig[9]/F");
529 muonnm = fs->
make<TH1F>(
"muonnm",
"No of muon", 10, -0.5, 9.5);
530 muonmm = fs->
make<TH1F>(
"muonmm",
"P_{mu}", 200, -100., 100.);
531 muonth = fs->
make<TH1F>(
"muonth",
"{Theta}_{mu}", 180, 0., 180.);
532 muonph = fs->
make<TH1F>(
"muonph",
"{Phi}_{mu}", 180, -180., 180.);
533 muonch = fs->
make<TH1F>(
"muonch",
"{chi^2}/ndf", 100, 0., 1000.);
535 sel_muonnm = fs->
make<TH1F>(
"sel_muonnm",
"No of muon(sel)", 10, -0.5, 9.5);
536 sel_muonmm = fs->
make<TH1F>(
"sel_muonmm",
"P_{mu}(sel)", 200, -100., 100.);
537 sel_muonth = fs->
make<TH1F>(
"sel_muonth",
"{Theta}_{mu}(sel)", 180, 0., 180.);
538 sel_muonph = fs->
make<TH1F>(
"sel_muonph",
"{Phi}_{mu}(sel)", 180, -180., 180.);
539 sel_muonch = fs->
make<TH1F>(
"sel_muonch",
"{chi^2}/ndf(sel)", 100, 0., 1000.);
546 if (m_digiInput) {alow = -10.0; ahigh = 40.;}
548 float tmpwid = (ahigh-alow)/nbin;
549 nbn = int(-alow/tmpwid)+1;
551 if (nbn>nbin) nbn = nbin;
556 cout <<
"nbin "<< nbin<<
" "<<alow<<
" "<<ahigh<<
" "<<tmpwid<<
" "<<nbn<<endl;
558 for (
int i=0;
i<15;
i++) {
560 sprintf(title,
"sigvsndof_ring%i",
i+1);
561 sigvsevt[
i][0] = fs->
make<TProfile>(
title,
title, 50, 0., 50.,-9., 20.);
563 sprintf(title,
"sigvschisq_ring%i",
i+1);
564 sigvsevt[
i][1] = fs->
make<TProfile>(
title,
title, 50, 0., 30.,-9., 20.);
566 sprintf(title,
"sigvsth_ring%i",
i+1);
567 sigvsevt[
i][2] = fs->
make<TProfile>(
title,
title, 50, .7, 2.4,-9., 20.);
569 sprintf(title,
"sigvsph_ring%i",
i+1);
570 sigvsevt[
i][3] = fs->
make<TProfile>(
title,
title, 50, -2.4, -0.7,-9., 20.);
572 sprintf(title,
"sigvstherr_ring%i",
i+1);
573 sigvsevt[
i][4] = fs->
make<TProfile>(
title,
title, 50, 0., 0.2,-9., 20.);
575 sprintf(title,
"sigvspherr_ring%i",
i+1);
576 sigvsevt[
i][5] = fs->
make<TProfile>(
title,
title, 50, 0., 0.2,-9., 20.);
578 sprintf(title,
"sigvsdircos_ring%i",
i+1);
579 sigvsevt[
i][6] = fs->
make<TProfile>(
title,
title, 50, 0.5, 1.,-9., 20.);
581 sprintf(title,
"sigvstrkmm_ring%i",
i+1);
582 sigvsevt[
i][7] = fs->
make<TProfile>(
title,
title, 50, 0., 50.,-9., 20.);
584 sprintf(title,
"sigvsnmuon_ring%i",
i+1);
585 sigvsevt[
i][8] = fs->
make<TProfile>(
title,
title, 5, 0.5, 5.5,-9., 20.);
587 sprintf(title,
"sigvserr_ring%i",
i+1);
588 sigvsevt[
i][9] = fs->
make<TProfile>(
title,
title, 50, 0., .3, -9., 20.);
590 sprintf(title,
"sigvsaccx_ring%i",
i+1);
591 sigvsevt[
i][10] = fs->
make<TProfile>(
title,
title, 100, -25., 25., -9., 20.);
593 sprintf(title,
"sigvsaccy_ring%i",
i+1);
594 sigvsevt[
i][11] = fs->
make<TProfile>(
title,
title, 100, -25., 25., -9., 20.);
596 sprintf(title,
"sigvscalo_ring%i",
i+1);
597 sigvsevt[
i][12] = fs->
make<TProfile>(
title,
title, 100, 0., 15., -9., 20.);
601 int ieta = (
j<15) ?
j+1 : 14-
j;
604 sprintf(title,
"sig_eta%i_allphi", ieta);
606 sprintf(title,
"sig_eta%i_phi%i", ieta,
i+1);
610 sprintf(title,
"ped_eta%i_allphi", ieta);
612 sprintf(title,
"ped_eta%i_phi%i", ieta,
i+1);
619 sprintf(title,
"hotime_eta%i_phi%i", (
j<=14) ?
j+1 : 14-
j,
i+1);
622 sprintf(title,
"hopedtime_eta%i_phi%i", (
j<=14) ?
j+1 : 14-
j,
i+1);
623 hopedtime[
j][
i] = fs->
make<TProfile>(
title,
title, 10, -0.5, 9.5, -1.0, 30.0);
627 sprintf(title,
"hbtime_eta%i_phi%i", (
j<=15) ?
j+1 : 15-
j,
i+1);
632 sprintf(title,
"corrsg_eta%i_phi%i_leftbottom", ieta,
i+1);
635 sprintf(title,
"corrsg_eta%i_phi%i_rightbottom", ieta,
i+1);
638 sprintf(title,
"corrsg_eta%i_phi%i_leftup", ieta,
i+1);
641 sprintf(title,
"corrsg_eta%i_phi%i_rightup", ieta,
i+1);
644 sprintf(title,
"corrsg_eta%i_phi%i_all", ieta,
i+1);
647 sprintf(title,
"corrsg_eta%i_phi%i_left", ieta,
i+1);
650 sprintf(title,
"corrsg_eta%i_phi%i_right", ieta,
i+1);
654 sprintf(title,
"corrsg_eta%i_phi%i_centrl", ieta,
i+1);
660 mnsigrsg = fs->
make<TH1F>(
"mnsigrsg",
"mnsigrsg", netamx*
nphimx+ringmx*routmx, -0.5, netamx*
nphimx+ringmx*routmx -0.5);
661 rmssigrsg = fs->
make<TH1F>(
"rmssigrsg",
"rmssigrsg", netamx*
nphimx+ringmx*routmx, -0.5, netamx*
nphimx+ringmx*routmx -0.5);
662 nevsigrsg = fs->
make<TH1F>(
"nevsigrsg",
"nevsigrsg", netamx*
nphimx+ringmx*routmx, -0.5, netamx*
nphimx+ringmx*routmx -0.5);
664 mncrossg = fs->
make<TH1F>(
"mncrossg",
"mncrossg", netamx*
nphimx+ringmx*routmx, -0.5, netamx*
nphimx+ringmx*routmx -0.5);
665 rmscrossg = fs->
make<TH1F>(
"rmscrossg",
"rmscrossg", netamx*
nphimx+ringmx*routmx, -0.5, netamx*
nphimx+ringmx*routmx -0.5);
666 nevcrossg = fs->
make<TH1F>(
"nevcrossg",
"nevcrossg", netamx*
nphimx+ringmx*routmx, -0.5, netamx*
nphimx+ringmx*routmx -0.5);
669 for (
int i=0;
i<neffip;
i++) {
671 sprintf(title,
"Total projected muon in tower");
672 sprintf(name,
"total_evt");
674 sprintf(title,
"Efficiency with sig >%i #sigma",
i);
675 sprintf(name,
"Effi_with_gt%i_sig",
i);
680 sprintf(title,
"Mean Energy of all towers");
681 sprintf(name,
"mean_energy");
685 mncorrsglb = fs->
make<TH1F>(
"mncorrsglb",
"mncorrsglb", netamx*
nphimx+60, -0.5, netamx*nphimx+59.5);
686 rmscorrsglb = fs->
make<TH1F>(
"rmscorrsglb",
"rmscorrsglb", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
687 nevcorrsglb = fs->
make<TH1F>(
"nevcorrsglb",
"nevcorrsglb", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
689 mncorrsgrb = fs->
make<TH1F>(
"mncorrsgrb",
"mncorrsgrb", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
690 rmscorrsgrb = fs->
make<TH1F>(
"rmscorrsgrb",
"rmscorrsgrb", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
691 nevcorrsgrb = fs->
make<TH1F>(
"nevcorrsgrb",
"nevcorrsgrb", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
693 mncorrsglu = fs->
make<TH1F>(
"mncorrsglu",
"mncorrsglu", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
694 rmscorrsglu = fs->
make<TH1F>(
"rmscorrsglu",
"rmscorrsglu", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
695 nevcorrsglu = fs->
make<TH1F>(
"nevcorrsglu",
"nevcorrsglu", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
697 mncorrsgru = fs->
make<TH1F>(
"mncorrsgru",
"mncorrsgru", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
698 rmscorrsgru = fs->
make<TH1F>(
"rmscorrsgru",
"rmscorrsgru", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
699 nevcorrsgru = fs->
make<TH1F>(
"nevcorrsgru",
"nevcorrsgru", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
701 mncorrsgall = fs->
make<TH1F>(
"mncorrsgall",
"mncorrsgall", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
702 rmscorrsgall = fs->
make<TH1F>(
"rmscorrsgall",
"rmscorrsgall", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
703 nevcorrsgall = fs->
make<TH1F>(
"nevcorrsgall",
"nevcorrsgall", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
705 mncorrsgl = fs->
make<TH1F>(
"mncorrsgl",
"mncorrsgl", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
706 rmscorrsgl = fs->
make<TH1F>(
"rmscorrsgl",
"rmscorrsgl", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
707 nevcorrsgl = fs->
make<TH1F>(
"nevcorrsgl",
"nevcorrsgl", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
709 mncorrsgr = fs->
make<TH1F>(
"mncorrsgr",
"mncorrsgr", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
710 rmscorrsgr = fs->
make<TH1F>(
"rmscorrsgr",
"rmscorrsgr", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
711 nevcorrsgr = fs->
make<TH1F>(
"nevcorrsgr",
"nevcorrsgr", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
715 mncorrsgc = fs->
make<TH1F>(
"mncorrsgc",
"mncorrsgc", netamx*
nphimx+60, -0.5, netamx*nphimx+59.5);
716 rmscorrsgc = fs->
make<TH1F>(
"rmscorrsgc",
"rmscorrsgc", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
717 nevcorrsgc = fs->
make<TH1F>(
"nevcorrsgc",
"nevcorrsgc", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
721 for (
int j=0;
j<ringmx;
j++) {
723 for (
int i=0;
i<routmx+1;
i++) {
724 if (
j!=2 &&
i>rout12mx)
continue;
727 if (
j==2) {phmn = 2*
i-1; phmx=2*
i;}
728 if (phmn <=0) phmn =
nphimx+phmn;
729 if (phmx <=0) phmx =
nphimx+phmx;
731 if ((
j==2 &&
i==routmx) || (
j!=2 &&
i==rout12mx)) {
732 sprintf(title,
"sig_ring%i_allrm",
j-2);
733 sprintf(name,
"sig_ring%i_allrm",
j-2);
735 sprintf(title,
"sig_ring%i_phi%i-%i",
j-2,phmn,phmx);
736 sprintf(name,
"sig_ring%i_rout%i",
j-2,
i+1);
739 if ((
j==2 &&
i==routmx) || (
j!=2 &&
i==rout12mx)) {
740 sprintf(title,
"ped_ring%i_allrm",
j-2);
741 sprintf(name,
"ped_ring%i_allrm",
j-2);
743 sprintf(title,
"ped_ring%i_phi%i-%i",
j-2,phmn, phmx);
744 sprintf(name,
"ped_ring%i_rout%i",
j-2,
i+1);
749 for (
int i=0;
i<sectmx;
i++) {
751 sprintf(title,
"com_hotime_ring%i_sect%i",
j-2,
i+1);
752 com_hotime[
j][
i] = fs->
make<TProfile>(
title,
title, 10, -0.5, 9.5, -1.0, 30.0);
754 sprintf(title,
"com_hopedtime_ring%i_sect%i",
j-2,
i+1);
755 com_hopedtime[
j][
i] = fs->
make<TProfile>(
title,
title, 10, -0.5, 9.5, -1.0, 30.0);
758 sprintf(title,
"_com_hbtime_ring%i_serrct%i",
j-2,
i+1);
759 com_hbtime[
j][
i] = fs->
make<TProfile>(
title,
title, 10, -0.5, 9.5, -1.0, 30.0);
763 sprintf(title,
"com_corrsg_ring%i_sect%i_leftbottom",
j-2,
i+1);
766 sprintf(title,
"com_corrsg_ring%i_sect%i_rightbottom",
j-2,
i+1);
769 sprintf(title,
"com_corrsg_ring%i_sect%i_leftup",
j-2,
i+1);
772 sprintf(title,
"com_corrsg_ring%i_sect%i_rightup",
j-2,
i+1);
775 sprintf(title,
"com_corrsg_ring%i_sect%i_all",
j-2,
i+1);
778 sprintf(title,
"com_corrsg_ring%i_sect%i_left",
j-2,
i+1);
781 sprintf(title,
"com_corrsg_ring%i_sect%i_right",
j-2,
i+1);
786 sprintf(title,
"com_corrsg_ring%i_sect%i_centrl",
j-2,
i+1);
793 for (
int i=-1;
i<=1;
i++) {
794 for (
int j=-1;
j<=1;
j++) {
797 sprintf(title,
"hosct2p_eta%i_phi%i",
i,
j);
800 sprintf(title,
"hosct1p_eta%i_phi%i",
i,
j);
803 sprintf(title,
"hosct00_eta%i_phi%i",
i,
j);
806 sprintf(title,
"hosct1m_eta%i_phi%i",
i,
j);
809 sprintf(title,
"hosct2m_eta%i_phi%i",
i,
j);
813 sprintf(title,
"hbhesig_eta%i_phi%i",
i,
j);
820 ped_evt = fs->
make<TH1F>(
"ped_evt",
"ped_evt", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
821 ped_mean = fs->
make<TH1F>(
"ped_mean",
"ped_mean", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
822 ped_width = fs->
make<TH1F>(
"ped_width",
"ped_width", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
824 fit_chi = fs->
make<TH1F>(
"fit_chi",
"fit_chi", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
825 sig_evt = fs->
make<TH1F>(
"sig_evt",
"sig_evt", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
826 fit_sigevt = fs->
make<TH1F>(
"fit_sigevt",
"fit_sigevt", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
827 fit_bkgevt = fs->
make<TH1F>(
"fit_bkgevt",
"fit_bkgevt", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
828 sig_mean = fs->
make<TH1F>(
"sig_mean",
"sig_mean", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
829 sig_diff = fs->
make<TH1F>(
"sig_diff",
"sig_diff", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
830 sig_width = fs->
make<TH1F>(
"sig_width",
"sig_width", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
831 sig_sigma = fs->
make<TH1F>(
"sig_sigma",
"sig_sigma", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
832 sig_meanerr = fs->
make<TH1F>(
"sig_meanerr",
"sig_meanerr", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
833 sig_meanerrp = fs->
make<TH1F>(
"sig_meanerrp",
"sig_meanerrp", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
834 sig_signf = fs->
make<TH1F>(
"sig_signf",
"sig_signf", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
836 ped_statmean = fs->
make<TH1F>(
"ped_statmean",
"ped_statmean", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
837 sig_statmean = fs->
make<TH1F>(
"sig_statmean",
"sig_statmean", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
838 ped_rms = fs->
make<TH1F>(
"ped_rms",
"ped_rms", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
839 sig_rms = fs->
make<TH1F>(
"sig_rms",
"sig_rms", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
841 const_eta_phi = fs->
make<TH2F>(
"const_eta_phi",
"const_eta_phi", netamx+1, -(netamx+1)/2., (netamx+1)/2.,
nphimx, 0.5, nphimx+0.5);
843 for (
int ij=0; ij<
netamx; ij++) {
844 int ieta = (ij<15) ? ij+1 : 14-ij;
845 sprintf(title,
"Cont_Eta_%i", ieta);
848 sprintf(title,
"Peak_Eta_%i", ieta);
852 for (
int ij=0; ij<ringmx; ij++) {
854 int iread = (ij==2) ? routmx : rout12mx;
855 sprintf(title,
"Cont_hpdrm_%i", iring);
856 const_hpdrm[ij] = fs->
make<TH1F>(
title,
title, iread, 0.5, iread+0.5);
858 sprintf(title,
"Peak_hpdrm_%i", iring);
859 peak_hpdrm[ij] = fs->
make<TH1F>(
title,
title, iread, 0.5, iread+0.5);
862 mean_phi_hst = fs->
make<TH1F>(
"mean_phi_hst",
"mean_phi_hst", netamx+1, -(netamx+1)/2., (netamx+1)/2.);
863 mean_phi_ave = fs->
make<TH1F>(
"mean_phi_ave",
"mean_phi_ave", netamx+1, -(netamx+1)/2., (netamx+1)/2.);
865 mean_eta_ave = fs->
make<TH1F>(
"mean_eta_ave",
"mean_eta_ave",
nphimx, 0.5, nphimx+0.5);
869 for (
int ij=0; ij<
netamx; ij++) {
870 int ieta = (ij<15) ? ij+1 : 14-ij;
872 sprintf(title,
"Stat_Eta_%i", ieta);
875 sprintf(title,
"#mu(stat)_Eta_%i", ieta);
884 for (
int j=0;
j<ringmx;
j++) {
885 for (
int i=0;
i<routmx+1;
i++) {
886 com_invang[
j][
i] = 0.0;
902 cout <<
" Selected events # is "<<ipass<<endl;
927 int mypow_2_10 = 1024;
928 int mypow_2_11 = 2048;
929 int mypow_2_12 = 4096;
990 float pival = acos(-1.);
991 irunold = irun = iEvent.
id().
run();
1004 if (isCosMu && (*HOCalib).size() >0 ) {
1005 nmuon = (*HOCalib).size();
1006 if (Nevents%5000==1)
cout <<
"nmuon event # "<<Nevents<<
" Run # "<<iEvent.id().run()<<
" Evt # "<<iEvent.id().event()<<
" "<<nmuon<<endl;
1008 for (HOCalibVariableCollection::const_iterator hoC=(*HOCalib).begin(); hoC!=(*HOCalib).end(); hoC++){
1009 itrg1 = (*hoC).trig1;
1010 itrg2 = (*hoC).trig2;
1012 trkdr = (*hoC).trkdr;
1013 trkdz = (*hoC).trkdz;
1015 trkvx = (*hoC).trkvx;
1016 trkvy = (*hoC).trkvy;
1017 trkvz = (*hoC).trkvz;
1019 trkmm = (*hoC).trkmm;
1020 trkth = (*hoC).trkth;
1021 trkph = (*hoC).trkph;
1023 ndof = (int)(*hoC).ndof;
1025 chisq = (*hoC).chisq;
1027 therr = (*hoC).therr;
1028 pherr = (*hoC).pherr;
1029 trkph = (*hoC).trkph;
1031 isect = (*hoC).isect;
1034 hoang = (*hoC).hoang;
1035 htime = (*hoC).htime;
1036 for (
int i=0;
i<9;
i++) { hosig[
i] = (*hoC).hosig[
i];}
1037 for (
int i=0;
i<18;
i++) { hocorsig[
i] = (*hoC).hocorsig[
i];}
1038 hocro = (*hoC).hocro;
1039 for (
int i=0;
i<3;
i++) { caloen[
i] = (*hoC).caloen[
i];}
1041 if (m_hbinfo) {
for (
int i=0;
i<9;
i++) { hbhesig[
i] = (*hoC).hbhesig[
i];}}
1060 if (ndof >=15 && chisq <30) iselect3 = 1;
1062 if (isect <0)
continue;
1063 if (fabs(trkth-pival/2)<0.000001)
continue;
1065 int ieta = int((
abs(isect)%10000)/100.)-30;
1066 if (
abs(ieta)>=16)
continue;
1067 int iphi =
abs(isect)%100;
1069 int tmpsect = int((iphi + 1)/6.) + 1;
1070 if (tmpsect >12) tmpsect = 1;
1073 int tmpeta = ieta + 4;
1074 if (ieta >=-15 && ieta <=-11) {iring = -2; tmpeta =-11-ieta; }
1075 if (ieta >=-10 && ieta <=-5) {iring = -1; tmpeta =-5-ieta; }
1076 if (ieta >= 5 && ieta <= 10) {iring = 1; tmpeta =ieta-5; }
1077 if (ieta >= 11 && ieta <= 15) {iring = 2; tmpeta =ieta-11;}
1079 int iring2 = iring + 2;
1081 int tmprout = int((iphi + 1)/3.) + 1;
1082 int tmproutmx =routmx;
1084 tmprout = int((iphi + 1)/2.) + 1;
1085 if (tmprout >routmx) tmprout = 1;
1087 if (tmprout >rout12mx) tmprout = 1;
1088 tmproutmx =rout12mx;
1094 if (
abs(ndof) >=20 &&
abs(ndof) <40) {ips0 = (int)mypow_2_0; ipsall += ips0;}
1095 if (chisq >0 && chisq<15) {ips1 = (int)mypow_2_1; ipsall +=ips1;}
1096 if (fabs(trkth-pival/2) <21.5) {ips2 = (int)mypow_2_2; ipsall +=ips2;}
1097 if (fabs(trkph+pival/2) <21.5) {ips3 = (int)mypow_2_3; ipsall +=ips3;}
1099 if (therr <0.02) {ips4 = (int)mypow_2_4; ipsall +=ips4;}
1100 if (pherr <0.0002) {ips5 = (int)mypow_2_5; ipsall +=ips5;}
1101 if (fabs(hoang) >0.30) {ips6 = (int)mypow_2_6; ipsall +=ips6;}
1102 if (fabs(trkmm) >0.100) {ips7 = (int)mypow_2_7; ipsall +=ips7;}
1104 if (nmuon >=1 && nmuon <=4) {ips8 = (int)mypow_2_8; ipsall +=ips8;}
1107 if (fabs(hodx)<100 && fabs(hodx)>2 && fabs(hocorsig[8]) <40 && fabs(hocorsig[8]) >2 )
1108 {ips10=(int)mypow_2_10;ipsall +=ips10;}
1110 if (fabs(hody)<100 && fabs(hody)>2 && fabs(hocorsig[9]) <40 && fabs(hocorsig[9]) >2 )
1111 {ips11=(int)mypow_2_11;ipsall +=ips11;}
1114 if (fabs(hodx)<100 && fabs(hodx)>2 )
1115 {ips10=(int)mypow_2_10;ipsall +=ips10;}
1117 if (fabs(hody)<100 && fabs(hody)>2)
1118 {ips11=(int)mypow_2_11;ipsall +=ips11;}
1120 if (caloen[0] ==0) { ips12=(int)mypow_2_12;ipsall +=ips12;}
1123 if (
abs(ndof) >=20 &&
abs(ndof) <40) {ips0 = (int)mypow_2_0; ipsall += ips0;}
1124 if (chisq >0 && chisq<15) {ips1 = (int)mypow_2_1; ipsall +=ips1;}
1125 if (fabs(trkth-pival/2) <21.5) {ips2 = (int)mypow_2_2; ipsall +=ips2;}
1126 if (fabs(trkph+pival/2) <21.5) {ips3 = (int)mypow_2_3; ipsall +=ips3;}
1128 if (therr <0.02) {ips4 = (int)mypow_2_4; ipsall +=ips4;}
1129 if (pherr <0.0002) {ips5 = (int)mypow_2_5; ipsall +=ips5;}
1130 if (fabs(hoang) >0.30) {ips6 = (int)mypow_2_6; ipsall +=ips6;}
1131 if (fabs(trkmm) >4.0) {ips7 = (int)mypow_2_7; ipsall +=ips7;}
1132 if (nmuon >=1 && nmuon <=2) {ips8 = (int)mypow_2_8; ipsall +=ips8;}
1135 if (fabs(hodx)<100 && fabs(hodx)>2 && fabs(hocorsig[8]) <40 && fabs(hocorsig[8]) >2 )
1136 {ips10=(int)mypow_2_10;ipsall +=ips10;}
1138 if (fabs(hody)<100 && fabs(hody)>2 && fabs(hocorsig[9]) <40 && fabs(hocorsig[9]) >2 )
1139 {ips11=(int)mypow_2_11;ipsall +=ips11;}
1142 if (fabs(hodx)<100 && fabs(hodx)>2 )
1143 {ips10=(int)mypow_2_10;ipsall +=ips10;}
1145 if (fabs(hody)<100 && fabs(hody)>2)
1146 {ips11=(int)mypow_2_11;ipsall +=ips11;}
1149 if (ndof >0 && caloen[0]<5.0) {ips12=(int)mypow_2_12;ipsall +=ips12;}
1154 if (htime >2.5 && htime <6.5) {ips9=(int)mypow_2_9;ipsall +=ips9;}
1156 if (htime >-40 && htime <60) {ips9=(int)mypow_2_9;ipsall +=ips9;}
1159 if (ipsall-ips0==mypow_2_ncut-mypow_2_0-1) sigvsevt[iring2][0]->Fill(
abs(ndof), hosig[4]);
1160 if (ipsall-ips1==mypow_2_ncut-mypow_2_1-1) sigvsevt[iring2][1]->Fill(chisq, hosig[4]);
1161 if (ipsall-ips2==mypow_2_ncut-mypow_2_2-1) sigvsevt[iring2][2]->Fill(trkth, hosig[4]);
1162 if (ipsall-ips3==mypow_2_ncut-mypow_2_3-1) sigvsevt[iring2][3]->Fill(trkph, hosig[4]);
1163 if (ipsall-ips4==mypow_2_ncut-mypow_2_4-1) sigvsevt[iring2][4]->Fill(therr, hosig[4]);
1164 if (ipsall-ips5==mypow_2_ncut-mypow_2_5-1) sigvsevt[iring2][5]->Fill(pherr, hosig[4]);
1165 if (ipsall-ips6==mypow_2_ncut-mypow_2_6-1) sigvsevt[iring2][6]->Fill(hoang, hosig[4]);
1166 if (ipsall-ips7==mypow_2_ncut-mypow_2_7-1) sigvsevt[iring2][7]->Fill(fabs(trkmm), hosig[4]);
1167 if (ipsall-ips8==mypow_2_ncut-mypow_2_8-1) sigvsevt[iring2][8]->Fill(nmuon, hosig[4]);
1168 if (ipsall-ips9==mypow_2_ncut-mypow_2_9-1) sigvsevt[iring2][9]->Fill(htime, hosig[4]);
1169 if (ipsall-ips10==mypow_2_ncut-mypow_2_10-1) sigvsevt[iring2][10]->Fill(hodx, hosig[4]);
1170 if (ipsall-ips11==mypow_2_ncut-mypow_2_11-1) sigvsevt[iring2][11]->Fill(hody, hosig[4]);
1172 if (ipsall-ips12==mypow_2_ncut-mypow_2_12-1) sigvsevt[iring2][12]->Fill(caloen[0], hosig[4]);
1175 sigvsevt[iring2+5][0]->Fill(
abs(ndof), hosig[4]);
1177 sigvsevt[iring2+5][1]->Fill(chisq, hosig[4]);
1179 sigvsevt[iring2+5][2]->Fill(trkth, hosig[4]);
1181 sigvsevt[iring2+5][3]->Fill(trkph, hosig[4]);
1183 sigvsevt[iring2+5][4]->Fill(therr, hosig[4]);
1185 sigvsevt[iring2+5][5]->Fill(pherr, hosig[4]);
1187 sigvsevt[iring2+5][6]->Fill(hoang, hosig[4]);
1189 sigvsevt[iring2+5][7]->Fill(fabs(trkmm), hosig[4]);
1191 sigvsevt[iring2+5][8]->Fill(nmuon, hosig[4]);
1193 sigvsevt[iring2+5][9]->Fill(htime, hosig[4]);
1195 sigvsevt[iring2+5][10]->Fill(hodx, hosig[4]);
1197 sigvsevt[iring2+5][11]->Fill(hody, hosig[4]);
1199 if (!m_cosmic) sigvsevt[iring2+5][12]->Fill(caloen[0], hosig[4]);
1213 sigvsevt[iring2+10][0]->Fill(
abs(ndof), hosig[4]);
1214 sigvsevt[iring2+10][1]->Fill(chisq, hosig[4]);
1215 sigvsevt[iring2+10][2]->Fill(trkth, hosig[4]);
1216 sigvsevt[iring2+10][3]->Fill(trkph, hosig[4]);
1217 sigvsevt[iring2+10][4]->Fill(therr, hosig[4]);
1218 sigvsevt[iring2+10][5]->Fill(pherr, hosig[4]);
1219 sigvsevt[iring2+10][6]->Fill(hoang, hosig[4]);
1220 sigvsevt[iring2+10][7]->Fill(fabs(trkmm), hosig[4]);
1221 sigvsevt[iring2+10][8]->Fill(nmuon, hosig[4]);
1222 sigvsevt[iring2+10][9]->Fill(htime, hosig[4]);
1223 sigvsevt[iring2+10][10]->Fill(hodx, hosig[4]);
1224 sigvsevt[iring2+10][11]->Fill(hody, hosig[4]);
1225 if (!m_cosmic) sigvsevt[iring2+10][12]->Fill(caloen[0], hosig[4]);
1227 int iselect = (ipsall == mypow_2_ncut - 1) ? 1 : 0;
1229 if (hocro !=-100.0 && hocro <-50.0) hocro +=100.;
1231 muonnm->Fill(nmuon);
1232 muonmm->Fill(trkmm);
1233 muonth->Fill(trkth*180/pival);
1234 muonph->Fill(trkph*180/pival);
1235 muonch->Fill(chisq);
1239 sel_muonnm->Fill(nmuon);
1240 sel_muonmm->Fill(trkmm);
1241 sel_muonth->Fill(trkth*180/pival);
1242 sel_muonph->Fill(trkph*180/pival);
1243 sel_muonch->Fill(chisq);
1246 if (iselect3) T1->Fill();
1248 int tmpphi = (iphi + 1)%3;
1255 tmpphi = (iphi+1)%2;
1256 if (tmpsect==2 || tmpsect==3 || tmpsect==6 || tmpsect==7 || tmpsect==10 || tmpsect==11) {
1257 npixel =
mapx0p[tmpeta][tmpphi];
1260 npixel =
mapx0m[tmpeta][tmpphi];
1265 if (tmpsect%2==1) iflip =1;
1266 if (
abs(iring)==1) {
1267 npixel =
mapx1[tmpeta][(iflip==0) ? tmpphi :
abs(tmpphi-2)];
1270 npixel =
mapx2[tmpeta][(iflip==0) ? tmpphi :
abs(tmpphi-2)];
1275 int tmpeta1 = (ieta>0) ? ieta -1 : -ieta +14;
1278 int tmpphi1 = iphi -1 ;
1281 if (hosig[4]!=-100) {
1283 if (caloen[2]<=0.0) iselect2=1;
1285 if (caloen[2]<=3.0) iselect2=1;
1293 int tmpphi2 = iphi - 1;
1294 if (!m_digiInput) { tmpphi2 = (iphi+6 <=
nphimx) ? iphi+5 : iphi+5-
nphimx;}
1296 int tmpsect2 = int((tmpphi2 + 2)/6.) + 1;
1297 if (tmpsect2 >12) tmpsect2 = 1;
1299 int tmprout2 = int((tmpphi2 + 2)/3.) + 1;
1301 tmprout2 = int((tmpphi2 + 2)/2.) + 1;
1302 if (tmprout2 >routmx) tmprout2 = 1;
1304 if (tmprout2 >rout12mx) tmprout2 = 1;
1308 if (hocro>alow && hocro<ahigh) {
1309 if (!m_histfit)
cro_ssg[tmpeta1][tmpphi2].push_back(hocro);
1310 crossg[tmpeta1][tmpphi2]->Fill(hocro);
1314 if (tmpphi2 >=0 && tmpphi2 <
nphimx) {
1315 crossg[tmpeta1][
nphimx]->Fill(hocro);
1318 com_crossg[iring2][tmprout2-1]->Fill(hocro);
1319 com_crossg[iring2][tmproutmx]->Fill(hocro);
1324 for (
int ij=0; ij<neffip; ij++) {
1326 sig_effi[ij]->Fill(ieta, iphi, 1.);
1328 if (hosig[4] >ij*m_sigma) {
1329 sig_effi[ij]->Fill(ieta, iphi, 1.);
1337 if (hosig[4]>-50&& hosig[4] <15) {
1338 sigrsg[tmpeta1][tmpphi1]->Fill(hosig[4]);
1339 if (!m_histfit && hosig[4]<=ahigh/2.)
sig_reg[tmpeta1][tmpphi1].push_back(hosig[4]);
1340 invang[tmpeta1][tmpphi1] += 1./fabs(hoang);
1344 if (tmpphi1 >=0 && tmpphi1 <
nphimx) {
1345 sigrsg[tmpeta1][
nphimx]->Fill(hosig[4]);
1346 invang[tmpeta1][
nphimx] += 1./fabs(hoang);
1350 com_sigrsg[iring2][tmprout-1]->Fill(hosig[4]);
1351 com_invang[iring2][tmprout-1] += 1./fabs(hoang);
1353 com_sigrsg[iring2][tmproutmx]->Fill(hosig[4]);
1354 com_invang[iring2][tmproutmx] += 1./fabs(hoang);
1357 if (m_checkmap || m_correl) {
1358 tmpeta =
etamap[itag][npixel];
1359 tmpphi =
phimap[itag][npixel];
1360 if (tmpeta>=0 && tmpphi >=0) {
1361 if (iflip !=0) tmpphi =
abs(tmpphi-2);
1362 if (
int((hocorsig[fact*tmpeta+tmpphi]-hosig[4])*10000)/10000.!=0) {
1364 cout<<
"iring2xxx "<<irun<<
" "<<ievt<<
" "<<isect<<
" "<<iring<<
" "<<tmpsect<<
" "<<ieta<<
" "<<iphi<<
" "<<npixel<<
" "<<tmpeta<<
" "<<tmpphi<<
" "<<tmpeta1<<
" "<<tmpphi1<<
" itag "<<itag<<
" "<<iflip<<
" "<<fact<<
" "<<hocorsig[fact*tmpeta+tmpphi]<<
" "<<fact*tmpeta+tmpphi<<
" "<<hosig[4]<<
" "<<hodx<<
" "<<hody<<endl;
1366 for (
int i=0;
i<18;
i++) {
cout <<
" "<<
i<<
" "<<hocorsig[
i];}
1367 cout<<
" ix "<<iaxxx<<
" "<<ibxxx<<endl;
1370 corrsgc[tmpeta1][tmpphi1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1372 com_corrsgc[iring2][tmpsect-1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1378 float allcorsig = 0.0;
1381 tmpphi =
phimap[itag][npixleft[npixel]];
1383 if (tmpeta>=0 && tmpphi >=0) {
1384 if (iflip !=0) tmpphi =
abs(tmpphi-2);
1385 corrsgl[tmpeta1][tmpphi1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1386 allcorsig +=hocorsig[fact*tmpeta+tmpphi];
1388 com_corrsgl[iring2][tmpsect-1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1393 tmpphi =
phimap[itag][npixrigh[npixel]];
1394 if (tmpeta>=0 && tmpphi >=0) {
1395 if (iflip !=0) tmpphi =
abs(tmpphi-2);
1396 corrsgr[tmpeta1][tmpphi1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1397 allcorsig +=hocorsig[fact*tmpeta+tmpphi];
1399 com_corrsgr[iring2][tmpsect-1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1404 tmpphi =
phimap[itag][npixlebt[npixel]];
1405 if (tmpeta>=0 && tmpphi >=0) {
1406 if (iflip !=0) tmpphi =
abs(tmpphi-2);
1407 corrsglb[tmpeta1][tmpphi1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1408 allcorsig +=hocorsig[fact*tmpeta+tmpphi];
1410 com_corrsglb[iring2][tmpsect-1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1415 tmpphi =
phimap[itag][npixribt[npixel]];
1416 if (tmpeta>=0 && tmpphi >=0) {
1417 if (iflip !=0) tmpphi =
abs(tmpphi-2);
1418 corrsgrb[tmpeta1][tmpphi1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1419 allcorsig +=hocorsig[fact*tmpeta+tmpphi];
1421 com_corrsgrb[iring2][tmpsect-1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1426 tmpphi =
phimap[itag][npixleup[npixel]];
1427 if (tmpeta>=0 && tmpphi >=0) {
1428 if (iflip !=0) tmpphi =
abs(tmpphi-2);
1429 corrsglu[tmpeta1][tmpphi1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1430 allcorsig +=hocorsig[fact*tmpeta+tmpphi];
1432 com_corrsglu[iring2][tmpsect-1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1437 tmpphi =
phimap[itag][npixriup[npixel]];
1438 if (tmpeta>=0 && tmpphi >=0) {
1439 if (iflip !=0) tmpphi =
abs(tmpphi-2);
1440 corrsgru[tmpeta1][tmpphi1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1441 allcorsig +=hocorsig[fact*tmpeta+tmpphi];
1443 com_corrsgru[iring2][tmpsect-1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1446 corrsgall[tmpeta1][tmpphi1]->Fill(allcorsig);
1448 com_corrsgall[iring2][tmpsect-1]->Fill(allcorsig);
1453 for (
int k=0;
k<9;
k++) {
1456 case 2 : ho_sig2p[
k]->Fill(hosig[
k]);
break;
1457 case 1 : ho_sig1p[
k]->Fill(hosig[k]);
break;
1458 case 0 : ho_sig00[
k]->Fill(hosig[k]);
break;
1459 case -1 : ho_sig1m[
k]->Fill(hosig[k]);
break;
1460 case -2 : ho_sig2m[
k]->Fill(hosig[k]);
break;
1463 hbhe_sig[
k]->Fill(hbhesig[
k]);
1472 #ifdef THIS_IS_AN_EVENT_EXAMPLE
1474 iEvent.getByLabel(
"example",pIn);
1477 #ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE
1479 iSetup.
get<SetupRecord>().
get(pSetup);
1499 nevsigrsg->Fill(netamx*
i+
j, sigrsg[
j][
i]->GetEntries());
1500 mnsigrsg->Fill(netamx*
i+
j, sigrsg[
j][
i]->GetMean());
1501 rmssigrsg->Fill(netamx*
i+
j, sigrsg[
j][
i]->GetRMS());
1503 nevcrossg->Fill(netamx*
i+
j, crossg[
j][
i]->GetEntries());
1504 mncrossg->Fill(netamx*
i+
j, crossg[
j][
i]->GetMean());
1505 rmscrossg->Fill(netamx*
i+
j, crossg[
j][
i]->GetRMS());
1509 nevcorrsglb->Fill(netamx*
i+
j, corrsglb[
j][
i]->GetEntries());
1510 mncorrsglb->Fill(netamx*
i+
j, corrsglb[
j][
i]->GetMean());
1511 rmscorrsglb->Fill(netamx*
i+
j, corrsglb[
j][
i]->GetRMS());
1513 nevcorrsgrb->Fill(netamx*
i+
j, corrsgrb[
j][
i]->GetEntries());
1514 mncorrsgrb->Fill(netamx*
i+
j, corrsgrb[
j][
i]->GetMean());
1515 rmscorrsgrb->Fill(netamx*
i+
j, corrsgrb[
j][
i]->GetRMS());
1517 nevcorrsglu->Fill(netamx*
i+
j, corrsglu[
j][
i]->GetEntries());
1518 mncorrsglu->Fill(netamx*
i+
j, corrsglu[
j][
i]->GetMean());
1519 rmscorrsglu->Fill(netamx*
i+
j, corrsglu[
j][
i]->GetRMS());
1521 nevcorrsgru->Fill(netamx*
i+
j, corrsgru[
j][
i]->GetEntries());
1522 mncorrsgru->Fill(netamx*
i+
j, corrsgru[
j][
i]->GetMean());
1523 rmscorrsgru->Fill(netamx*
i+
j, corrsgru[
j][
i]->GetRMS());
1525 nevcorrsgall->Fill(netamx*
i+
j, corrsgall[
j][
i]->GetEntries());
1526 mncorrsgall->Fill(netamx*
i+
j, corrsgall[
j][
i]->GetMean());
1527 rmscorrsgall->Fill(netamx*
i+
j, corrsgall[
j][
i]->GetRMS());
1529 nevcorrsgl->Fill(netamx*
i+
j, corrsgl[
j][
i]->GetEntries());
1530 mncorrsgl->Fill(netamx*
i+
j, corrsgl[
j][
i]->GetMean());
1531 rmscorrsgl->Fill(netamx*
i+
j, corrsgl[
j][
i]->GetRMS());
1533 nevcorrsgr->Fill(netamx*
i+
j, corrsgr[
j][
i]->GetEntries());
1534 mncorrsgr->Fill(netamx*
i+
j, corrsgr[
j][
i]->GetMean());
1535 rmscorrsgr->Fill(netamx*
i+
j, corrsgr[
j][
i]->GetRMS());
1538 nevcorrsgc->Fill(netamx*
i+
j, corrsgc[
j][
i]->GetEntries());
1539 mncorrsgc->Fill(netamx*
i+
j, corrsgc[
j][
i]->GetMean());
1540 rmscorrsgc->Fill(netamx*
i+
j, corrsgc[
j][
i]->GetRMS());
1546 for (
int j=0;
j<ringmx;
j++) {
1547 for (
int i=0;
i<routmx;
i++) {
1548 if (
j!=2 &&
i>=rout12mx)
continue;
1549 nevsigrsg->Fill(
netamx*nphimx+ringmx*
i+
j, com_sigrsg[
j][
i]->GetEntries());
1550 mnsigrsg->Fill(
netamx*nphimx+ringmx*
i+
j, com_sigrsg[
j][
i]->GetMean());
1551 rmssigrsg->Fill(
netamx*nphimx+ringmx*
i+
j, com_sigrsg[
j][
i]->GetRMS());
1553 nevcrossg->Fill(
netamx*nphimx+ringmx*
i+
j, com_crossg[
j][
i]->GetEntries());
1554 mncrossg->Fill(
netamx*nphimx+ringmx*
i+
j, com_crossg[
j][
i]->GetMean());
1555 rmscrossg->Fill(
netamx*nphimx+ringmx*
i+
j, com_crossg[
j][
i]->GetRMS());
1559 for (
int i=0;
i<sectmx;
i++) {
1560 for (
int j=0;
j<ringmx;
j++) {
1562 nevcorrsglb->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsglb[
j][
i]->GetEntries());
1563 mncorrsglb->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsglb[
j][
i]->GetMean());
1564 rmscorrsglb->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsglb[
j][
i]->GetRMS());
1566 nevcorrsgrb->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgrb[
j][
i]->GetEntries());
1567 mncorrsgrb->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgrb[
j][
i]->GetMean());
1568 rmscorrsgrb->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgrb[
j][
i]->GetRMS());
1570 nevcorrsglu->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsglu[
j][
i]->GetEntries());
1571 mncorrsglu->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsglu[
j][
i]->GetMean());
1572 rmscorrsglu->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsglu[
j][
i]->GetRMS());
1574 nevcorrsgru->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgru[
j][
i]->GetEntries());
1575 mncorrsgru->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgru[
j][
i]->GetMean());
1576 rmscorrsgru->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgru[
j][
i]->GetRMS());
1578 nevcorrsgall->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgall[
j][
i]->GetEntries());
1579 mncorrsgall->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgall[
j][
i]->GetMean());
1580 rmscorrsgall->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgall[
j][
i]->GetRMS());
1582 nevcorrsgl->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgl[
j][
i]->GetEntries());
1583 mncorrsgl->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgl[
j][
i]->GetMean());
1584 rmscorrsgl->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgl[
j][
i]->GetRMS());
1586 nevcorrsgr->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgr[
j][
i]->GetEntries());
1587 mncorrsgr->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgr[
j][
i]->GetMean());
1588 rmscorrsgr->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgr[
j][
i]->GetRMS());
1591 nevcorrsgc->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgc[
j][
i]->GetEntries());
1592 mncorrsgc->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgc[
j][
i]->GetMean());
1593 rmscorrsgc->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgc[
j][
i]->GetRMS());
1600 for (
int i=1;
i<neffip;
i++) {
1601 sig_effi[
i]->Divide(sig_effi[0]);
1603 for (
int ij=0; ij<
netamx; ij++) {
1604 for (
int jk = 0; jk <
nphimx; jk++) {
1605 int ieta = (ij<15) ? ij+1 : 14-ij;
1607 double signal = sigrsg[ij][jk]->GetMean();
1608 mean_energy->Fill(ieta, iphi, signal);
1615 gStyle->SetOptLogy(0);
1616 gStyle->SetTitleFillColor(10);
1617 gStyle->SetStatColor(10);
1619 gStyle->SetCanvasColor(10);
1620 gStyle->SetOptStat(0);
1621 gStyle->SetOptTitle(1);
1623 gStyle->SetTitleColor(10);
1624 gStyle->SetTitleFontSize(0.09);
1625 gStyle->SetTitleOffset(-0.05);
1626 gStyle->SetTitleBorderSize(1);
1628 gStyle->SetPadColor(10);
1629 gStyle->SetPadBorderMode(0);
1630 gStyle->SetStatColor(10);
1631 gStyle->SetPadBorderMode(0);
1632 gStyle->SetStatBorderSize(1);
1633 gStyle->SetStatFontSize(.07);
1635 gStyle->SetStatStyle(1001);
1636 gStyle->SetOptFit(101);
1637 gStyle->SetCanvasColor(10);
1638 gStyle->SetCanvasBorderMode(0);
1640 gStyle->SetStatX(.99);
1641 gStyle->SetStatY(.99);
1642 gStyle->SetStatW(.45);
1643 gStyle->SetStatH(.16);
1644 gStyle->SetLabelSize(0.075,
"XY");
1645 gStyle->SetLabelOffset(0.21,
"XYZ");
1646 gStyle->SetTitleSize(0.065,
"XY");
1647 gStyle->SetTitleOffset(0.06,
"XYZ");
1648 gStyle->SetPadTopMargin(.09);
1649 gStyle->SetPadBottomMargin(0.11);
1650 gStyle->SetPadLeftMargin(0.12);
1651 gStyle->SetPadRightMargin(0.15);
1652 gStyle->SetPadGridX(3);
1653 gStyle->SetPadGridY(3);
1654 gStyle->SetGridStyle(2);
1655 gStyle->SetNdivisions(303,
"XY");
1657 gStyle->SetMarkerSize(0.60);
1658 gStyle->SetMarkerColor(2);
1659 gStyle->SetMarkerStyle(20);
1660 gStyle->SetTitleFontSize(0.07);
1666 TCanvas *c2 =
new TCanvas(
"c2",
"Statistics and efficiency", xsiz, ysiz);
1668 for (
int ij=0; ij<neffip; ij=ij+3) {
1669 sig_effi[ij]->GetXaxis()->SetTitle(
"#eta");
1670 sig_effi[ij]->GetXaxis()->SetTitleSize(0.075);
1671 sig_effi[ij]->GetXaxis()->SetTitleOffset(0.65);
1672 sig_effi[ij]->GetXaxis()->CenterTitle();
1673 sig_effi[ij]->GetXaxis()->SetLabelSize(0.055);
1674 sig_effi[ij]->GetXaxis()->SetLabelOffset(0.001);
1676 sig_effi[ij]->GetYaxis()->SetTitle(
"#phi");
1677 sig_effi[ij]->GetYaxis()->SetTitleSize(0.075);
1678 sig_effi[ij]->GetYaxis()->SetTitleOffset(0.9);
1679 sig_effi[ij]->GetYaxis()->CenterTitle();
1680 sig_effi[ij]->GetYaxis()->SetLabelSize(0.055);
1681 sig_effi[ij]->GetYaxis()->SetLabelOffset(0.01);
1683 c2->cd(
int(ij/3.)+1); sig_effi[ij]->Draw(
"colz");
1685 sprintf(out_file,
"comb_hosig_evt_%i.jpg",irunold);
1686 c2->SaveAs(out_file);
1688 gStyle->SetTitleFontSize(0.045);
1689 gStyle->SetPadRightMargin(0.1);
1690 gStyle->SetPadLeftMargin(0.1);
1691 gStyle->SetPadBottomMargin(0.12);
1693 TCanvas *
c1 =
new TCanvas(
"c1",
"Mean signal in each tower", xsiz, ysiz);
1695 mean_energy->GetXaxis()->SetTitle(
"#eta");
1696 mean_energy->GetXaxis()->SetTitleSize(0.075);
1697 mean_energy->GetXaxis()->SetTitleOffset(0.65);
1698 mean_energy->GetXaxis()->CenterTitle();
1699 mean_energy->GetXaxis()->SetLabelSize(0.045);
1700 mean_energy->GetXaxis()->SetLabelOffset(0.001);
1702 mean_energy->GetYaxis()->SetTitle(
"#phi");
1703 mean_energy->GetYaxis()->SetTitleSize(0.075);
1704 mean_energy->GetYaxis()->SetTitleOffset(0.5);
1705 mean_energy->GetYaxis()->CenterTitle();
1706 mean_energy->GetYaxis()->SetLabelSize(0.045);
1707 mean_energy->GetYaxis()->SetLabelOffset(0.01);
1709 mean_energy->Draw(
"colz");
1710 sprintf(out_file,
"homean_energy_%i.jpg",irunold);
1711 c1->SaveAs(out_file);
1716 gStyle->SetPadBottomMargin(0.14);
1717 gStyle->SetPadLeftMargin(0.17);
1718 gStyle->SetPadRightMargin(0.03);
1720 gStyle->SetOptStat(1110);
1722 const int nsample =8;
1723 TF1* gx0[nsample]={0};
1724 TF1* ped0fun[nsample]={0};
1725 TF1* signal[nsample]={0};
1726 TF1* pedfun[nsample]={0};
1727 TF1* sigfun[nsample]={0};
1728 TF1* signalx[nsample]={0};
1730 TH1F* signall[nsample]={0};
1731 TH1F* pedstll[nsample]={0};
1735 gStyle->SetOptFit(101);
1736 gStyle->SetCanvasBorderMode(0);
1737 gStyle->SetPadBorderMode(0);
1738 gStyle->SetStatBorderSize(1);
1739 gStyle->SetStatStyle(1001);
1740 gStyle->SetTitleColor(10);
1741 gStyle->SetTitleFontSize(0.09);
1742 gStyle->SetTitleOffset(-0.05);
1743 gStyle->SetTitleBorderSize(1);
1745 gStyle->SetCanvasColor(10);
1746 gStyle->SetPadColor(10);
1747 gStyle->SetStatColor(10);
1748 gStyle->SetStatFontSize(.07);
1749 gStyle->SetStatX(0.99);
1750 gStyle->SetStatY(0.99);
1751 gStyle->SetStatW(0.30);
1752 gStyle->SetStatH(0.10);
1753 gStyle->SetTitleSize(0.065,
"XYZ");
1754 gStyle->SetLabelSize(0.075,
"XYZ");
1755 gStyle->SetLabelOffset(0.012,
"XYZ");
1756 gStyle->SetPadGridX(1);
1757 gStyle->SetPadGridY(1);
1758 gStyle->SetGridStyle(3);
1759 gStyle->SetNdivisions(101,
"XY");
1760 gStyle->SetOptLogy(0);
1764 ofstream file_out(theoutputtxtFile.c_str());
1767 TPostScript ps(theoutputpsFile.c_str(),ips);
1772 TCanvas *c0 =
new TCanvas(
"c0",
" Pedestal vs signal", xsiz, ysiz);
1779 for (
int ij=0; ij<
nphimx; ij++) {mean_phi[ij] = rms_phi[ij] =0;}
1780 for (
int ij=0; ij<
netamx; ij++) {mean_eta[ij] = rms_eta[ij] =0;}
1792 for (
int iijj = 0; iijj <4; iijj++) {
1795 mxeta = ringmx; mxphi = 1; mneta = 0; mnphi = 0;
1796 }
else if (iijj==1) {
1797 mxeta = ringmx; mxphi = routmx;
1798 mneta = 0; mnphi = 0;
1799 }
else if (iijj==2) {
1800 mxeta =
netamx; mxphi = 1; mneta = 0; mnphi = 0;
1801 }
else if (iijj==3) {
1803 mneta = 0; mnphi = 0;
1806 for (
int jk=mneta; jk<mxeta; jk++) {
1807 for (
int ij=mnphi; ij<mxphi; ij++) {
1808 if (iijj==1)
continue;
1809 if ((iijj==0 || iijj==1) && jk !=2 && ij >=rout12mx)
continue;
1810 int izone = iiter%nsample;
1813 int iread = (jk==2) ? routmx : rout12mx;
1814 signall[izone] = (TH1F*)com_sigrsg[jk][iread]->Clone(
"hnew");
1815 pedstll[izone] = (TH1F*)com_crossg[jk][iread]->Clone(
"hnew");
1816 }
else if (iijj==1) {
1817 signall[izone] = (TH1F*)com_sigrsg[jk][ij]->Clone(
"hnew");
1818 pedstll[izone] = (TH1F*)com_crossg[jk][ij]->Clone(
"hnew");
1819 }
else if (iijj==2) {
1820 signall[izone] = (TH1F*)sigrsg[jk][nphimx]->Clone(
"hnew");
1821 pedstll[izone] = (TH1F*)crossg[jk][nphimx]->Clone(
"hnew");
1822 }
else if (iijj==3) {
1823 signall[izone] = (TH1F*)sigrsg[jk][ij]->Clone(
"hnew");
1824 pedstll[izone] = (TH1F*)crossg[jk][ij]->Clone(
"hnew");
1827 pedstll[izone]->SetLineWidth(2);
1828 signall[izone]->SetLineWidth(2);
1829 pedstll[izone]->SetLineColor(2);
1830 signall[izone]->SetLineColor(4);
1831 pedstll[izone]->SetNdivisions(506,
"XY");
1832 signall[izone]->SetNdivisions(506,
"XY");
1834 signall[izone]->GetXaxis()->SetLabelSize(.065);
1835 signall[izone]->GetYaxis()->SetLabelSize(.06);
1837 signall[izone]->GetXaxis()->SetTitle(
"Signal (fC)");
1839 signall[izone]->GetXaxis()->SetTitle(
"Signal (GeV)");
1841 signall[izone]->GetXaxis()->SetTitleSize(.065);
1842 signall[izone]->GetXaxis()->CenterTitle();
1879 float mean = pedstll[izone]->GetMean();
1880 float rms = pedstll[izone]->GetRMS();
1882 if (rms <0.6) rms = 0.6;
1883 if (rms >1.2) rms = 1.2;
1884 if (mean >1.2) mean = 1.2;
1885 if (mean <-1.2) mean = -1.2;
1887 if (rms <0.10) rms = 0.10;
1888 if (rms >0.15) rms=0.15;
1889 if (mean >0.20) mean = 0.20;
1890 if (mean <-0.20) mean = -0.20;
1892 float xmn = mean-6.*
rms;
1893 float xmx = mean+6.*
rms;
1895 binwid = pedstll[izone]->GetBinWidth(1);
1896 if (xmx > pedstll[izone]->GetXaxis()->GetXmax()) xmx = pedstll[izone]->GetXaxis()->GetXmax()-0.5*binwid;
1897 if (xmn < pedstll[izone]->GetXaxis()->GetXmin()) xmn = pedstll[izone]->GetXaxis()->GetXmin()+0.5*binwid;
1899 float height = pedstll[izone]->GetEntries();
1901 double par[
nbgpr] ={height,
mean, 0.75*rms};
1903 double gaupr[
nbgpr];
1904 double parer[
nbgpr];
1908 pedstll[izone]->GetXaxis()->SetLabelSize(.065);
1909 pedstll[izone]->GetYaxis()->SetLabelSize(.06);
1914 pedstll[izone]->GetXaxis()->SetRangeUser(xmn, xmx);
1919 pedstll[izone]->GetXaxis()->SetTitle(
"Pedestal/Signal (fC)");
1921 pedstll[izone]->GetXaxis()->SetTitle(
"Pedestal (fC)");
1925 pedstll[izone]->GetXaxis()->SetTitle(
"Pedestal/Signal (GeV)");
1927 pedstll[izone]->GetXaxis()->SetTitle(
"Pedestal (GeV)");
1930 pedstll[izone]->GetXaxis()->SetTitleSize(.065);
1931 pedstll[izone]->GetXaxis()->CenterTitle();
1934 pedstll[izone]->Draw();
1935 if (m_pedsuppr && !m_digiInput) {
1943 parer[0] = parer[1] = parer[2] = 0;
1946 if (pedstll[izone]->GetEntries() >5) {
1948 if ((iijj!=3) || m_histfit) {
1950 sprintf(temp,
"gx0_%i",izone);
1951 gx0[izone] =
new TF1(temp,
gausX, xmn, xmx,
nbgpr);
1952 gx0[izone]->SetParameters(par);
1953 gx0[izone]->SetLineWidth(1);
1954 pedstll[izone]->Fit(gx0[izone],
"R+");
1957 parer[
k] = gx0[izone]->GetParError(
k);
1958 gaupr[
k] = gx0[izone]->GetParameter(
k);
1961 double strt[
nbgpr] = {height,
mean, 0.75*rms};
1962 double step[
nbgpr] = {1.0, 0.001, 0.001};
1963 double alowmn[
nbgpr] = {0.5*height, mean-
rms, 0.3*rms};
1964 double ahighmn[
nbgpr] ={1.5*height, mean+
rms, 1.5*rms};
1967 gMinuit->SetFCN(
fcnbg);
1972 gMinuit->mnexcm(
"SET ERR", arglist, 1, ierflg);
1975 sprintf(name,
"pedpar%i",
k);
1976 gMinuit->mnparm(
k, name, strt[
k], step[k], alowmn[k], ahighmn[k],ierflg);
1980 gMinuit->mnexcm(
"SIMPLEX", arglist, 0, ierflg);
1983 gMinuit->mnexcm(
"IMPROVE", arglist, 0, ierflg);
1986 double parv,err,xlo,xup, plerr, mierr, eparab, gcc;
1991 gMinuit->mnpout(
k, chnam, parv, err, xlo, xup, iuit);
1992 gMinuit->mnerrs(
k, plerr, mierr, eparab, gcc);
1995 gaupr[
k] = parv*binwid;
1996 parer[
k] = err*binwid;
2007 sprintf(temp,
"ped0fun_%i",izone);
2008 ped0fun[izone] =
new TF1(temp,
gausX, xmn, xmx, nbgpr);
2009 ped0fun[izone]->SetParameters(gaupr);
2010 ped0fun[izone]->SetLineColor(3);
2011 ped0fun[izone]->SetLineWidth(1);
2012 ped0fun[izone]->Draw(
"same");
2017 for (
int k=0;
k<
nbgpr;
k++) {gaupr[
k] = par[
k]; }
2018 if (m_digiInput) { gaupr[2] = 0.90; }
else { gaupr[2] = 0.15;}
2023 if (signall[izone]->GetEntries() >5) {
2024 Double_t parall[
nsgpr];
2025 double parserr[
nsgpr];
2026 double fitres[
nsgpr];
2030 sprintf(temp,
"signal_%i",izone);
2031 xmn = signall[izone]->GetXaxis()->GetXmin();
2032 xmx = 0.5*signall[izone]->GetXaxis()->GetXmax();
2035 if ((iijj!=3) || m_histfit) {
2036 pedht = (signall[izone]->GetBinContent(nbn-1)+
2037 signall[izone]->GetBinContent(nbn)+
2038 signall[izone]->GetBinContent(nbn+1))/3.;
2040 if (m_pedsuppr && !m_digiInput) {
2042 if (m_digiInput) { parall[2] = 0.90; }
else { parall[2] = 0.15;}
2044 for (
int i=0;
i<
nbgpr;
i++) {parall[
i] = gaupr[
i];}
2050 parall[0] = 0.9*pedht;
2052 double area = binwid*signall[izone]->GetEntries();
2056 parall[4] = fitprm[4][jk];
2057 parall[6] = fitprm[6][jk];
2059 parall[4] = signall[izone]->GetMean();
2060 parall[6]=parall[2];
2063 signal[izone]->SetParameters(parall);
2064 signal[izone]->FixParameter(1, parall[1]);
2065 signal[izone]->FixParameter(2, parall[2]);
2066 signal[izone]->SetParLimits(0, 0.00, 2.0*pedht+0.1);
2067 signal[izone]->FixParameter(3, 0.14);
2069 signal[izone]->SetParLimits(5, 0.40*area, 1.15*area);
2072 signal[izone]->SetParLimits(4, 0.2*fitprm[4][jk], 2.0*fitprm[4][jk]);
2073 signal[izone]->SetParLimits(6, 0.2*fitprm[6][jk], 2.0*fitprm[6][jk]);
2076 signal[izone]->SetParLimits(4, 0.6, 6.0);
2077 signal[izone]->SetParLimits(6, 0.60, 3.0);
2079 signal[izone]->SetParLimits(4, 0.1, 1.0);
2080 signal[izone]->SetParLimits(6, 0.035, 0.3);
2083 signal[izone]->SetParNames(
"const",
"mean",
"sigma",
"Width",
"MP",
"Area",
"GSigma");
2084 signall[izone]->Fit(signal[izone],
"0R+");
2086 signall[izone]->GetXaxis()->SetRangeUser(xmn,xmx);
2088 fitres[
k] = fitprm[
k][jk] = signal[izone]->GetParameter(
k);
2089 parserr[
k] = signal[izone]->GetParError(
k);
2101 TString
name[
nsgpr] = {
"const",
"mean",
"sigma",
"Width",
"MP",
"Area",
"GSigma"};
2102 double strt[
nsgpr] = {0.9*pedhtx, gaupr[1], gaupr[2], fitprm[3][jk], fitprm[4][jk], signall[izone]->GetEntries(), fitprm[6][jk]};
2103 double alowmn[
nsgpr] = {0.1*pedhtx-0.1, gaupr[1]-0.1, gaupr[2]-0.1,0.07, 0.2*strt[4], 0.1*strt[5], 0.2*strt[6]};
2104 double ahighmn[
nsgpr] ={1.2*pedhtx+0.1, gaupr[1]+0.1, gaupr[2]+0.1,0.20, 2.5*strt[4], 1.5*strt[5], 2.2*strt[6]};
2105 double step[
nsgpr] = {1.0, 0.0, 0.0, 0.0, 0.001, 1.0, 0.002};
2108 gMinuit->SetFCN(
fcnsg);
2113 gMinuit->mnexcm(
"SET ERR", arglist, 1, ierflg);
2116 gMinuit->mnparm(
k, name[
k], strt[k], step[k], alowmn[k], ahighmn[k],ierflg);
2120 gMinuit->mnexcm(
"SIMPLEX", arglist, 0, ierflg);
2123 gMinuit->mnexcm(
"IMPROVE", arglist, 0, ierflg);
2126 double parv,err,xlo,xup, plerr, mierr, eparab, gcc;
2131 gMinuit->mnpout(
k, chnam, parv, err, xlo, xup, iuit);
2132 gMinuit->mnerrs(
k, plerr, mierr, eparab, gcc);
2134 fitres[
k] = parv*binwid;
2135 parserr[
k]= err*binwid;
2150 signall[izone]->Draw();
2153 sprintf(temp,
"pedfun_%i",izone);
2154 pedfun[izone] =
new TF1(temp,
gausX, xmn, xmx,
nbgpr);
2155 pedfun[izone]->SetParameters(fitres);
2156 pedfun[izone]->SetLineColor(3);
2157 pedfun[izone]->SetLineWidth(1);
2158 pedfun[izone]->Draw(
"same");
2160 sprintf(temp,
"signalfun_%i",izone);
2162 sigfun[izone]->SetParameters(&fitres[3]);
2163 sigfun[izone]->SetLineWidth(1);
2164 sigfun[izone]->SetLineColor(4);
2165 sigfun[izone]->Draw(
"same");
2167 sprintf(temp,
"total_%i",izone);
2169 signalx[izone]->SetParameters(fitres);
2170 signalx[izone]->SetLineWidth(1);
2171 signalx[izone]->Draw(
"same");
2173 int kl = (jk<15) ? jk+1 : 14-jk;
2175 cout<<
"histinfo"<<iijj<<
" fit "
2176 <<std::setw(3)<< kl<<
" "
2177 <<std::setw(3)<< ij+1<<
" "
2178 <<std::setw(5)<<pedstll[izone]->GetEntries()<<
" "
2179 <<std::setw(6)<<pedstll[izone]->GetMean()<<
" "
2180 <<std::setw(6)<<pedstll[izone]->GetRMS()<<
" "
2181 <<std::setw(5)<<signall[izone]->GetEntries()<<
" "
2182 <<std::setw(6)<<signall[izone]->GetMean()<<
" "
2183 <<std::setw(6)<<signall[izone]->GetRMS()<<
" "
2184 <<std::setw(6)<< signal[izone]->GetChisquare()<<
" "
2185 <<std::setw(3)<< signal[izone]->GetNDF()<<endl;
2187 file_out<<
"histinfo"<<iijj<<
" fit "
2188 <<std::setw(3)<< kl<<
" "
2189 <<std::setw(3)<< ij+1<<
" "
2190 <<std::setw(5)<<pedstll[izone]->GetEntries()<<
" "
2191 <<std::setw(6)<<pedstll[izone]->GetMean()<<
" "
2192 <<std::setw(6)<<pedstll[izone]->GetRMS()<<
" "
2193 <<std::setw(5)<<signall[izone]->GetEntries()<<
" "
2194 <<std::setw(6)<<signall[izone]->GetMean()<<
" "
2195 <<std::setw(6)<<signall[izone]->GetRMS()<<
" "
2196 <<std::setw(6)<< signal[izone]->GetChisquare()<<
" "
2197 <<std::setw(3)<< signal[izone]->GetNDF()<<endl;
2199 file_out <<
"fitres x"<<iijj<<
" "<<kl<<
" "<<ij+1<<
" "<< fitres[0]<<
" "<< fitres[1]<<
" "<< fitres[2]<<
" "<< fitres[3]<<
" "<< fitres[4]<<
" "<< fitres[5]<<
" "<< fitres[6]<<endl;
2200 file_out <<
"parserr"<<iijj<<
" "<<kl<<
" "<<ij+1<<
" "<< parserr[0]<<
" "<< parserr[1]<<
" "<< parserr[2]<<
" "<< parserr[3]<<
" "<< parserr[4]<<
" "<< parserr[5]<<
" "<< parserr[6]<<endl;
2202 double diff=fitres[4]-fitres[1];
2203 if (diff <=0) diff = 0.000001;
2204 double error=parserr[4]*parserr[4]+parer[2]*parer[2];
2205 error =
pow(error,0.5);
2207 int ieta = (jk<15) ? (15+jk) : (29-jk);
2208 int ifl = nphimx*ieta + ij;
2211 ped_evt->Fill(ifl,pedstll[izone]->GetEntries());
2212 ped_mean->Fill(ifl,gaupr[1]);
2213 ped_width->Fill(ifl,gaupr[2]);
2214 fit_chi->Fill(ifl,signal[izone]->GetChisquare());
2215 sig_evt->Fill(ifl, signall[izone]->GetEntries());
2216 fit_sigevt->Fill(ifl, fitres[5]);
2217 fit_bkgevt->Fill(ifl, fitres[0]*
sqrt(2*acos(-1.))*gaupr[2]);
2218 sig_mean->Fill(ifl, fitres[4]);
2219 sig_diff->Fill(ifl, fitres[4]-fitres[1]);
2220 sig_width->Fill(ifl, fitres[3]);
2221 sig_sigma->Fill(ifl, fitres[6]);
2222 sig_meanerr->Fill(ifl, parserr[4]);
2223 if (fitres[4]-fitres[1] !=0) sig_meanerrp->Fill(ifl, 100*parserr[4]/(fitres[4]-fitres[1]));
2224 if (gaupr[2]!=0) sig_signf->Fill(ifl,(fitres[4]-fitres[1])/gaupr[2]);
2226 ped_statmean->Fill(ifl,pedstll[izone]->GetMean());
2227 sig_statmean->Fill(ifl,signall[izone]->GetMean());
2228 ped_rms->Fill(ifl,pedstll[izone]->GetRMS());
2229 sig_rms->Fill(ifl,signall[izone]->GetRMS());
2232 if ((iijj==2) || (iijj==3) || (iijj==1)) {
2233 if (signall[izone]->GetEntries() >5 && fitres[4]>0.1) {
2236 if (
abs(kl)<=4) fact=0.895;
2237 if (!m_digiInput) fact *=0.19;
2240 if (iijj==2) fact2 = invang[jk][
nphimx];
2241 if (iijj==3) fact2 = invang[jk][ij];
2242 if (iijj==1) fact2 = com_invang[jk][ij];
2244 float calibc = fact*fact2/(fitres[4]*signall[izone]->GetEntries());
2245 float caliberr= TMath::Abs(calibc*parserr[4]/
max(0.001,fitres[4]));
2248 int ieta = (jk<15) ? jk+1 : 14-jk;
2249 mean_phi_hst->Fill(ieta, calibc);
2250 mean_phi_hst->SetBinError(mean_phi_hst->FindBin(ieta), caliberr);
2251 file_out<<
"intieta "<<jk<<
" "<<ij<<
" "<<ieta<<
" "<<mean_phi_hst->FindBin(
double(ieta))<<
" "<<calibc<<
" "<<caliberr<<endl;
2252 }
else if (iijj==3) {
2253 const_eta[jk]->Fill(ij+1,calibc);
2254 const_eta[jk]->SetBinError(const_eta[jk]->FindBin(ij+1), caliberr);
2256 peak_eta[jk]->Fill(ij+1,fitres[4]);
2257 peak_eta[jk]->SetBinError(peak_eta[jk]->FindBin(ij+1),parserr[4]);
2259 int ieta = (jk<15) ? jk+1 : 14-jk;
2260 const_eta_phi->Fill(ieta, ij+1,calibc);
2261 file_out<<
"intietax "<<jk<<
" "<<ij<<
" "<<ieta<<
" "<<const_eta_phi->FindBin(ieta, ij+1)<<endl;
2263 const_eta_phi->SetBinError(const_eta_phi->FindBin(ieta, ij+1),caliberr);
2265 mean_eta[ij] +=calibc/(caliberr*caliberr);
2266 mean_phi[jk] +=calibc/(caliberr*caliberr);
2268 rms_eta[ij] +=1./(caliberr*caliberr);
2269 rms_phi[jk] +=1./(caliberr*caliberr);
2272 const_eta_phi->SetBinError(const_eta_phi->FindBin(ieta, ij+1), 0.0);
2274 }
else if (iijj==1) {
2275 const_hpdrm[jk]->Fill(ij+1,calibc);
2276 const_hpdrm[jk]->SetBinError(const_hpdrm[jk]->FindBin(ij+1), caliberr);
2278 peak_hpdrm[jk]->Fill(ij+1,fitres[4]);
2279 peak_hpdrm[jk]->SetBinError(peak_hpdrm[jk]->FindBin(ij+1),parserr[4]);
2282 file_out<<
"HO 4 "<<iijj<<
" "<< std::setw(3)<<kl<<
" "<<std::setw(3)<<ij+1<<
" "
2283 <<std::setw(7)<<calibc<<
" "<<std::setw(7)<<caliberr<<endl;
2288 signall[izone]->Draw();
2290 int kl = (jk<15) ? jk+1 : 14-jk;
2291 file_out<<
"histinfo"<<iijj<<
" nof "
2292 <<std::setw(3)<< kl<<
" "
2293 <<std::setw(3)<< ij+1<<
" "
2294 <<std::setw(5)<<pedstll[izone]->GetEntries()<<
" "
2295 <<std::setw(6)<<pedstll[izone]->GetMean()<<
" "
2296 <<std::setw(6)<<pedstll[izone]->GetRMS()<<
" "
2297 <<std::setw(5)<<signall[izone]->GetEntries()<<
" "
2298 <<std::setw(6)<<signall[izone]->GetMean()<<
" "
2299 <<std::setw(6)<<signall[izone]->GetRMS()<<
" "
2300 <<std::setw(6)<< varx<<
" "
2301 <<std::setw(3)<< varx<<endl;
2303 file_out <<
"fitres x"<<iijj<<
" "<<kl<<
" "<<ij+1<<
" "<< varx<<
" "<< varx<<
" "<< varx<<
" "<< varx<<
" "<< varx<<
" "<< varx<<
" "<< varx<<endl;
2304 file_out <<
"parserr"<<iijj<<
" "<<kl<<
" "<<ij+1<<
" "<< varx<<
" "<< varx<<
" "<< varx<<
" "<< varx<<
" "<< varx<<
" "<< varx<<
" "<< varx<<endl;
2308 if (iiter%nsample==0) {
2311 for (
int kl=0; kl<nsample; kl++) {
2312 if (gx0[kl]) {
delete gx0[kl];gx0[kl] = 0;}
2313 if (ped0fun[kl]) {
delete ped0fun[kl];ped0fun[kl] = 0;}
2314 if (signal[kl]) {
delete signal[kl];signal[kl] = 0;}
2315 if (pedfun[kl]) {
delete pedfun[kl];pedfun[kl] = 0;}
2316 if (sigfun[kl]) {
delete sigfun[kl];sigfun[kl] = 0;}
2317 if (signalx[kl]) {
delete signalx[kl];signalx[kl] = 0;}
2318 if (signall[kl]) {
delete signall[kl];signall[kl] = 0;}
2319 if (pedstll[kl]) {
delete pedstll[kl];pedstll[kl] = 0;}
2336 if (iiter%nsample!=0) {
2338 for (
int kl=0; kl<nsample; kl++) {
2339 if (gx0[kl]) {
delete gx0[kl];gx0[kl] = 0;}
2340 if (ped0fun[kl]) {
delete ped0fun[kl];ped0fun[kl] = 0;}
2341 if (signal[kl]) {
delete signal[kl];signal[kl] = 0;}
2342 if (pedfun[kl]) {
delete pedfun[kl];pedfun[kl] = 0;}
2343 if (sigfun[kl]) {
delete sigfun[kl];sigfun[kl] = 0;}
2344 if (signalx[kl]) {
delete signalx[kl];signalx[kl] = 0;}
2345 if (signall[kl]) {
delete signall[kl];signall[kl] = 0;}
2346 if (pedstll[kl]) {
delete pedstll[kl];pedstll[kl] = 0;}
2355 gStyle->SetTitleFontSize(0.05);
2356 gStyle->SetTitleSize(0.025,
"XYZ");
2357 gStyle->SetLabelSize(0.025,
"XYZ");
2358 gStyle->SetStatFontSize(.045);
2360 gStyle->SetOptStat(0);
2361 ps.NewPage(); TCanvas *c1 =
new TCanvas(
"c1",
" Pedestal vs signal", xsiz, ysiz);
2362 ped_evt->Draw(); c1->Update();
2365 ped_statmean->Draw(); c1->Update();
2368 ped_rms->Draw(); c1->Update();
2371 ped_mean->Draw(); c1->Update();
2374 ped_width->Draw(); c1->Update();
2377 sig_evt->Draw(); c1->Update();
2380 sig_statmean->Draw(); c1->Update();
2383 sig_rms->Draw(); c1->Update();
2386 fit_chi->Draw(); c1->Update();
2389 fit_sigevt->Draw(); c1->Update();
2392 fit_bkgevt->Draw(); c1->Update();
2395 sig_mean->Draw(); c1->Update();
2398 sig_width->Draw(); c1->Update();
2401 sig_sigma->Draw(); c1->Update();
2404 sig_meanerr->Draw(); c1->Update();
2407 sig_meanerrp->Draw(); c1->Update();
2410 sig_signf->Draw(); c1->Update();
2421 gStyle->SetTitleFontSize(0.09);
2422 gStyle->SetPadBottomMargin(0.17);
2423 gStyle->SetPadLeftMargin(0.18);
2424 gStyle->SetPadRightMargin(0.01);
2425 gStyle->SetOptLogy(0);
2426 gStyle->SetOptStat(0);
2428 TCanvas *c2 =
new TCanvas(
"c2",
"runfile", xsiz, ysiz);
2431 for (
int side=0; side <2; side++) {
2432 gStyle->SetNdivisions(303,
"XY");
2433 gStyle->SetPadRightMargin(0.01);
2443 for (
int ij=nmn; ij<nmx; ij++) {
2446 const_eta[ij]->GetXaxis()->SetTitle(
"#phi index");
2447 const_eta[ij]->GetXaxis()->SetTitleSize(.08);
2448 const_eta[ij]->GetXaxis()->CenterTitle();
2449 const_eta[ij]->GetXaxis()->SetTitleOffset(0.9);
2450 const_eta[ij]->GetXaxis()->SetLabelSize(.085);
2451 const_eta[ij]->GetXaxis()->SetLabelOffset(.01);
2453 const_eta[ij]->GetYaxis()->SetLabelSize(.08);
2454 const_eta[ij]->GetYaxis()->SetLabelOffset(.01);
2456 const_eta[ij]->GetYaxis()->SetTitle(
"GeV/fC");
2458 const_eta[ij]->GetYaxis()->SetTitle(
"GeV/MIP-GeV!!");
2461 const_eta[ij]->GetYaxis()->SetTitleSize(.085);
2462 const_eta[ij]->GetYaxis()->CenterTitle();
2463 const_eta[ij]->GetYaxis()->SetTitleOffset(1.3);
2464 const_eta[ij]->SetMarkerSize(0.60);
2465 const_eta[ij]->SetMarkerColor(2);
2466 const_eta[ij]->SetMarkerStyle(20);
2469 const_eta[ij]->Draw();
2473 sprintf(out_file,
"calibho_%i_side%i.eps", irunold, side);
2474 c2->SaveAs(out_file);
2476 sprintf(out_file,
"calibho_%i_side%i.jpg", irunold, side);
2477 c2->SaveAs(out_file);
2480 for (
int ij=nmn; ij<nmx; ij++) {
2482 peak_eta[ij]->GetXaxis()->SetTitle(
"#phi index");
2483 peak_eta[ij]->GetXaxis()->SetTitleSize(.08);
2484 peak_eta[ij]->GetXaxis()->CenterTitle();
2485 peak_eta[ij]->GetXaxis()->SetTitleOffset(0.90);
2486 peak_eta[ij]->GetXaxis()->SetLabelSize(.08);
2487 peak_eta[ij]->GetXaxis()->SetLabelOffset(.01);
2489 peak_eta[ij]->GetYaxis()->SetLabelSize(.08);
2490 peak_eta[ij]->GetYaxis()->SetLabelOffset(.01);
2492 peak_eta[ij]->GetYaxis()->SetTitle(
"fC");
2494 peak_eta[ij]->GetYaxis()->SetTitle(
"GeV");
2497 peak_eta[ij]->GetYaxis()->SetTitleSize(.085);
2498 peak_eta[ij]->GetYaxis()->CenterTitle();
2499 peak_eta[ij]->GetYaxis()->SetTitleOffset(1.3);
2501 peak_eta[ij]->SetMarkerSize(0.60);
2502 peak_eta[ij]->SetMarkerColor(2);
2503 peak_eta[ij]->SetMarkerStyle(20);
2505 peak_eta[ij]->Draw();
2509 sprintf(out_file,
"peakho_%i_side%i.eps", irunold, side);
2510 c2->SaveAs(out_file);
2512 sprintf(out_file,
"peakho_%i_side%i.jpg", irunold, side);
2513 c2->SaveAs(out_file);
2518 gStyle->SetTitleFontSize(0.045);
2519 gStyle->SetPadRightMargin(0.13);
2520 gStyle->SetPadBottomMargin(0.15);
2521 gStyle->SetPadLeftMargin(0.1);
2522 gStyle->SetOptStat(0);
2525 TCanvas *c1 =
new TCanvas(
"c1",
"Fitted const in each tower", xsiz, ysiz);
2526 const_eta_phi->GetXaxis()->SetTitle(
"#eta");
2527 const_eta_phi->GetXaxis()->SetTitleSize(0.065);
2528 const_eta_phi->GetXaxis()->SetTitleOffset(0.85);
2529 const_eta_phi->GetXaxis()->CenterTitle();
2530 const_eta_phi->GetXaxis()->SetLabelSize(0.045);
2531 const_eta_phi->GetXaxis()->SetLabelOffset(0.01);
2533 const_eta_phi->GetYaxis()->SetTitle(
"#phi");
2534 const_eta_phi->GetYaxis()->SetTitleSize(0.075);
2535 const_eta_phi->GetYaxis()->SetTitleOffset(0.5);
2536 const_eta_phi->GetYaxis()->CenterTitle();
2537 const_eta_phi->GetYaxis()->SetLabelSize(0.045);
2538 const_eta_phi->GetYaxis()->SetLabelOffset(0.01);
2540 const_eta_phi->Draw(
"colz");
2541 sprintf(out_file,
"high_hoconst_eta_phi_%i.jpg",irunold);
2542 c1->SaveAs(out_file);
2546 for (
int jk=0; jk<
netamx; jk++) {
2547 int ieta = (jk<15) ? jk+1 : 14-jk;
2548 if (rms_phi[jk]>0) {
2549 mean_phi_ave->Fill(ieta, mean_phi[jk]/rms_phi[jk]);
2550 mean_phi_ave->SetBinError(mean_phi_ave->FindBin(ieta),
pow(
double(rms_phi[jk]), -0.5));
2554 for (
int ij=0; ij<
nphimx; ij++) {
2555 if (rms_eta[ij] >0) {
2556 mean_eta_ave->Fill(ij+1, mean_eta[ij]/rms_eta[ij]);
2557 mean_eta_ave->SetBinError(mean_eta_ave->FindBin(ij+1),
pow(
double(rms_eta[ij]), -0.5));
2562 gStyle->SetPadLeftMargin(0.13);
2563 gStyle->SetPadRightMargin(0.03);
2566 TCanvas *c2y =
new TCanvas(
"c2",
"Avearge signal in eta and phi", xsiz, ysiz);
2568 mean_eta_ave->GetXaxis()->SetTitle(
"#phi");
2569 mean_eta_ave->GetXaxis()->SetTitleSize(0.085);
2570 mean_eta_ave->GetXaxis()->SetTitleOffset(0.65);
2571 mean_eta_ave->GetXaxis()->CenterTitle();
2572 mean_eta_ave->GetXaxis()->SetLabelSize(0.05);
2573 mean_eta_ave->GetXaxis()->SetLabelOffset(0.001);
2575 mean_eta_ave->GetYaxis()->SetTitle(
"Signal (GeV)/MIP");
2576 mean_eta_ave->GetYaxis()->SetTitleSize(0.055);
2577 mean_eta_ave->GetYaxis()->SetTitleOffset(1.3);
2578 mean_eta_ave->GetYaxis()->CenterTitle();
2579 mean_eta_ave->GetYaxis()->SetLabelSize(0.045);
2580 mean_eta_ave->GetYaxis()->SetLabelOffset(0.01);
2581 mean_eta_ave->SetMarkerSize(0.60);
2582 mean_eta_ave->SetMarkerColor(2);
2583 mean_eta_ave->SetMarkerStyle(20);
2585 c2y->cd(1); mean_eta_ave->Draw();
2587 mean_phi_ave->GetXaxis()->SetTitle(
"#eta");
2588 mean_phi_ave->GetXaxis()->SetTitleSize(0.085);
2589 mean_phi_ave->GetXaxis()->SetTitleOffset(0.65);
2590 mean_phi_ave->GetXaxis()->CenterTitle();
2591 mean_phi_ave->GetXaxis()->SetLabelSize(0.05);
2592 mean_phi_ave->GetXaxis()->SetLabelOffset(0.001);
2594 mean_phi_ave->GetYaxis()->SetTitle(
"Signal (GeV)/MIP");
2595 mean_phi_ave->GetYaxis()->SetTitleSize(0.055);
2596 mean_phi_ave->GetYaxis()->SetTitleOffset(1.3);
2597 mean_phi_ave->GetYaxis()->CenterTitle();
2598 mean_phi_ave->GetYaxis()->SetLabelSize(0.045);
2599 mean_phi_ave->GetYaxis()->SetLabelOffset(0.01);
2600 mean_phi_ave->SetMarkerSize(0.60);
2601 mean_phi_ave->SetMarkerColor(2);
2602 mean_phi_ave->SetMarkerStyle(20);
2604 c2y->cd(2); mean_phi_ave->Draw();
2606 sprintf(out_file,
"high_hoaverage_eta_phi_%i.jpg",irunold);
2607 c2y->SaveAs(out_file);
2614 TCanvas *c3 =
new TCanvas(
"c3",
"Avearge signal in eta and phi", xsiz, ysiz);
2616 mean_phi_hst->GetXaxis()->SetTitle(
"#eta");
2617 mean_phi_hst->GetXaxis()->SetTitleSize(0.065);
2618 mean_phi_hst->GetXaxis()->SetTitleOffset(0.9);
2619 mean_phi_hst->GetXaxis()->CenterTitle();
2620 mean_phi_hst->GetXaxis()->SetLabelSize(0.065);
2621 mean_phi_hst->GetXaxis()->SetLabelOffset(0.001);
2623 mean_phi_hst->GetYaxis()->SetTitle(
"GeV/MIP");
2624 mean_phi_hst->GetYaxis()->SetTitleSize(0.055);
2625 mean_phi_hst->GetYaxis()->SetTitleOffset(0.9);
2626 mean_phi_hst->GetYaxis()->CenterTitle();
2627 mean_phi_hst->GetYaxis()->SetLabelSize(0.065);
2628 mean_phi_hst->GetYaxis()->SetLabelOffset(0.01);
2630 mean_phi_hst->SetMarkerColor(4);
2631 mean_phi_hst->SetMarkerSize(0.8);
2632 mean_phi_hst->SetMarkerStyle(20);
2633 mean_phi_hst->Draw();
2635 sprintf(out_file,
"low_mean_phi_hst_%i.jpg",irunold);
2636 c3->SaveAs(out_file);
2643 gStyle->SetOptLogy(1);
2644 gStyle->SetPadTopMargin(.1);
2645 gStyle->SetPadLeftMargin(.15);
2648 TCanvas *c0x =
new TCanvas(
"c0x",
"Signal in each ring", xsiz, ysiz);
2651 for (
int ij=0; ij<ringmx; ij++) {
2652 int iread = (ij==2) ? routmx : rout12mx;
2654 com_sigrsg[ij][iread]->GetXaxis()->SetTitle(
"Signal/ped (fC)");
2656 com_sigrsg[ij][iread]->GetXaxis()->SetTitle(
"Signal/ped (GeV)");
2658 com_sigrsg[ij][iread]->GetXaxis()->SetTitleSize(0.060);
2659 com_sigrsg[ij][iread]->GetXaxis()->SetTitleOffset(1.05);
2660 com_sigrsg[ij][iread]->GetXaxis()->CenterTitle();
2661 com_sigrsg[ij][iread]->GetXaxis()->SetLabelSize(0.065);
2662 com_sigrsg[ij][iread]->GetXaxis()->SetLabelOffset(0.01);
2664 com_sigrsg[ij][iread]->GetYaxis()->SetLabelSize(0.065);
2665 com_sigrsg[ij][iread]->GetYaxis()->SetLabelOffset(0.01);
2668 com_sigrsg[ij][iread]->SetLineWidth(3);
2669 com_sigrsg[ij][iread]->SetLineColor(4);
2671 c0x->cd(ij+1); com_sigrsg[ij][iread]->Draw();
2673 com_crossg[ij][iread]->SetLineWidth(2);
2674 com_crossg[ij][iread]->SetLineColor(2);
2675 com_crossg[ij][iread]->Draw(
"same");
2677 sprintf(out_file,
"hosig_ring_%i.jpg",irunold);
2678 c0x->SaveAs(out_file);
2681 gStyle->SetTitleFontSize(0.06);
2682 gStyle->SetOptStat(0);
2683 gStyle->SetOptLogy(0);
2685 TCanvas *c0 =
new TCanvas(
"c0",
"Signal in each ring", xsiz, ysiz);
2688 for (
int jk=0; jk<ringmx; jk++) {
2689 peak_hpdrm[jk]->GetXaxis()->SetTitle(
"RM #");
2690 peak_hpdrm[jk]->GetXaxis()->SetTitleSize(0.070);
2691 peak_hpdrm[jk]->GetXaxis()->SetTitleOffset(1.0);
2692 peak_hpdrm[jk]->GetXaxis()->CenterTitle();
2693 peak_hpdrm[jk]->GetXaxis()->SetLabelSize(0.065);
2694 peak_hpdrm[jk]->GetXaxis()->SetLabelOffset(0.01);
2696 peak_hpdrm[jk]->GetYaxis()->SetTitle(
"Peak(GeV)/MIP");
2698 peak_hpdrm[jk]->GetYaxis()->SetTitleSize(0.07);
2699 peak_hpdrm[jk]->GetYaxis()->SetTitleOffset(1.3);
2700 peak_hpdrm[jk]->GetYaxis()->CenterTitle();
2701 peak_hpdrm[jk]->GetYaxis()->SetLabelSize(0.065);
2702 peak_hpdrm[jk]->GetYaxis()->SetLabelOffset(0.01);
2705 peak_hpdrm[jk]->SetMarkerSize(0.60);
2706 peak_hpdrm[jk]->SetMarkerColor(2);
2707 peak_hpdrm[jk]->SetMarkerStyle(20);
2710 c0->cd(jk+1); peak_hpdrm[jk]->Draw();
2712 sprintf(out_file,
"comb_peak_hpdrm_%i.jpg",irunold);
2713 c0->SaveAs(out_file);
2717 TCanvas *c1y =
new TCanvas(
"c1y",
"Signal in each ring", xsiz, ysiz);
2720 for (
int jk=0; jk<ringmx; jk++) {
2721 const_hpdrm[jk]->GetXaxis()->SetTitle(
"RM #");
2722 const_hpdrm[jk]->GetXaxis()->SetTitleSize(0.070);
2723 const_hpdrm[jk]->GetXaxis()->SetTitleOffset(1.3);
2724 const_hpdrm[jk]->GetXaxis()->CenterTitle();
2725 const_hpdrm[jk]->GetXaxis()->SetLabelSize(0.065);
2726 const_hpdrm[jk]->GetXaxis()->SetLabelOffset(0.01);
2729 const_hpdrm[jk]->GetYaxis()->SetTitle(
"Peak(fC)");
2731 const_hpdrm[jk]->GetYaxis()->SetTitle(
"Peak(GeV)");
2733 const_hpdrm[jk]->GetYaxis()->SetTitleSize(0.065);
2734 const_hpdrm[jk]->GetYaxis()->SetTitleOffset(1.0);
2735 const_hpdrm[jk]->GetYaxis()->CenterTitle();
2736 const_hpdrm[jk]->GetYaxis()->SetLabelSize(0.065);
2737 const_hpdrm[jk]->GetYaxis()->SetLabelOffset(0.01);
2740 const_hpdrm[jk]->SetMarkerSize(0.60);
2741 const_hpdrm[jk]->SetMarkerColor(2);
2742 const_hpdrm[jk]->SetMarkerStyle(20);
2744 c1y->cd(jk+1); const_hpdrm[jk]->Draw();
2747 sprintf(out_file,
"comb_const_hpdrm_%i.jpg",irunold);
2748 c1y->SaveAs(out_file);
2761 for (
int ij=0; ij<
nphimx; ij++) {
2762 for (
int jk=0; jk<
netamx; jk++) {
2763 stat_eta[jk]->Fill(ij+1,sigrsg[jk][ij]->GetEntries());
2764 statmn_eta[jk]->Fill(ij+1,sigrsg[jk][ij]->GetMean());
2770 gStyle->SetTitleFontSize(0.09);
2771 gStyle->SetPadBottomMargin(0.14);
2772 gStyle->SetPadLeftMargin(0.17);
2773 gStyle->SetPadRightMargin(0.01);
2774 gStyle->SetNdivisions(303,
"XY");
2775 gStyle->SetOptLogy(1);
2777 TCanvas *c2x =
new TCanvas(
"c2x",
"runfile", xsiz, ysiz);
2779 for (
int side=0; side <2; side++) {
2789 for (
int ij=nmn; ij<nmx; ij++) {
2790 int ieta = (ij<15) ? ij+1 : 14-ij;
2793 sprintf(name,
"fC(#eta=%i)",ieta);
2795 sprintf(name,
"GeV(#eta=%i)",ieta);
2797 sigrsg[ij][
nphimx]->GetXaxis()->SetTitle(name);
2798 sigrsg[ij][
nphimx]->GetXaxis()->SetTitleSize(.08);
2799 sigrsg[ij][
nphimx]->GetXaxis()->CenterTitle();
2800 sigrsg[ij][
nphimx]->GetXaxis()->SetTitleOffset(0.90);
2801 sigrsg[ij][
nphimx]->GetXaxis()->SetLabelSize(.08);
2802 sigrsg[ij][
nphimx]->GetXaxis()->SetLabelOffset(.01);
2804 sigrsg[ij][
nphimx]->GetYaxis()->SetLabelSize(.08);
2805 sigrsg[ij][
nphimx]->GetYaxis()->SetLabelOffset(.01);
2806 sigrsg[ij][
nphimx]->SetLineWidth(2);
2807 sigrsg[ij][
nphimx]->SetLineColor(4);
2808 sigrsg[ij][
nphimx]->Draw();
2809 crossg[ij][
nphimx]->SetLineWidth(2);
2810 crossg[ij][
nphimx]->SetLineColor(2);
2811 crossg[ij][
nphimx]->Draw(
"same");
2815 sprintf(out_file,
"sig_ho_%i_side%i.eps", irunold, side);
2816 c2x->SaveAs(out_file);
2818 sprintf(out_file,
"sig_ho_%i_side%i.jpg", irunold, side);
2819 c2x->SaveAs(out_file);
2822 gStyle->SetOptLogy(0);
2823 c2x =
new TCanvas(
"c2x",
"runfile", xsiz, ysiz);
2825 for (
int side=0; side <2; side++) {
2835 for (
int ij=nmn; ij<nmx; ij++) {
2837 statmn_eta[ij]->SetLineWidth(2);
2838 statmn_eta[ij]->SetLineColor(4);
2839 statmn_eta[ij]->GetXaxis()->SetTitle(
"#phi index");
2840 statmn_eta[ij]->GetXaxis()->SetTitleSize(.08);
2841 statmn_eta[ij]->GetXaxis()->CenterTitle();
2842 statmn_eta[ij]->GetXaxis()->SetTitleOffset(0.9);
2843 statmn_eta[ij]->GetYaxis()->SetLabelSize(.08);
2844 statmn_eta[ij]->GetYaxis()->SetLabelOffset(.01);
2845 statmn_eta[ij]->GetXaxis()->SetLabelSize(.08);
2846 statmn_eta[ij]->GetXaxis()->SetLabelOffset(.01);
2848 statmn_eta[ij]->GetYaxis()->SetTitle(
"fC");
2850 statmn_eta[ij]->GetYaxis()->SetTitle(
"GeV");
2852 statmn_eta[ij]->GetYaxis()->SetTitleSize(.075);
2853 statmn_eta[ij]->GetYaxis()->CenterTitle();
2854 statmn_eta[ij]->GetYaxis()->SetTitleOffset(1.30);
2856 statmn_eta[ij]->Draw();
2860 sprintf(out_file,
"statmnho_%i_side%i.eps", irunold, side);
2861 c2x->SaveAs(out_file);
2863 sprintf(out_file,
"statmnho_%i_side%i.jpg", irunold, side);
2864 c2x->SaveAs(out_file);
2866 gStyle->SetOptLogy(1);
2867 gStyle->SetNdivisions(203,
"XY");
2870 for (
int ij=nmn; ij<nmx; ij++) {
2872 stat_eta[ij]->SetLineWidth(2);
2873 stat_eta[ij]->SetLineColor(4);
2874 stat_eta[ij]->GetXaxis()->SetTitle(
"#phi index");
2875 stat_eta[ij]->GetXaxis()->SetTitleSize(.08);
2876 stat_eta[ij]->GetXaxis()->CenterTitle();
2877 stat_eta[ij]->GetXaxis()->SetTitleOffset(0.80);
2878 stat_eta[ij]->GetXaxis()->SetLabelSize(.08);
2879 stat_eta[ij]->GetXaxis()->SetLabelOffset(.01);
2880 stat_eta[ij]->GetYaxis()->SetLabelSize(.08);
2881 stat_eta[ij]->GetYaxis()->SetLabelOffset(.01);
2883 stat_eta[ij]->Draw();
2887 sprintf(out_file,
"statho_%i_side%i.eps", irunold, side);
2888 c2x->SaveAs(out_file);
2890 sprintf(out_file,
"statho_%i_side%i.jpg", irunold, side);
2891 c2x->SaveAs(out_file);
2900 if (crossg[
j][
i]) {
delete crossg[
j][
i];}
2901 if (sigrsg[
j][i]) {
delete sigrsg[
j][
i];}
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
std::string theRootFileName
static const int npixrigh[21]
static const int mapx2[6][3]
static const int npixleft[21]
#define DEFINE_FWK_MODULE(type)
HOCalibAnalyzer(const edm::ParameterSet &)
static const int rout12mx
static const int phimap[4][21]
bool getByType(Handle< PROD > &result) const
static const int mapx1[6][3]
static const int npixriup[21]
void set_sigma(double &x, bool mdigi)
std::string theoutputtxtFile
virtual void analyze(const edm::Event &, const edm::EventSetup &)
const T & max(const T &a, const T &b)
Double_t totalfunc(Double_t *x, Double_t *par)
vector< float > sig_reg[netamx][nphimx+1]
std::string theoutputpsFile
static const int npixribt[21]
void fcnsg(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t flag)
static const int npixleup[21]
Double_t gausX(Double_t *x, Double_t *par)
static const int mapx0m[9][2]
void set_mean(double &x, bool mdigi)
vector< float > cro_ssg[netamx][nphimx+1]
static const int mapx0p[9][2]
T * make() const
make new ROOT object
void fcnbg(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t flag)
Double_t langaufun(Double_t *x, Double_t *par)
static const int etamap[4][21]
static const int npixlebt[21]
tuple size
Write out results.
Power< A, B >::type pow(const A &a, const B &b)