1422 |
memset(conn,0,12*sizeof(Bool_t)); |
memset(conn,0,12*sizeof(Bool_t)); |
1423 |
memset(ts,0,12*sizeof(UInt_t)); |
memset(ts,0,12*sizeof(UInt_t)); |
1424 |
memset(te,0,12*sizeof(UInt_t)); |
memset(te,0,12*sizeof(UInt_t)); |
1425 |
|
eDEDXpmt = new TArrayF(48); |
1426 |
Define_PMTsat(); |
Define_PMTsat(); |
1427 |
Clear(); |
Clear(); |
1428 |
} |
} |
1467 |
{ |
{ |
1468 |
// |
// |
1469 |
// Set arrays and initialize structure |
// Set arrays and initialize structure |
1470 |
eDEDXpmt.Set(48); eDEDXpmt.Reset(-1); // Set array size and reset structure |
// eDEDXpmt.Set(48); eDEDXpmt.Reset(-1); // Set array size and reset structure |
1471 |
|
eDEDXpmt->Set(48); eDEDXpmt->Reset(-1); // Set array size and reset structure |
1472 |
// |
// |
1473 |
}; |
}; |
1474 |
|
|
1510 |
void ToFdEdx::Process(UInt_t atime, Float_t betamean, Float_t *xtr_tof, Float_t *ytr_tof, Int_t exitat) |
void ToFdEdx::Process(UInt_t atime, Float_t betamean, Float_t *xtr_tof, Float_t *ytr_tof, Int_t exitat) |
1511 |
{ |
{ |
1512 |
// the parameters should be already initialised by InitPar() |
// the parameters should be already initialised by InitPar() |
1513 |
|
// printf(" in process \n"); |
1514 |
Clear(); |
Clear(); |
1515 |
|
|
1516 |
// define angle: |
// define angle: |
1543 |
int Nconn=conn[11]; // PMT 36,38,39,41 |
int Nconn=conn[11]; // PMT 36,38,39,41 |
1544 |
if( false ) cout << Gconn << Iconn << Lconn <<endl; // to avoid compilation warnings |
if( false ) cout << Gconn << Iconn << Lconn <<endl; // to avoid compilation warnings |
1545 |
|
|
1546 |
|
// printf(" size %i \n",eDEDXpmt.GetSize()); |
1547 |
for( int ii=0; ii<48; ii++ ) { |
for( int ii=0; ii<48; ii++ ) { |
1548 |
// |
// |
1549 |
|
// eDEDXpmt.SetAt(-1.,ii); |
1550 |
// 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]); |
1551 |
// if( adc[ii] >= PMTsat[ii]-5 ) continue; // EMILIANO |
|
1552 |
if( adc[ii] <= 0. ) continue; |
if( adc[ii] >= 4095. ){ |
1553 |
|
// eDEDXpmt[ii] = 0.; |
1554 |
|
eDEDXpmt->AddAt(0.,ii); |
1555 |
|
continue; // EMILIANO |
1556 |
|
}; |
1557 |
|
|
1558 |
|
if( adc[ii] >= (PMTsat[ii]-5.) && adc[ii] < 4095. ){ |
1559 |
|
eDEDXpmt->AddAt(1000.,ii); |
1560 |
|
continue; // EMILIANO |
1561 |
|
}; |
1562 |
|
|
1563 |
|
if( adc[ii] <= 0. ) { |
1564 |
|
eDEDXpmt->AddAt(1500.,ii); |
1565 |
|
continue; |
1566 |
|
}; |
1567 |
// |
// |
1568 |
double adcpC = f_adcPC( adc[ii] ); // - adc conversion in pC |
double adcpC = f_adcPC( adc[ii] ); // - adc conversion in pC |
1569 |
if ( exitat == 0 ){ |
if ( exitat == 0 ){ |
1570 |
eDEDXpmt[ii]=(Float_t)adcpC; |
eDEDXpmt->AddAt((Float_t)adcpC,ii); |
1571 |
continue; |
continue; |
1572 |
} |
} |
1573 |
|
// printf(" e qua? \n"); |
1574 |
|
|
1575 |
double adccorr = adcpC*fabs(cos(theta)); |
double adccorr = adcpC*fabs(cos(theta)); |
1576 |
if(adccorr<=0.) continue; |
if(adccorr<=0.) continue; |
1577 |
if ( exitat == 1 ){ |
if ( exitat == 1 ){ |
1578 |
eDEDXpmt[ii]=(Float_t)adccorr; |
eDEDXpmt->AddAt((Float_t)adccorr,ii); |
1579 |
continue; |
continue; |
1580 |
} |
} |
1581 |
|
// printf(" e quo? \n"); |
1582 |
|
|
1583 |
// int standard=0; |
// int standard=0; |
1584 |
int S115B_ok=0; |
int S115B_ok=0; |
1589 |
|
|
1590 |
|
|
1591 |
//------------------------------------------------------------------------ |
//------------------------------------------------------------------------ |
1592 |
|
// printf(" e qui? \n"); |
1593 |
//---------------------------------------------------- Z reconstruction |
//---------------------------------------------------- Z reconstruction |
1594 |
|
|
1595 |
double adcHe, adcnorm, adclin, dEdx, Zeta; |
double adcHe, adcnorm, adclin, dEdx, Zeta; |
1633 |
} |
} |
1634 |
else correction = 1.; |
else correction = 1.; |
1635 |
|
|
1636 |
if( S115B_break==1 ){ |
if( ii==9 && S115B_break==1 ){ |
1637 |
adcHe = f_att5B( ytr_tof[0] )/correction; |
adcHe = f_att5B( ytr_tof[0] )/correction; |
1638 |
} else { |
} else { |
1639 |
adcHe = Get_adc_he(ii, xtr_tof, ytr_tof)/correction; |
adcHe = Get_adc_he(ii, xtr_tof, ytr_tof)/correction; |
1640 |
}; |
}; |
1641 |
if(adcHe<=0) continue; |
if(adcHe<=0) continue; |
1642 |
if ( exitat == 2 ){ |
if ( exitat == 2 ){ |
1643 |
if(ii==9 && S115B_break==1) eDEDXpmt[ii]=36.*(Float_t)adccorr/adcHe; |
if(ii==9 && S115B_break==1) eDEDXpmt->AddAt(36.*(Float_t)adccorr/adcHe,ii); |
1644 |
else adclin = 4.*(Float_t)adccorr/adcHe; |
else adclin = 4.*(Float_t)adccorr/adcHe; |
1645 |
continue; |
continue; |
1646 |
} |
} |
1652 |
else adclin = 4.*adcnorm/adcHe; |
else adclin = 4.*adcnorm/adcHe; |
1653 |
if(adclin<=0) continue; |
if(adclin<=0) continue; |
1654 |
if ( exitat == 3 ){ |
if ( exitat == 3 ){ |
1655 |
if(ii==9 && S115B_break==1) eDEDXpmt[ii]=(Float_t)adclin; |
if(ii==9 && S115B_break==1) eDEDXpmt->AddAt((Float_t)adclin,ii); |
1656 |
else eDEDXpmt[ii]=(Float_t)adclin; |
else eDEDXpmt->AddAt((Float_t)adclin,ii); |
1657 |
continue; |
continue; |
1658 |
} |
} |
1659 |
// |
// |
1660 |
if ( betamean > 99. ){ |
if ( betamean > 99. ){ |
1661 |
// eDEDXpmt.AddAt((Float_t)adclin,ii); |
// eDEDXpmt.AddAt((Float_t)adclin,ii); |
1662 |
eDEDXpmt[ii]=(Float_t)adclin; |
eDEDXpmt->AddAt((Float_t)adclin,ii); |
1663 |
// printf(" AAPMT IS %i dedx is %f vector is %f \n",ii,adclin,eDEDXpmt[ii]); |
// printf(" AAPMT IS %i dedx is %f vector is %f \n",ii,adclin,eDEDXpmt[ii]); |
1664 |
continue; |
continue; |
1665 |
}; |
}; |
1675 |
|
|
1676 |
|
|
1677 |
if(dEdxHe<=0){ |
if(dEdxHe<=0){ |
1678 |
eDEDXpmt[ii]=(Float_t)adclin; |
eDEDXpmt->AddAt((Float_t)adclin,ii); |
1679 |
continue; |
continue; |
1680 |
}; |
}; |
1681 |
|
|
1683 |
else dEdx = f_desatBB((parDesatBB[ii]), adclin ); |
else dEdx = f_desatBB((parDesatBB[ii]), adclin ); |
1684 |
|
|
1685 |
if(dEdx<=0){ |
if(dEdx<=0){ |
1686 |
eDEDXpmt[ii]=(Float_t)adclin; |
eDEDXpmt->AddAt((Float_t)adclin,ii); |
1687 |
continue; |
continue; |
1688 |
}; |
}; |
1689 |
|
|
1690 |
eDEDXpmt[ii]=(Float_t)dEdx; |
eDEDXpmt->AddAt((Float_t)dEdx,ii); |
1691 |
// eDEDXpmt.AddAt((Float_t)dEdx,ii); |
// eDEDXpmt.AddAt((Float_t)dEdx,ii); |
1692 |
|
|
1693 |
// printf(" PMT IS %i dedx is %f vector is %f \n",ii,dEdx,eDEDXpmt[ii]); |
// printf(" PMT IS %i dedx is %f vector is %f \n",ii,dEdx,eDEDXpmt[ii]); |