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();
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);
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);
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) {
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();
1943 parer[0] = parer[1] = parer[2] = 0;
1946 if (pedstll[izone]->GetEntries() >5) {
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};
1966 TMinuit *
gMinuit =
new TMinuit(nbgpr);
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);
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();
2036 pedht = (signall[izone]->GetBinContent(
nbn-1)+
2037 signall[izone]->GetBinContent(
nbn)+
2038 signall[izone]->GetBinContent(
nbn+1))/3.;
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};
2107 TMinuit *gMinuit =
new TMinuit(nsgpr);
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);
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);
2161 sigfun[izone] =
new TF1(temp,
langaufun, xmn, xmx, nsgpr-nbgpr);
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);
2168 signalx[izone] =
new TF1(temp,
totalfunc, xmn, xmx, nsgpr);
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());
2214 fit_chi->Fill(ifl,signal[izone]->GetChisquare());
2215 sig_evt->Fill(ifl, signall[izone]->GetEntries());
2219 sig_diff->Fill(ifl, fitres[4]-fitres[1]);
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]);
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;
2241 if (iijj==3) fact2 =
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;
2251 file_out<<
"intieta "<<jk<<
" "<<ij<<
" "<<ieta<<
" "<<
mean_phi_hst->FindBin(
double(ieta))<<
" "<<calibc<<
" "<<caliberr<<endl;
2252 }
else if (iijj==3) {
2256 peak_eta[jk]->Fill(ij+1,fitres[4]);
2259 int ieta = (jk<15) ? jk+1 : 14-jk;
2261 file_out<<
"intietax "<<jk<<
" "<<ij<<
" "<<ieta<<
" "<<
const_eta_phi->FindBin(ieta, ij+1)<<endl;
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);
2274 }
else if (iijj==1) {
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();
2368 ped_rms->Draw(); c1->Update();
2377 sig_evt->Draw(); c1->Update();
2383 sig_rms->Draw(); c1->Update();
2386 fit_chi->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);
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);
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);
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) {
2554 for (
int ij=0; ij<
nphimx; ij++) {
2555 if (rms_eta[ij] >0) {
2562 gStyle->SetPadLeftMargin(0.13);
2563 gStyle->SetPadRightMargin(0.03);
2566 TCanvas *c2y =
new TCanvas(
"c2",
"Avearge signal in eta and phi", xsiz, ysiz);
2575 mean_eta_ave->GetYaxis()->SetTitle(
"Signal (GeV)/MIP");
2594 mean_phi_ave->GetYaxis()->SetTitle(
"Signal (GeV)/MIP");
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);
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);
2671 c0x->cd(ij+1);
com_sigrsg[ij][iread]->Draw();
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);
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);
2701 peak_hpdrm[jk]->GetYaxis()->SetLabelSize(0.065);
2702 peak_hpdrm[jk]->GetYaxis()->SetLabelOffset(0.01);
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++) {
2726 const_hpdrm[jk]->GetXaxis()->SetLabelOffset(0.01);
2729 const_hpdrm[jk]->GetYaxis()->SetTitle(
"Peak(fC)");
2731 const_hpdrm[jk]->GetYaxis()->SetTitle(
"Peak(GeV)");
2737 const_hpdrm[jk]->GetYaxis()->SetLabelOffset(0.01);
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++) {
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);
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++) {
2839 statmn_eta[ij]->GetXaxis()->SetTitle(
"#phi index");
2840 statmn_eta[ij]->GetXaxis()->SetTitleSize(.08);
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);
2852 statmn_eta[ij]->GetYaxis()->SetTitleSize(.075);
2854 statmn_eta[ij]->GetYaxis()->SetTitleOffset(1.30);
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++) {
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);
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);
TH1F * corrsgrb[netamx][nphimx]
TH1F * const_hpdrm[ringmx]
TH1F * com_crossg[ringmx][routmx+1]
TH1F * corrsgr[netamx][nphimx]
TH1F * corrsglu[netamx][nphimx]
static const int rout12mx
TH1F * crossg[netamx][nphimx+1]
TH1F * com_corrsgall[ringmx][sectmx]
float invang[netamx][nphimx+1]
TH1F * corrsgc[netamx][nphimx]
TH1F * peak_hpdrm[ringmx]
TH1F * corrsglb[netamx][nphimx]
TH1F * sigrsg[netamx][nphimx+1]
TH1F * com_corrsglu[ringmx][sectmx]
void set_sigma(double &x, bool mdigi)
std::string theoutputtxtFile
TH1F * com_sigrsg[ringmx][routmx+1]
float com_invang[ringmx][routmx+1]
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
TH1F * corrsgl[netamx][nphimx]
TH1F * com_corrsgc[ringmx][sectmx]
TH1F * com_corrsgrb[ringmx][sectmx]
TH1F * com_corrsgr[ringmx][sectmx]
void fcnsg(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t flag)
double fitprm[nsgpr][netamx]
Double_t gausX(Double_t *x, Double_t *par)
TH1F * corrsgru[netamx][nphimx]
TH1F * com_corrsgl[ringmx][sectmx]
TH1F * com_corrsglb[ringmx][sectmx]
void set_mean(double &x, bool mdigi)
TH1F * com_corrsgru[ringmx][sectmx]
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)
TH1F * statmn_eta[netamx]
Power< A, B >::type pow(const A &a, const B &b)
TH1F * corrsgall[netamx][nphimx]