44 #include "TPostScript.h"
71 static const int mapx1[6][3]={{1,4,8}, {12,7,3}, {5,9,13}, {11,6,2}, {16,15,14}, {19,18,17}};
73 static const int mapx2[6][3]={{1,4,8}, {12,7,3}, {5,9,13}, {11,6,2}, {16,15,14}, {-1,-1,-1}};
75 static const int mapx0p[9][2]={{3,1}, {7,4}, {6,5}, {12,8}, {0,0}, {11,9}, {16,13}, {15,14}, {19,17}};
76 static const int mapx0m[9][2]={{17,19}, {14,15}, {13,16}, {9,11}, {0,0}, {8,12}, {5,6}, {4,7}, {1,3}};
78 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},
79 {-1, 0,3,1, 0,2,3, 1,0,2, -1, 3,1,2, 4,4,4, 5,5,5, -1},
80 {-1, 0,-1,0, 1,2,2, 1,3,5, -1, 5,3,6, 7,7,6, 8,-1,8, -1},
81 {-1, 8,-1,8, 7,6,6, 7,5,3, -1, 3,5,2, 1,1,2, 0,-1,0, -1}};
83 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},
84 {-1, 0,2,2, 1,0,1, 1,2,1, -1, 0,0,2, 2,1,0, 2,1,0, -1},
85 {-1, 1,-1,0, 1,1,0, 0,1,1, -1, 0,0,1, 1,0,0, 1,-1,0, -1},
86 {-1, 0,-1,1, 0,0,1, 1,0,0, -1, 1,1,0, 0,1,1, 0,-1,1, -1}};
89 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};
90 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};
91 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};
92 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};
93 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};
94 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};
112 Double_t
gausX(Double_t*
x, Double_t* par){
113 return par[0]*(TMath::Gaus(x[0], par[1], par[2], kTRUE));
130 Double_t invsq2pi = 0.3989422804014;
131 Double_t mpshift = -0.22278298;
148 mpc = par[1] - mpshift * par[0]*par[1];
151 xlow = x[0] - sc * par[3];
152 xupp = x[0] + sc * par[3];
154 step = (xupp-xlow) / np;
157 for(i=1.0; i<=np/2; i++) {
158 xx = xlow + (i-.5) *
step;
159 fland = TMath::Landau(xx,mpc,par[0]*par[1], kTRUE);
160 sum += fland * TMath::Gaus(x[0],xx,par[3]);
161 xx = xupp - (i-.5) *
step;
162 fland = TMath::Landau(xx,mpc,par[0]*par[1], kTRUE);
163 sum += fland * TMath::Gaus(x[0],xx,par[3]);
166 return (par[2] * step * sum * invsq2pi / par[3]);
173 void fcnbg(Int_t &npar, Double_t* gin, Double_t &
f, Double_t* par, Int_t flag) {
175 double fval = -par[0];
178 fval +=
log(
max(1.
e-30,par[0]*TMath::Gaus(xval, par[1], par[2], 1)));
184 void fcnsg(Int_t &npar, Double_t* gin, Double_t &
f, Double_t* par, Int_t flag) {
187 double fval = -(par[0]+par[5]);
227 virtual void endJob()
override ;
248 static const int ncut = 13;
249 static const int mypow_2_ncut = 8192;
348 static const int ringmx=5;
349 static const int sectmx=12;
350 static const int routmx=36;
351 static const int rout12mx=24;
352 static const int neffip=6;
355 TProfile* com_hotime[ringmx][sectmx];
356 TProfile* com_hopedtime[ringmx][sectmx];
359 TProfile* com_hbtime[ringmx][sectmx];
362 TH1F* com_corrsglb[ringmx][sectmx];
363 TH1F* com_corrsgrb[ringmx][sectmx];
364 TH1F* com_corrsglu[ringmx][sectmx];
365 TH1F* com_corrsgru[ringmx][sectmx];
366 TH1F* com_corrsgall[ringmx][sectmx];
368 TH1F* com_corrsgl[ringmx][sectmx];
369 TH1F* com_corrsgr[ringmx][sectmx];
372 TH1F* com_corrsgc[ringmx][sectmx];
375 TH1F* com_sigrsg[ringmx][routmx+1];
376 TH1F* com_crossg[ringmx][routmx+1];
377 float com_invang[ringmx][routmx+1];
409 TH1F* const_hpdrm[ringmx];
412 TH1F* peak_hpdrm[ringmx];
418 TH2F* sig_effi[neffip];
424 TProfile* sigvsevt[15][ncut];
428 int irun, ievt, itrg1, itrg2, isect, ndof,
nmuon;
429 float trkdr, trkdz, trkvx, trkvy,
trkvz, trkmm, trkth, trkph, chisq, therr, pherr, hodx, hody,
430 hoang, htime, hosig[9], hocorsig[18], hocro, hbhesig[9], caloen[3];
492 theFile =
new TFile(theRootFileName.c_str(),
"RECREATE");
495 T1 =
new TTree(
"T1",
"DT+CSC+HO");
497 T1->Branch(
"irun",&irun,
"irun/I");
498 T1->Branch(
"ievt",&ievt,
"ievt/I");
499 T1->Branch(
"itrg1",&itrg1,
"itrg1/I");
500 T1->Branch(
"itrg2",&itrg2,
"itrg2/I");
502 T1->Branch(
"isect",&isect,
"isect/I");
504 T1->Branch(
"ndof",&ndof,
"ndof/I");
505 T1->Branch(
"nmuon",&nmuon,
"nmuon/I");
507 T1->Branch(
"trkdr",&trkdr,
"trkdr/F");
508 T1->Branch(
"trkdz",&trkdz,
"trkdz/F");
510 T1->Branch(
"trkvx",&trkvx,
"trkvx/F");
511 T1->Branch(
"trkvy",&trkvy,
"trkvy/F");
512 T1->Branch(
"trkvz",&trkvz,
"trkvz/F");
513 T1->Branch(
"trkmm",&trkmm,
"trkmm/F");
514 T1->Branch(
"trkth",&trkth,
"trkth/F");
515 T1->Branch(
"trkph",&trkph,
"trkph/F");
517 T1->Branch(
"chisq",&chisq,
"chisq/F");
518 T1->Branch(
"therr",&therr,
"therr/F");
519 T1->Branch(
"pherr",&pherr,
"pherr/F");
520 T1->Branch(
"hodx",&hodx,
"hodx/F");
521 T1->Branch(
"hody",&hody,
"hody/F");
522 T1->Branch(
"hoang",&hoang,
"hoang/F");
524 T1->Branch(
"htime",&htime,
"htime/F");
525 T1->Branch(
"hosig",hosig,
"hosig[9]/F");
526 T1->Branch(
"hocro",&hocro,
"hocro/F");
527 T1->Branch(
"hocorsig",hocorsig,
"hocorsig[18]/F");
528 T1->Branch(
"caloen",caloen,
"caloen[3]/F");
531 T1->Branch(
"hbhesig",hbhesig,
"hbhesig[9]/F");
534 muonnm = fs->
make<TH1F>(
"muonnm",
"No of muon", 10, -0.5, 9.5);
535 muonmm = fs->
make<TH1F>(
"muonmm",
"P_{mu}", 200, -100., 100.);
536 muonth = fs->
make<TH1F>(
"muonth",
"{Theta}_{mu}", 180, 0., 180.);
537 muonph = fs->
make<TH1F>(
"muonph",
"{Phi}_{mu}", 180, -180., 180.);
538 muonch = fs->
make<TH1F>(
"muonch",
"{chi^2}/ndf", 100, 0., 1000.);
540 sel_muonnm = fs->
make<TH1F>(
"sel_muonnm",
"No of muon(sel)", 10, -0.5, 9.5);
541 sel_muonmm = fs->
make<TH1F>(
"sel_muonmm",
"P_{mu}(sel)", 200, -100., 100.);
542 sel_muonth = fs->
make<TH1F>(
"sel_muonth",
"{Theta}_{mu}(sel)", 180, 0., 180.);
543 sel_muonph = fs->
make<TH1F>(
"sel_muonph",
"{Phi}_{mu}(sel)", 180, -180., 180.);
544 sel_muonch = fs->
make<TH1F>(
"sel_muonch",
"{chi^2}/ndf(sel)", 100, 0., 1000.);
551 if (m_digiInput) {alow = -10.0; ahigh = 40.;}
553 float tmpwid = (ahigh-alow)/nbin;
554 nbn = int(-alow/tmpwid)+1;
556 if (nbn>nbin) nbn = nbin;
561 cout <<
"nbin "<< nbin<<
" "<<alow<<
" "<<ahigh<<
" "<<tmpwid<<
" "<<nbn<<endl;
563 for (
int i=0;
i<15;
i++) {
565 sprintf(title,
"sigvsndof_ring%i",
i+1);
566 sigvsevt[
i][0] = fs->
make<TProfile>(
title,
title, 50, 0., 50.,-9., 20.);
568 sprintf(title,
"sigvschisq_ring%i",
i+1);
569 sigvsevt[
i][1] = fs->
make<TProfile>(
title,
title, 50, 0., 30.,-9., 20.);
571 sprintf(title,
"sigvsth_ring%i",
i+1);
572 sigvsevt[
i][2] = fs->
make<TProfile>(
title,
title, 50, .7, 2.4,-9., 20.);
574 sprintf(title,
"sigvsph_ring%i",
i+1);
575 sigvsevt[
i][3] = fs->
make<TProfile>(
title,
title, 50, -2.4, -0.7,-9., 20.);
577 sprintf(title,
"sigvstherr_ring%i",
i+1);
578 sigvsevt[
i][4] = fs->
make<TProfile>(
title,
title, 50, 0., 0.2,-9., 20.);
580 sprintf(title,
"sigvspherr_ring%i",
i+1);
581 sigvsevt[
i][5] = fs->
make<TProfile>(
title,
title, 50, 0., 0.2,-9., 20.);
583 sprintf(title,
"sigvsdircos_ring%i",
i+1);
584 sigvsevt[
i][6] = fs->
make<TProfile>(
title,
title, 50, 0.5, 1.,-9., 20.);
586 sprintf(title,
"sigvstrkmm_ring%i",
i+1);
587 sigvsevt[
i][7] = fs->
make<TProfile>(
title,
title, 50, 0., 50.,-9., 20.);
589 sprintf(title,
"sigvsnmuon_ring%i",
i+1);
590 sigvsevt[
i][8] = fs->
make<TProfile>(
title,
title, 5, 0.5, 5.5,-9., 20.);
592 sprintf(title,
"sigvserr_ring%i",
i+1);
593 sigvsevt[
i][9] = fs->
make<TProfile>(
title,
title, 50, 0., .3, -9., 20.);
595 sprintf(title,
"sigvsaccx_ring%i",
i+1);
596 sigvsevt[
i][10] = fs->
make<TProfile>(
title,
title, 100, -25., 25., -9., 20.);
598 sprintf(title,
"sigvsaccy_ring%i",
i+1);
599 sigvsevt[
i][11] = fs->
make<TProfile>(
title,
title, 100, -25., 25., -9., 20.);
601 sprintf(title,
"sigvscalo_ring%i",
i+1);
602 sigvsevt[
i][12] = fs->
make<TProfile>(
title,
title, 100, 0., 15., -9., 20.);
606 int ieta = (
j<15) ?
j+1 : 14-
j;
609 sprintf(title,
"sig_eta%i_allphi", ieta);
611 sprintf(title,
"sig_eta%i_phi%i", ieta,
i+1);
615 sprintf(title,
"ped_eta%i_allphi", ieta);
617 sprintf(title,
"ped_eta%i_phi%i", ieta,
i+1);
624 sprintf(title,
"hotime_eta%i_phi%i", (
j<=14) ?
j+1 : 14-
j,
i+1);
627 sprintf(title,
"hopedtime_eta%i_phi%i", (
j<=14) ?
j+1 : 14-
j,
i+1);
628 hopedtime[
j][
i] = fs->
make<TProfile>(
title,
title, 10, -0.5, 9.5, -1.0, 30.0);
632 sprintf(title,
"hbtime_eta%i_phi%i", (
j<=15) ?
j+1 : 15-
j,
i+1);
637 sprintf(title,
"corrsg_eta%i_phi%i_leftbottom", ieta,
i+1);
640 sprintf(title,
"corrsg_eta%i_phi%i_rightbottom", ieta,
i+1);
643 sprintf(title,
"corrsg_eta%i_phi%i_leftup", ieta,
i+1);
646 sprintf(title,
"corrsg_eta%i_phi%i_rightup", ieta,
i+1);
649 sprintf(title,
"corrsg_eta%i_phi%i_all", ieta,
i+1);
652 sprintf(title,
"corrsg_eta%i_phi%i_left", ieta,
i+1);
655 sprintf(title,
"corrsg_eta%i_phi%i_right", ieta,
i+1);
659 sprintf(title,
"corrsg_eta%i_phi%i_centrl", ieta,
i+1);
665 mnsigrsg = fs->
make<TH1F>(
"mnsigrsg",
"mnsigrsg", netamx*
nphimx+ringmx*routmx, -0.5, netamx*
nphimx+ringmx*routmx -0.5);
666 rmssigrsg = fs->
make<TH1F>(
"rmssigrsg",
"rmssigrsg", netamx*
nphimx+ringmx*routmx, -0.5, netamx*
nphimx+ringmx*routmx -0.5);
667 nevsigrsg = fs->
make<TH1F>(
"nevsigrsg",
"nevsigrsg", netamx*
nphimx+ringmx*routmx, -0.5, netamx*
nphimx+ringmx*routmx -0.5);
669 mncrossg = fs->
make<TH1F>(
"mncrossg",
"mncrossg", netamx*
nphimx+ringmx*routmx, -0.5, netamx*
nphimx+ringmx*routmx -0.5);
670 rmscrossg = fs->
make<TH1F>(
"rmscrossg",
"rmscrossg", netamx*
nphimx+ringmx*routmx, -0.5, netamx*
nphimx+ringmx*routmx -0.5);
671 nevcrossg = fs->
make<TH1F>(
"nevcrossg",
"nevcrossg", netamx*
nphimx+ringmx*routmx, -0.5, netamx*
nphimx+ringmx*routmx -0.5);
674 for (
int i=0;
i<neffip;
i++) {
676 sprintf(title,
"Total projected muon in tower");
677 sprintf(name,
"total_evt");
679 sprintf(title,
"Efficiency with sig >%i #sigma",
i);
680 sprintf(name,
"Effi_with_gt%i_sig",
i);
685 sprintf(title,
"Mean Energy of all towers");
686 sprintf(name,
"mean_energy");
690 mncorrsglb = fs->
make<TH1F>(
"mncorrsglb",
"mncorrsglb", netamx*
nphimx+60, -0.5, netamx*nphimx+59.5);
691 rmscorrsglb = fs->
make<TH1F>(
"rmscorrsglb",
"rmscorrsglb", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
692 nevcorrsglb = fs->
make<TH1F>(
"nevcorrsglb",
"nevcorrsglb", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
694 mncorrsgrb = fs->
make<TH1F>(
"mncorrsgrb",
"mncorrsgrb", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
695 rmscorrsgrb = fs->
make<TH1F>(
"rmscorrsgrb",
"rmscorrsgrb", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
696 nevcorrsgrb = fs->
make<TH1F>(
"nevcorrsgrb",
"nevcorrsgrb", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
698 mncorrsglu = fs->
make<TH1F>(
"mncorrsglu",
"mncorrsglu", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
699 rmscorrsglu = fs->
make<TH1F>(
"rmscorrsglu",
"rmscorrsglu", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
700 nevcorrsglu = fs->
make<TH1F>(
"nevcorrsglu",
"nevcorrsglu", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
702 mncorrsgru = fs->
make<TH1F>(
"mncorrsgru",
"mncorrsgru", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
703 rmscorrsgru = fs->
make<TH1F>(
"rmscorrsgru",
"rmscorrsgru", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
704 nevcorrsgru = fs->
make<TH1F>(
"nevcorrsgru",
"nevcorrsgru", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
706 mncorrsgall = fs->
make<TH1F>(
"mncorrsgall",
"mncorrsgall", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
707 rmscorrsgall = fs->
make<TH1F>(
"rmscorrsgall",
"rmscorrsgall", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
708 nevcorrsgall = fs->
make<TH1F>(
"nevcorrsgall",
"nevcorrsgall", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
710 mncorrsgl = fs->
make<TH1F>(
"mncorrsgl",
"mncorrsgl", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
711 rmscorrsgl = fs->
make<TH1F>(
"rmscorrsgl",
"rmscorrsgl", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
712 nevcorrsgl = fs->
make<TH1F>(
"nevcorrsgl",
"nevcorrsgl", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
714 mncorrsgr = fs->
make<TH1F>(
"mncorrsgr",
"mncorrsgr", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
715 rmscorrsgr = fs->
make<TH1F>(
"rmscorrsgr",
"rmscorrsgr", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
716 nevcorrsgr = fs->
make<TH1F>(
"nevcorrsgr",
"nevcorrsgr", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
720 mncorrsgc = fs->
make<TH1F>(
"mncorrsgc",
"mncorrsgc", netamx*
nphimx+60, -0.5, netamx*nphimx+59.5);
721 rmscorrsgc = fs->
make<TH1F>(
"rmscorrsgc",
"rmscorrsgc", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
722 nevcorrsgc = fs->
make<TH1F>(
"nevcorrsgc",
"nevcorrsgc", netamx*nphimx+60, -0.5, netamx*nphimx+59.5);
726 for (
int j=0;
j<ringmx;
j++) {
728 for (
int i=0;
i<routmx+1;
i++) {
729 if (
j!=2 &&
i>rout12mx)
continue;
732 if (
j==2) {phmn = 2*
i-1; phmx=2*
i;}
733 if (phmn <=0) phmn =
nphimx+phmn;
734 if (phmx <=0) phmx =
nphimx+phmx;
736 if ((
j==2 &&
i==routmx) || (
j!=2 &&
i==rout12mx)) {
737 sprintf(title,
"sig_ring%i_allrm",
j-2);
738 sprintf(name,
"sig_ring%i_allrm",
j-2);
740 sprintf(title,
"sig_ring%i_phi%i-%i",
j-2,phmn,phmx);
741 sprintf(name,
"sig_ring%i_rout%i",
j-2,
i+1);
744 if ((
j==2 &&
i==routmx) || (
j!=2 &&
i==rout12mx)) {
745 sprintf(title,
"ped_ring%i_allrm",
j-2);
746 sprintf(name,
"ped_ring%i_allrm",
j-2);
748 sprintf(title,
"ped_ring%i_phi%i-%i",
j-2,phmn, phmx);
749 sprintf(name,
"ped_ring%i_rout%i",
j-2,
i+1);
754 for (
int i=0;
i<sectmx;
i++) {
756 sprintf(title,
"com_hotime_ring%i_sect%i",
j-2,
i+1);
757 com_hotime[
j][
i] = fs->
make<TProfile>(
title,
title, 10, -0.5, 9.5, -1.0, 30.0);
759 sprintf(title,
"com_hopedtime_ring%i_sect%i",
j-2,
i+1);
760 com_hopedtime[
j][
i] = fs->
make<TProfile>(
title,
title, 10, -0.5, 9.5, -1.0, 30.0);
763 sprintf(title,
"_com_hbtime_ring%i_serrct%i",
j-2,
i+1);
764 com_hbtime[
j][
i] = fs->
make<TProfile>(
title,
title, 10, -0.5, 9.5, -1.0, 30.0);
768 sprintf(title,
"com_corrsg_ring%i_sect%i_leftbottom",
j-2,
i+1);
771 sprintf(title,
"com_corrsg_ring%i_sect%i_rightbottom",
j-2,
i+1);
774 sprintf(title,
"com_corrsg_ring%i_sect%i_leftup",
j-2,
i+1);
777 sprintf(title,
"com_corrsg_ring%i_sect%i_rightup",
j-2,
i+1);
780 sprintf(title,
"com_corrsg_ring%i_sect%i_all",
j-2,
i+1);
783 sprintf(title,
"com_corrsg_ring%i_sect%i_left",
j-2,
i+1);
786 sprintf(title,
"com_corrsg_ring%i_sect%i_right",
j-2,
i+1);
791 sprintf(title,
"com_corrsg_ring%i_sect%i_centrl",
j-2,
i+1);
798 for (
int i=-1;
i<=1;
i++) {
799 for (
int j=-1;
j<=1;
j++) {
802 sprintf(title,
"hosct2p_eta%i_phi%i",
i,
j);
805 sprintf(title,
"hosct1p_eta%i_phi%i",
i,
j);
808 sprintf(title,
"hosct00_eta%i_phi%i",
i,
j);
811 sprintf(title,
"hosct1m_eta%i_phi%i",
i,
j);
814 sprintf(title,
"hosct2m_eta%i_phi%i",
i,
j);
818 sprintf(title,
"hbhesig_eta%i_phi%i",
i,
j);
825 ped_evt = fs->
make<TH1F>(
"ped_evt",
"ped_evt", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
826 ped_mean = fs->
make<TH1F>(
"ped_mean",
"ped_mean", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
827 ped_width = fs->
make<TH1F>(
"ped_width",
"ped_width", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
829 fit_chi = fs->
make<TH1F>(
"fit_chi",
"fit_chi", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
830 sig_evt = fs->
make<TH1F>(
"sig_evt",
"sig_evt", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
831 fit_sigevt = fs->
make<TH1F>(
"fit_sigevt",
"fit_sigevt", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
832 fit_bkgevt = fs->
make<TH1F>(
"fit_bkgevt",
"fit_bkgevt", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
833 sig_mean = fs->
make<TH1F>(
"sig_mean",
"sig_mean", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
834 sig_diff = fs->
make<TH1F>(
"sig_diff",
"sig_diff", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
835 sig_width = fs->
make<TH1F>(
"sig_width",
"sig_width", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
836 sig_sigma = fs->
make<TH1F>(
"sig_sigma",
"sig_sigma", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
837 sig_meanerr = fs->
make<TH1F>(
"sig_meanerr",
"sig_meanerr", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
838 sig_meanerrp = fs->
make<TH1F>(
"sig_meanerrp",
"sig_meanerrp", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
839 sig_signf = fs->
make<TH1F>(
"sig_signf",
"sig_signf", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
841 ped_statmean = fs->
make<TH1F>(
"ped_statmean",
"ped_statmean", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
842 sig_statmean = fs->
make<TH1F>(
"sig_statmean",
"sig_statmean", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
843 ped_rms = fs->
make<TH1F>(
"ped_rms",
"ped_rms", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
844 sig_rms = fs->
make<TH1F>(
"sig_rms",
"sig_rms", netamx*
nphimx, -0.5, netamx*nphimx-0.5);
846 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);
848 for (
int ij=0; ij<
netamx; ij++) {
849 int ieta = (ij<15) ? ij+1 : 14-ij;
850 sprintf(title,
"Cont_Eta_%i", ieta);
853 sprintf(title,
"Peak_Eta_%i", ieta);
857 for (
int ij=0; ij<ringmx; ij++) {
859 int iread = (ij==2) ? routmx : rout12mx;
860 sprintf(title,
"Cont_hpdrm_%i", iring);
861 const_hpdrm[ij] = fs->
make<TH1F>(
title,
title, iread, 0.5, iread+0.5);
863 sprintf(title,
"Peak_hpdrm_%i", iring);
864 peak_hpdrm[ij] = fs->
make<TH1F>(
title,
title, iread, 0.5, iread+0.5);
867 mean_phi_hst = fs->
make<TH1F>(
"mean_phi_hst",
"mean_phi_hst", netamx+1, -(netamx+1)/2., (netamx+1)/2.);
868 mean_phi_ave = fs->
make<TH1F>(
"mean_phi_ave",
"mean_phi_ave", netamx+1, -(netamx+1)/2., (netamx+1)/2.);
870 mean_eta_ave = fs->
make<TH1F>(
"mean_eta_ave",
"mean_eta_ave",
nphimx, 0.5, nphimx+0.5);
874 for (
int ij=0; ij<
netamx; ij++) {
875 int ieta = (ij<15) ? ij+1 : 14-ij;
877 sprintf(title,
"Stat_Eta_%i", ieta);
880 sprintf(title,
"#mu(stat)_Eta_%i", ieta);
889 for (
int j=0;
j<ringmx;
j++) {
890 for (
int i=0;
i<routmx+1;
i++) {
891 com_invang[
j][
i] = 0.0;
907 cout <<
" Selected events # is "<<ipass<<endl;
932 int mypow_2_10 = 1024;
933 int mypow_2_11 = 2048;
934 int mypow_2_12 = 4096;
995 float pival = acos(-1.);
996 irunold = irun = iEvent.
id().
run();
1002 bool isCosMu =
true;
1008 if (isCosMu && (*HOCalib).size() >0 ) {
1009 nmuon = (*HOCalib).size();
1010 if (Nevents%5000==1)
cout <<
"nmuon event # "<<Nevents<<
" Run # "<<iEvent.id().run()<<
" Evt # "<<iEvent.id().event()<<
" "<<nmuon<<endl;
1012 for (HOCalibVariableCollection::const_iterator hoC=(*HOCalib).begin(); hoC!=(*HOCalib).end(); hoC++){
1013 itrg1 = (*hoC).trig1;
1014 itrg2 = (*hoC).trig2;
1016 trkdr = (*hoC).trkdr;
1017 trkdz = (*hoC).trkdz;
1019 trkvx = (*hoC).trkvx;
1020 trkvy = (*hoC).trkvy;
1021 trkvz = (*hoC).trkvz;
1023 trkmm = (*hoC).trkmm;
1024 trkth = (*hoC).trkth;
1025 trkph = (*hoC).trkph;
1027 ndof = (int)(*hoC).ndof;
1029 chisq = (*hoC).chisq;
1031 therr = (*hoC).therr;
1032 pherr = (*hoC).pherr;
1033 trkph = (*hoC).trkph;
1035 isect = (*hoC).isect;
1038 hoang = (*hoC).hoang;
1039 htime = (*hoC).htime;
1040 for (
int i=0;
i<9;
i++) { hosig[
i] = (*hoC).hosig[
i];}
1041 for (
int i=0;
i<18;
i++) { hocorsig[
i] = (*hoC).hocorsig[
i];}
1042 hocro = (*hoC).hocro;
1043 for (
int i=0;
i<3;
i++) { caloen[
i] = (*hoC).caloen[
i];}
1045 if (m_hbinfo) {
for (
int i=0;
i<9;
i++) { hbhesig[
i] = (*hoC).hbhesig[
i];}}
1064 if (ndof >=15 && chisq <30) iselect3 = 1;
1066 if (isect <0)
continue;
1067 if (fabs(trkth-pival/2)<0.000001)
continue;
1069 int ieta = int((
abs(isect)%10000)/100.)-30;
1070 if (
abs(ieta)>=16)
continue;
1071 int iphi =
abs(isect)%100;
1073 int tmpsect = int((iphi + 1)/6.) + 1;
1074 if (tmpsect >12) tmpsect = 1;
1077 int tmpeta = ieta + 4;
1078 if (ieta >=-15 && ieta <=-11) {iring = -2; tmpeta =-11-ieta; }
1079 if (ieta >=-10 && ieta <=-5) {iring = -1; tmpeta =-5-ieta; }
1080 if (ieta >= 5 && ieta <= 10) {iring = 1; tmpeta =ieta-5; }
1081 if (ieta >= 11 && ieta <= 15) {iring = 2; tmpeta =ieta-11;}
1083 int iring2 = iring + 2;
1085 int tmprout = int((iphi + 1)/3.) + 1;
1086 int tmproutmx =routmx;
1088 tmprout = int((iphi + 1)/2.) + 1;
1089 if (tmprout >routmx) tmprout = 1;
1091 if (tmprout >rout12mx) tmprout = 1;
1092 tmproutmx =rout12mx;
1098 if (
abs(ndof) >=20 &&
abs(ndof) <40) {ips0 = (int)mypow_2_0; ipsall += ips0;}
1099 if (chisq >0 && chisq<15) {ips1 = (int)mypow_2_1; ipsall +=ips1;}
1100 if (fabs(trkth-pival/2) <21.5) {ips2 = (int)mypow_2_2; ipsall +=ips2;}
1101 if (fabs(trkph+pival/2) <21.5) {ips3 = (int)mypow_2_3; ipsall +=ips3;}
1103 if (therr <0.02) {ips4 = (int)mypow_2_4; ipsall +=ips4;}
1104 if (pherr <0.0002) {ips5 = (int)mypow_2_5; ipsall +=ips5;}
1105 if (fabs(hoang) >0.30) {ips6 = (int)mypow_2_6; ipsall +=ips6;}
1106 if (fabs(trkmm) >0.100) {ips7 = (int)mypow_2_7; ipsall +=ips7;}
1108 if (nmuon >=1 && nmuon <=4) {ips8 = (int)mypow_2_8; ipsall +=ips8;}
1111 if (fabs(hodx)<100 && fabs(hodx)>2 && fabs(hocorsig[8]) <40 && fabs(hocorsig[8]) >2 )
1112 {ips10=(int)mypow_2_10;ipsall +=ips10;}
1114 if (fabs(hody)<100 && fabs(hody)>2 && fabs(hocorsig[9]) <40 && fabs(hocorsig[9]) >2 )
1115 {ips11=(int)mypow_2_11;ipsall +=ips11;}
1118 if (fabs(hodx)<100 && fabs(hodx)>2 )
1119 {ips10=(int)mypow_2_10;ipsall +=ips10;}
1121 if (fabs(hody)<100 && fabs(hody)>2)
1122 {ips11=(int)mypow_2_11;ipsall +=ips11;}
1124 if (caloen[0] ==0) { ips12=(int)mypow_2_12;ipsall +=ips12;}
1127 if (
abs(ndof) >=20 &&
abs(ndof) <40) {ips0 = (int)mypow_2_0; ipsall += ips0;}
1128 if (chisq >0 && chisq<15) {ips1 = (int)mypow_2_1; ipsall +=ips1;}
1129 if (fabs(trkth-pival/2) <21.5) {ips2 = (int)mypow_2_2; ipsall +=ips2;}
1130 if (fabs(trkph+pival/2) <21.5) {ips3 = (int)mypow_2_3; ipsall +=ips3;}
1132 if (therr <0.02) {ips4 = (int)mypow_2_4; ipsall +=ips4;}
1133 if (pherr <0.0002) {ips5 = (int)mypow_2_5; ipsall +=ips5;}
1134 if (fabs(hoang) >0.30) {ips6 = (int)mypow_2_6; ipsall +=ips6;}
1135 if (fabs(trkmm) >4.0) {ips7 = (int)mypow_2_7; ipsall +=ips7;}
1136 if (nmuon >=1 && nmuon <=2) {ips8 = (int)mypow_2_8; ipsall +=ips8;}
1139 if (fabs(hodx)<100 && fabs(hodx)>2 && fabs(hocorsig[8]) <40 && fabs(hocorsig[8]) >2 )
1140 {ips10=(int)mypow_2_10;ipsall +=ips10;}
1142 if (fabs(hody)<100 && fabs(hody)>2 && fabs(hocorsig[9]) <40 && fabs(hocorsig[9]) >2 )
1143 {ips11=(int)mypow_2_11;ipsall +=ips11;}
1146 if (fabs(hodx)<100 && fabs(hodx)>2 )
1147 {ips10=(int)mypow_2_10;ipsall +=ips10;}
1149 if (fabs(hody)<100 && fabs(hody)>2)
1150 {ips11=(int)mypow_2_11;ipsall +=ips11;}
1153 if (ndof >0 && caloen[0]<5.0) {ips12=(int)mypow_2_12;ipsall +=ips12;}
1158 if (htime >2.5 && htime <6.5) {ips9=(int)mypow_2_9;ipsall +=ips9;}
1160 if (htime >-40 && htime <60) {ips9=(int)mypow_2_9;ipsall +=ips9;}
1163 if (ipsall-ips0==mypow_2_ncut-mypow_2_0-1) sigvsevt[iring2][0]->Fill(
abs(ndof), hosig[4]);
1164 if (ipsall-ips1==mypow_2_ncut-mypow_2_1-1) sigvsevt[iring2][1]->Fill(chisq, hosig[4]);
1165 if (ipsall-ips2==mypow_2_ncut-mypow_2_2-1) sigvsevt[iring2][2]->Fill(trkth, hosig[4]);
1166 if (ipsall-ips3==mypow_2_ncut-mypow_2_3-1) sigvsevt[iring2][3]->Fill(trkph, hosig[4]);
1167 if (ipsall-ips4==mypow_2_ncut-mypow_2_4-1) sigvsevt[iring2][4]->Fill(therr, hosig[4]);
1168 if (ipsall-ips5==mypow_2_ncut-mypow_2_5-1) sigvsevt[iring2][5]->Fill(pherr, hosig[4]);
1169 if (ipsall-ips6==mypow_2_ncut-mypow_2_6-1) sigvsevt[iring2][6]->Fill(hoang, hosig[4]);
1170 if (ipsall-ips7==mypow_2_ncut-mypow_2_7-1) sigvsevt[iring2][7]->Fill(fabs(trkmm), hosig[4]);
1171 if (ipsall-ips8==mypow_2_ncut-mypow_2_8-1) sigvsevt[iring2][8]->Fill(nmuon, hosig[4]);
1172 if (ipsall-ips9==mypow_2_ncut-mypow_2_9-1) sigvsevt[iring2][9]->Fill(htime, hosig[4]);
1173 if (ipsall-ips10==mypow_2_ncut-mypow_2_10-1) sigvsevt[iring2][10]->Fill(hodx, hosig[4]);
1174 if (ipsall-ips11==mypow_2_ncut-mypow_2_11-1) sigvsevt[iring2][11]->Fill(hody, hosig[4]);
1176 if (ipsall-ips12==mypow_2_ncut-mypow_2_12-1) sigvsevt[iring2][12]->Fill(caloen[0], hosig[4]);
1179 sigvsevt[iring2+5][0]->Fill(
abs(ndof), hosig[4]);
1181 sigvsevt[iring2+5][1]->Fill(chisq, hosig[4]);
1183 sigvsevt[iring2+5][2]->Fill(trkth, hosig[4]);
1185 sigvsevt[iring2+5][3]->Fill(trkph, hosig[4]);
1187 sigvsevt[iring2+5][4]->Fill(therr, hosig[4]);
1189 sigvsevt[iring2+5][5]->Fill(pherr, hosig[4]);
1191 sigvsevt[iring2+5][6]->Fill(hoang, hosig[4]);
1193 sigvsevt[iring2+5][7]->Fill(fabs(trkmm), hosig[4]);
1195 sigvsevt[iring2+5][8]->Fill(nmuon, hosig[4]);
1197 sigvsevt[iring2+5][9]->Fill(htime, hosig[4]);
1199 sigvsevt[iring2+5][10]->Fill(hodx, hosig[4]);
1201 sigvsevt[iring2+5][11]->Fill(hody, hosig[4]);
1203 if (!m_cosmic) sigvsevt[iring2+5][12]->Fill(caloen[0], hosig[4]);
1217 sigvsevt[iring2+10][0]->Fill(
abs(ndof), hosig[4]);
1218 sigvsevt[iring2+10][1]->Fill(chisq, hosig[4]);
1219 sigvsevt[iring2+10][2]->Fill(trkth, hosig[4]);
1220 sigvsevt[iring2+10][3]->Fill(trkph, hosig[4]);
1221 sigvsevt[iring2+10][4]->Fill(therr, hosig[4]);
1222 sigvsevt[iring2+10][5]->Fill(pherr, hosig[4]);
1223 sigvsevt[iring2+10][6]->Fill(hoang, hosig[4]);
1224 sigvsevt[iring2+10][7]->Fill(fabs(trkmm), hosig[4]);
1225 sigvsevt[iring2+10][8]->Fill(nmuon, hosig[4]);
1226 sigvsevt[iring2+10][9]->Fill(htime, hosig[4]);
1227 sigvsevt[iring2+10][10]->Fill(hodx, hosig[4]);
1228 sigvsevt[iring2+10][11]->Fill(hody, hosig[4]);
1229 if (!m_cosmic) sigvsevt[iring2+10][12]->Fill(caloen[0], hosig[4]);
1231 int iselect = (ipsall == mypow_2_ncut - 1) ? 1 : 0;
1233 if (hocro !=-100.0 && hocro <-50.0) hocro +=100.;
1235 muonnm->Fill(nmuon);
1236 muonmm->Fill(trkmm);
1237 muonth->Fill(trkth*180/pival);
1238 muonph->Fill(trkph*180/pival);
1239 muonch->Fill(chisq);
1243 sel_muonnm->Fill(nmuon);
1244 sel_muonmm->Fill(trkmm);
1245 sel_muonth->Fill(trkth*180/pival);
1246 sel_muonph->Fill(trkph*180/pival);
1247 sel_muonch->Fill(chisq);
1250 if (iselect3) T1->Fill();
1252 int tmpphi = (iphi + 1)%3;
1259 tmpphi = (iphi+1)%2;
1260 if (tmpsect==2 || tmpsect==3 || tmpsect==6 || tmpsect==7 || tmpsect==10 || tmpsect==11) {
1261 npixel =
mapx0p[tmpeta][tmpphi];
1264 npixel =
mapx0m[tmpeta][tmpphi];
1269 if (tmpsect%2==1) iflip =1;
1270 if (
abs(iring)==1) {
1271 npixel =
mapx1[tmpeta][(iflip==0) ? tmpphi :
abs(tmpphi-2)];
1274 npixel =
mapx2[tmpeta][(iflip==0) ? tmpphi :
abs(tmpphi-2)];
1279 int tmpeta1 = (ieta>0) ? ieta -1 : -ieta +14;
1282 int tmpphi1 = iphi -1 ;
1285 if (hosig[4]!=-100) {
1287 if (caloen[2]<=0.0) iselect2=1;
1289 if (caloen[2]<=3.0) iselect2=1;
1297 int tmpphi2 = iphi - 1;
1298 if (!m_digiInput) { tmpphi2 = (iphi+6 <=
nphimx) ? iphi+5 : iphi+5-
nphimx;}
1300 int tmpsect2 = int((tmpphi2 + 2)/6.) + 1;
1301 if (tmpsect2 >12) tmpsect2 = 1;
1303 int tmprout2 = int((tmpphi2 + 2)/3.) + 1;
1305 tmprout2 = int((tmpphi2 + 2)/2.) + 1;
1306 if (tmprout2 >routmx) tmprout2 = 1;
1308 if (tmprout2 >rout12mx) tmprout2 = 1;
1312 if (hocro>alow && hocro<ahigh) {
1313 if (!m_histfit)
cro_ssg[tmpeta1][tmpphi2].push_back(hocro);
1314 crossg[tmpeta1][tmpphi2]->Fill(hocro);
1318 if (tmpphi2 >=0 && tmpphi2 <
nphimx) {
1319 crossg[tmpeta1][
nphimx]->Fill(hocro);
1322 com_crossg[iring2][tmprout2-1]->Fill(hocro);
1323 com_crossg[iring2][tmproutmx]->Fill(hocro);
1328 for (
int ij=0; ij<neffip; ij++) {
1330 sig_effi[ij]->Fill(ieta, iphi, 1.);
1332 if (hosig[4] >ij*m_sigma) {
1333 sig_effi[ij]->Fill(ieta, iphi, 1.);
1341 if (hosig[4]>-50&& hosig[4] <15) {
1342 sigrsg[tmpeta1][tmpphi1]->Fill(hosig[4]);
1343 if (!m_histfit && hosig[4]<=ahigh/2.)
sig_reg[tmpeta1][tmpphi1].push_back(hosig[4]);
1344 invang[tmpeta1][tmpphi1] += 1./fabs(hoang);
1348 if (tmpphi1 >=0 && tmpphi1 <
nphimx) {
1349 sigrsg[tmpeta1][
nphimx]->Fill(hosig[4]);
1350 invang[tmpeta1][
nphimx] += 1./fabs(hoang);
1354 com_sigrsg[iring2][tmprout-1]->Fill(hosig[4]);
1355 com_invang[iring2][tmprout-1] += 1./fabs(hoang);
1357 com_sigrsg[iring2][tmproutmx]->Fill(hosig[4]);
1358 com_invang[iring2][tmproutmx] += 1./fabs(hoang);
1361 if (m_checkmap || m_correl) {
1362 tmpeta =
etamap[itag][npixel];
1363 tmpphi =
phimap[itag][npixel];
1364 if (tmpeta>=0 && tmpphi >=0) {
1365 if (iflip !=0) tmpphi =
abs(tmpphi-2);
1366 if (
int((hocorsig[fact*tmpeta+tmpphi]-hosig[4])*10000)/10000.!=0) {
1368 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;
1370 for (
int i=0;
i<18;
i++) {
cout <<
" "<<
i<<
" "<<hocorsig[
i];}
1371 cout<<
" ix "<<iaxxx<<
" "<<ibxxx<<endl;
1374 corrsgc[tmpeta1][tmpphi1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1376 com_corrsgc[iring2][tmpsect-1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1382 float allcorsig = 0.0;
1385 tmpphi =
phimap[itag][npixleft[npixel]];
1387 if (tmpeta>=0 && tmpphi >=0) {
1388 if (iflip !=0) tmpphi =
abs(tmpphi-2);
1389 corrsgl[tmpeta1][tmpphi1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1390 allcorsig +=hocorsig[fact*tmpeta+tmpphi];
1392 com_corrsgl[iring2][tmpsect-1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1397 tmpphi =
phimap[itag][npixrigh[npixel]];
1398 if (tmpeta>=0 && tmpphi >=0) {
1399 if (iflip !=0) tmpphi =
abs(tmpphi-2);
1400 corrsgr[tmpeta1][tmpphi1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1401 allcorsig +=hocorsig[fact*tmpeta+tmpphi];
1403 com_corrsgr[iring2][tmpsect-1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1408 tmpphi =
phimap[itag][npixlebt[npixel]];
1409 if (tmpeta>=0 && tmpphi >=0) {
1410 if (iflip !=0) tmpphi =
abs(tmpphi-2);
1411 corrsglb[tmpeta1][tmpphi1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1412 allcorsig +=hocorsig[fact*tmpeta+tmpphi];
1414 com_corrsglb[iring2][tmpsect-1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1419 tmpphi =
phimap[itag][npixribt[npixel]];
1420 if (tmpeta>=0 && tmpphi >=0) {
1421 if (iflip !=0) tmpphi =
abs(tmpphi-2);
1422 corrsgrb[tmpeta1][tmpphi1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1423 allcorsig +=hocorsig[fact*tmpeta+tmpphi];
1425 com_corrsgrb[iring2][tmpsect-1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1430 tmpphi =
phimap[itag][npixleup[npixel]];
1431 if (tmpeta>=0 && tmpphi >=0) {
1432 if (iflip !=0) tmpphi =
abs(tmpphi-2);
1433 corrsglu[tmpeta1][tmpphi1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1434 allcorsig +=hocorsig[fact*tmpeta+tmpphi];
1436 com_corrsglu[iring2][tmpsect-1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1441 tmpphi =
phimap[itag][npixriup[npixel]];
1442 if (tmpeta>=0 && tmpphi >=0) {
1443 if (iflip !=0) tmpphi =
abs(tmpphi-2);
1444 corrsgru[tmpeta1][tmpphi1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1445 allcorsig +=hocorsig[fact*tmpeta+tmpphi];
1447 com_corrsgru[iring2][tmpsect-1]->Fill(hocorsig[fact*tmpeta+tmpphi]);
1450 corrsgall[tmpeta1][tmpphi1]->Fill(allcorsig);
1452 com_corrsgall[iring2][tmpsect-1]->Fill(allcorsig);
1457 for (
int k=0;
k<9;
k++) {
1460 case 2 : ho_sig2p[
k]->Fill(hosig[
k]);
break;
1461 case 1 : ho_sig1p[
k]->Fill(hosig[k]);
break;
1462 case 0 : ho_sig00[
k]->Fill(hosig[k]);
break;
1463 case -1 : ho_sig1m[
k]->Fill(hosig[k]);
break;
1464 case -2 : ho_sig2m[
k]->Fill(hosig[k]);
break;
1467 hbhe_sig[
k]->Fill(hbhesig[
k]);
1476 #ifdef THIS_IS_AN_EVENT_EXAMPLE
1478 iEvent.getByLabel(
"example",pIn);
1481 #ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE
1483 iSetup.
get<SetupRecord>().
get(pSetup);
1503 nevsigrsg->Fill(netamx*
i+
j, sigrsg[
j][
i]->GetEntries());
1504 mnsigrsg->Fill(netamx*
i+
j, sigrsg[
j][
i]->GetMean());
1505 rmssigrsg->Fill(netamx*
i+
j, sigrsg[
j][
i]->GetRMS());
1507 nevcrossg->Fill(netamx*
i+
j, crossg[
j][
i]->GetEntries());
1508 mncrossg->Fill(netamx*
i+
j, crossg[
j][
i]->GetMean());
1509 rmscrossg->Fill(netamx*
i+
j, crossg[
j][
i]->GetRMS());
1513 nevcorrsglb->Fill(netamx*
i+
j, corrsglb[
j][
i]->GetEntries());
1514 mncorrsglb->Fill(netamx*
i+
j, corrsglb[
j][
i]->GetMean());
1515 rmscorrsglb->Fill(netamx*
i+
j, corrsglb[
j][
i]->GetRMS());
1517 nevcorrsgrb->Fill(netamx*
i+
j, corrsgrb[
j][
i]->GetEntries());
1518 mncorrsgrb->Fill(netamx*
i+
j, corrsgrb[
j][
i]->GetMean());
1519 rmscorrsgrb->Fill(netamx*
i+
j, corrsgrb[
j][
i]->GetRMS());
1521 nevcorrsglu->Fill(netamx*
i+
j, corrsglu[
j][
i]->GetEntries());
1522 mncorrsglu->Fill(netamx*
i+
j, corrsglu[
j][
i]->GetMean());
1523 rmscorrsglu->Fill(netamx*
i+
j, corrsglu[
j][
i]->GetRMS());
1525 nevcorrsgru->Fill(netamx*
i+
j, corrsgru[
j][
i]->GetEntries());
1526 mncorrsgru->Fill(netamx*
i+
j, corrsgru[
j][
i]->GetMean());
1527 rmscorrsgru->Fill(netamx*
i+
j, corrsgru[
j][
i]->GetRMS());
1529 nevcorrsgall->Fill(netamx*
i+
j, corrsgall[
j][
i]->GetEntries());
1530 mncorrsgall->Fill(netamx*
i+
j, corrsgall[
j][
i]->GetMean());
1531 rmscorrsgall->Fill(netamx*
i+
j, corrsgall[
j][
i]->GetRMS());
1533 nevcorrsgl->Fill(netamx*
i+
j, corrsgl[
j][
i]->GetEntries());
1534 mncorrsgl->Fill(netamx*
i+
j, corrsgl[
j][
i]->GetMean());
1535 rmscorrsgl->Fill(netamx*
i+
j, corrsgl[
j][
i]->GetRMS());
1537 nevcorrsgr->Fill(netamx*
i+
j, corrsgr[
j][
i]->GetEntries());
1538 mncorrsgr->Fill(netamx*
i+
j, corrsgr[
j][
i]->GetMean());
1539 rmscorrsgr->Fill(netamx*
i+
j, corrsgr[
j][
i]->GetRMS());
1542 nevcorrsgc->Fill(netamx*
i+
j, corrsgc[
j][
i]->GetEntries());
1543 mncorrsgc->Fill(netamx*
i+
j, corrsgc[
j][
i]->GetMean());
1544 rmscorrsgc->Fill(netamx*
i+
j, corrsgc[
j][
i]->GetRMS());
1550 for (
int j=0;
j<ringmx;
j++) {
1551 for (
int i=0;
i<routmx;
i++) {
1552 if (
j!=2 &&
i>=rout12mx)
continue;
1553 nevsigrsg->Fill(
netamx*nphimx+ringmx*
i+
j, com_sigrsg[
j][
i]->GetEntries());
1554 mnsigrsg->Fill(
netamx*nphimx+ringmx*
i+
j, com_sigrsg[
j][
i]->GetMean());
1555 rmssigrsg->Fill(
netamx*nphimx+ringmx*
i+
j, com_sigrsg[
j][
i]->GetRMS());
1557 nevcrossg->Fill(
netamx*nphimx+ringmx*
i+
j, com_crossg[
j][
i]->GetEntries());
1558 mncrossg->Fill(
netamx*nphimx+ringmx*
i+
j, com_crossg[
j][
i]->GetMean());
1559 rmscrossg->Fill(
netamx*nphimx+ringmx*
i+
j, com_crossg[
j][
i]->GetRMS());
1563 for (
int i=0;
i<sectmx;
i++) {
1564 for (
int j=0;
j<ringmx;
j++) {
1566 nevcorrsglb->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsglb[
j][
i]->GetEntries());
1567 mncorrsglb->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsglb[
j][
i]->GetMean());
1568 rmscorrsglb->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsglb[
j][
i]->GetRMS());
1570 nevcorrsgrb->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgrb[
j][
i]->GetEntries());
1571 mncorrsgrb->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgrb[
j][
i]->GetMean());
1572 rmscorrsgrb->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgrb[
j][
i]->GetRMS());
1574 nevcorrsglu->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsglu[
j][
i]->GetEntries());
1575 mncorrsglu->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsglu[
j][
i]->GetMean());
1576 rmscorrsglu->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsglu[
j][
i]->GetRMS());
1578 nevcorrsgru->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgru[
j][
i]->GetEntries());
1579 mncorrsgru->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgru[
j][
i]->GetMean());
1580 rmscorrsgru->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgru[
j][
i]->GetRMS());
1582 nevcorrsgall->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgall[
j][
i]->GetEntries());
1583 mncorrsgall->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgall[
j][
i]->GetMean());
1584 rmscorrsgall->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgall[
j][
i]->GetRMS());
1586 nevcorrsgl->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgl[
j][
i]->GetEntries());
1587 mncorrsgl->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgl[
j][
i]->GetMean());
1588 rmscorrsgl->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgl[
j][
i]->GetRMS());
1590 nevcorrsgr->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgr[
j][
i]->GetEntries());
1591 mncorrsgr->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgr[
j][
i]->GetMean());
1592 rmscorrsgr->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgr[
j][
i]->GetRMS());
1595 nevcorrsgc->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgc[
j][
i]->GetEntries());
1596 mncorrsgc->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgc[
j][
i]->GetMean());
1597 rmscorrsgc->Fill(
netamx*nphimx+ringmx*
i+
j, com_corrsgc[
j][
i]->GetRMS());
1604 for (
int i=1;
i<neffip;
i++) {
1605 sig_effi[
i]->Divide(sig_effi[0]);
1607 for (
int ij=0; ij<
netamx; ij++) {
1608 for (
int jk = 0; jk <
nphimx; jk++) {
1609 int ieta = (ij<15) ? ij+1 : 14-ij;
1611 double signal = sigrsg[ij][jk]->GetMean();
1612 mean_energy->Fill(ieta, iphi, signal);
1619 gStyle->SetOptLogy(0);
1620 gStyle->SetTitleFillColor(10);
1621 gStyle->SetStatColor(10);
1623 gStyle->SetCanvasColor(10);
1624 gStyle->SetOptStat(0);
1625 gStyle->SetOptTitle(1);
1627 gStyle->SetTitleColor(10);
1628 gStyle->SetTitleFontSize(0.09);
1629 gStyle->SetTitleOffset(-0.05);
1630 gStyle->SetTitleBorderSize(1);
1632 gStyle->SetPadColor(10);
1633 gStyle->SetPadBorderMode(0);
1634 gStyle->SetStatColor(10);
1635 gStyle->SetPadBorderMode(0);
1636 gStyle->SetStatBorderSize(1);
1637 gStyle->SetStatFontSize(.07);
1639 gStyle->SetStatStyle(1001);
1640 gStyle->SetOptFit(101);
1641 gStyle->SetCanvasColor(10);
1642 gStyle->SetCanvasBorderMode(0);
1644 gStyle->SetStatX(.99);
1645 gStyle->SetStatY(.99);
1646 gStyle->SetStatW(.45);
1647 gStyle->SetStatH(.16);
1648 gStyle->SetLabelSize(0.075,
"XY");
1649 gStyle->SetLabelOffset(0.21,
"XYZ");
1650 gStyle->SetTitleSize(0.065,
"XY");
1651 gStyle->SetTitleOffset(0.06,
"XYZ");
1652 gStyle->SetPadTopMargin(.09);
1653 gStyle->SetPadBottomMargin(0.11);
1654 gStyle->SetPadLeftMargin(0.12);
1655 gStyle->SetPadRightMargin(0.15);
1656 gStyle->SetPadGridX(3);
1657 gStyle->SetPadGridY(3);
1658 gStyle->SetGridStyle(2);
1659 gStyle->SetNdivisions(303,
"XY");
1661 gStyle->SetMarkerSize(0.60);
1662 gStyle->SetMarkerColor(2);
1663 gStyle->SetMarkerStyle(20);
1664 gStyle->SetTitleFontSize(0.07);
1670 TCanvas *c2 =
new TCanvas(
"c2",
"Statistics and efficiency", xsiz, ysiz);
1672 for (
int ij=0; ij<neffip; ij=ij+3) {
1673 sig_effi[ij]->GetXaxis()->SetTitle(
"#eta");
1674 sig_effi[ij]->GetXaxis()->SetTitleSize(0.075);
1675 sig_effi[ij]->GetXaxis()->SetTitleOffset(0.65);
1676 sig_effi[ij]->GetXaxis()->CenterTitle();
1677 sig_effi[ij]->GetXaxis()->SetLabelSize(0.055);
1678 sig_effi[ij]->GetXaxis()->SetLabelOffset(0.001);
1680 sig_effi[ij]->GetYaxis()->SetTitle(
"#phi");
1681 sig_effi[ij]->GetYaxis()->SetTitleSize(0.075);
1682 sig_effi[ij]->GetYaxis()->SetTitleOffset(0.9);
1683 sig_effi[ij]->GetYaxis()->CenterTitle();
1684 sig_effi[ij]->GetYaxis()->SetLabelSize(0.055);
1685 sig_effi[ij]->GetYaxis()->SetLabelOffset(0.01);
1687 c2->cd(
int(ij/3.)+1); sig_effi[ij]->Draw(
"colz");
1689 sprintf(out_file,
"comb_hosig_evt_%i.jpg",irunold);
1690 c2->SaveAs(out_file);
1692 gStyle->SetTitleFontSize(0.045);
1693 gStyle->SetPadRightMargin(0.1);
1694 gStyle->SetPadLeftMargin(0.1);
1695 gStyle->SetPadBottomMargin(0.12);
1697 TCanvas *
c1 =
new TCanvas(
"c1",
"Mean signal in each tower", xsiz, ysiz);
1699 mean_energy->GetXaxis()->SetTitle(
"#eta");
1700 mean_energy->GetXaxis()->SetTitleSize(0.075);
1701 mean_energy->GetXaxis()->SetTitleOffset(0.65);
1702 mean_energy->GetXaxis()->CenterTitle();
1703 mean_energy->GetXaxis()->SetLabelSize(0.045);
1704 mean_energy->GetXaxis()->SetLabelOffset(0.001);
1706 mean_energy->GetYaxis()->SetTitle(
"#phi");
1707 mean_energy->GetYaxis()->SetTitleSize(0.075);
1708 mean_energy->GetYaxis()->SetTitleOffset(0.5);
1709 mean_energy->GetYaxis()->CenterTitle();
1710 mean_energy->GetYaxis()->SetLabelSize(0.045);
1711 mean_energy->GetYaxis()->SetLabelOffset(0.01);
1713 mean_energy->Draw(
"colz");
1714 sprintf(out_file,
"homean_energy_%i.jpg",irunold);
1715 c1->SaveAs(out_file);
1720 gStyle->SetPadBottomMargin(0.14);
1721 gStyle->SetPadLeftMargin(0.17);
1722 gStyle->SetPadRightMargin(0.03);
1724 gStyle->SetOptStat(1110);
1726 const int nsample =8;
1727 TF1* gx0[nsample]={0};
1728 TF1* ped0fun[nsample]={0};
1729 TF1* signal[nsample]={0};
1730 TF1* pedfun[nsample]={0};
1731 TF1* sigfun[nsample]={0};
1732 TF1* signalx[nsample]={0};
1734 TH1F* signall[nsample]={0};
1735 TH1F* pedstll[nsample]={0};
1739 gStyle->SetOptFit(101);
1740 gStyle->SetCanvasBorderMode(0);
1741 gStyle->SetPadBorderMode(0);
1742 gStyle->SetStatBorderSize(1);
1743 gStyle->SetStatStyle(1001);
1744 gStyle->SetTitleColor(10);
1745 gStyle->SetTitleFontSize(0.09);
1746 gStyle->SetTitleOffset(-0.05);
1747 gStyle->SetTitleBorderSize(1);
1749 gStyle->SetCanvasColor(10);
1750 gStyle->SetPadColor(10);
1751 gStyle->SetStatColor(10);
1752 gStyle->SetStatFontSize(.07);
1753 gStyle->SetStatX(0.99);
1754 gStyle->SetStatY(0.99);
1755 gStyle->SetStatW(0.30);
1756 gStyle->SetStatH(0.10);
1757 gStyle->SetTitleSize(0.065,
"XYZ");
1758 gStyle->SetLabelSize(0.075,
"XYZ");
1759 gStyle->SetLabelOffset(0.012,
"XYZ");
1760 gStyle->SetPadGridX(1);
1761 gStyle->SetPadGridY(1);
1762 gStyle->SetGridStyle(3);
1763 gStyle->SetNdivisions(101,
"XY");
1764 gStyle->SetOptLogy(0);
1768 std::ofstream file_out(theoutputtxtFile.c_str());
1771 TPostScript ps(theoutputpsFile.c_str(),ips);
1776 TCanvas *c0 =
new TCanvas(
"c0",
" Pedestal vs signal", xsiz, ysiz);
1785 for (
int ij=0; ij<
nphimx; ++ij) {mean_phi[ij] = 0; rms_phi[ij] = 0;}
1786 for (
int ij=0; ij<
netamx; ++ij) {mean_eta[ij] = 0; rms_eta[ij] = 0;}
1798 for (
int iijj = 0; iijj <4; iijj++) {
1801 mxeta = ringmx; mxphi = 1; mneta = 0; mnphi = 0;
1802 }
else if (iijj==1) {
1803 mxeta = ringmx; mxphi = routmx;
1804 mneta = 0; mnphi = 0;
1805 }
else if (iijj==2) {
1806 mxeta =
netamx; mxphi = 1; mneta = 0; mnphi = 0;
1807 }
else if (iijj==3) {
1809 mneta = 0; mnphi = 0;
1812 for (
int jk=mneta; jk<mxeta; jk++) {
1813 for (
int ij=mnphi; ij<mxphi; ij++) {
1814 if (iijj==1)
continue;
1815 if ((iijj==0 || iijj==1) && jk !=2 && ij >=rout12mx)
continue;
1816 int izone = iiter%nsample;
1819 int iread = (jk==2) ? routmx : rout12mx;
1820 signall[izone] = (TH1F*)com_sigrsg[jk][iread]->Clone(
"hnew");
1821 pedstll[izone] = (TH1F*)com_crossg[jk][iread]->Clone(
"hnew");
1822 }
else if (iijj==1) {
1823 signall[izone] = (TH1F*)com_sigrsg[jk][ij]->Clone(
"hnew");
1824 pedstll[izone] = (TH1F*)com_crossg[jk][ij]->Clone(
"hnew");
1825 }
else if (iijj==2) {
1826 signall[izone] = (TH1F*)sigrsg[jk][nphimx]->Clone(
"hnew");
1827 pedstll[izone] = (TH1F*)crossg[jk][nphimx]->Clone(
"hnew");
1828 }
else if (iijj==3) {
1829 signall[izone] = (TH1F*)sigrsg[jk][ij]->Clone(
"hnew");
1830 pedstll[izone] = (TH1F*)crossg[jk][ij]->Clone(
"hnew");
1833 pedstll[izone]->SetLineWidth(2);
1834 signall[izone]->SetLineWidth(2);
1835 pedstll[izone]->SetLineColor(2);
1836 signall[izone]->SetLineColor(4);
1837 pedstll[izone]->SetNdivisions(506,
"XY");
1838 signall[izone]->SetNdivisions(506,
"XY");
1840 signall[izone]->GetXaxis()->SetLabelSize(.065);
1841 signall[izone]->GetYaxis()->SetLabelSize(.06);
1843 signall[izone]->GetXaxis()->SetTitle(
"Signal (fC)");
1845 signall[izone]->GetXaxis()->SetTitle(
"Signal (GeV)");
1847 signall[izone]->GetXaxis()->SetTitleSize(.065);
1848 signall[izone]->GetXaxis()->CenterTitle();
1885 float mean = pedstll[izone]->GetMean();
1886 float rms = pedstll[izone]->GetRMS();
1888 if (rms <0.6) rms = 0.6;
1889 if (rms >1.2) rms = 1.2;
1890 if (mean >1.2) mean = 1.2;
1891 if (mean <-1.2) mean = -1.2;
1893 if (rms <0.10) rms = 0.10;
1894 if (rms >0.15) rms=0.15;
1895 if (mean >0.20) mean = 0.20;
1896 if (mean <-0.20) mean = -0.20;
1898 float xmn = mean-6.*
rms;
1899 float xmx = mean+6.*
rms;
1901 binwid = pedstll[izone]->GetBinWidth(1);
1902 if (xmx > pedstll[izone]->GetXaxis()->GetXmax()) xmx = pedstll[izone]->GetXaxis()->GetXmax()-0.5*binwid;
1903 if (xmn < pedstll[izone]->GetXaxis()->GetXmin()) xmn = pedstll[izone]->GetXaxis()->GetXmin()+0.5*binwid;
1905 float height = pedstll[izone]->GetEntries();
1907 double par[
nbgpr] ={height,
mean, 0.75*rms};
1909 double gaupr[
nbgpr];
1910 double parer[
nbgpr];
1914 pedstll[izone]->GetXaxis()->SetLabelSize(.065);
1915 pedstll[izone]->GetYaxis()->SetLabelSize(.06);
1920 pedstll[izone]->GetXaxis()->SetRangeUser(xmn, xmx);
1925 pedstll[izone]->GetXaxis()->SetTitle(
"Pedestal/Signal (fC)");
1927 pedstll[izone]->GetXaxis()->SetTitle(
"Pedestal (fC)");
1931 pedstll[izone]->GetXaxis()->SetTitle(
"Pedestal/Signal (GeV)");
1933 pedstll[izone]->GetXaxis()->SetTitle(
"Pedestal (GeV)");
1936 pedstll[izone]->GetXaxis()->SetTitleSize(.065);
1937 pedstll[izone]->GetXaxis()->CenterTitle();
1940 pedstll[izone]->Draw();
1941 if (m_pedsuppr && !m_digiInput) {
1949 parer[0] = parer[1] = parer[2] = 0;
1952 if (pedstll[izone]->GetEntries() >5) {
1954 if ((iijj!=3) || m_histfit) {
1956 sprintf(temp,
"gx0_%i",izone);
1957 gx0[izone] =
new TF1(temp,
gausX, xmn, xmx,
nbgpr);
1958 gx0[izone]->SetParameters(par);
1959 gx0[izone]->SetLineWidth(1);
1960 pedstll[izone]->Fit(gx0[izone],
"R+");
1963 parer[
k] = gx0[izone]->GetParError(
k);
1964 gaupr[
k] = gx0[izone]->GetParameter(
k);
1967 double strt[
nbgpr] = {height,
mean, 0.75*rms};
1968 double step[
nbgpr] = {1.0, 0.001, 0.001};
1969 double alowmn[
nbgpr] = {0.5*height, mean-
rms, 0.3*rms};
1970 double ahighmn[
nbgpr] ={1.5*height, mean+
rms, 1.5*rms};
1973 gMinuit->SetFCN(
fcnbg);
1978 gMinuit->mnexcm(
"SET ERR", arglist, 1, ierflg);
1981 sprintf(name,
"pedpar%i",
k);
1982 gMinuit->mnparm(
k, name, strt[
k], step[k], alowmn[k], ahighmn[k],ierflg);
1986 gMinuit->mnexcm(
"SIMPLEX", arglist, 0, ierflg);
1989 gMinuit->mnexcm(
"IMPROVE", arglist, 0, ierflg);
1992 double parv,err,xlo,xup, plerr, mierr, eparab, gcc;
1997 gMinuit->mnpout(
k, chnam, parv, err, xlo, xup, iuit);
1998 gMinuit->mnerrs(
k, plerr, mierr, eparab, gcc);
2001 gaupr[
k] = parv*binwid;
2002 parer[
k] = err*binwid;
2013 sprintf(temp,
"ped0fun_%i",izone);
2014 ped0fun[izone] =
new TF1(temp,
gausX, xmn, xmx, nbgpr);
2015 ped0fun[izone]->SetParameters(gaupr);
2016 ped0fun[izone]->SetLineColor(3);
2017 ped0fun[izone]->SetLineWidth(1);
2018 ped0fun[izone]->Draw(
"same");
2023 for (
int k=0;
k<
nbgpr;
k++) {gaupr[
k] = par[
k]; }
2024 if (m_digiInput) { gaupr[2] = 0.90; }
else { gaupr[2] = 0.15;}
2029 if (signall[izone]->GetEntries() >5) {
2030 Double_t parall[
nsgpr];
2031 double parserr[
nsgpr];
2032 double fitres[
nsgpr];
2036 sprintf(temp,
"signal_%i",izone);
2037 xmn = signall[izone]->GetXaxis()->GetXmin();
2038 xmx = 0.5*signall[izone]->GetXaxis()->GetXmax();
2041 if ((iijj!=3) || m_histfit) {
2042 pedht = (signall[izone]->GetBinContent(nbn-1)+
2043 signall[izone]->GetBinContent(nbn)+
2044 signall[izone]->GetBinContent(nbn+1))/3.;
2046 if (m_pedsuppr && !m_digiInput) {
2048 if (m_digiInput) { parall[2] = 0.90; }
else { parall[2] = 0.15;}
2050 for (
int i=0;
i<
nbgpr;
i++) {parall[
i] = gaupr[
i];}
2056 parall[0] = 0.9*pedht;
2058 double area = binwid*signall[izone]->GetEntries();
2062 parall[4] = fitprm[4][jk];
2063 parall[6] = fitprm[6][jk];
2065 parall[4] = signall[izone]->GetMean();
2066 parall[6]=parall[2];
2069 signal[izone]->SetParameters(parall);
2070 signal[izone]->FixParameter(1, parall[1]);
2071 signal[izone]->FixParameter(2, parall[2]);
2072 signal[izone]->SetParLimits(0, 0.00, 2.0*pedht+0.1);
2073 signal[izone]->FixParameter(3, 0.14);
2075 signal[izone]->SetParLimits(5, 0.40*area, 1.15*area);
2078 signal[izone]->SetParLimits(4, 0.2*fitprm[4][jk], 2.0*fitprm[4][jk]);
2079 signal[izone]->SetParLimits(6, 0.2*fitprm[6][jk], 2.0*fitprm[6][jk]);
2082 signal[izone]->SetParLimits(4, 0.6, 6.0);
2083 signal[izone]->SetParLimits(6, 0.60, 3.0);
2085 signal[izone]->SetParLimits(4, 0.1, 1.0);
2086 signal[izone]->SetParLimits(6, 0.035, 0.3);
2089 signal[izone]->SetParNames(
"const",
"mean",
"sigma",
"Width",
"MP",
"Area",
"GSigma");
2090 signall[izone]->Fit(signal[izone],
"0R+");
2092 signall[izone]->GetXaxis()->SetRangeUser(xmn,xmx);
2094 fitres[
k] = fitprm[
k][jk] = signal[izone]->GetParameter(
k);
2095 parserr[
k] = signal[izone]->GetParError(
k);
2107 TString
name[
nsgpr] = {
"const",
"mean",
"sigma",
"Width",
"MP",
"Area",
"GSigma"};
2108 double strt[
nsgpr] = {0.9*pedhtx, gaupr[1], gaupr[2], fitprm[3][jk], fitprm[4][jk], signall[izone]->GetEntries(), fitprm[6][jk]};
2109 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]};
2110 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]};
2111 double step[
nsgpr] = {1.0, 0.0, 0.0, 0.0, 0.001, 1.0, 0.002};
2114 gMinuit->SetFCN(
fcnsg);
2119 gMinuit->mnexcm(
"SET ERR", arglist, 1, ierflg);
2122 gMinuit->mnparm(
k, name[
k], strt[k], step[k], alowmn[k], ahighmn[k],ierflg);
2126 gMinuit->mnexcm(
"SIMPLEX", arglist, 0, ierflg);
2129 gMinuit->mnexcm(
"IMPROVE", arglist, 0, ierflg);
2132 double parv,err,xlo,xup, plerr, mierr, eparab, gcc;
2137 gMinuit->mnpout(
k, chnam, parv, err, xlo, xup, iuit);
2138 gMinuit->mnerrs(
k, plerr, mierr, eparab, gcc);
2140 fitres[
k] = parv*binwid;
2141 parserr[
k]= err*binwid;
2156 signall[izone]->Draw();
2159 sprintf(temp,
"pedfun_%i",izone);
2160 pedfun[izone] =
new TF1(temp,
gausX, xmn, xmx,
nbgpr);
2161 pedfun[izone]->SetParameters(fitres);
2162 pedfun[izone]->SetLineColor(3);
2163 pedfun[izone]->SetLineWidth(1);
2164 pedfun[izone]->Draw(
"same");
2166 sprintf(temp,
"signalfun_%i",izone);
2168 sigfun[izone]->SetParameters(&fitres[3]);
2169 sigfun[izone]->SetLineWidth(1);
2170 sigfun[izone]->SetLineColor(4);
2171 sigfun[izone]->Draw(
"same");
2173 sprintf(temp,
"total_%i",izone);
2175 signalx[izone]->SetParameters(fitres);
2176 signalx[izone]->SetLineWidth(1);
2177 signalx[izone]->Draw(
"same");
2179 int kl = (jk<15) ? jk+1 : 14-jk;
2181 cout<<
"histinfo"<<iijj<<
" fit "
2182 <<std::setw(3)<< kl<<
" "
2183 <<std::setw(3)<< ij+1<<
" "
2184 <<std::setw(5)<<pedstll[izone]->GetEntries()<<
" "
2185 <<std::setw(6)<<pedstll[izone]->GetMean()<<
" "
2186 <<std::setw(6)<<pedstll[izone]->GetRMS()<<
" "
2187 <<std::setw(5)<<signall[izone]->GetEntries()<<
" "
2188 <<std::setw(6)<<signall[izone]->GetMean()<<
" "
2189 <<std::setw(6)<<signall[izone]->GetRMS()<<
" "
2190 <<std::setw(6)<< signal[izone]->GetChisquare()<<
" "
2191 <<std::setw(3)<< signal[izone]->GetNDF()<<endl;
2193 file_out<<
"histinfo"<<iijj<<
" fit "
2194 <<std::setw(3)<< kl<<
" "
2195 <<std::setw(3)<< ij+1<<
" "
2196 <<std::setw(5)<<pedstll[izone]->GetEntries()<<
" "
2197 <<std::setw(6)<<pedstll[izone]->GetMean()<<
" "
2198 <<std::setw(6)<<pedstll[izone]->GetRMS()<<
" "
2199 <<std::setw(5)<<signall[izone]->GetEntries()<<
" "
2200 <<std::setw(6)<<signall[izone]->GetMean()<<
" "
2201 <<std::setw(6)<<signall[izone]->GetRMS()<<
" "
2202 <<std::setw(6)<< signal[izone]->GetChisquare()<<
" "
2203 <<std::setw(3)<< signal[izone]->GetNDF()<<endl;
2205 file_out <<
"fitres x"<<iijj<<
" "<<kl<<
" "<<ij+1<<
" "<< fitres[0]<<
" "<< fitres[1]<<
" "<< fitres[2]<<
" "<< fitres[3]<<
" "<< fitres[4]<<
" "<< fitres[5]<<
" "<< fitres[6]<<endl;
2206 file_out <<
"parserr"<<iijj<<
" "<<kl<<
" "<<ij+1<<
" "<< parserr[0]<<
" "<< parserr[1]<<
" "<< parserr[2]<<
" "<< parserr[3]<<
" "<< parserr[4]<<
" "<< parserr[5]<<
" "<< parserr[6]<<endl;
2208 double diff=fitres[4]-fitres[1];
2209 if (diff <=0) diff = 0.000001;
2210 double error=parserr[4]*parserr[4]+parer[2]*parer[2];
2211 error =
pow(error,0.5);
2213 int ieta = (jk<15) ? (15+jk) : (29-jk);
2214 int ifl = nphimx*ieta + ij;
2217 ped_evt->Fill(ifl,pedstll[izone]->GetEntries());
2218 ped_mean->Fill(ifl,gaupr[1]);
2219 ped_width->Fill(ifl,gaupr[2]);
2220 fit_chi->Fill(ifl,signal[izone]->GetChisquare());
2221 sig_evt->Fill(ifl, signall[izone]->GetEntries());
2222 fit_sigevt->Fill(ifl, fitres[5]);
2223 fit_bkgevt->Fill(ifl, fitres[0]*
sqrt(2*acos(-1.))*gaupr[2]);
2224 sig_mean->Fill(ifl, fitres[4]);
2225 sig_diff->Fill(ifl, fitres[4]-fitres[1]);
2226 sig_width->Fill(ifl, fitres[3]);
2227 sig_sigma->Fill(ifl, fitres[6]);
2228 sig_meanerr->Fill(ifl, parserr[4]);
2229 if (fitres[4]-fitres[1] !=0) sig_meanerrp->Fill(ifl, 100*parserr[4]/(fitres[4]-fitres[1]));
2230 if (gaupr[2]!=0) sig_signf->Fill(ifl,(fitres[4]-fitres[1])/gaupr[2]);
2232 ped_statmean->Fill(ifl,pedstll[izone]->GetMean());
2233 sig_statmean->Fill(ifl,signall[izone]->GetMean());
2234 ped_rms->Fill(ifl,pedstll[izone]->GetRMS());
2235 sig_rms->Fill(ifl,signall[izone]->GetRMS());
2238 if ((iijj==2) || (iijj==3) || (iijj==1)) {
2239 if (signall[izone]->GetEntries() >5 && fitres[4]>0.1) {
2242 if (
abs(kl)<=4) fact=0.895;
2243 if (!m_digiInput) fact *=0.19;
2246 if (iijj==2) fact2 = invang[jk][
nphimx];
2247 if (iijj==3) fact2 = invang[jk][ij];
2248 if (iijj==1) fact2 = com_invang[jk][ij];
2250 float calibc = fact*fact2/(fitres[4]*signall[izone]->GetEntries());
2251 float caliberr= TMath::Abs(calibc*parserr[4]/
max(0.001,fitres[4]));
2254 int ieta = (jk<15) ? jk+1 : 14-jk;
2255 mean_phi_hst->Fill(ieta, calibc);
2256 mean_phi_hst->SetBinError(mean_phi_hst->FindBin(ieta), caliberr);
2257 file_out<<
"intieta "<<jk<<
" "<<ij<<
" "<<ieta<<
" "<<mean_phi_hst->FindBin(
double(ieta))<<
" "<<calibc<<
" "<<caliberr<<endl;
2258 }
else if (iijj==3) {
2259 const_eta[jk]->Fill(ij+1,calibc);
2260 const_eta[jk]->SetBinError(const_eta[jk]->FindBin(ij+1), caliberr);
2262 peak_eta[jk]->Fill(ij+1,fitres[4]);
2263 peak_eta[jk]->SetBinError(peak_eta[jk]->FindBin(ij+1),parserr[4]);
2265 int ieta = (jk<15) ? jk+1 : 14-jk;
2266 const_eta_phi->Fill(ieta, ij+1,calibc);
2267 file_out<<
"intietax "<<jk<<
" "<<ij<<
" "<<ieta<<
" "<<const_eta_phi->FindBin(ieta, ij+1)<<endl;
2269 const_eta_phi->SetBinError(const_eta_phi->FindBin(ieta, ij+1),caliberr);
2271 mean_eta[ij] +=calibc/(caliberr*caliberr);
2272 mean_phi[jk] +=calibc/(caliberr*caliberr);
2274 rms_eta[ij] +=1./(caliberr*caliberr);
2275 rms_phi[jk] +=1./(caliberr*caliberr);
2278 const_eta_phi->SetBinError(const_eta_phi->FindBin(ieta, ij+1), 0.0);
2280 }
else if (iijj==1) {
2281 const_hpdrm[jk]->Fill(ij+1,calibc);
2282 const_hpdrm[jk]->SetBinError(const_hpdrm[jk]->FindBin(ij+1), caliberr);
2284 peak_hpdrm[jk]->Fill(ij+1,fitres[4]);
2285 peak_hpdrm[jk]->SetBinError(peak_hpdrm[jk]->FindBin(ij+1),parserr[4]);
2288 file_out<<
"HO 4 "<<iijj<<
" "<< std::setw(3)<<kl<<
" "<<std::setw(3)<<ij+1<<
" "
2289 <<std::setw(7)<<calibc<<
" "<<std::setw(7)<<caliberr<<endl;
2294 signall[izone]->Draw();
2296 int kl = (jk<15) ? jk+1 : 14-jk;
2297 file_out<<
"histinfo"<<iijj<<
" nof "
2298 <<std::setw(3)<< kl<<
" "
2299 <<std::setw(3)<< ij+1<<
" "
2300 <<std::setw(5)<<pedstll[izone]->GetEntries()<<
" "
2301 <<std::setw(6)<<pedstll[izone]->GetMean()<<
" "
2302 <<std::setw(6)<<pedstll[izone]->GetRMS()<<
" "
2303 <<std::setw(5)<<signall[izone]->GetEntries()<<
" "
2304 <<std::setw(6)<<signall[izone]->GetMean()<<
" "
2305 <<std::setw(6)<<signall[izone]->GetRMS()<<
" "
2306 <<std::setw(6)<< varx<<
" "
2307 <<std::setw(3)<< varx<<endl;
2309 file_out <<
"fitres x"<<iijj<<
" "<<kl<<
" "<<ij+1<<
" "<< varx<<
" "<< varx<<
" "<< varx<<
" "<< varx<<
" "<< varx<<
" "<< varx<<
" "<< varx<<endl;
2310 file_out <<
"parserr"<<iijj<<
" "<<kl<<
" "<<ij+1<<
" "<< varx<<
" "<< varx<<
" "<< varx<<
" "<< varx<<
" "<< varx<<
" "<< varx<<
" "<< varx<<endl;
2314 if (iiter%nsample==0) {
2317 for (
int kl=0; kl<nsample; kl++) {
2318 if (gx0[kl]) {
delete gx0[kl];gx0[kl] = 0;}
2319 if (ped0fun[kl]) {
delete ped0fun[kl];ped0fun[kl] = 0;}
2320 if (signal[kl]) {
delete signal[kl];signal[kl] = 0;}
2321 if (pedfun[kl]) {
delete pedfun[kl];pedfun[kl] = 0;}
2322 if (sigfun[kl]) {
delete sigfun[kl];sigfun[kl] = 0;}
2323 if (signalx[kl]) {
delete signalx[kl];signalx[kl] = 0;}
2324 if (signall[kl]) {
delete signall[kl];signall[kl] = 0;}
2325 if (pedstll[kl]) {
delete pedstll[kl];pedstll[kl] = 0;}
2342 if (iiter%nsample!=0) {
2344 for (
int kl=0; kl<nsample; kl++) {
2345 if (gx0[kl]) {
delete gx0[kl];gx0[kl] = 0;}
2346 if (ped0fun[kl]) {
delete ped0fun[kl];ped0fun[kl] = 0;}
2347 if (signal[kl]) {
delete signal[kl];signal[kl] = 0;}
2348 if (pedfun[kl]) {
delete pedfun[kl];pedfun[kl] = 0;}
2349 if (sigfun[kl]) {
delete sigfun[kl];sigfun[kl] = 0;}
2350 if (signalx[kl]) {
delete signalx[kl];signalx[kl] = 0;}
2351 if (signall[kl]) {
delete signall[kl];signall[kl] = 0;}
2352 if (pedstll[kl]) {
delete pedstll[kl];pedstll[kl] = 0;}
2361 gStyle->SetTitleFontSize(0.05);
2362 gStyle->SetTitleSize(0.025,
"XYZ");
2363 gStyle->SetLabelSize(0.025,
"XYZ");
2364 gStyle->SetStatFontSize(.045);
2366 gStyle->SetOptStat(0);
2367 ps.NewPage(); TCanvas *c1 =
new TCanvas(
"c1",
" Pedestal vs signal", xsiz, ysiz);
2368 ped_evt->Draw(); c1->Update();
2371 ped_statmean->Draw(); c1->Update();
2374 ped_rms->Draw(); c1->Update();
2377 ped_mean->Draw(); c1->Update();
2380 ped_width->Draw(); c1->Update();
2383 sig_evt->Draw(); c1->Update();
2386 sig_statmean->Draw(); c1->Update();
2389 sig_rms->Draw(); c1->Update();
2392 fit_chi->Draw(); c1->Update();
2395 fit_sigevt->Draw(); c1->Update();
2398 fit_bkgevt->Draw(); c1->Update();
2401 sig_mean->Draw(); c1->Update();
2404 sig_width->Draw(); c1->Update();
2407 sig_sigma->Draw(); c1->Update();
2410 sig_meanerr->Draw(); c1->Update();
2413 sig_meanerrp->Draw(); c1->Update();
2416 sig_signf->Draw(); c1->Update();
2427 gStyle->SetTitleFontSize(0.09);
2428 gStyle->SetPadBottomMargin(0.17);
2429 gStyle->SetPadLeftMargin(0.18);
2430 gStyle->SetPadRightMargin(0.01);
2431 gStyle->SetOptLogy(0);
2432 gStyle->SetOptStat(0);
2434 TCanvas *c2 =
new TCanvas(
"c2",
"runfile", xsiz, ysiz);
2437 for (
int side=0; side <2; side++) {
2438 gStyle->SetNdivisions(303,
"XY");
2439 gStyle->SetPadRightMargin(0.01);
2449 for (
int ij=nmn; ij<nmx; ij++) {
2452 const_eta[ij]->GetXaxis()->SetTitle(
"#phi index");
2453 const_eta[ij]->GetXaxis()->SetTitleSize(.08);
2454 const_eta[ij]->GetXaxis()->CenterTitle();
2455 const_eta[ij]->GetXaxis()->SetTitleOffset(0.9);
2456 const_eta[ij]->GetXaxis()->SetLabelSize(.085);
2457 const_eta[ij]->GetXaxis()->SetLabelOffset(.01);
2459 const_eta[ij]->GetYaxis()->SetLabelSize(.08);
2460 const_eta[ij]->GetYaxis()->SetLabelOffset(.01);
2462 const_eta[ij]->GetYaxis()->SetTitle(
"GeV/fC");
2464 const_eta[ij]->GetYaxis()->SetTitle(
"GeV/MIP-GeV!!");
2467 const_eta[ij]->GetYaxis()->SetTitleSize(.085);
2468 const_eta[ij]->GetYaxis()->CenterTitle();
2469 const_eta[ij]->GetYaxis()->SetTitleOffset(1.3);
2470 const_eta[ij]->SetMarkerSize(0.60);
2471 const_eta[ij]->SetMarkerColor(2);
2472 const_eta[ij]->SetMarkerStyle(20);
2475 const_eta[ij]->Draw();
2479 sprintf(out_file,
"calibho_%i_side%i.eps", irunold, side);
2480 c2->SaveAs(out_file);
2482 sprintf(out_file,
"calibho_%i_side%i.jpg", irunold, side);
2483 c2->SaveAs(out_file);
2486 for (
int ij=nmn; ij<nmx; ij++) {
2488 peak_eta[ij]->GetXaxis()->SetTitle(
"#phi index");
2489 peak_eta[ij]->GetXaxis()->SetTitleSize(.08);
2490 peak_eta[ij]->GetXaxis()->CenterTitle();
2491 peak_eta[ij]->GetXaxis()->SetTitleOffset(0.90);
2492 peak_eta[ij]->GetXaxis()->SetLabelSize(.08);
2493 peak_eta[ij]->GetXaxis()->SetLabelOffset(.01);
2495 peak_eta[ij]->GetYaxis()->SetLabelSize(.08);
2496 peak_eta[ij]->GetYaxis()->SetLabelOffset(.01);
2498 peak_eta[ij]->GetYaxis()->SetTitle(
"fC");
2500 peak_eta[ij]->GetYaxis()->SetTitle(
"GeV");
2503 peak_eta[ij]->GetYaxis()->SetTitleSize(.085);
2504 peak_eta[ij]->GetYaxis()->CenterTitle();
2505 peak_eta[ij]->GetYaxis()->SetTitleOffset(1.3);
2507 peak_eta[ij]->SetMarkerSize(0.60);
2508 peak_eta[ij]->SetMarkerColor(2);
2509 peak_eta[ij]->SetMarkerStyle(20);
2511 peak_eta[ij]->Draw();
2515 sprintf(out_file,
"peakho_%i_side%i.eps", irunold, side);
2516 c2->SaveAs(out_file);
2518 sprintf(out_file,
"peakho_%i_side%i.jpg", irunold, side);
2519 c2->SaveAs(out_file);
2524 gStyle->SetTitleFontSize(0.045);
2525 gStyle->SetPadRightMargin(0.13);
2526 gStyle->SetPadBottomMargin(0.15);
2527 gStyle->SetPadLeftMargin(0.1);
2528 gStyle->SetOptStat(0);
2531 TCanvas *c1 =
new TCanvas(
"c1",
"Fitted const in each tower", xsiz, ysiz);
2532 const_eta_phi->GetXaxis()->SetTitle(
"#eta");
2533 const_eta_phi->GetXaxis()->SetTitleSize(0.065);
2534 const_eta_phi->GetXaxis()->SetTitleOffset(0.85);
2535 const_eta_phi->GetXaxis()->CenterTitle();
2536 const_eta_phi->GetXaxis()->SetLabelSize(0.045);
2537 const_eta_phi->GetXaxis()->SetLabelOffset(0.01);
2539 const_eta_phi->GetYaxis()->SetTitle(
"#phi");
2540 const_eta_phi->GetYaxis()->SetTitleSize(0.075);
2541 const_eta_phi->GetYaxis()->SetTitleOffset(0.5);
2542 const_eta_phi->GetYaxis()->CenterTitle();
2543 const_eta_phi->GetYaxis()->SetLabelSize(0.045);
2544 const_eta_phi->GetYaxis()->SetLabelOffset(0.01);
2546 const_eta_phi->Draw(
"colz");
2547 sprintf(out_file,
"high_hoconst_eta_phi_%i.jpg",irunold);
2548 c1->SaveAs(out_file);
2552 for (
int jk=0; jk<
netamx; jk++) {
2553 int ieta = (jk<15) ? jk+1 : 14-jk;
2554 if (rms_phi[jk]>0) {
2555 mean_phi_ave->Fill(ieta, mean_phi[jk]/rms_phi[jk]);
2556 mean_phi_ave->SetBinError(mean_phi_ave->FindBin(ieta),
pow(
double(rms_phi[jk]), -0.5));
2560 for (
int ij=0; ij<
nphimx; ij++) {
2561 if (rms_eta[ij] >0) {
2562 mean_eta_ave->Fill(ij+1, mean_eta[ij]/rms_eta[ij]);
2563 mean_eta_ave->SetBinError(mean_eta_ave->FindBin(ij+1),
pow(
double(rms_eta[ij]), -0.5));
2568 gStyle->SetPadLeftMargin(0.13);
2569 gStyle->SetPadRightMargin(0.03);
2572 TCanvas *c2y =
new TCanvas(
"c2",
"Avearge signal in eta and phi", xsiz, ysiz);
2574 mean_eta_ave->GetXaxis()->SetTitle(
"#phi");
2575 mean_eta_ave->GetXaxis()->SetTitleSize(0.085);
2576 mean_eta_ave->GetXaxis()->SetTitleOffset(0.65);
2577 mean_eta_ave->GetXaxis()->CenterTitle();
2578 mean_eta_ave->GetXaxis()->SetLabelSize(0.05);
2579 mean_eta_ave->GetXaxis()->SetLabelOffset(0.001);
2581 mean_eta_ave->GetYaxis()->SetTitle(
"Signal (GeV)/MIP");
2582 mean_eta_ave->GetYaxis()->SetTitleSize(0.055);
2583 mean_eta_ave->GetYaxis()->SetTitleOffset(1.3);
2584 mean_eta_ave->GetYaxis()->CenterTitle();
2585 mean_eta_ave->GetYaxis()->SetLabelSize(0.045);
2586 mean_eta_ave->GetYaxis()->SetLabelOffset(0.01);
2587 mean_eta_ave->SetMarkerSize(0.60);
2588 mean_eta_ave->SetMarkerColor(2);
2589 mean_eta_ave->SetMarkerStyle(20);
2591 c2y->cd(1); mean_eta_ave->Draw();
2593 mean_phi_ave->GetXaxis()->SetTitle(
"#eta");
2594 mean_phi_ave->GetXaxis()->SetTitleSize(0.085);
2595 mean_phi_ave->GetXaxis()->SetTitleOffset(0.65);
2596 mean_phi_ave->GetXaxis()->CenterTitle();
2597 mean_phi_ave->GetXaxis()->SetLabelSize(0.05);
2598 mean_phi_ave->GetXaxis()->SetLabelOffset(0.001);
2600 mean_phi_ave->GetYaxis()->SetTitle(
"Signal (GeV)/MIP");
2601 mean_phi_ave->GetYaxis()->SetTitleSize(0.055);
2602 mean_phi_ave->GetYaxis()->SetTitleOffset(1.3);
2603 mean_phi_ave->GetYaxis()->CenterTitle();
2604 mean_phi_ave->GetYaxis()->SetLabelSize(0.045);
2605 mean_phi_ave->GetYaxis()->SetLabelOffset(0.01);
2606 mean_phi_ave->SetMarkerSize(0.60);
2607 mean_phi_ave->SetMarkerColor(2);
2608 mean_phi_ave->SetMarkerStyle(20);
2610 c2y->cd(2); mean_phi_ave->Draw();
2612 sprintf(out_file,
"high_hoaverage_eta_phi_%i.jpg",irunold);
2613 c2y->SaveAs(out_file);
2620 TCanvas *c3 =
new TCanvas(
"c3",
"Avearge signal in eta and phi", xsiz, ysiz);
2622 mean_phi_hst->GetXaxis()->SetTitle(
"#eta");
2623 mean_phi_hst->GetXaxis()->SetTitleSize(0.065);
2624 mean_phi_hst->GetXaxis()->SetTitleOffset(0.9);
2625 mean_phi_hst->GetXaxis()->CenterTitle();
2626 mean_phi_hst->GetXaxis()->SetLabelSize(0.065);
2627 mean_phi_hst->GetXaxis()->SetLabelOffset(0.001);
2629 mean_phi_hst->GetYaxis()->SetTitle(
"GeV/MIP");
2630 mean_phi_hst->GetYaxis()->SetTitleSize(0.055);
2631 mean_phi_hst->GetYaxis()->SetTitleOffset(0.9);
2632 mean_phi_hst->GetYaxis()->CenterTitle();
2633 mean_phi_hst->GetYaxis()->SetLabelSize(0.065);
2634 mean_phi_hst->GetYaxis()->SetLabelOffset(0.01);
2636 mean_phi_hst->SetMarkerColor(4);
2637 mean_phi_hst->SetMarkerSize(0.8);
2638 mean_phi_hst->SetMarkerStyle(20);
2639 mean_phi_hst->Draw();
2641 sprintf(out_file,
"low_mean_phi_hst_%i.jpg",irunold);
2642 c3->SaveAs(out_file);
2649 gStyle->SetOptLogy(1);
2650 gStyle->SetPadTopMargin(.1);
2651 gStyle->SetPadLeftMargin(.15);
2654 TCanvas *c0x =
new TCanvas(
"c0x",
"Signal in each ring", xsiz, ysiz);
2657 for (
int ij=0; ij<ringmx; ij++) {
2658 int iread = (ij==2) ? routmx : rout12mx;
2660 com_sigrsg[ij][iread]->GetXaxis()->SetTitle(
"Signal/ped (fC)");
2662 com_sigrsg[ij][iread]->GetXaxis()->SetTitle(
"Signal/ped (GeV)");
2664 com_sigrsg[ij][iread]->GetXaxis()->SetTitleSize(0.060);
2665 com_sigrsg[ij][iread]->GetXaxis()->SetTitleOffset(1.05);
2666 com_sigrsg[ij][iread]->GetXaxis()->CenterTitle();
2667 com_sigrsg[ij][iread]->GetXaxis()->SetLabelSize(0.065);
2668 com_sigrsg[ij][iread]->GetXaxis()->SetLabelOffset(0.01);
2670 com_sigrsg[ij][iread]->GetYaxis()->SetLabelSize(0.065);
2671 com_sigrsg[ij][iread]->GetYaxis()->SetLabelOffset(0.01);
2674 com_sigrsg[ij][iread]->SetLineWidth(3);
2675 com_sigrsg[ij][iread]->SetLineColor(4);
2677 c0x->cd(ij+1); com_sigrsg[ij][iread]->Draw();
2679 com_crossg[ij][iread]->SetLineWidth(2);
2680 com_crossg[ij][iread]->SetLineColor(2);
2681 com_crossg[ij][iread]->Draw(
"same");
2683 sprintf(out_file,
"hosig_ring_%i.jpg",irunold);
2684 c0x->SaveAs(out_file);
2687 gStyle->SetTitleFontSize(0.06);
2688 gStyle->SetOptStat(0);
2689 gStyle->SetOptLogy(0);
2691 TCanvas *c0 =
new TCanvas(
"c0",
"Signal in each ring", xsiz, ysiz);
2694 for (
int jk=0; jk<ringmx; jk++) {
2695 peak_hpdrm[jk]->GetXaxis()->SetTitle(
"RM #");
2696 peak_hpdrm[jk]->GetXaxis()->SetTitleSize(0.070);
2697 peak_hpdrm[jk]->GetXaxis()->SetTitleOffset(1.0);
2698 peak_hpdrm[jk]->GetXaxis()->CenterTitle();
2699 peak_hpdrm[jk]->GetXaxis()->SetLabelSize(0.065);
2700 peak_hpdrm[jk]->GetXaxis()->SetLabelOffset(0.01);
2702 peak_hpdrm[jk]->GetYaxis()->SetTitle(
"Peak(GeV)/MIP");
2704 peak_hpdrm[jk]->GetYaxis()->SetTitleSize(0.07);
2705 peak_hpdrm[jk]->GetYaxis()->SetTitleOffset(1.3);
2706 peak_hpdrm[jk]->GetYaxis()->CenterTitle();
2707 peak_hpdrm[jk]->GetYaxis()->SetLabelSize(0.065);
2708 peak_hpdrm[jk]->GetYaxis()->SetLabelOffset(0.01);
2711 peak_hpdrm[jk]->SetMarkerSize(0.60);
2712 peak_hpdrm[jk]->SetMarkerColor(2);
2713 peak_hpdrm[jk]->SetMarkerStyle(20);
2716 c0->cd(jk+1); peak_hpdrm[jk]->Draw();
2718 sprintf(out_file,
"comb_peak_hpdrm_%i.jpg",irunold);
2719 c0->SaveAs(out_file);
2723 TCanvas *c1y =
new TCanvas(
"c1y",
"Signal in each ring", xsiz, ysiz);
2726 for (
int jk=0; jk<ringmx; jk++) {
2727 const_hpdrm[jk]->GetXaxis()->SetTitle(
"RM #");
2728 const_hpdrm[jk]->GetXaxis()->SetTitleSize(0.070);
2729 const_hpdrm[jk]->GetXaxis()->SetTitleOffset(1.3);
2730 const_hpdrm[jk]->GetXaxis()->CenterTitle();
2731 const_hpdrm[jk]->GetXaxis()->SetLabelSize(0.065);
2732 const_hpdrm[jk]->GetXaxis()->SetLabelOffset(0.01);
2735 const_hpdrm[jk]->GetYaxis()->SetTitle(
"Peak(fC)");
2737 const_hpdrm[jk]->GetYaxis()->SetTitle(
"Peak(GeV)");
2739 const_hpdrm[jk]->GetYaxis()->SetTitleSize(0.065);
2740 const_hpdrm[jk]->GetYaxis()->SetTitleOffset(1.0);
2741 const_hpdrm[jk]->GetYaxis()->CenterTitle();
2742 const_hpdrm[jk]->GetYaxis()->SetLabelSize(0.065);
2743 const_hpdrm[jk]->GetYaxis()->SetLabelOffset(0.01);
2746 const_hpdrm[jk]->SetMarkerSize(0.60);
2747 const_hpdrm[jk]->SetMarkerColor(2);
2748 const_hpdrm[jk]->SetMarkerStyle(20);
2750 c1y->cd(jk+1); const_hpdrm[jk]->Draw();
2753 sprintf(out_file,
"comb_const_hpdrm_%i.jpg",irunold);
2754 c1y->SaveAs(out_file);
2767 for (
int ij=0; ij<
nphimx; ij++) {
2768 for (
int jk=0; jk<
netamx; jk++) {
2769 stat_eta[jk]->Fill(ij+1,sigrsg[jk][ij]->GetEntries());
2770 statmn_eta[jk]->Fill(ij+1,sigrsg[jk][ij]->GetMean());
2776 gStyle->SetTitleFontSize(0.09);
2777 gStyle->SetPadBottomMargin(0.14);
2778 gStyle->SetPadLeftMargin(0.17);
2779 gStyle->SetPadRightMargin(0.01);
2780 gStyle->SetNdivisions(303,
"XY");
2781 gStyle->SetOptLogy(1);
2783 TCanvas *c2x =
new TCanvas(
"c2x",
"runfile", xsiz, ysiz);
2785 for (
int side=0; side <2; side++) {
2795 for (
int ij=nmn; ij<nmx; ij++) {
2796 int ieta = (ij<15) ? ij+1 : 14-ij;
2799 sprintf(name,
"fC(#eta=%i)",ieta);
2801 sprintf(name,
"GeV(#eta=%i)",ieta);
2803 sigrsg[ij][
nphimx]->GetXaxis()->SetTitle(name);
2804 sigrsg[ij][
nphimx]->GetXaxis()->SetTitleSize(.08);
2805 sigrsg[ij][
nphimx]->GetXaxis()->CenterTitle();
2806 sigrsg[ij][
nphimx]->GetXaxis()->SetTitleOffset(0.90);
2807 sigrsg[ij][
nphimx]->GetXaxis()->SetLabelSize(.08);
2808 sigrsg[ij][
nphimx]->GetXaxis()->SetLabelOffset(.01);
2810 sigrsg[ij][
nphimx]->GetYaxis()->SetLabelSize(.08);
2811 sigrsg[ij][
nphimx]->GetYaxis()->SetLabelOffset(.01);
2812 sigrsg[ij][
nphimx]->SetLineWidth(2);
2813 sigrsg[ij][
nphimx]->SetLineColor(4);
2814 sigrsg[ij][
nphimx]->Draw();
2815 crossg[ij][
nphimx]->SetLineWidth(2);
2816 crossg[ij][
nphimx]->SetLineColor(2);
2817 crossg[ij][
nphimx]->Draw(
"same");
2821 sprintf(out_file,
"sig_ho_%i_side%i.eps", irunold, side);
2822 c2x->SaveAs(out_file);
2824 sprintf(out_file,
"sig_ho_%i_side%i.jpg", irunold, side);
2825 c2x->SaveAs(out_file);
2828 gStyle->SetOptLogy(0);
2829 c2x =
new TCanvas(
"c2x",
"runfile", xsiz, ysiz);
2831 for (
int side=0; side <2; side++) {
2841 for (
int ij=nmn; ij<nmx; ij++) {
2843 statmn_eta[ij]->SetLineWidth(2);
2844 statmn_eta[ij]->SetLineColor(4);
2845 statmn_eta[ij]->GetXaxis()->SetTitle(
"#phi index");
2846 statmn_eta[ij]->GetXaxis()->SetTitleSize(.08);
2847 statmn_eta[ij]->GetXaxis()->CenterTitle();
2848 statmn_eta[ij]->GetXaxis()->SetTitleOffset(0.9);
2849 statmn_eta[ij]->GetYaxis()->SetLabelSize(.08);
2850 statmn_eta[ij]->GetYaxis()->SetLabelOffset(.01);
2851 statmn_eta[ij]->GetXaxis()->SetLabelSize(.08);
2852 statmn_eta[ij]->GetXaxis()->SetLabelOffset(.01);
2854 statmn_eta[ij]->GetYaxis()->SetTitle(
"fC");
2856 statmn_eta[ij]->GetYaxis()->SetTitle(
"GeV");
2858 statmn_eta[ij]->GetYaxis()->SetTitleSize(.075);
2859 statmn_eta[ij]->GetYaxis()->CenterTitle();
2860 statmn_eta[ij]->GetYaxis()->SetTitleOffset(1.30);
2862 statmn_eta[ij]->Draw();
2866 sprintf(out_file,
"statmnho_%i_side%i.eps", irunold, side);
2867 c2x->SaveAs(out_file);
2869 sprintf(out_file,
"statmnho_%i_side%i.jpg", irunold, side);
2870 c2x->SaveAs(out_file);
2872 gStyle->SetOptLogy(1);
2873 gStyle->SetNdivisions(203,
"XY");
2876 for (
int ij=nmn; ij<nmx; ij++) {
2878 stat_eta[ij]->SetLineWidth(2);
2879 stat_eta[ij]->SetLineColor(4);
2880 stat_eta[ij]->GetXaxis()->SetTitle(
"#phi index");
2881 stat_eta[ij]->GetXaxis()->SetTitleSize(.08);
2882 stat_eta[ij]->GetXaxis()->CenterTitle();
2883 stat_eta[ij]->GetXaxis()->SetTitleOffset(0.80);
2884 stat_eta[ij]->GetXaxis()->SetLabelSize(.08);
2885 stat_eta[ij]->GetXaxis()->SetLabelOffset(.01);
2886 stat_eta[ij]->GetYaxis()->SetLabelSize(.08);
2887 stat_eta[ij]->GetYaxis()->SetLabelOffset(.01);
2889 stat_eta[ij]->Draw();
2893 sprintf(out_file,
"statho_%i_side%i.eps", irunold, side);
2894 c2x->SaveAs(out_file);
2896 sprintf(out_file,
"statho_%i_side%i.jpg", irunold, side);
2897 c2x->SaveAs(out_file);
2906 if (crossg[
j][
i]) {
delete crossg[
j][
i];}
2907 if (sigrsg[
j][i]) {
delete sigrsg[
j][
i];}
T getParameter(std::string const &) const
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]
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
HOCalibAnalyzer(const edm::ParameterSet &)
static const int rout12mx
virtual void beginJob() override
static const int phimap[4][21]
T * make(const Args &...args) const
make new ROOT object
virtual void endJob() override
static const int mapx1[6][3]
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
static const int npixriup[21]
edm::InputTag hoCalibVariableCollectionTag
void set_sigma(double &x, bool mdigi)
std::string theoutputtxtFile
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]
Abs< T >::type abs(const T &t)
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]
edm::EDGetTokenT< HOCalibVariableCollection > tok_ho_
static const int mapx0p[9][2]
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]
for(const auto &isodef:isoDefs)
tuple size
Write out results.
Power< A, B >::type pow(const A &a, const B &b)