with TOF satisfied request about writng in ESD T0 spread
authoralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Feb 2011 08:46:43 +0000 (08:46 +0000)
committeralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Feb 2011 08:46:43 +0000 (08:46 +0000)
T0/AliT0Reconstructor.cxx

index 47320a7..5bc175f 100644 (file)
@@ -40,6 +40,7 @@
 #include "AliCTPTimeParams.h"
 #include "AliLHCClockPhase.h"
 #include "AliT0CalibSeasonTimeShift.h"
+#include "AliESDRun.h"
 
 #include <TArrayI.h>
 #include <TGraph.h>
@@ -67,6 +68,8 @@ ClassImp(AliT0Reconstructor)
                                              fESDTZEROfriend(NULL)
 
 {
+
+
   //constructor
   AliCDBEntry *entry = AliCDBManager::Instance()->Get("GRP/CTP/CTPtiming");
   if (!entry) AliFatal("CTP timing parameters are not found in OCDB !");
@@ -89,8 +92,8 @@ ClassImp(AliT0Reconstructor)
     AliT0CalibSeasonTimeShift *timeshift = (AliT0CalibSeasonTimeShift*)entry5->GetObject();
     fTimeMeanShift = timeshift->GetT0Means();
     fTimeSigmaShift  = timeshift->GetT0Sigmas();
-     timeshift->Print();
-  }
+    //   timeshift->Print();
+   }
   else
     AliWarning("Time Adjust is not found in OCDB !");
 
@@ -290,8 +293,7 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
       low[i0] = Int_t (GetRecoParam()->GetLow(i0));    
       high[i0] = Int_t (GetRecoParam()->GetHigh(i0));
       }
-  Float_t lowAmpThreshold =  GetRecoParam()->GetLow(200);  
-  Float_t highAmpThreshold =  GetRecoParam()->GetHigh(200);  
+   
   Double32_t besttimeA=9999999;
   Double32_t besttimeC=9999999;
   Int_t pmtBestA=99999;
@@ -406,7 +408,7 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
          }
        Double32_t time[24], adc[24],  noncalibtime[24];
        for (Int_t ipmt=0; ipmt<24; ipmt++) {
-         if(timeCFD[ipmt]>0 ){
+         if(timeCFD[ipmt]>0 && ipmt != badpmt ){
           //for simulated data
             //for physics  data
           if(( chargeQT0[ipmt] - chargeQT1[ipmt])>0)  {
@@ -438,7 +440,7 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
        }
        fESDTZEROfriend->SetT0timeCorr(noncalibtime) ;     
        for (Int_t ipmt=0; ipmt<12; ipmt++){
-        if(time[ipmt] > 1 && ipmt != badpmt && adc[ipmt]>lowAmpThreshold  && adc[ipmt]<highAmpThreshold)
+        if(time[ipmt] > 1 && ipmt != badpmt && adc[ipmt]>0.1 )
           {
             if(time[ipmt]<besttimeC){
                  besttimeC=time[ipmt]; //timeC
@@ -448,7 +450,7 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
        }
        for ( Int_t ipmt=12; ipmt<24; ipmt++)
         {
-          if(time[ipmt] > 1 && ipmt != badpmt && adc[ipmt]>lowAmpThreshold && adc[ipmt]<highAmpThreshold)
+          if(time[ipmt] > 1 && ipmt != badpmt && adc[ipmt]>0.1)
             {
               if(time[ipmt]<besttimeA) {
                 besttimeA=time[ipmt]; //timeA
@@ -514,6 +516,9 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
   ****************************************************/
   
   AliDebug(1,Form("Start FillESD T0"));
+  pESD ->SetT0spread(fTimeSigmaShift);
+
   Float_t channelWidth = fParam->GetChannelWidth() ;  
   Float_t c = 0.0299792458; // cm/ps
   Float_t currentVertex=0, shift=0;