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); |