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();
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);
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);
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) {
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();
1949 parer[0] = parer[1] = parer[2] = 0;
1952 if (pedstll[izone]->GetEntries() >5) {
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};
1972 TMinuit *
gMinuit =
new TMinuit(nbgpr);
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);
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();
2042 pedht = (signall[izone]->GetBinContent(
nbn-1)+
2043 signall[izone]->GetBinContent(
nbn)+
2044 signall[izone]->GetBinContent(
nbn+1))/3.;
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};
2113 TMinuit *gMinuit =
new TMinuit(nsgpr);
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);
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);
2167 sigfun[izone] =
new TF1(temp,
langaufun, xmn, xmx, nsgpr-nbgpr);
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);
2174 signalx[izone] =
new TF1(temp,
totalfunc, xmn, xmx, nsgpr);
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());
2220 fit_chi->Fill(ifl,signal[izone]->GetChisquare());
2221 sig_evt->Fill(ifl, signall[izone]->GetEntries());
2225 sig_diff->Fill(ifl, fitres[4]-fitres[1]);
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]);
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;
2247 if (iijj==3) fact2 =
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;
2257 file_out<<
"intieta "<<jk<<
" "<<ij<<
" "<<ieta<<
" "<<
mean_phi_hst->FindBin(
double(ieta))<<
" "<<calibc<<
" "<<caliberr<<endl;
2258 }
else if (iijj==3) {
2262 peak_eta[jk]->Fill(ij+1,fitres[4]);
2265 int ieta = (jk<15) ? jk+1 : 14-jk;
2267 file_out<<
"intietax "<<jk<<
" "<<ij<<
" "<<ieta<<
" "<<
const_eta_phi->FindBin(ieta, ij+1)<<endl;
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);
2280 }
else if (iijj==1) {
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();
2374 ped_rms->Draw(); c1->Update();
2383 sig_evt->Draw(); c1->Update();
2389 sig_rms->Draw(); c1->Update();
2392 fit_chi->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);
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);
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);
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) {
2560 for (
int ij=0; ij<
nphimx; ij++) {
2561 if (rms_eta[ij] >0) {
2568 gStyle->SetPadLeftMargin(0.13);
2569 gStyle->SetPadRightMargin(0.03);
2572 TCanvas *c2y =
new TCanvas(
"c2",
"Avearge signal in eta and phi", xsiz, ysiz);
2581 mean_eta_ave->GetYaxis()->SetTitle(
"Signal (GeV)/MIP");
2600 mean_phi_ave->GetYaxis()->SetTitle(
"Signal (GeV)/MIP");
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);
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);
2677 c0x->cd(ij+1);
com_sigrsg[ij][iread]->Draw();
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);
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);
2707 peak_hpdrm[jk]->GetYaxis()->SetLabelSize(0.065);
2708 peak_hpdrm[jk]->GetYaxis()->SetLabelOffset(0.01);
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++) {
2732 const_hpdrm[jk]->GetXaxis()->SetLabelOffset(0.01);
2735 const_hpdrm[jk]->GetYaxis()->SetTitle(
"Peak(fC)");
2737 const_hpdrm[jk]->GetYaxis()->SetTitle(
"Peak(GeV)");
2743 const_hpdrm[jk]->GetYaxis()->SetLabelOffset(0.01);
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++) {
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);
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++) {
2845 statmn_eta[ij]->GetXaxis()->SetTitle(
"#phi index");
2846 statmn_eta[ij]->GetXaxis()->SetTitleSize(.08);
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);
2858 statmn_eta[ij]->GetYaxis()->SetTitleSize(.075);
2860 statmn_eta[ij]->GetYaxis()->SetTitleOffset(1.30);
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++) {
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);
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);
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]
Abs< T >::type abs(const T &t)
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]