| 158 |
this->InitDo(dbc,hs,sgnl,l0tree,isdeb,isverb); |
this->InitDo(dbc,hs,sgnl,l0tree,isdeb,isverb); |
| 159 |
dbc->Close(); |
dbc->Close(); |
| 160 |
delete dbc; |
delete dbc; |
| 161 |
|
dbc = 0; |
| 162 |
} |
} |
| 163 |
|
|
| 164 |
|
|
| 278 |
Int_t sig = this->ChkParamDo(dbc,runheader,mechal); |
Int_t sig = this->ChkParamDo(dbc,runheader,mechal); |
| 279 |
dbc->Close(); |
dbc->Close(); |
| 280 |
delete dbc; |
delete dbc; |
| 281 |
|
dbc = 0; |
| 282 |
return(sig); |
return(sig); |
| 283 |
} |
} |
| 284 |
|
|
| 604 |
Int_t sig = CalcCrossTalkCorrDo(dbc,runheader,usetable); |
Int_t sig = CalcCrossTalkCorrDo(dbc,runheader,usetable); |
| 605 |
dbc->Close(); |
dbc->Close(); |
| 606 |
delete dbc; |
delete dbc; |
| 607 |
|
dbc = 0; |
| 608 |
// |
// |
| 609 |
return(sig); |
return(sig); |
| 610 |
// |
// |
| 624 |
Int_t sig = CalcCrossTalkCorrDo(dbc,runheader,true); |
Int_t sig = CalcCrossTalkCorrDo(dbc,runheader,true); |
| 625 |
dbc->Close(); |
dbc->Close(); |
| 626 |
delete dbc; |
delete dbc; |
| 627 |
|
dbc = 0; |
| 628 |
// |
// |
| 629 |
return(sig); |
return(sig); |
| 630 |
// |
// |
| 745 |
// |
// |
| 746 |
if ( !ncalibs ) return(-110); |
if ( !ncalibs ) return(-110); |
| 747 |
// |
// |
| 748 |
calo->GetEntry(calibno); |
if ( calo->GetEntry(calibno) <= 0) throw -36; |
| 749 |
if ( verbose ) printf(" PULSE2 using entry %u from file %s",calibno,fcalname.Data()); |
if ( verbose ) printf(" PULSE2 using entry %u from file %s",calibno,fcalname.Data()); |
| 750 |
// |
// |
| 751 |
// retrieve calibration table |
// retrieve calibration table |
| 826 |
// |
// |
| 827 |
if ( !ncalibs ) return(-110); |
if ( !ncalibs ) return(-110); |
| 828 |
// |
// |
| 829 |
calo1->GetEntry(calibno); |
if ( calo1->GetEntry(calibno) <= 0 ) throw -36; |
| 830 |
if ( verbose ) printf(" PULSE1 using entry %u from file %s",calibno,fcalname.Data()); |
if ( verbose ) printf(" PULSE1 using entry %u from file %s",calibno,fcalname.Data()); |
| 831 |
// |
// |
| 832 |
// retrieve calibration table |
// retrieve calibration table |
| 1164 |
if ( strip6s < 4 && base[l][m][pre] > (-0.015*qp+sbase[l][m][pre]) && sbase[l][m][pre] > 0. ){ |
if ( strip6s < 4 && base[l][m][pre] > (-0.015*qp+sbase[l][m][pre]) && sbase[l][m][pre] > 0. ){ |
| 1165 |
if ( debug ) printf(" Suspicious calculated baseline: base %f sbase-0.02*qp %f strip6s %i \n",base[l][m][pre],(-qp*0.02+sbase[l][m][pre]),(Int_t)strip6s); |
if ( debug ) printf(" Suspicious calculated baseline: base %f sbase-0.02*qp %f strip6s %i \n",base[l][m][pre],(-qp*0.02+sbase[l][m][pre]),(Int_t)strip6s); |
| 1166 |
base[l][m][pre] = 31000.; |
base[l][m][pre] = 31000.; |
| 1167 |
|
nst = 0; // 9RED BUG |
| 1168 |
|
qp = 0.; // 9RED BUG |
| 1169 |
for (Int_t e = pre*16; e < (pre+1)*16 ; e++){ |
for (Int_t e = pre*16; e < (pre+1)*16 ; e++){ |
| 1170 |
dexyc[l][m][e] = dexy[l][m][e]; |
dexyc[l][m][e] = dexy[l][m][e]; |
| 1171 |
}; |
}; |
| 1172 |
}; |
}; |
| 1173 |
} else { |
} else { |
| 1174 |
|
if ( debug ) printf(" reset baseline here if ! ( (strip6s >=2 && process == 2) || (strip6s >= 9 and process > 2) ) \n"); |
| 1175 |
base[l][m][pre] = 31000.; |
base[l][m][pre] = 31000.; |
| 1176 |
|
nst = 0; // 9RED BUG |
| 1177 |
|
qp = 0.; // 9RED BUG |
| 1178 |
for (Int_t e = pre*16; e < (pre+1)*16 ; e++){ |
for (Int_t e = pre*16; e < (pre+1)*16 ; e++){ |
| 1179 |
dexyc[l][m][e] = dexy[l][m][e]; |
dexyc[l][m][e] = dexy[l][m][e]; |
| 1180 |
}; |
}; |
| 1181 |
}; |
}; |
| 1182 |
} else { |
} else { |
| 1183 |
|
if ( debug ) printf(" reset baseline here if no minimum find\n"); |
| 1184 |
|
nst = 0; // 9RED BUG |
| 1185 |
|
qp = 0.; // 9RED BUG |
| 1186 |
process += 2; |
process += 2; |
| 1187 |
base[l][m][pre] = 31000.; |
base[l][m][pre] = 31000.; |
| 1188 |
for (Int_t e = pre*16; e < (pre+1)*16 ; e++){ |
for (Int_t e = pre*16; e < (pre+1)*16 ; e++){ |
| 1190 |
}; |
}; |
| 1191 |
}; |
}; |
| 1192 |
}; |
}; |
| 1193 |
|
if ( debug ) printf(" Baseline calculation: baseline for view %i plane %i pre %i is %f nst %i qp %f \n",l,m,pre,base[l][m][pre],nst,qp); |
| 1194 |
} |
} |
| 1195 |
|
|
| 1196 |
Int_t CaloLevel0::Calibrate(Int_t ei){ |
Int_t CaloLevel0::Calibrate(Int_t ei){ |
| 1197 |
// |
// |
| 1198 |
// get entry ei |
// get entry ei |
| 1199 |
// |
// |
| 1200 |
l0calo->GetEntry(ei); |
if ( l0calo->GetEntry(ei) <= 0 ) throw -36; |
| 1201 |
// |
// |
| 1202 |
// if it was not a selftrigger event, could it ever been a selftrigger event? if so trigty = 3. |
// if it was not a selftrigger event, could it ever been a selftrigger event? if so trigty = 3. |
| 1203 |
// |
// |
| 1214 |
val = 0; |
val = 0; |
| 1215 |
del = 1000; |
del = 1000; |
| 1216 |
if ( clevel2->trigty < 2. ){ |
if ( clevel2->trigty < 2. ){ |
| 1217 |
Bool_t ck = false; |
// Bool_t ck = false; |
| 1218 |
for (Int_t sec = 0; sec < 4; sec++){ |
for (Int_t sec = 0; sec < 4; sec++){ |
| 1219 |
val = (Int_t)de->calselftrig[sec][6]; |
val = (Int_t)de->calselftrig[sec][6]; |
| 1220 |
del = delay(val); |
del = delay(val); |
| 1221 |
if ( del < 1000 ){ |
if ( del < 1000 ){ |
| 1222 |
clevel2->wartrig = 0.; |
clevel2->wartrig = 0.; |
| 1223 |
clevel2->trigty = 3.; |
clevel2->trigty = 3.; |
| 1224 |
ck = true; |
// ck = true; |
| 1225 |
break; |
break; |
| 1226 |
}; |
}; |
| 1227 |
}; |
}; |
| 1242 |
Int_t se = 5; |
Int_t se = 5; |
| 1243 |
Int_t done = 0; |
Int_t done = 0; |
| 1244 |
Int_t pre = -1; |
Int_t pre = -1; |
| 1245 |
Bool_t isCOMP = false; |
// Bool_t isCOMP = false; |
| 1246 |
Bool_t isFULL = false; |
// Bool_t isFULL = false; |
| 1247 |
Bool_t isRAW = false; |
Bool_t isRAW = false; |
| 1248 |
Float_t ener; |
Float_t ener; |
| 1249 |
Int_t doneb = 0; |
Int_t doneb = 0; |
| 1266 |
// |
// |
| 1267 |
Float_t ener0 = 0.; |
Float_t ener0 = 0.; |
| 1268 |
Float_t cbase0 = 0.; |
Float_t cbase0 = 0.; |
| 1269 |
|
Float_t totbase = 0.; |
| 1270 |
|
Float_t totped = 0.; |
| 1271 |
Bool_t pproblem = false; |
Bool_t pproblem = false; |
| 1272 |
Bool_t negbase = false; |
Bool_t negbase = false; |
| 1273 |
// |
// |
| 1292 |
// |
// |
| 1293 |
// determine what kind of event we are going to analyze |
// determine what kind of event we are going to analyze |
| 1294 |
// |
// |
| 1295 |
isCOMP = false; |
// isCOMP = false; |
| 1296 |
isFULL = false; |
// isFULL = false; |
| 1297 |
isRAW = false; |
isRAW = false; |
| 1298 |
if ( de->stwerr[se] & (1 << 16) ) isCOMP = true; |
// if ( de->stwerr[se] & (1 << 16) ) isCOMP = true; |
| 1299 |
if ( de->stwerr[se] & (1 << 17) ) isFULL = true; |
// if ( de->stwerr[se] & (1 << 17) ) isFULL = true; |
| 1300 |
if ( de->stwerr[se] & (1 << 3) ) isRAW = true; |
if ( de->stwerr[se] & (1 << 3) ) isRAW = true; |
| 1301 |
if ( !chdone[se] ){ |
if ( !chdone[se] ){ |
| 1302 |
// |
// |
| 1382 |
// |
// |
| 1383 |
pre = -1; |
pre = -1; |
| 1384 |
ener0 = 0.; |
ener0 = 0.; |
| 1385 |
|
totbase = 0.; |
| 1386 |
|
totped = 0.; |
| 1387 |
for (Int_t i = 0 ; i < 3 ; i++){ |
for (Int_t i = 0 ; i < 3 ; i++){ |
| 1388 |
ip[i] = 0; |
ip[i] = 0; |
| 1389 |
for (Int_t n = i*32 ; n < (i+1)*32 ; n++){ |
for (Int_t n = i*32 ; n < (i+1)*32 ; n++){ |
| 1401 |
// no suitable new baseline, use old ones! |
// no suitable new baseline, use old ones! |
| 1402 |
// |
// |
| 1403 |
if ( !done ){ |
if ( !done ){ |
| 1404 |
|
if ( debug ) printf(" l %i m %i pre %i ip[i] %i base %f base ip[i] %f sbase %f \n",l,m,pre,ip[i],base[l][m][pre],base[l][m][ip[i]],sbase[l][m][pre]); |
| 1405 |
if ( (base[l][m][pre] == 31000. || base[l][m][pre] == 0.) ){ |
if ( (base[l][m][pre] == 31000. || base[l][m][pre] == 0.) ){ |
| 1406 |
ck[l][m][pre] = 1; |
ck[l][m][pre] = 1; |
| 1407 |
if (pre%2 == 0) { |
if (pre%2 == 0) { |
| 1452 |
ener = dexyc[l][m][n]; |
ener = dexyc[l][m][n]; |
| 1453 |
ener0 += ener; |
ener0 += ener; |
| 1454 |
clevel1->estrip[n][m][l] = 0.; |
clevel1->estrip[n][m][l] = 0.; |
| 1455 |
|
totbase += de->base[l][m][pre]/96.; |
| 1456 |
|
totped += fabs(calped[l][m][n]); |
| 1457 |
if ( de->base[l][m][pre] < 0 ) negbase = true; |
if ( de->base[l][m][pre] < 0 ) negbase = true; |
| 1458 |
if ( base0>0 && base0 < 30000. ){ |
if ( base0>0 && base0 < 30000. ){ |
| 1459 |
// |
// |
| 1468 |
// |
// |
| 1469 |
// OK, now in estrip we have the energy deposit in MIP of all the strips for this event (at the end of loops of course) |
// OK, now in estrip we have the energy deposit in MIP of all the strips for this event (at the end of loops of course) |
| 1470 |
// |
// |
| 1471 |
|
if ( debug && l==0 && (m==17 || m==18) ) printf(" view %i plane %i strip %i ener %f calped %f base0 %f base1 %f base2 %f mip %f ENERGIA %f \n",l,m,n,ener,calped[l][m][n],base0,base1,base2,mip[l][m][n],clevel1->estrip[n][m][l]); |
| 1472 |
if ( clevel1->estrip[n][m][l] > 0. ) qpre[l][m][pre] += clevel1->estrip[n][m][l]; |
if ( clevel1->estrip[n][m][l] > 0. ) qpre[l][m][pre] += clevel1->estrip[n][m][l]; |
| 1473 |
// |
// |
| 1474 |
// |
// |
| 1478 |
}; |
}; |
| 1479 |
// |
// |
| 1480 |
// check if there were problems with 5.7 or glitches in the power supply |
// check if there were problems with 5.7 or glitches in the power supply |
| 1481 |
// |
// |
| 1482 |
if ( ((ener0 == 0. && cbase0 == 0.) || negbase ) && !pproblem && clevel2->perr[se] == 0){ |
// if ( ((ener0 == 0. && cbase0 == 0.) || negbase || totbase > 196600. || totped < 1. ) && !pproblem && clevel2->perr[se] == 0){ // check pedestal and baseline values for one plane, if all zeros calibration is not valid (calorimeter power problems) [8th data reduction bug, fixed on 25/11/2009 by E.M.] |
| 1483 |
if ( verbose ) printf(" L0 entry %i : calorimeter power problems! event marked as bad perr %f swerr %X view %i plane %i \n",ei,de->perror[se],de->stwerr[se],l,m); |
if ( ((ener0 == 0. && cbase0 == 0.) || negbase || totbase > 32700. || totped < 1. ) && !pproblem && clevel2->perr[se] == 0){ // check pedestal and baseline values for one plane, if all zeros calibration is not valid (calorimeter power problems) [8th data reduction bug, fixed on 25/11/2009 by E.M.] |
| 1484 |
|
if ( verbose ) printf(" L0 entry %i : calorimeter power problems! event marked as bad perr %f swerr %X view %i plane %i negbase %i totbase %f totped %f\n",ei,de->perror[se],de->stwerr[se],l,m, negbase, totbase, totped); |
| 1485 |
pproblem = true; |
pproblem = true; |
| 1486 |
pe++; |
pe++; |
| 1487 |
}; |
}; |
| 1513 |
// |
// |
| 1514 |
// Cross-talk corrections |
// Cross-talk corrections |
| 1515 |
// |
// |
| 1516 |
if ( crosst ){ |
if ( crosst ){ |
| 1517 |
// |
// |
| 1518 |
// energy on silicon ladders |
// energy on silicon ladders |
| 1519 |
// |
// |
| 1530 |
if ( noselfct ){ |
if ( noselfct ){ |
| 1531 |
for (Int_t j = ladder*32 ; j < (ladder+1)*32 ; j++){ |
for (Int_t j = ladder*32 ; j < (ladder+1)*32 ; j++){ |
| 1532 |
ipre = j/16 ; |
ipre = j/16 ; |
| 1533 |
|
if ( debug ) printf(" CT STEP1 %i %i %i estrip %f ctprecor %f \n",j,m,l,clevel1->estrip[j][m][l],ctprecor[l][m][ipre]); |
| 1534 |
if ( clevel1->estrip[j][m][l] != 0. ) clevel1->estrip[j][m][l] -= clevel1->estrip[j][m][l] * ctprecor[l][m][ipre]; |
if ( clevel1->estrip[j][m][l] != 0. ) clevel1->estrip[j][m][l] -= clevel1->estrip[j][m][l] * ctprecor[l][m][ipre]; |
| 1535 |
|
if ( debug ) printf(" CT STEP2 %i %i %i estrip %f ctprecor %f \n",j,m,l,clevel1->estrip[j][m][l],ctprecor[l][m][ipre]); |
| 1536 |
}; |
}; |
| 1537 |
}; |
}; |
| 1538 |
// |
// |
| 1554 |
// |
// |
| 1555 |
if ( debug ) printf(" CK1 Limit for while: 0.07 \n"); |
if ( debug ) printf(" CK1 Limit for while: 0.07 \n"); |
| 1556 |
for (Int_t j = ipre*16 ; j < (ipre+1)*16 ; j++){ |
for (Int_t j = ipre*16 ; j < (ipre+1)*16 ; j++){ |
| 1557 |
|
if ( debug ) printf(" CT STEP3 %i %i %i estrip %f ctprecor %f \n",j,m,l,clevel1->estrip[j][m][l],ctprecor[l][m][ipp]); |
| 1558 |
if ( !ctground ){ |
if ( !ctground ){ |
| 1559 |
if ( clevel1->estrip[j][m][l] != 0. ) clevel1->estrip[j][m][l] += - qpre[l][m][ipp] * ctprecor[l][m][ipp]; |
if ( clevel1->estrip[j][m][l] != 0. ) clevel1->estrip[j][m][l] += - qpre[l][m][ipp] * ctprecor[l][m][ipp]; |
| 1560 |
} else { |
} else { |
| 1561 |
if ( clevel1->estrip[j][m][l] != 0. ) clevel1->estrip[j][m][l] += - qpre[l][m][ipp] * 0.00478; |
if ( clevel1->estrip[j][m][l] != 0. ) clevel1->estrip[j][m][l] += - qpre[l][m][ipp] * 0.00478; |
| 1562 |
}; |
}; |
| 1563 |
if ( clevel1->estrip[j][m][l] > 0. ) nqpre += clevel1->estrip[j][m][l] ; |
if ( clevel1->estrip[j][m][l] > 0. ) nqpre += clevel1->estrip[j][m][l] ; |
| 1564 |
|
if ( debug ) printf(" CT STEP4 %i %i %i estrip %f ctprecor %f \n",j,m,l,clevel1->estrip[j][m][l],ctprecor[l][m][ipp]); |
| 1565 |
}; |
}; |
| 1566 |
qpre[l][m][ipre] = nqpre; |
qpre[l][m][ipre] = nqpre; |
| 1567 |
nqpre = 0.; |
nqpre = 0.; |
| 1572 |
while ( it < 10 && deltaqpre > 0.07 ){ |
while ( it < 10 && deltaqpre > 0.07 ){ |
| 1573 |
nqpre = 0.; |
nqpre = 0.; |
| 1574 |
for (Int_t j = ipre*16 ; j < (ipre+1)*16 ; j++){ |
for (Int_t j = ipre*16 ; j < (ipre+1)*16 ; j++){ |
| 1575 |
|
if ( debug ) printf(" CT STEP5 %i %i %i estrip %f ctprecor %f \n",j,m,l,clevel1->estrip[j][m][l],ctprecor[l][m][ipre]); |
| 1576 |
if ( !ctground ){ |
if ( !ctground ){ |
| 1577 |
if ( debug ) printf(" CK1 pre correction: iteration %i deltaqpre %f ctprecor %f TOTAL CORRECTION %f \n",it,deltaqpre,ctprecor[l][m][ipre],deltaqpre * ctprecor[l][m][ipre]); |
if ( debug ) printf(" CK1 pre correction: iteration %i deltaqpre %f ctprecor %f TOTAL CORRECTION %f \n",it,deltaqpre,ctprecor[l][m][ipre],deltaqpre * ctprecor[l][m][ipre]); |
| 1578 |
if ( clevel1->estrip[j][m][l] != 0. ) clevel1->estrip[j][m][l] += deltaqpre * ctprecor[l][m][ipre]; |
if ( clevel1->estrip[j][m][l] != 0. ) clevel1->estrip[j][m][l] += deltaqpre * ctprecor[l][m][ipre]; |
| 1580 |
if ( clevel1->estrip[j][m][l] != 0. ) clevel1->estrip[j][m][l] += deltaqpre * 0.00478; |
if ( clevel1->estrip[j][m][l] != 0. ) clevel1->estrip[j][m][l] += deltaqpre * 0.00478; |
| 1581 |
}; |
}; |
| 1582 |
if ( clevel1->estrip[j][m][l] > 0. ) nqpre += clevel1->estrip[j][m][l] ; |
if ( clevel1->estrip[j][m][l] > 0. ) nqpre += clevel1->estrip[j][m][l] ; |
| 1583 |
|
if ( debug ) printf(" CT STEP6 %i %i %i estrip %f ctprecor %f \n",j,m,l,clevel1->estrip[j][m][l],ctprecor[l][m][ipre]); |
| 1584 |
}; |
}; |
| 1585 |
if ( ctground ) it = 100; |
if ( ctground ) it = 100; |
| 1586 |
it++; |
it++; |
| 1687 |
nqpre[0] = 0.; |
nqpre[0] = 0.; |
| 1688 |
nqpre[1] = 0.; |
nqpre[1] = 0.; |
| 1689 |
for (Int_t j = ladder*32 ; j < (ladder+1)*32 ; j++){ |
for (Int_t j = ladder*32 ; j < (ladder+1)*32 ; j++){ |
| 1690 |
|
if ( debug ) printf(" CT STEP6 %i %i %i estrip %f ctprecor %f \n",j,m,l,clevel1->estrip[j][m][l],ctsicor[l][m][si2]); |
| 1691 |
ipre = 0; |
ipre = 0; |
| 1692 |
if ( j > (ladder*32)+15 ) ipre = 1; |
if ( j > (ladder*32)+15 ) ipre = 1; |
| 1693 |
jpre = j/16 ; |
jpre = j/16 ; |
| 1703 |
}; |
}; |
| 1704 |
if ( clevel1->estrip[j][m][l] > 0. ) nqsi += clevel1->estrip[j][m][l] ; |
if ( clevel1->estrip[j][m][l] > 0. ) nqsi += clevel1->estrip[j][m][l] ; |
| 1705 |
if ( clevel1->estrip[j][m][l] > 0. ) nqpre[ipre] += clevel1->estrip[j][m][l] ; |
if ( clevel1->estrip[j][m][l] > 0. ) nqpre[ipre] += clevel1->estrip[j][m][l] ; |
| 1706 |
|
if ( debug ) printf(" CT STEP7 %i %i %i estrip %f ctprecor %f \n",j,m,l,clevel1->estrip[j][m][l],ctsicor[l][m][si2]); |
| 1707 |
}; |
}; |
| 1708 |
if ( ctground ) it = 100; |
if ( ctground ) it = 100; |
| 1709 |
deltaqsi = nqsi-snqsi; |
deltaqsi = nqsi-snqsi; |
|
snqsi = nqsi; |
|
|
it++; |
|
| 1710 |
deltaqpre[0] = nqpre[0] - qpre[l][m][pre-1]; |
deltaqpre[0] = nqpre[0] - qpre[l][m][pre-1]; |
| 1711 |
deltaqpre[1] = nqpre[1] - qpre[l][m][pre]; |
deltaqpre[1] = nqpre[1] - qpre[l][m][pre]; |
| 1712 |
|
// |
| 1713 |
|
// Check for divergence and stop if it happens! [9RED bug noticed with plane 18X] |
| 1714 |
|
// |
| 1715 |
|
if ( deltaqpre[0] > qpre[l][m][pre-1] || deltaqpre[1] > qpre[l][m][pre] || deltaqsi >snqsi ){ |
| 1716 |
|
if ( debug ) printf(" WARNING!! DIVERGING CORRECTION EXIT IMMEDIATLY FROM THE LOOP!! dqpre0 %f qpre0 %f // dqpre1 %f qpre1 %f // dqsi %f qsi %f \n",deltaqpre[0],qpre[l][m][pre-1],deltaqpre[1],qpre[l][m][pre],deltaqsi,snqsi); |
| 1717 |
|
it = 1000; |
| 1718 |
|
}; |
| 1719 |
|
// |
| 1720 |
|
snqsi = nqsi; |
| 1721 |
|
it++; |
| 1722 |
if ( debug ) printf(" BEFORE: qpre 0 %f qpre 1 %f \n",qpre[l][m][pre-1],qpre[l][m][pre]); |
if ( debug ) printf(" BEFORE: qpre 0 %f qpre 1 %f \n",qpre[l][m][pre-1],qpre[l][m][pre]); |
| 1723 |
qpre[l][m][pre-1] = nqpre[0]; |
qpre[l][m][pre-1] = nqpre[0]; |
| 1724 |
qpre[l][m][pre] = nqpre[1]; |
qpre[l][m][pre] = nqpre[1]; |
| 1754 |
jjj++; |
jjj++; |
| 1755 |
j4++; |
j4++; |
| 1756 |
if ( j < 96 ) ene[j] = clevel1->estrip[j][m][l]; |
if ( j < 96 ) ene[j] = clevel1->estrip[j][m][l]; |
| 1757 |
if ( crosst ){ |
if ( crosst ){ |
| 1758 |
// |
// |
| 1759 |
// "Real" crosstalk effect on the neighbour strips respect to the one which have seen the energy deposit |
// "Real" crosstalk effect on the neighbour strips respect to the one which have seen the energy deposit |
| 1760 |
// |
// |
| 1790 |
clevel1->estrip[j4][m][l] = 0.; |
clevel1->estrip[j4][m][l] = 0.; |
| 1791 |
}; |
}; |
| 1792 |
// |
// |
| 1793 |
|
if ( debug ) printf(" STRIP: view %i plane %i strip %i energy: %f \n",l,m,j4,clevel1->estrip[j4][m][l]); |
| 1794 |
|
// |
| 1795 |
// code and save the energy for each strip in svstrip |
// code and save the energy for each strip in svstrip |
| 1796 |
// |
// |
| 1797 |
if ( clevel1->estrip[j4][m][l] > clevel1->emin ){ |
if ( clevel1->estrip[j4][m][l] > clevel1->emin ){ |
| 1798 |
// |
// |
| 1799 |
Float_t savel1 = clevel1->estrip[j4][m][l]; |
Float_t savel1 = clevel1->estrip[j4][m][l]; |
| 1800 |
|
// |
| 1801 |
|
if ( m == 18 && l == 0 ){ |
| 1802 |
|
if ( debug ) printf(" Resetting plane 18X for variable calculation: view %i plane %i strip %i \n",l,m,j4); |
| 1803 |
|
clevel1->estrip[j4][m][l] = 0.; // SAVE STRIPS VALUE FOR PLANE 18 X but DO NOT USE IT FOR VARIABLE CALCULATION |
| 1804 |
|
}; |
| 1805 |
|
if ( debug ) printf(" HIT STRIP: view %i plane %i strip %i energy: %f \n",l,m,j4,clevel1->estrip[j4][m][l]); |
| 1806 |
// if ( dexyc[l][m][j4] == 32767. ){ |
// if ( dexyc[l][m][j4] == 32767. ){ |
| 1807 |
if ( dexyc[l][m][j4] > 32000. ){ |
if ( dexyc[l][m][j4] > 32000. || savel1 > 5000.){ // CaloLevel1 bug with plane 18X [9RED 14/04/2010] |
| 1808 |
savel1 += 5000.; |
if ( savel1 > 5000 ){ |
| 1809 |
|
if ( debug ) printf(" Absurd plane 18X energy... resetting value to 1100 MIP \n"); |
| 1810 |
|
savel1 = 1100.; // CaloLevel1 bug with plane 18x [9RED 14/04/2010] |
| 1811 |
|
}; |
| 1812 |
|
savel1 += 5000.; |
| 1813 |
clevel2->nsatstrip += 1.; |
clevel2->nsatstrip += 1.; |
| 1814 |
}; |
}; |
| 1815 |
// |
// |
| 1852 |
} else { |
} else { |
| 1853 |
svstrip[istrip] = -(fbi*1000000000 + plo*10000000 + j4*100000 + cle); |
svstrip[istrip] = -(fbi*1000000000 + plo*10000000 + j4*100000 + cle); |
| 1854 |
}; |
}; |
| 1855 |
|
if ( debug ) printf(" svstrip[%i] = %i fbi %i plo %i j4 %i cle %i \n",istrip,svstrip[istrip],fbi,plo,j4,cle); |
| 1856 |
// |
// |
| 1857 |
istrip++; |
istrip++; |
| 1858 |
}; |
}; |
| 1992 |
}; |
}; |
| 1993 |
// |
// |
| 1994 |
} |
} |
| 1995 |
|
void CaloLevel0::FillCommonVar(CaloLevel1 *c1){ |
| 1996 |
|
if ( c1 ){ |
| 1997 |
|
c1->istrip = istrip; |
| 1998 |
|
c1->estrip = TArrayI(istrip,svstrip); |
| 1999 |
|
}; |
| 2000 |
|
// |
| 2001 |
|
} |
| 2002 |
|
|
| 2003 |
void CaloLevel0::ClearStructs(){ |
void CaloLevel0::ClearStructs(){ |
| 2004 |
ClearTrkVar(); |
ClearTrkVar(); |
| 2239 |
// |
// |
| 2240 |
if ( !ncalibs ) return(-110); |
if ( !ncalibs ) return(-110); |
| 2241 |
// |
// |
| 2242 |
calo->GetEntry(calibno[s]); |
if ( calo->GetEntry(calibno[s]) <= 0 ) throw -36; |
| 2243 |
// |
// |
| 2244 |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
if (ce->cstwerr[s] != 0 && ce->cperror[s] == 0 ) { |
| 2245 |
for ( Int_t d=0 ; d<11 ;d++ ){ |
for ( Int_t d=0 ; d<11 ;d++ ){ |