AliDebug(2,Form(" LatencyL1 %f latencyL1A %f latencyL1C %f latencyHPTDC %f \n",fLatencyL1, fLatencyL1A, fLatencyL1C, fLatencyHPTDC));
for (Int_t i=0; i<24; i++) {
- if( fTime0vertex[i] < 500 || fTime0vertex[i] > 50000) fTime0vertex[i] =( 1000.*fLatencyHPTDC - 1000.*fLatencyL1 + 1000.*fGRPdelays)/24.4;
- // printf(" calulated mean %i %f \n",i, fTime0vertex[i]);
+ if( fTime0vertex[i] < 500 || fTime0vertex[i] > 60000) fTime0vertex[i] =( 1000.*fLatencyHPTDC - 1000.*fLatencyL1 + 1000.*fGRPdelays)/24.4;
}
//here real Z position
fdZonC = TMath::Abs(fParam->GetZPosition("T0/C/PMT1"));
fdZonA = TMath::Abs(fParam->GetZPosition("T0/A/PMT15"));
- // printf(" !!!! fdZonC %f fdZonA %f \n", fdZonC/29.9792458, fdZonA/29.9792458);
+
fCalib = new AliT0Calibrator();
fESDTZEROfriend = new AliESDTZEROfriend();
fESDTZERO = new AliESDTZERO();
Float_t lowAmpThreshold = GetRecoParam()->GetAmpLowThreshold();
Float_t highAmpThreshold = GetRecoParam()->GetAmpHighThreshold();
- printf( "AliT0Reconstructor::Reconstruct::: RecoParam amplitude %f %f \n",lowAmpThreshold, highAmpThreshold);
+ printf("Reconstruct(TTree*digitsTree highAmpThreshold %f lowAmpThreshold %f \n",lowAmpThreshold, highAmpThreshold);
+
+ //shift T0A, T0C , T0AC
+ Float_t shiftA = GetRecoParam() -> GetLow(310);
+ Float_t shiftC = GetRecoParam() -> GetLow(311);
+ Float_t shiftAC = GetRecoParam() -> GetLow(312);
+ printf("Reconstruct(TTree*digitsTree shiftA %f shiftC %f shiftAC %f \n",shiftA, shiftC, shiftAC);
Double32_t besttimeA=9999999; Double32_t besttimeA_best=9999999;
Double32_t besttimeC=9999999; Double32_t besttimeC_best=9999999;
Float_t time[24], adc[24], adcmip[24];
for (Int_t ipmt=0; ipmt<24; ipmt++) {
if(timeCFD->At(ipmt)>0 ) {
- Float_t timefull = 0.001*( timeCFD->At(ipmt) - 513 - timeDelayCFD[ipmt]) * channelWidth;
+ Float_t timefull = 0.001*( timeCFD->At(ipmt) - 511 - timeDelayCFD[ipmt]) * channelWidth;
frecpoints.SetTimeFull(ipmt, 0 ,timefull) ;
if(( chargeQT1->At(ipmt) - chargeQT0->At(ipmt))>0)
adc[ipmt] = chargeQT1->At(ipmt) - chargeQT0->At(ipmt);
adc[ipmt] = 0;
time[ipmt] = fCalib-> WalkCorrection(refAmp, ipmt, Int_t(adc[ipmt]), timeCFD->At(ipmt)) ;
- time[ipmt] = time[ipmt] - 513;
+ time[ipmt] = time[ipmt] - 511;
Double_t sl = Double_t(timeLED->At(ipmt) - timeCFD->At(ipmt));
// time[ipmt] = fCalib-> WalkCorrection( refAmp,ipmt, Int_t(sl), timeCFD->At(ipmt) ) ;
AliDebug(5,Form(" ipmt %i QTC %i , time in chann %i (led-cfd) %i ",
if( besttimeA < 999999 && besttimeA!=0) {
frecpoints.SetTimeBestA((besttimeA_best * channelWidth - fdZonA/c) );
- frecpoints.SetTime1stA((besttimeA * channelWidth - fdZonA/c ) );
+ frecpoints.SetTime1stA((besttimeA * channelWidth - fdZonA/c - shiftA) );
tr[1]=true;
}
if( besttimeC < 999999 && besttimeC!=0) {
frecpoints.SetTimeBestC((besttimeC_best * channelWidth - fdZonC/c) );
- frecpoints.SetTime1stC((besttimeC * channelWidth - fdZonC/c ) );
+ frecpoints.SetTime1stC((besttimeC * channelWidth - fdZonC/c - shiftC) );
tr[2]=true;
}
// timeDiff = (besttimeC - besttimeA)*channelWidth;
timeDiff = (besttimeA - besttimeC)*channelWidth;
meanTime = channelWidth * (besttimeA_best + besttimeC_best)/2. ;
- timeclock = channelWidth * (besttimeA + besttimeC)/2. ;
+ timeclock = channelWidth * (besttimeA + besttimeC)/2. - shiftAC ;
vertex = meanVertex - 0.001* c*(timeDiff)/2.;// + (fdZonA - fdZonC)/2;
tr[0]=true;
}
Float_t meanOrC = fTime0vertex[0] + 678;
Float_t meanTVDC = fTime0vertex[0] + 2564;
Int_t timeDelayCFD[24];
-
-
+ Int_t corridor = GetRecoParam() -> GetCorridor();
+ // printf("!!!! corridor %i \n",corridor);
Int_t badpmt[24];
//Bad channel
for (Int_t i=0; i<24; i++) {
timeDelayCFD[i] = Int_t (fParam->GetTimeDelayCFD(i));
}
Int_t equalize = GetRecoParam() -> GetEq();
- // printf( "AliT0Reconstructor::Reconstruct::: RecoParam %i \n",equalize);
+ printf( "AliT0Reconstructor::Reconstruct::: RecoParam %i \n",equalize);
fCalib->SetEq(equalize);
Int_t low[500], high[500];
- Float_t timefull=-9999;;
- Float_t tvdc = -9999; Float_t ora = -9999; Float_t orc = -9999;
+ Float_t timefull=-99999;;
+ Float_t tvdc = -99999; Float_t ora = -99999; Float_t orc = -99999;
Int_t allData[110][5];
Float_t meanVertex = 0;
Int_t pedestal[24];
for (Int_t i0=0; i0<24; i0++) {
- low[i0] = Int_t(fTime0vertex[i0]) - 50;
- high[i0] = Int_t(fTime0vertex[i0]) + 50;
- time2zero[i0] = 999999;
- pedestal[i0]=GetRecoParam()->GetLow(i0+100);
- // printf("pmt %i pedestal %i\n", i0,pedestal[i0]);
+ low[i0] = Int_t(fTime0vertex[i0]) - corridor;
+ high[i0] = Int_t(fTime0vertex[i0]) + corridor;
+ time2zero[i0] = 99999;
+ pedestal[i0]=Int_t (GetRecoParam()->GetLow(100+i0) );
}
for (Int_t i0=0; i0<110; i0++)
Float_t lowAmpThreshold = GetRecoParam()->GetAmpLowThreshold();
Float_t highAmpThreshold = GetRecoParam()->GetAmpHighThreshold();
- // printf( "AliT0Reconstructor::Reconstruct::: RecoParam amplitude %f %f \n",lowAmpThreshold, highAmpThreshold);
+ printf( "AliT0Reconstructor::Reconstruct::: RecoParam amplitude %f %f \n",lowAmpThreshold, highAmpThreshold);
Double32_t besttimeA=9999999; Double32_t besttimeA_best=9999999;
Double32_t besttimeC=9999999; Double32_t besttimeC_best=9999999;
{
timeCFD[i]=0; timeLED[i]=0; chargeQT0[i]=0; chargeQT1[i]=0;
}
- Int_t fBCID=Int_t (rawReader->GetBCID());
- Int_t trmbunch= myrawreader.GetTRMBunchID();
- AliDebug(10,Form(" CDH BC ID %i, TRM BC ID %i \n", fBCID, trmbunch ));
-
+
if(type == 7 ) { //only physics
for (Int_t i=0; i<107; i++) {
for (Int_t iHit=0; iHit<5; iHit++)
}
}
+ Int_t fBCID=Int_t (rawReader->GetBCID());
+ Int_t trmbunch= myrawreader.GetTRMBunchID();
+ AliDebug(10,Form(" CDH BC ID %i, TRM BC ID %i \n", fBCID, trmbunch ));
+ if( (trmbunch-fBCID)!=37 ) {
+ AliDebug(0,Form("wrong :::: CDH BC ID %i, TRM BC ID %i \n", fBCID, trmbunch ));
+ // type = -1;
+ }
for (Int_t in=0; in<12; in++)
{
for (Int_t iHit=0; iHit<5; iHit++)
allData[in+1][iHit] < high[in])
{
timeCFD[in] = allData[in+1][iHit] ;
- break;
+ break;
}
}
for (Int_t iHit=0; iHit<5; iHit++)
{
- if(allData[in+1+56][iHit] > low[in] &&
- allData[in+1+56][iHit] < high[in])
+ if(allData[in+1+56][iHit] > low[in+12] &&
+ allData[in+1+56][iHit] < high[in+12])
{
timeCFD[in+12] = allData[in+56+1][iHit] ;
break;
}
-
for (Int_t in=0; in<12; in++)
{
- chargeQT0[in]=allData[2*in+25][0];
- chargeQT1[in]=allData[2*in+26][0];
- AliDebug(25, Form(" readed Raw %i %i %i",
- in, chargeQT0[in],chargeQT1[in]));
+ if(allData[2*in+26][0] > low[in] + 1000)
+ {
+ chargeQT0[in]=allData[2*in+25][0];
+ chargeQT1[in]=allData[2*in+26][0];
+ AliDebug(25, Form(" readed Raw %i %i %i",
+ in, chargeQT0[in],chargeQT1[in]));
+ }
}
for (Int_t in=12; in<24; in++)
{
- chargeQT0[in]=allData[2*in+57][0];
- chargeQT1[in]=allData[2*in+58][0];
- AliDebug(25, Form(" readed Raw %i %i %i",
- in, chargeQT0[in],chargeQT1[in]));
+ if(allData[2*in+58][0] > low[in] + 1000)
+ {
+ chargeQT0[in]=allData[2*in+57][0];
+ chargeQT1[in]=allData[2*in+58][0];
+ AliDebug(25, Form(" readed Raw %i %i %i",
+ in, chargeQT0[in],chargeQT1[in]));
+ }
}
onlineMean = allData[49][0];
Double32_t time[24], adc[24], adcmip[24], noncalibtime[24];
for (Int_t ipmt=0; ipmt<24; ipmt++) {
- if(timeCFD[ipmt] > 0 &&( chargeQT0[ipmt] - chargeQT1[ipmt])>pedestal[ipmt] /* && badpmt[ipmt]==0*/ ) {
+ // if(timeCFD[ipmt] > 0 && (chargeQT0[ipmt] - chargeQT1[ipmt])>pedestal[ipmt] ){
+ if(timeCFD[ipmt] > 0 && (chargeQT0[ipmt] - chargeQT1[ipmt])> 0 ){
+ //for simulated data
//for physics data
- if(( chargeQT0[ipmt] - chargeQT1[ipmt])>pedestal[ipmt]) {
+ if(( chargeQT0[ipmt] - chargeQT1[ipmt])>pedestal[ipmt]) {
adc[ipmt] = chargeQT0[ipmt] - chargeQT1[ipmt];
}
else
TGraph * qtGraph = (TGraph*)fQTC.At(ipmt);
if (qtGraph) qtMip = qtGraph->Eval(adc[ipmt]);
AliDebug(10,Form(" Amlitude in MIPS LED %f ; QTC %f; in channels %f\n ",ampMip,qtMip, adc[ipmt]));
- if( qtMip>lowAmpThreshold && qtMip<highAmpThreshold )
- {
- if( equalize ==0 )
- frecpoints.SetTime(ipmt, Float_t(time[ipmt]) );
+ if( equalize ==0 )
+ frecpoints.SetTime(ipmt, Float_t(time[ipmt]) );
else
frecpoints.SetTime(ipmt, Float_t(time[ipmt] + fTime0vertex[ipmt]) );
- // frecpoints.SetTime(ipmt, Float_t(time[ipmt] ) );
-
+ // frecpoints.SetTime(ipmt, Float_t(time[ipmt] ) );
frecpoints.SetAmp(ipmt, Double32_t( qtMip));
adcmip[ipmt]=qtMip;
- frecpoints.SetAmpLED(ipmt, Double32_t(ampMip));
- }
+ frecpoints.SetAmpLED(ipmt, Double32_t(ampMip));
noncalibtime[ipmt]= Double32_t (timeCFD[ipmt]);
- }
- else {
+ }
+ else {
time[ipmt] = -9999;
adc[ipmt] = 0;
adcmip[ipmt] = 0;
noncalibtime[ipmt] = -9999;
- }
+ }
}
fESDTZEROfriend->SetT0timeCorr(noncalibtime) ;
for (Int_t ipmt=0; ipmt<12; ipmt++){
if(time[ipmt] !=0 && time[ipmt] > -9000
/*&& badpmt[ipmt]==0 */
- && adcmip[ipmt]>lowAmpThreshold && adcmip[ipmt]<highAmpThreshold )
+ && adcmip[ipmt]>lowAmpThreshold )
{
if(time[ipmt]<besttimeC) besttimeC=time[ipmt]; //timeC
if(TMath::Abs(time[ipmt])<TMath::Abs(besttimeC_best))
{
if(time[ipmt] != 0 && time[ipmt] > -9000
/* && badpmt[ipmt]==0*/
- && adcmip[ipmt]>lowAmpThreshold && adcmip[ipmt]<40)
- // && adcmip[ipmt]>lowAmpThreshold && adcmip[ipmt]<highAmpThreshold)
+ && adcmip[ipmt]>lowAmpThreshold )
{
if(time[ipmt]<besttimeA) besttimeA=time[ipmt];
if(TMath::Abs(time[ipmt] ) < TMath::Abs(besttimeA_best))
fTimeMeanShift[1],fTimeMeanShift[2] ) );
if( besttimeC < 999999 && besttimeA < 999999) {
if(equalize ==0 )
- timeclock = ((besttimeC * channelWidth)- 1000.*fLatencyHPTDC +1000.*fLatencyL1 - 1000.*fGRPdelays - fTimeMeanShift[0]);
+ timeclock = (channelWidth*(besttimeC + besttimeA)/2.- 1000.*fLatencyHPTDC +1000.*fLatencyL1 - 1000.*fGRPdelays - fTimeMeanShift[0]);
else
{
timeclock = channelWidth * Float_t( besttimeA+besttimeC)/2. - fTimeMeanShift[0];
Bool_t AliT0Reconstructor::BackgroundFlag() const
{
+
Bool_t background = false;
-
- Float_t orA = fESDTZERO->GetOrA(0);
- Float_t orC = fESDTZERO->GetOrC(0);
- Float_t tvdc = fESDTZERO->GetTVDC(0);
-
- if ( (orA > -5 && orA <5) && (orC > -5 && orC <5) && (tvdc < -5 || tvdc > 5)) {
- background = true;
- // printf(" orA %f orC %f tvdc %f\n", orA, orC, tvdc);
- }
+ /*
+ Float_t orA = fESDTZERO->GetOrA(0);
+ Float_t orC = fESDTZERO->GetOrC(0);
+ Float_t tvdc = fESDTZERO->GetTVDC(ih);
+
+ if ( (orA > -5 && orA <5) && (orC > -5 && orC <5) && (tvdc < -5 || tvdc > 5)) {
+ background = true;
+ // printf(" orA %f orC %f tvdc %f\n", orA, orC, tvdc);
+ }
+ */
return background;