15 |
|
|
16 |
float time_res[8] = {425.,210.,170.,130.,120.,120.,120.,120.}; |
float time_res[8] = {425.,210.,170.,130.,120.,120.,120.,120.}; |
17 |
for(Int_t i=0;i<8;i++)time_res[i]/=1.4;//1.17;1.5;1.3*/ |
for(Int_t i=0;i<8;i++)time_res[i]/=1.4;//1.17;1.5;1.3*/ |
18 |
Float_t dt1;// = 1.e-12*time_res[0]; // single PMT resolution for Z=1 (WM, Nov'07) |
Float_t dt1 = 0.;// = 1.e-12*time_res[0]; // single PMT resolution for Z=1 (WM, Nov'07) |
19 |
|
|
20 |
if ((Z > 1) && (Z < 9)) dt1=1.e-12*time_res[(Z-1)]; |
if ((Z > 1) && (Z < 9)) dt1=1.e-12*time_res[(Z-1)]; |
21 |
if (Z > 8) dt1=120.e-12; |
if (Z > 8) dt1=120.e-12; |
101 |
pmtleft=0; |
pmtleft=0; |
102 |
pmtright=0; |
pmtright=0; |
103 |
// WM: S12 paddles are "reversed" (Nov'07) |
// WM: S12 paddles are "reversed" (Nov'07) |
104 |
if (ip==2) |
if (ip==2){ |
105 |
if (ipad==0) |
if (ipad==0) |
106 |
ipad=1; |
ipad=1; |
107 |
else |
else |
108 |
ipad=0; |
ipad=0; |
109 |
|
} |
110 |
if ((ip>-1)&&(ip<6)) { //ToF paddles only, not S4 |
if ((ip>-1)&&(ip<6)) { //ToF paddles only, not S4 |
111 |
Paddle2Pmt(ip, ipad, &pmtleft, &pmtright); |
Paddle2Pmt(ip, ipad, &pmtleft, &pmtright); |
112 |
// DC: evaluates mean position and path inside the paddle |
// DC: evaluates mean position and path inside the paddle |
189 |
} // NTHTOF < 200 |
} // NTHTOF < 200 |
190 |
// ====== ADC ====== |
// ====== ADC ====== |
191 |
for(Int_t i=0; i<48; i++){ |
for(Int_t i=0; i<48; i++){ |
192 |
if (QevePmt_pC[i] < 800.) ADCtof[i]= (Int_t)(ADC_pC0A + ADC_pC1A*QevePmt_pC[i] + ADC_pC2A*pow(QevePmt_pC[i],2) + ADC_pC3A*pow(QevePmt_pC[i],3)); |
if (QevePmt_pC[i] <= 800.) ADCtof[i]= (Int_t)(ADC_pC0A + ADC_pC1A*QevePmt_pC[i] + ADC_pC2A*pow(QevePmt_pC[i],2) + ADC_pC3A*pow(QevePmt_pC[i],3)); |
193 |
if (QevePmt_pC[i] > 800.) ADCtof[i]= (Int_t)(ADC_pC0B + ADC_pC1B*QevePmt_pC[i] + ADC_pC2B*pow(QevePmt_pC[i],2) + ADC_pC3B*pow(QevePmt_pC[i],3)); |
if (QevePmt_pC[i] > 800.) ADCtof[i]= (Int_t)(ADC_pC0B + ADC_pC1B*QevePmt_pC[i] + ADC_pC2B*pow(QevePmt_pC[i],2) + ADC_pC3B*pow(QevePmt_pC[i],3)); |
194 |
if (QevePmt_pC[i] > 2485.) ADCtof[i]= (Int_t)(1758. + 0.54*QevePmt_pC[i]); //assuming a fictional 0.54 ch/pC above ADCsat |
if (QevePmt_pC[i] > 2485.) ADCtof[i]= (Int_t)(1758. + 0.54*QevePmt_pC[i]); //assuming a fictional 0.54 ch/pC above ADCsat |
195 |
if (ADCtof[i]>ADCsat) ADCtof[i]=ADCsat; |
if (ADCtof[i]>ADCsat) ADCtof[i]=ADCsat; |
203 |
|
|
204 |
// ====== build TDC coincidence ====== |
// ====== build TDC coincidence ====== |
205 |
|
|
206 |
|
// |
207 |
|
for(Int_t i=0; i<48; i++) { |
208 |
|
if((tdcpmt[i] - c1_S[i]) > 1e-7) { |
209 |
|
tdcpmt[i] = 0.; |
210 |
|
tdc[i] = 0.; |
211 |
|
} |
212 |
|
}// cycle to introduce a window for tdc |
213 |
|
|
214 |
|
|
215 |
Float_t t_coinc = 0; |
Float_t t_coinc = 0; |
216 |
Int_t ilast = 100; |
Int_t ilast = 100; |
217 |
for (Int_t ii=0; ii<48;ii++) |
for (Int_t ii=0; ii<48;ii++) |
382 |
UChar_t crcTof=0x00; |
UChar_t crcTof=0x00; |
383 |
UChar_t *pc=&crcTof, *pc2; |
UChar_t *pc=&crcTof, *pc2; |
384 |
pc2=pTof; |
pc2=pTof; |
385 |
for (Int_t jp=0; jp < 23; jp++){ |
for (Int_t jp=0; jp < 22; jp++){ // cecilia: fixed 23->22 |
386 |
//crcTof = crc8(...) |
//crcTof = crc8(...) |
387 |
Crc8Tof(pc2++,pc); |
Crc8Tof(pc2++,pc); |
388 |
// printf("%2i --- %x\n",jp,crcTof); |
// printf("%2i --- %x\n",jp,crcTof); |
473 |
Int_t error = 0,temp=0; |
Int_t error = 0,temp=0; |
474 |
GL_PARAM *glparam = new GL_PARAM(); |
GL_PARAM *glparam = new GL_PARAM(); |
475 |
error = glparam->Query_GL_PARAM(3,202,fDbc); |
error = glparam->Query_GL_PARAM(3,202,fDbc); |
476 |
calfile.str(""); |
if(!error){ |
477 |
calfile << glparam->PATH.Data() << "/"; |
calfile.str(""); |
478 |
calfile << glparam->NAME.Data(); |
calfile << glparam->PATH.Data() << "/"; |
479 |
printf("\n Using TOF calibration file: \n %s\n",calfile.str().c_str()); |
calfile << glparam->NAME.Data(); |
480 |
ifstream fileTriggerCalib; |
printf("\n Using TOF calibration file: \n %s\n",calfile.str().c_str()); |
481 |
fileTriggerCalib.open(calfile.str().c_str()); |
ifstream fileTriggerCalib; |
482 |
if(!fileTriggerCalib)printf("debug: no trigger calib file!\n"); |
fileTriggerCalib.open(calfile.str().c_str()); |
483 |
// correct readout WM Oct '07 |
for(Int_t i=0; i<np; i++){ |
484 |
for(Int_t i=0; i<np; i++){ |
fileTriggerCalib >> temp; |
485 |
fileTriggerCalib >> temp; |
fileTriggerCalib >> atte1[i]; |
486 |
fileTriggerCalib >> atte1[i]; |
fileTriggerCalib >> lambda1[i]; |
487 |
fileTriggerCalib >> lambda1[i]; |
fileTriggerCalib >> atte2[i]; |
488 |
fileTriggerCalib >> atte2[i]; |
fileTriggerCalib >> lambda2[i]; |
489 |
fileTriggerCalib >> lambda2[i]; |
fileTriggerCalib >> temp; |
490 |
fileTriggerCalib >> temp; |
} |
491 |
|
fileTriggerCalib.close(); |
492 |
|
} |
493 |
|
else{ |
494 |
|
cout<<endl<<" *********** ATTENTION ***********"<<endl; |
495 |
|
cout<<endl<<" TOF: NO trigger calib file!"<<endl<<endl; |
496 |
|
cout<<endl<<" TOF digitized data will be wrong!"<<endl<<endl; |
497 |
|
for(Int_t i=0; i<np; i++){ |
498 |
|
atte1[i]=0.; |
499 |
|
lambda1[i]=0.; |
500 |
|
atte2[i]=0.; |
501 |
|
lambda2[i]=0.; |
502 |
|
} |
503 |
} |
} |
|
fileTriggerCalib.close(); |
|
504 |
//end tof calib |
//end tof calib |
505 |
} |
} |