AliTOFHeader include in AliAODEvent
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 25 Feb 2012 21:53:38 +0000 (21:53 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 25 Feb 2012 21:53:38 +0000 (21:53 +0000)
https://savannah.cern.ch/bugs/?91864
Pietro Antonioli

STEER/AOD/AliAODEvent.cxx
STEER/AOD/AliAODEvent.h

index f1b7e69..cf72ef7 100644 (file)
@@ -52,7 +52,8 @@ ClassImp(AliAODEvent)
                                                      "dimuons",
                                                      "AliAODTZERO",
                                                      "AliAODVZERO",
-                                                     "AliAODZDC"
+                                                     "AliAODZDC",
+                                                     "AliTOFHeader"
 #ifdef MFT_UPGRADE       
                                                      ,"AliAODMFT"
 #endif                                               
@@ -81,7 +82,8 @@ AliAODEvent::AliAODEvent() :
   fDimuons(0),
   fAODTZERO(0),
   fAODVZERO(0),
-  fAODZDC(0)
+  fAODZDC(0),
+  fTOFHeader(0)
 #ifdef MFT_UPGRADE
   ,fAODMFT(0)
 #endif
@@ -113,7 +115,8 @@ AliAODEvent::AliAODEvent(const AliAODEvent& aod):
   fDimuons(new TClonesArray(*aod.fDimuons)),
   fAODTZERO(new AliAODTZERO(*aod.fAODTZERO)),
   fAODVZERO(new AliAODVZERO(*aod.fAODVZERO)),
-  fAODZDC(new AliAODZDC(*aod.fAODZDC))
+  fAODZDC(new AliAODZDC(*aod.fAODZDC)),
+  fTOFHeader(new AliTOFHeader(*aod.fTOFHeader))
 #ifdef MFT_UPGRADE
   ,fAODMFT(new AliAODMFT(*aod.fAODMFT))
 #endif
@@ -137,6 +140,7 @@ AliAODEvent::AliAODEvent(const AliAODEvent& aod):
   AddObject(fAODTZERO);
   AddObject(fAODVZERO);
   AddObject(fAODZDC);
+  AddObject(fTOFHeader);
 #ifdef MFT_UPGRADE     
   AddObject(fAODVZERO);
 #endif
@@ -310,6 +314,7 @@ void AliAODEvent::CreateStdContent()
   AddObject(new AliAODTZERO());
   AddObject(new AliAODVZERO());
   AddObject(new AliAODZDC());
+  AddObject(new AliTOFHeader());
 #ifdef MFT_UPGRADE
   AddObject(new AliAODMFT());
 #endif
@@ -401,6 +406,7 @@ void AliAODEvent::GetStdContent()
   fAODTZERO      = (AliAODTZERO*)fAODObjects->FindObject("AliAODTZERO");
   fAODVZERO      = (AliAODVZERO*)fAODObjects->FindObject("AliAODVZERO");
   fAODZDC        = (AliAODZDC*)fAODObjects->FindObject("AliAODZDC");
+  fTOFHeader     = (AliTOFHeader*)fAODObjects->FindObject("AliTOFHeader");
 #ifdef MFT_UPGRADE
   fAODMFT        = (AliAODMFT*)fAODObjects->FindObject("AliAODMFT");
 #endif
@@ -876,3 +882,23 @@ Float_t AliAODEvent::GetVZEROEqMultiplicity(Int_t i) const
 
   return (fAODVZERO->GetMultiplicity(i)/factor);
 }
+
+//------------------------------------------------------------
+void  AliAODEvent::SetTOFHeader(const AliTOFHeader *header)
+{
+  //
+  // Set the TOF event_time
+  //
+
+  if (fTOFHeader) {
+    *fTOFHeader=*header;
+    //fTOFHeader->SetName(fgkESDListName[kTOFHeader]);
+  }
+  else {
+    // for analysis of reconstructed events
+    // when this information is not avaliable
+    fTOFHeader = new AliTOFHeader(*header);
+    //AddObject(fTOFHeader);
+  }
+
+}
index 87c81c0..7d3fe4d 100644 (file)
@@ -34,6 +34,7 @@
 #include "AliAODTZERO.h"
 #include "AliAODVZERO.h"
 #include "AliAODZDC.h"
+#include "AliTOFHeader.h"
 #ifdef MFT_UPGRADE
 #include "AliAODMFT.h"
 #endif
@@ -64,6 +65,7 @@ class AliAODEvent : public AliVEvent {
                       kAODTZERO,
                       kAODVZERO,
                       kAODZDC,
+                      kTOFHeader,
                       kAODListN
                   #ifdef MFT_UPGRADE
                   ,kAODVZERO
@@ -128,6 +130,12 @@ class AliAODEvent : public AliVEvent {
   Double_t  GetZDCP2Energy()        const { return fHeader ? fHeader->GetZDCP2Energy() : -999.; }
   Double_t  GetZDCEMEnergy(Int_t i) const { return fHeader ? fHeader->GetZDCEMEnergy(i) : -999.; }
 
+  void SetTOFHeader(const AliTOFHeader * tofEventTime);
+  const AliTOFHeader *GetTOFHeader() const {return fTOFHeader;}
+  Float_t GetEventTimeSpread() const {if (fTOFHeader) return fTOFHeader->GetT0spread(); else return 0.;}
+  Float_t GetTOFTimeResolution() const {if (fTOFHeader) return fTOFHeader->GetTOFResolution(); else return 0.;}
+
+
   // -- Tracks
   TClonesArray *GetTracks()              const { return fTracks; }
   Int_t         GetNTracks()             const { return fTracks? fTracks->GetEntriesFast() : 0; }
@@ -303,13 +311,17 @@ class AliAODEvent : public AliVEvent {
   AliAODTZERO     *fAODTZERO;     //! TZERO AOD
   AliAODVZERO     *fAODVZERO;     //! VZERO AOD
   AliAODZDC       *fAODZDC;       //! ZDC AOD
+  AliTOFHeader    *fTOFHeader;  //! event times (and sigmas) as estimated by TOF
+                            //  combinatorial algorithm.
+                             //  It contains also TOF time resolution
+                             //  and T0spread as written in OCDB
 #ifdef MFT_UPGRADE
   AliAODMFT       *fAODMFT;       //! VZERO AOD
 #endif
   
   static const char* fAODListName[kAODListN]; //!
 
-  ClassDef(AliAODEvent,89);
+  ClassDef(AliAODEvent,90);
 };
 
 #endif