58 Int_t neta,nphi,ndepth,nmax,nquad,npin;
60 std::cout<<std::endl<<
"HFLightCal beginJob: --> "<<std::endl;
65 printf(
"\nNo output textfile open\n\n");
66 std::cout<<
"Problem with output textFILE => exit"<<std::endl;
71 printf(
"\nNo input pre-file open\n\n");
72 std::cout<<
"Problem with input textFILE => exit"<<std::endl;
76 for (
int i=0;
i<1728;
i++) {
77 fscanf(
preFile,
"%d%d%d%d\r",&neta,&nphi,&ndepth,&nmax);
79 if (neta>=29 && neta<=41 && nphi<72 && nphi>0 && ndepth>0 && ndepth<=2)
80 itsmax[neta-29][(nphi-1)/2][ndepth-1] = nmax;
81 else if (neta<=-29 && neta>=-41 && nphi<72 && nphi>0 && ndepth>0 && ndepth<=2)
82 itsmax[13-neta-29][(nphi-1)/2][ndepth-1] = nmax;
84 std::cout<<
"Input pre-file: wrong channel record:"<<std::endl;
85 std::cout<<
"eta="<<neta<<
" phi="<<nphi<<
" depth="<<ndepth<<
" max="<<nmax<<std::endl;
88 for (
int i=0;
i<24;
i++) {
89 fscanf(
preFile,
"%d%d%d\r",&nquad,&npin,&nmax);
91 if (nquad>0 && nquad<=4 && npin<=3 && npin>0)
93 else if (nquad<0 && nquad>=-4 && npin<=3 && npin>0)
96 std::cout<<
"Input pre-file: wrong PIN record:"<<std::endl;
97 std::cout<<
"quad="<<nquad<<
" pin="<<npin<<
" max="<<nmax<<std::endl;
102 htmax =
new TH1F(
"htmax",
"Max TS",10,-0.5,9.5);
103 htmean =
new TH1F(
"htmean",
"Mean signal TS",100,0,10);
104 hsignalmean =
new TH1F(
"hsignalmean",
"Mean ADC 4maxTS",1201,-25,30000);
105 hsignalrms =
new TH1F(
"hsignalrms",
"RMS ADC 4maxTS",500,0,500);
106 hpedmean =
new TH1F(
"hpedmean",
"Mean ADC 4lowTS",200,-10,90);
107 hpedrms =
new TH1F(
"hpedrms",
"RMS ADC 4lowTS",200,0,100);
108 hspes =
new TH1F(
"hspes",
"SPE if measured",200,0,40);
109 hnpevar =
new TH1F(
"hnpevar",
"~N PE input",500,0,500);
110 hsignalmapP =
new TH2F(
"hsignalmapP",
"Mean(Response) - Mean(Pedestal) HFP;#eta;#phi",26,28.5,41.5,36,0,72);
111 hsignalRMSmapP =
new TH2F(
"hsignalRMSmapP",
"RMS Response HFP;#eta;#phi",26,28.5,41.5,36,0,72);
112 hnpemapP =
new TH2F(
"hnpemapP",
"~N PE input HFP;#eta;#phi",26,28.5,41.5,36,0,72);
114 hsignalmapM =
new TH2F(
"hsignalmapM",
"Mean(Response) - Mean(Pedestal) HFM;#eta;#phi",26,-41.5,-28.5,36,0,72);
115 hsignalRMSmapM =
new TH2F(
"hsignalRMSmapM",
"RMS Response HFM;#eta;#phi",26,-41.5,-28.5,36,0,72);
116 hnpemapM =
new TH2F(
"hnpemapM",
"~N PE input HFM;#eta;#phi",26,-41.5,-28.5,36,0,72);
119 for (
int i=0;
i<13;
i++)
for (
int j=0;
j<36;
j++)
for (
int k=0;
k<2;
k++) {
120 if (
i>10 &&
j%2==0)
continue;
121 sprintf(htit,
"ts_+%d_%d_%d",
i+29,
j*2+1,
k+1);
122 hts[
i][
j][
k] =
new TH1F(htit,htit,10,-0.5,9.5);
123 sprintf(htit,
"tsmean_+%d_%d_%d",
i+29,
j*2+1,
k+1);
124 htsm[
i][
j][
k] =
new TH1F(htit,htit,100,0,10);
125 sprintf(htit,
"sp_+%d_%d_%d",
i+29,
j*2+1,
k+1);
126 hsp[
i][
j][
k] =
new TH1F(htit,htit,1201,-25,30000);
127 sprintf(htit,
"spe_+%d_%d_%d",
i+29,
j*2+1,
k+1);
128 hspe[
i][
j][
k] =
new TH1F(htit,htit,200,-9.5,190.5);
129 sprintf(htit,
"ped_+%d_%d_%d",
i+29,
j*2+1,
k+1);
130 hped[
i][
j][
k] =
new TH1F(htit,htit,200,-9.5,190.5);
131 sprintf(htit,
"ts_-%d_%d_%d",
i+29,
j*2+1,
k+1);
132 hts[
i+13][
j][
k] =
new TH1F(htit,htit,10,-0.5,9.5);
133 sprintf(htit,
"tsmean_-%d_%d_%d",
i+29,
j*2+1,
k+1);
134 htsm[
i+13][
j][
k] =
new TH1F(htit,htit,100,0,10);
135 sprintf(htit,
"sp_-%d_%d_%d",
i+29,
j*2+1,
k+1);
136 hsp[
i+13][
j][
k] =
new TH1F(htit,htit,1201,-25,30000);
137 sprintf(htit,
"spe_-%d_%d_%d",
i+29,
j*2+1,
k+1);
138 hspe[
i+13][
j][
k] =
new TH1F(htit,htit,200,-9.5,190.5);
139 sprintf(htit,
"ped_-%d_%d_%d",
i+29,
j*2+1,
k+1);
140 hped[
i+13][
j][
k] =
new TH1F(htit,htit,200,-9.5,190.5);
143 for (
int i=0;
i<4;
i++)
for (
int j=0;
j<3;
j++) {
144 sprintf(htit,
"ts_PIN%d_+Q%d",
j+1,
i+1);
145 htspin[
i][
j] =
new TH1F(htit,htit,10,-0.5,9.5);
146 sprintf(htit,
"sp_PIN%d_+Q%d",
j+1,
i+1);
147 hsppin[
i][
j] =
new TH1F(htit,htit,1601,-25,40000);
148 sprintf(htit,
"spe_PIN%d_+Q%d",
j+1,
i+1);
149 hspepin[
i][
j] =
new TH1F(htit,htit,200,-9.5,190.5);
150 sprintf(htit,
"ped_PIN%d_+Q%d",
j+1,
i+1);
151 hpedpin[
i][
j] =
new TH1F(htit,htit,200,-9.5,190.5);
152 sprintf(htit,
"tsmean_PIN%d_+Q%d",
j+1,
i+1);
153 htsmpin[
i][
j] =
new TH1F(htit,htit,100,0,10);
154 sprintf(htit,
"ts_PIN%d_-Q%d",
j+1,
i+1);
155 htspin[
i+4][
j] =
new TH1F(htit,htit,10,-0.5,9.5);
156 sprintf(htit,
"sp_PIN%d_-Q%d",
j+1,
i+1);
157 hsppin[
i+4][
j] =
new TH1F(htit,htit,1601,-25,40000);
158 sprintf(htit,
"spe_PIN%d_-Q%d",
j+1,
i+1);
159 hspepin[
i+4][
j] =
new TH1F(htit,htit,200,-9.5,190.5);
160 sprintf(htit,
"ped_PIN%d_-Q%d",
j+1,
i+1);
161 hpedpin[
i+4][
j] =
new TH1F(htit,htit,200,-9.5,190.5);
162 sprintf(htit,
"tsmean_PIN%d_-Q%d",
j+1,
i+1);
163 htsmpin[
i+4][
j] =
new TH1F(htit,htit,100,0,10);