1505 |
|
|
1506 |
}; |
}; |
1507 |
//------------------------------------------------------------------------ |
//------------------------------------------------------------------------ |
1508 |
void ToFdEdx::Process(UInt_t atime, Float_t betamean, Float_t *xtr_tof, Float_t *ytr_tof) |
void ToFdEdx::Process(UInt_t atime, Float_t betamean, Float_t *xtr_tof, Float_t *ytr_tof, Int_t exitat) |
1509 |
{ |
{ |
1510 |
// the parameters should be already initialised by InitPar() |
// the parameters should be already initialised by InitPar() |
1511 |
Clear(); |
Clear(); |
1519 |
if ( xtr_tof[1] > 99. || xtr_tof[5] > 99. || ytr_tof[0] > 99. || ytr_tof[4] > 99. ) theta = 0.; |
if ( xtr_tof[1] > 99. || xtr_tof[5] > 99. || ytr_tof[0] > 99. || ytr_tof[4] > 99. ) theta = 0.; |
1520 |
for (Int_t ii=0; ii<6; ii++){ |
for (Int_t ii=0; ii<6; ii++){ |
1521 |
if ( xtr_tof[ii] > 99. ) xtr_tof[ii] = 0.; |
if ( xtr_tof[ii] > 99. ) xtr_tof[ii] = 0.; |
1522 |
if ( ytr_tof[ii] > 99. ) xtr_tof[ii] = 0.; |
if ( ytr_tof[ii] > 99. ) ytr_tof[ii] = 0.; |
1523 |
}; |
}; |
1524 |
// |
// |
1525 |
|
|
1526 |
|
|
1527 |
|
//--------------------- TABLE OF PERIODS WITH HV PROBLEMS ---------------------------- |
1528 |
|
|
1529 |
|
int Aconn=conn[0]; // PMT 0,20,22,24 |
1530 |
|
int Bconn=conn[1]; // PMT 6,12,26,34 |
1531 |
|
int Cconn=conn[2]; // PMT 4,14,28,32 |
1532 |
|
int Dconn=conn[3]; // PMT 2,8,10,30 |
1533 |
|
int Econn=conn[4]; // PMT 42,43,44,47 |
1534 |
|
int Fconn=conn[5]; // PMT 7,19,23,27 |
1535 |
|
int Gconn=conn[6]; // PMT 3,11,25,33 |
1536 |
|
int Hconn=conn[7]; // PMT 1,9,13,21 |
1537 |
|
int Iconn=conn[8]; // PMT 5,29,31,35 |
1538 |
|
int Lconn=conn[9]; // PMT 37,40,45,46 |
1539 |
|
int Mconn=conn[10]; // PMT 15,16,17,18 |
1540 |
|
int Nconn=conn[11]; // PMT 36,38,39,41 |
1541 |
|
if( false ) cout << Gconn << Iconn << Lconn <<endl; // to avoid compilation warnings |
1542 |
|
|
1543 |
for( int ii=0; ii<48; ii++ ) { |
for( int ii=0; ii<48; ii++ ) { |
1544 |
// |
// |
1545 |
// printf(" ii %i beta %f atime %u xtr 1 %f ytr 1 %f adc %f \n",ii,betamean,atime,xtr_tof[0],ytr_tof[0],adc[ii]); |
// printf(" ii %i beta %f atime %u xtr 1 %f ytr 1 %f adc %f \n",ii,betamean,atime,xtr_tof[0],ytr_tof[0],adc[ii]); |
1546 |
if( adc[ii] >= PMTsat[ii]-5 ) continue; |
// if( adc[ii] >= PMTsat[ii]-5 ) continue; // EMILIANO |
1547 |
if( adc[ii] <= 0. ) continue; |
if( adc[ii] <= 0. ) continue; |
1548 |
// |
// |
1549 |
double adcpC = f_adcPC( adc[ii] ); // - adc conversion in pC |
double adcpC = f_adcPC( adc[ii] ); // - adc conversion in pC |
1550 |
double adccorr = adcpC*fabs(cos(theta)); |
if ( exitat == 0 ){ |
1551 |
// |
eDEDXpmt[ii]=(Float_t)adcpC; |
1552 |
if(adccorr<=0.) continue; |
continue; |
1553 |
|
} |
|
//--------------------- TABLE OF PERIODS WITH HV PROBLEMS ---------------------------- |
|
1554 |
|
|
1555 |
int Aconn=conn[0]; // PMT 0,20,22,24 |
double adccorr = adcpC*fabs(cos(theta)); |
1556 |
int Bconn=conn[1]; // PMT 6,12,26,34 |
if(adccorr<=0.) continue; |
1557 |
int Cconn=conn[2]; // PMT 4,14,28,32 |
if ( exitat == 1 ){ |
1558 |
int Dconn=conn[3]; // PMT 2,8,10,30 |
eDEDXpmt[ii]=(Float_t)adccorr; |
1559 |
int Econn=conn[4]; // PMT 42,43,44,47 |
continue; |
1560 |
int Fconn=conn[5]; // PMT 7,19,23,27 |
} |
|
int Gconn=conn[6]; // PMT 3,11,25,33 |
|
|
int Hconn=conn[7]; // PMT 1,9,13,21 |
|
|
int Iconn=conn[8]; // PMT 5,29,31,35 |
|
|
int Lconn=conn[9]; // PMT 37,40,45,46 |
|
|
int Mconn=conn[10]; // PMT 15,16,17,18 |
|
|
int Nconn=conn[11]; // PMT 36,38,39,41 |
|
1561 |
|
|
1562 |
// int standard=0; |
// int standard=0; |
|
if( false ) cout << Gconn << Iconn << Lconn <<endl; |
|
1563 |
int S115B_ok=0; |
int S115B_ok=0; |
1564 |
int S115B_break=0; |
int S115B_break=0; |
1565 |
|
|
1578 |
adclin=-2; |
adclin=-2; |
1579 |
dEdx=-2; |
dEdx=-2; |
1580 |
Zeta=-2; |
Zeta=-2; |
1581 |
|
Double_t correction = 1.; |
1582 |
|
|
1583 |
if(Aconn==1 && (ii==0 || ii==20 || ii==22 || ii==24)){ |
if(Aconn==1 && (ii==0 || ii==20 || ii==22 || ii==24)){ |
1584 |
adcHe = (Get_adc_he(ii, xtr_tof, ytr_tof))/1.675; |
correction = 1.675; |
1585 |
} |
} |
1586 |
else if(Bconn==1 && (ii==6 || ii==12 || ii==26 || ii==34)){ |
else if(Bconn==1 && (ii==6 || ii==12 || ii==26 || ii==34)){ |
1587 |
adcHe = (Get_adc_he(ii, xtr_tof, ytr_tof))/2.482; |
correction = 2.482; |
1588 |
} |
} |
1589 |
else if(Cconn==1 && (ii==4 || ii==14 || ii==28 || ii==32)){ |
else if(Cconn==1 && (ii==4 || ii==14 || ii==28 || ii==32)){ |
1590 |
adcHe = (Get_adc_he(ii, xtr_tof, ytr_tof))/1.464; |
correction = 1.464; |
1591 |
} |
} |
1592 |
else if(Dconn==1 && (ii==2 || ii==8 || ii==10 || ii==30)){ |
else if(Dconn==1 && (ii==2 || ii==8 || ii==10 || ii==30)){ |
1593 |
adcHe = (Get_adc_he(ii, xtr_tof, ytr_tof))/1.995; |
correction = 1.995; |
1594 |
} |
} |
1595 |
else if(Econn==1 && (ii==42 || ii==43 || ii==44 || ii==47)){ |
else if(Econn==1 && (ii==42 || ii==43 || ii==44 || ii==47)){ |
1596 |
adcHe = (Get_adc_he(ii, xtr_tof, ytr_tof))/1.273; |
correction = 1.273; |
1597 |
} |
} |
1598 |
else if(Fconn==1 && (ii==7 || ii==19 || ii==23 || ii==27)){ |
else if(Fconn==1 && (ii==7 || ii==19 || ii==23 || ii==27)){ |
1599 |
adcHe = (Get_adc_he(ii, xtr_tof, ytr_tof))/1.565; |
correction = 1.565; |
1600 |
} |
} |
1601 |
else if(Mconn==1 && (ii==15 || ii==16 || ii==17 || ii==18)){ |
else if(Mconn==1 && (ii==15 || ii==16 || ii==17 || ii==18)){ |
1602 |
adcHe = (Get_adc_he(ii, xtr_tof, ytr_tof))/1.565; |
correction = 1.565; |
1603 |
} |
} |
1604 |
else if(Nconn==1 && (ii==36 || ii==38 || ii==39 || ii==41)){ |
else if(Nconn==1 && (ii==36 || ii==38 || ii==39 || ii==41)){ |
1605 |
adcHe = (Get_adc_he(ii, xtr_tof, ytr_tof))/1.018; |
correction = 1.018; |
1606 |
} |
} |
1607 |
else if(Hconn==1 && (ii==1 || ii==13 || ii==21 || (ii==9&&S115B_ok==1))){ |
else if(Hconn==1 && (ii==1 || ii==13 || ii==21 || (ii==9&&S115B_ok==1))){ |
1608 |
adcHe = (Get_adc_he(ii, xtr_tof, ytr_tof))/1.84; |
correction = 1.84; |
|
} |
|
|
else if(S115B_break==1 && ii==9 && Hconn==0){ |
|
|
adcHe = f_att5B( ytr_tof[0] ); //N.B.: this function refers to the Carbon!!! |
|
1609 |
} |
} |
1610 |
else if(S115B_break==1 && ii==9 && Hconn==1){ |
else if(S115B_break==1 && ii==9 && Hconn==1){ |
1611 |
adcHe = (f_att5B( ytr_tof[0] ))/1.64; |
correction = 1.64; |
1612 |
} |
} |
1613 |
else adcHe = Get_adc_he(ii, xtr_tof, ytr_tof); |
else correction = 1.; |
1614 |
|
|
1615 |
|
if( S115B_break==1 ){ |
1616 |
|
adcHe = f_att5B( ytr_tof[0] )/correction; |
1617 |
|
} else { |
1618 |
|
adcHe = Get_adc_he(ii, xtr_tof, ytr_tof)/correction; |
1619 |
|
}; |
1620 |
if(adcHe<=0) continue; |
if(adcHe<=0) continue; |
1621 |
|
if ( exitat == 2 ){ |
1622 |
|
if(ii==9 && S115B_break==1) eDEDXpmt[ii]=36.*(Float_t)adccorr/adcHe; |
1623 |
|
else adclin = 4.*(Float_t)adccorr/adcHe; |
1624 |
|
continue; |
1625 |
|
} |
1626 |
|
|
1627 |
if(ii==9 && S115B_break==1) adcnorm = f_pos5B(adccorr); |
if(ii==9 && S115B_break==1) adcnorm = f_pos5B(adccorr); |
1628 |
else adcnorm = f_pos( (parPos[ii]), adccorr); |
else adcnorm = f_pos( (parPos[ii]), adccorr); |
|
|
|
1629 |
if(adcnorm<=0) continue; |
if(adcnorm<=0) continue; |
|
|
|
1630 |
if(ii==9 && S115B_break==1) adclin = 36.*adcnorm/adcHe; |
if(ii==9 && S115B_break==1) adclin = 36.*adcnorm/adcHe; |
1631 |
else adclin = 4.*adcnorm/adcHe; |
else adclin = 4.*adcnorm/adcHe; |
|
|
|
1632 |
if(adclin<=0) continue; |
if(adclin<=0) continue; |
1633 |
|
if ( exitat == 3 ){ |
1634 |
|
if(ii==9 && S115B_break==1) eDEDXpmt[ii]=(Float_t)adclin; |
1635 |
|
else eDEDXpmt[ii]=(Float_t)adclin; |
1636 |
|
continue; |
1637 |
|
} |
1638 |
// |
// |
1639 |
if ( betamean > 99. ){ |
if ( betamean > 99. ){ |
1640 |
|
// eDEDXpmt.AddAt((Float_t)adclin,ii); |
1641 |
eDEDXpmt[ii]=(Float_t)adclin; |
eDEDXpmt[ii]=(Float_t)adclin; |
1642 |
|
// printf(" AAPMT IS %i dedx is %f vector is %f \n",ii,adclin,eDEDXpmt[ii]); |
1643 |
continue; |
continue; |
1644 |
}; |
}; |
1645 |
// |
// |
1652 |
else dEdxHe = parBBpos[ii]; |
else dEdxHe = parBBpos[ii]; |
1653 |
} |
} |
1654 |
|
|
1655 |
if(dEdxHe<=0) continue; |
|
1656 |
|
if(dEdxHe<=0){ |
1657 |
|
eDEDXpmt[ii]=(Float_t)adclin; |
1658 |
|
continue; |
1659 |
|
}; |
1660 |
|
|
1661 |
if(ii==9 && S115B_break==1) dEdx = f_desatBB5B( adclin ); |
if(ii==9 && S115B_break==1) dEdx = f_desatBB5B( adclin ); |
1662 |
else dEdx = f_desatBB((parDesatBB[ii]), adclin ); |
else dEdx = f_desatBB((parDesatBB[ii]), adclin ); |
1663 |
|
|
1664 |
if(dEdx<=0) continue; |
if(dEdx<=0){ |
1665 |
|
eDEDXpmt[ii]=(Float_t)adclin; |
1666 |
|
continue; |
1667 |
|
}; |
1668 |
|
|
1669 |
eDEDXpmt[ii]=(Float_t)dEdx; |
eDEDXpmt[ii]=(Float_t)dEdx; |
1670 |
|
// eDEDXpmt.AddAt((Float_t)dEdx,ii); |
1671 |
|
|
1672 |
|
// printf(" PMT IS %i dedx is %f vector is %f \n",ii,dEdx,eDEDXpmt[ii]); |
1673 |
|
|
1674 |
} //end loop on 48 PMT |
} //end loop on 48 PMT |
1675 |
|
|