]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFReconstructor.cxx
added protection in case of missing TOF RECO params -> will call AliFatal
[u/mrichter/AliRoot.git] / TOF / AliTOFReconstructor.cxx
index 16fccb14a5d3ee0dbfef1434164788601b5df87a..b3326b45f441185a03f4d2df8757715279697a1e 100644 (file)
 #include "TString.h"
 
 #include "AliLog.h"
+#include "AliESDEvent.h"
+#include "AliESDpid.h"
 #include "AliRawReader.h"
+#include "AliTOFHeader.h"
 
 #include "AliTOFClusterFinder.h"
 #include "AliTOFClusterFinderV1.h"
 #include "AliTOFtrackerMI.h"
 #include "AliTOFtracker.h"
 #include "AliTOFtrackerV1.h"
+#include "AliTOFT0maker.h"
 #include "AliTOFReconstructor.h"
 
 class TTree;
 
-class AliESDEvent;
-
 ClassImp(AliTOFReconstructor)
 
  //____________________________________________________________________
 AliTOFReconstructor::AliTOFReconstructor() 
   : AliReconstructor(),
-    fTOFcalib(0)
+    fTOFcalib(0)/*,
+                 fTOFT0maker(0)*/
 {
 //
 // ctor
@@ -78,7 +81,11 @@ AliTOFReconstructor::~AliTOFReconstructor()
 //
 // dtor
 //
+
   delete fTOFcalib;
+
+  //delete fTOFT0maker;
+
 }
 
 //_____________________________________________________________________________
@@ -243,3 +250,36 @@ AliTracker* AliTOFReconstructor::CreateTracker() const
   return tracker;
 
 }
+
+//_____________________________________________________________________________
+void AliTOFReconstructor::FillEventTimeWithTOF(AliESDEvent *event, AliESDpid *esdPID)
+{
+  //
+  // Fill AliESDEvent::fTOFHeader variable
+  // It contains the event_time estiamted by the TOF combinatorial algorithm
+  //
+
+  if (!GetRecoParam()) AliFatal("cannot get TOF RECO params");
+
+  Float_t tofResolution = GetRecoParam()->GetTimeResolution();// TOF time resolution in ps
+  AliTOFT0maker *tofT0maker = new AliTOFT0maker(esdPID,fTOFcalib);
+  //AliTOFT0maker tofT0maker = AliTOFT0maker(esdPID,fTOFcalib);
+  tofT0maker->SetTimeResolution(tofResolution);
+  tofT0maker->ComputeT0TOF(event);
+  tofT0maker->WriteInESD(event);
+  tofT0maker->~AliTOFT0maker();
+  delete tofT0maker;
+
+}
+
+//_____________________________________________________________________________
+void 
+AliTOFReconstructor::FillESD(TTree *, TTree *, AliESDEvent *esdEvent) const
+{
+  //
+  // correct Texp 
+  // 
+  //
+
+  fTOFcalib->CalibrateTExp(esdEvent);
+}