Changes for #83919: port to Realease T0 code for luminocity and satellite analysis
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 6 Jul 2011 19:44:38 +0000 (19:44 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 6 Jul 2011 19:44:38 +0000 (19:44 +0000)
STEER/AliESDEvent.cxx
STEER/AliESDEvent.h
STEER/AliESDTZERO.cxx
STEER/AliESDTZERO.h
T0/AliT0RecPoint.cxx
T0/AliT0RecPoint.h
T0/AliT0Reconstructor.cxx
T0/AliT0Reconstructor.h

index fb10335..f15f5e7 100644 (file)
@@ -1088,6 +1088,13 @@ void AliESDEvent::SetVZEROData(AliESDVZERO * obj)
     *fESDVZERO = *obj;
 }
 
+void AliESDEvent::SetTZEROData(AliESDTZERO * obj)
+{ 
+  // use already allocated space
+  if(fESDTZERO)
+    *fESDTZERO = *obj;
+}
+
 void AliESDEvent::SetACORDEData(AliESDACORDE * obj)
 {
   if(fESDACORDE)
index 62d323a..d55a2ad 100644 (file)
@@ -212,7 +212,8 @@ public:
 
   // TZERO CKB: put this in the header?
   const AliESDTZERO*    GetESDTZERO() const {return fESDTZERO;}
-  // delegetated methods for fESDTZERO
+  void SetTZEROData(AliESDTZERO * obj);
+ // delegetated methods for fESDTZERO
 
   Double32_t GetT0zVertex() const {return fESDTZERO?fESDTZERO->GetT0zVertex():0;}
   void SetT0zVertex(Double32_t z) {if(fESDTZERO) fESDTZERO->SetT0zVertex(z);}
index 1082f61..863aceb 100644 (file)
@@ -33,18 +33,31 @@ AliESDTZERO::AliESDTZERO() :
   fT0clock(0),
   fT0zVertex(0),
   fT0timeStart(0),   
-  fT0trig(0)
+  fT0trig(0),
+  fPileup(kFALSE),
+  fSattelite(kFALSE)
+
 {
-  for(int i = 0;i<24;i++)fT0time[i] = fT0amplitude[i] = 0;
+  for(int i = 0;i<24;i++) {
+    fT0time[i] = fT0amplitude[i] = 0;
+    for(Int_t iHit=0; iHit<5; iHit++) {
+      fTimeFull[i][iHit] = 0;   
+      fOrA[iHit] = 0; 
+      fOrC[iHit] = 0;  
+      fTVDC[iHit] = 0; 
+    }
+  }
   for(int i = 0;i<3;i++) fT0TOF[i]=0;
 }
-
+//______________________________________________________________________________
 AliESDTZERO::AliESDTZERO(const AliESDTZERO &tzero ) :
   TObject(tzero),
   fT0clock(tzero.fT0clock),  
   fT0zVertex(tzero.fT0zVertex),
   fT0timeStart(tzero.fT0timeStart),
-  fT0trig(tzero.fT0trig)
+  fT0trig(tzero.fT0trig),
+  fMultA(tzero.fMultA),
+  fMultC(tzero.fMultC)
 {
   // copy constuctor
   for(int i = 0;i<3;i++) fT0TOF[i] = tzero.fT0TOF[i];
@@ -52,25 +65,40 @@ AliESDTZERO::AliESDTZERO(const AliESDTZERO &tzero ) :
   for(int i = 0;i<24;i++){
     fT0time[i] = tzero.fT0time[i]; 
     fT0amplitude[i] = tzero.fT0amplitude[i];
+    for(Int_t iHit=0; iHit<5; iHit++) {
+      fTimeFull[i][iHit] = tzero.fTimeFull[i][iHit];   
+      fOrA[iHit] = tzero.fOrA[iHit]; 
+      fOrC[iHit] = tzero.fOrC[iHit];  
+      fTVDC[iHit] = tzero.fTVDC[iHit]; 
+    }
   }
 }
-
+//______________________________________________________________________________
 AliESDTZERO& AliESDTZERO::operator=(const AliESDTZERO& tzero){
   // assigmnent operator
   if(this!=&tzero) {
     TObject::operator=(tzero);
     fT0clock = tzero.fT0clock;
     fT0zVertex = tzero.fT0zVertex;
-    fT0timeStart = tzero.fT0timeStart;   
+    fT0timeStart = tzero.fT0timeStart;
+    fMultA = tzero.fMultA;
+    fMultC = tzero.fMultC;
+    fT0trig = tzero.fT0trig;
     for(int i = 0;i<3;i++) fT0TOF[i] = tzero.fT0TOF[i];
     for(int i = 0;i<24;i++){
       fT0time[i] = tzero.fT0time[i]; 
       fT0amplitude[i] = tzero.fT0amplitude[i];
-    }
+      for(Int_t iHit=0; iHit<5; iHit++) {
+       fTimeFull[i][iHit] = tzero.fTimeFull[i][iHit];   
+       fOrA[iHit] = tzero.fOrA[iHit]; 
+       fOrC[iHit] = tzero.fOrC[iHit];  
+       fTVDC[iHit] = tzero.fTVDC[iHit]; 
+      }
+   }
   } 
   return *this;
 }
-
+//______________________________________________________________________________
 void AliESDTZERO::Copy(TObject &obj) const {
   
   // this overwrites the virtual TOBject::Copy()
@@ -92,7 +120,12 @@ void AliESDTZERO::Reset()
   fT0clock=0;
   fT0zVertex = 0;  
   fT0timeStart = 0;
-  for(int i = 0;i<24;i++)fT0time[i] = fT0amplitude[i] = 0;
+  for(int i = 0;i<24;i++) {
+    fT0time[i] = fT0amplitude[i] =  0;
+    for(Int_t iHit=0; iHit<5; iHit++)  fTimeFull[i][iHit] = -10000;
+  }
+  for(Int_t iHit=0; iHit<5; iHit++) fOrA[iHit] = fOrC[iHit] = fTVDC[iHit] = -10000; 
+
   for(int i = 0;i<3;i++) fT0TOF[i] = 0;
 }
 
index ab1554b..23b1586 100644 (file)
@@ -1,3 +1,4 @@
+
 // -*- mode: C++ -*- 
 #ifndef ALIESDTZERO_H
 #define ALIESDTZERO_H
@@ -34,15 +35,30 @@ public:
   void SetT0TOF(Int_t icase, Float_t time) { fT0TOF[icase] = time;}
   Int_t GetT0Trig() const {return fT0trig;}
   void SetT0Trig(Int_t tvdc) {fT0trig = tvdc;}
+  Bool_t GetT0Trig(Int_t i) {return (fT0trig&(1<<i)) != 0;}
   const Double32_t * GetT0time() const {return fT0time;}
   void SetT0time(Double32_t time[24]) {
-  for (Int_t i=0; i<24; i++) fT0time[i] = time[i];
+    for (Int_t i=0; i<24; i++) fT0time[i] = time[i];
   }
   const Double32_t * GetT0amplitude() const {return fT0amplitude;}
   void SetT0amplitude(Double32_t amp[24]) {
     for (Int_t i=0; i<24; i++) fT0amplitude[i] = amp[i];
   }
-
+  Float_t GetTimeFull(Int_t ch, Int_t hit) {return fTimeFull[ch][hit];}
+  Float_t GetOrA(Int_t hit) {return fOrA[hit];}
+  Float_t GetOrC(Int_t hit) {return fOrC[hit];}
+  Float_t GetTVDC(Int_t hit) {return fTVDC[hit];}
+  
+  void SetTimeFull(Int_t ch, Int_t hit, Float_t time) {fTimeFull[ch][hit] = time;}
+  void SetOrA (Int_t hit, Float_t time) { fOrA[hit] = time ;}
+  void SetOrC (Int_t hit, Float_t time) { fOrC[hit] = time;}
+  void SetTVDC(Int_t hit, Float_t time) { fTVDC[hit] = time;}
+  
+  void SetMultC(Float_t mult) {fMultC = mult;}
+  void SetMultA(Float_t mult) {fMultA = mult;}
+  Float_t GetMultC()       const {return fMultC;}
+  Float_t GetMultA()       const {return fMultA;}
+  
   void    Reset();
   void    Print(const Option_t *opt=0) const;
 
@@ -55,8 +71,16 @@ private:
   Int_t        fT0trig;            // T0 trigger signals
   Double32_t   fT0time[24];      // best TOF on each T0 PMT
   Double32_t   fT0amplitude[24]; // number of particles(MIPs) on each T0 PMT
-
-  ClassDef(AliESDTZERO,4)
+  Float_t fTimeFull[24][5];    // array's TDC no-correction ;centred  around 0
+  Float_t fOrA[5];  //hardware OrA centred around 0
+  Float_t fOrC[5];  //hardware OrC centred around 0
+  Float_t fTVDC[5]; //hardware TVDC centred around 0
+  Bool_t fPileup;   // pile-up flag
+  Bool_t fSattelite; //sattelite flag
+  Float_t fMultC; // multiplicity on the C side
+  Float_t fMultA; // multiplicity on the A side
+  ClassDef(AliESDTZERO,5)
 };
 
 
index bd6341d..dba983a 100644 (file)
@@ -42,7 +42,10 @@ ClassImp(AliT0RecPoint)
                                   fTimeBestA(0),fTimeBestC(0),
                                    fMultC(0),fMultA(0),
                                    fT0clock(9999999),
-                                  fT0trig(0)
+                                  fT0trig(0),
+                                  fPileup(kFALSE),
+                                  fSattelite(kFALSE)
+
 
 {
   //ctor
@@ -52,7 +55,14 @@ ClassImp(AliT0RecPoint)
   //  fVertexPosition=99999;
   fMultA=0;
   fMultC=0;
-  for (Int_t i=0; i<24; i++) { fTime[i]=0; fADC[i]=0; fADCLED[i]=0;}
+  for (Int_t i=0; i<24; i++) { fTime[i]=0; fADC[i]=0; fADCLED[i]=0;
+    for(Int_t iHit=0; iHit<5; iHit++) {
+     fTimeFull[i][iHit] = 0;   
+     fOrA[iHit] = 0; 
+     fOrC[iHit] = 0;  
+     fTVDC[iHit] = 0; 
+    }
+ }
 }
 //_____________________________________________________________________________
 
@@ -63,7 +73,9 @@ AliT0RecPoint::AliT0RecPoint(const AliT0RecPoint &r):TObject(),
                                                     fTimeBestA(0),fTimeBestC(0),
                                                     fMultC(0),fMultA(0),
                                                      fT0clock(9999999),
-                                                    fT0trig(0)
+                                                    fT0trig(0),
+                                                    fPileup(kFALSE),
+                                                    fSattelite(kFALSE)
 {
   //
   // AliT0RecPoint copy constructor
@@ -77,14 +89,14 @@ AliT0RecPoint::AliT0RecPoint(const AliT0RecPoint &r):TObject(),
 void AliT0RecPoint::SetT0Trig(Bool_t *tr)
 {
   fT0trig=0;
-  for (Int_t i=0; i<5; i++) fT0trig=fT0trig<<1|tr[i];
+  for (Int_t i=0; i<5; i++) fT0trig = fT0trig | (tr[i]?(1<<i):0);
 }
 //_____________________________________________________________________________
 
 void AliT0RecPoint::PrintTriggerSignals(Int_t trig)
 {
   Bool_t tr[5];
-  for (Int_t i=0; i<5; i++) tr[i]=trig&(1<<i);
+  for (Int_t i=0; i<5; i++) tr[i] = (trig&(1<<i))!=0;
 
-  AliInfo(Form("T0 triggers %d %d %d %d %d",tr[0],tr[1],tr[2],tr[3],tr[4]));
+  AliInfo(Form("T0 triggers tvdc %d orA %d orC %d centr %d semicentral %d",tr[0],tr[1],tr[2],tr[3],tr[4]));
 }
index a8f3e33..7d392d8 100644 (file)
@@ -43,10 +43,21 @@ class AliT0RecPoint: public TObject  {
     void    SetT0clock (Double32_t time) { fT0clock = time;}
     Double32_t GetT0clock () const{ return fT0clock;}
 
-    Bool_t GetT0Trig(Int_t i) {return fT0trig&(1<<i);}
+    Bool_t GetT0Trig(Int_t i) {return (fT0trig&(1<<i)) != 0;}
     Int_t GetT0Trig() {return fT0trig;}
     void   SetT0Trig(Bool_t *tr );
     void PrintTriggerSignals(Int_t trig);
+
+    Float_t GetTimeFull(Int_t ch, Int_t hit) {return fTimeFull[ch][hit];}
+    Float_t GetOrA(Int_t hit) {return fOrA[hit];}
+    Float_t GetOrC(Int_t hit) {return fOrC[hit];}
+    Float_t GetTVDC(Int_t hit) {return fTVDC[hit];}
+
+    void SetTimeFull(Int_t ch, Int_t hit, Float_t time) {fTimeFull[ch][hit] = time;}
+    void SetOrA (Int_t hit, Float_t time) { fOrA[hit] = time ;}
+    void SetOrC (Int_t hit, Float_t time) { fOrC[hit] = time;}
+    void SetTVDC(Int_t hit, Float_t time) { fTVDC[hit] = time;}
+
   private: 
     Double32_t fTimeAverage;     // Average time
     Int_t   fTimeOnlineMean; // online mean signal
@@ -62,8 +73,15 @@ class AliT0RecPoint: public TObject  {
     Double32_t fADC[24];    // array's amplitude
     Double32_t fADCLED[24];    // array's LED amplitude
 
+    Float_t fTimeFull[24][5];    // array's TDC no-correction; centred around 0
+    Float_t fOrA[5];  //hardware OrA centred around 0
+    Float_t fOrC[5];  //hardware OrC centred around 0
+    Float_t fTVDC[5]; //hardware TVDC centred around 0
+    Bool_t fPileup;
+    Bool_t fSattelite;
 
-    ClassDef(AliT0RecPoint,6)  //Digit (Header) object for set:T0
+    ClassDef(AliT0RecPoint,7)  // RecPoints (Header) object for set:T0
 };
 
 typedef AliT0RecPoint AliSTARTRecPoint; // for backward compatibility
index 1fae747..e750cb7 100644 (file)
@@ -31,6 +31,7 @@
 #include "AliT0Parameters.h"
 #include "AliT0Calibrator.h"
 #include "AliESDfriend.h"
+#include "AliESDTZERO.h"
 #include "AliESDTZEROfriend.h"
 #include "AliLog.h"
 #include "AliCDBEntry.h" 
@@ -63,7 +64,8 @@ ClassImp(AliT0Reconstructor)
                                             fGRPdelays(0),
                                             fTimeMeanShift(0x0),
                                             fTimeSigmaShift(0x0),
-                                             fESDTZEROfriend(NULL)
+                                             fESDTZEROfriend(NULL),
+                                             fESDTZERO(NULL)
 
 {
   for (Int_t i=0; i<24; i++)  fTime0vertex[i] =0;
@@ -105,7 +107,7 @@ ClassImp(AliT0Reconstructor)
          TGraph* gr2 = fParam ->GetQTC(i);
          if (gr2) fQTC.AddAtAndExpand(gr2,i) ;         
          fTime0vertex[i] = fParam->GetCFD(i);
-         printf("OCDB mean CFD time %i %f \n",i, fTime0vertex[i]);
+         AliDebug(2,Form("OCDB mean CFD time %i %f \n",i, fTime0vertex[i]));
  }
   fLatencyL1 = fParam->GetLatencyL1();
   fLatencyL1A = fParam->GetLatencyL1A(); 
@@ -117,16 +119,15 @@ ClassImp(AliT0Reconstructor)
     if( fTime0vertex[i] < 500 || fTime0vertex[i] > 50000) fTime0vertex[i] =( 1000.*fLatencyHPTDC - 1000.*fLatencyL1 + 1000.*fGRPdelays)/24.4;
  
   }
-  
-  // fdZonC = TMath::Abs(fParam->GetZPositionShift("T0/C/PMT1"));
-  //fdZonA = TMath::Abs(fParam->GetZPositionShift("T0/A/PMT15"));
   //here real Z position
   fdZonC = TMath::Abs(fParam->GetZPosition("T0/C/PMT1"));
   fdZonA = TMath::Abs(fParam->GetZPosition("T0/A/PMT15"));
 
   fCalib = new AliT0Calibrator();
   fESDTZEROfriend = new AliESDTZEROfriend();
+  fESDTZERO  = new AliESDTZERO();
 
 }
 
 //_____________________________________________________________________________
@@ -278,11 +279,12 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
 {
   // T0 raw ->
   //
-  // reference amplitude and time ref. point from reco param
-
-  // Float_t refAmp = GetRecoParam()->GetRefAmp();
+  
+  Float_t meanOrA = fTime0vertex[0] + 587;
+  Float_t meanOrC = fTime0vertex[0] + 678;
+  Float_t meanTVDC = fTime0vertex[0] + 2564;
 
-  //  Int_t refPoint = 0;
   Int_t badpmt[24];
   //Bad channel
   for (Int_t i=0; i<24; i++) {
@@ -298,7 +300,6 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
   Float_t c = 29.9792458; // cm/ns
   Double32_t vertex = 9999999;
   Int_t onlineMean=0;
-  // Float_t meanVertex = fParam->GetMeanVertex();
   Float_t meanVertex = 0;
   for (Int_t i0=0; i0<24; i0++) {
     low[i0] = Int_t(fTime0vertex[i0]) - 200;
@@ -306,11 +307,7 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
   }
   
   for (Int_t i0=0; i0<110; i0++)
-    {
-      for (Int_t j0=0; j0<5; j0++) allData[i0][j0]=0; 
-      //    low[i0] = Int_t (GetRecoParam()->GetLow(i0));      
-      // high[i0] = Int_t (GetRecoParam()->GetHigh(i0));
-      }
+    for (Int_t j0=0; j0<5; j0++)  allData[i0][j0]=0; 
   
   Float_t lowAmpThreshold =  GetRecoParam()->GetAmpLowThreshold();  
   Float_t highAmpThreshold =  GetRecoParam()->GetAmpHighThreshold(); 
@@ -319,7 +316,8 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
   Double32_t besttimeC=9999999;
   Int_t pmtBestA=99999;
   Int_t pmtBestC=99999;
-   
+  Float_t channelWidth = fParam->GetChannelWidth() ;  
+       
   AliT0RecPoint* frecpoints= new AliT0RecPoint ();
   
   recTree->Branch( "T0", "AliT0RecPoint" ,&frecpoints);
@@ -349,14 +347,6 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
          }
        }
        Int_t ref=0;
-
-       //      if (refPoint>0) 
-       //  ref = allData[refPoint][0]-5000;
-
-       
-       Float_t channelWidth = fParam->GetChannelWidth() ;  
-       
-       //       Int_t meanT0 = fParam->GetMeanT0();
        
        for (Int_t in=0; in<12; in++)  
          {
@@ -444,7 +434,7 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
        for (Int_t ipmt=0; ipmt<12; ipmt++){
         if(time[ipmt] !=0 /*&& badpmt[ipmt]==0 */&&  adcmip[ipmt]>lowAmpThreshold && adcmip[ipmt]<highAmpThreshold )
           {
-              //              if(TMath::Abs(time[ipmt])<TMath::Abs(besttimeC)) {
+              // if(TMath::Abs(time[ipmt])<TMath::Abs(besttimeC)) {
             if(time[ipmt]<besttimeC){
               besttimeC=time[ipmt]; //timeC
                  pmtBestC=ipmt;
@@ -492,21 +482,55 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
       Int_t trchan[5]= {50,51,52,55,56};
       for (Int_t i=0; i<5; i++) tr[i]=false; 
       for (Int_t itr=0; itr<5; itr++) {
-       for (Int_t iHit=0; iHit<5; iHit++) 
+       for (Int_t iHit=0; iHit<1; iHit++) 
          {
            Int_t trr=trchan[itr];
-           if( allData[trr][iHit] > 0) tr[itr]=true;
-         }
+           if( allData[trr][iHit] > 0)  tr[itr]=true;
+
+           AliDebug(1,Form("Reconstruct :::  T0 triggers iHit %i tvdc %d orA %d orC %d centr %d semicentral %d",iHit, tr[0],tr[1],tr[2],tr[3],tr[4]));
+         }       
       }
       frecpoints->SetT0Trig(tr);
-   
+      
+      for (Int_t iHit=0; iHit<5; iHit++) 
+       {
+         Float_t tvdc  = -9999; Float_t ora = -9999; Float_t orc = -9999;
+         if(allData[50][iHit]>0) 
+           tvdc = (Float_t(allData[50][iHit]) - meanTVDC) * channelWidth* 0.001; 
+         if(allData[51][iHit]>0)
+           ora = (Float_t(allData[51][iHit]) - meanOrA) * channelWidth* 0.001;
+         
+         if(allData[52][iHit]>0) 
+           orc = (Float_t(allData[52][iHit]) - meanOrC) * channelWidth* 0.001;
+         
+         frecpoints->SetOrC( iHit, orc);
+         frecpoints->SetOrA( iHit, ora);
+         frecpoints->SetTVDC( iHit, tvdc);
+         Float_t timefull;
+         for (Int_t i0=0; i0<12; i0++) {
+           timefull = -9999; 
+           if(allData[i0+1][iHit]>1) 
+             timefull = (Float_t(allData[i0+1][iHit])-fTime0vertex[i0])* channelWidth* 0.001;
+           frecpoints->SetTimeFull(i0, iHit,timefull) ;
+           
+         }
+         
+         for (Int_t i0=12; i0<24; i0++) {
+           timefull = -9999; 
+           if(allData[i0+45][iHit]>1) 
+             timefull = (Float_t(allData[i0+45][iHit])-fTime0vertex[i0])* channelWidth* 0.001;
+           frecpoints->SetTimeFull(i0, iHit, timefull) ;
+         }
+       }
+      
+      
       //Set MPD
       if(allData[53][0]>0 && allData[54][0]) 
        frecpoints->SetMultA(allData[53][0]-allData[54][0]);
-       if(allData[105][0]>0 && allData[106][0]) 
-         frecpoints->SetMultC(allData[105][0]-allData[106][0]);
-       
-       
+      if(allData[105][0]>0 && allData[106][0]) 
+       frecpoints->SetMultC(allData[105][0]-allData[106][0]);
+      
+      
     } // if (else )raw data
   recTree->Fill();
   if(frecpoints) delete frecpoints;
@@ -545,7 +569,6 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
     currentVertex = vertex->GetZ();
     
     ncont = vertex->GetNContributors();
-    //  cout<<"@@ spdver "<<spdver<<" ncont "<<ncont<<endl;
     if(ncont>0 ) {
       shift = currentVertex/c;
     }
@@ -591,24 +614,48 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
    }
   }
   Int_t trig= frecpoints ->GetT0Trig();
-  pESD->SetT0Trig(trig);
-  
-  pESD->SetT0zVertex(zPosition); //vertex Z position 
+  frecpoints->PrintTriggerSignals( trig);
+  printf(" FillESD trigger %i \n",trig);
+  fESDTZERO->SetT0Trig(trig);
+  //pESD->SetT0Trig(trig);
+  //  pESD->SetT0zVertex(zPosition); //vertex Z position 
+  fESDTZERO->SetT0zVertex(zPosition); //vertex Z position 
 
   Double32_t multA=frecpoints ->GetMultA();
   Double32_t multC=frecpoints ->GetMultC();
-  //  pESD->SetT0MultC(multC);        // multiplicity Cside 
-  //  pESD->SetT0MultA(multA);        // multiplicity Aside 
-  pESD->SetT0(multA); // for backward compatubility
-  pESD->SetT0clock(multC); // for backward compatubility
-
+  //  pESD->SetT0(multC);        // multiplicity Cside 
+  //  pESD->SetT0clock(multA);        // multiplicity Aside 
+  fESDTZERO->SetMultA(multA); // for backward compatubility
+  fESDTZERO->SetMultC(multC); // for backward compatubility
+
+
+  for (Int_t iHit =0; iHit<5; iHit++ ) {
+       AliDebug(1,Form("FillESD ::: iHit %i tvdc %f orA %f orC %f\n", iHit,
+          frecpoints->GetTVDC(iHit),
+          frecpoints->GetOrA(iHit),
+                      frecpoints->GetOrC(iHit) ));
+    fESDTZERO->SetTVDC(iHit,frecpoints->GetTVDC(iHit));
+    fESDTZERO->SetOrA(iHit,frecpoints->GetOrA(iHit));
+    fESDTZERO->SetOrC(iHit,frecpoints->GetOrC(iHit));
+    
+    for (Int_t i0=0; i0<24; i0++) {
+      if(frecpoints->GetTimeFull(i0,iHit)>0){
+       //      printf("FillESD ::: iHit %i cfd %i time %f \n", iHit, i0, 
+       //             frecpoints->GetTimeFull(i0,iHit));
+       fESDTZERO->SetTimeFull(i0, iHit,frecpoints->GetTimeFull(i0,iHit));
+      }
+       
+    }               
+  }
   for(Int_t i=0; i<3; i++) 
-    pESD->SetT0TOF(i,timeClock[i]);   // interaction time (ns) 
-  pESD->SetT0time(time);         // best TOF on each PMT 
-  pESD->SetT0amplitude(ampQTC);     // number of particles(MIPs) on each PMT
+    fESDTZERO->SetT0TOF(i,timeClock[i]);   // interaction time (ns) 
+  fESDTZERO->SetT0time(time);         // best TOF on each PMT 
+  fESDTZERO->SetT0amplitude(ampQTC);     // number of particles(MIPs) on each PMT
   
   AliDebug(1,Form("T0: SPDshift %f Vertex %f (T0A+T0C)/2 %f #channels T0signal %f ns OrA %f ns OrC %f T0trig %i\n",shift, zPosition, timeStart, timeClock[0], timeClock[1], timeClock[2], trig));
+
   
+
   if (pESD) {
     
     AliESDfriend *fr = (AliESDfriend*)pESD->FindListObject("AliESDfriend");
@@ -628,8 +675,9 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
        fr->SetTZEROfriend(fESDTZEROfriend);
        //      }//
     }
+
+    pESD->SetTZEROData(fESDTZERO);
   }
-     
 
 
 } // vertex in 3 sigma
index caddb5d..530f924 100644 (file)
@@ -15,6 +15,7 @@
 #include "AliT0Calibrator.h"
 #include "AliT0RecoParam.h"
 #include "AliESDTZEROfriend.h"
+#include "AliESDTZERO.h"
 
 class AliT0Reconstructor: public AliReconstructor {
  public:
@@ -52,12 +53,13 @@ class AliT0Reconstructor: public AliReconstructor {
   Float_t *fTimeSigmaShift;
 
   AliESDTZEROfriend*  fESDTZEROfriend; // ESD friend object 
-
+  AliESDTZERO*        fESDTZERO;       // ESD output object  
  private:
   AliT0Reconstructor( const AliT0Reconstructor&r ); //Not implemented
   AliT0Reconstructor& operator=(const AliT0Reconstructor&r); //Not implemented
 
-  ClassDef(AliT0Reconstructor, 7)   // class for the T0 reconstruction
+  ClassDef(AliT0Reconstructor, 8)   // class for the T0 reconstruction
 
 };