Getters for period,orbit,bc added to the raw-readers. Removing the indirect of gettin...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 14 Jul 2008 16:33:25 +0000 (16:33 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 14 Jul 2008 16:33:25 +0000 (16:33 +0000)
RAW/AliRawReader.h
STEER/AliReconstruction.cxx

index c97494a..624e8c2 100644 (file)
@@ -47,6 +47,18 @@ class AliRawReader: public TObject {
     virtual UInt_t   GetType() const = 0;
     virtual UInt_t   GetRunNumber() const = 0;
     virtual const UInt_t* GetEventId() const = 0;
+    UInt_t                GetPeriod() const {
+      const UInt_t *id = GetEventId();
+      return (((id)[0]>>4)&0x0fffffff);
+    }
+    UInt_t                GetOrbitID() const {
+      const UInt_t *id = GetEventId();
+      return ((((id)[0]<<20)&0xf00000)|(((id)[1]>>12)&0xfffff));
+    }
+    UShort_t              GetBCID() const {
+      const UInt_t *id = GetEventId();
+      return ((id)[1]&0x00000fff);
+    }
     virtual const UInt_t* GetTriggerPattern() const = 0;
     virtual const UInt_t* GetDetectorPattern() const = 0;
     virtual const UInt_t* GetAttributes() const = 0;
index d8f5241..0ba21ed 100644 (file)
@@ -2116,23 +2116,16 @@ Bool_t AliReconstruction::FillRawEventHeaderESD(AliESDEvent*& esd)
   // Filling information from RawReader Header
   // 
 
+  if (!fRawReader) return kFALSE;
+
   AliInfo("Filling information from RawReader Header");
-  esd->SetBunchCrossNumber(0);
-  esd->SetOrbitNumber(0);
-  esd->SetPeriodNumber(0);
-  esd->SetTimeStamp(0);
-  esd->SetEventType(0);
-  const AliRawEventHeaderBase * eventHeader = fRawReader->GetEventHeader();
-  if (eventHeader){
-
-    const UInt_t *id = eventHeader->GetP("Id");
-    esd->SetBunchCrossNumber((id)[1]&0x00000fff);
-    esd->SetOrbitNumber((((id)[0]<<20)&0xf00000)|(((id)[1]>>12)&0xfffff));
-    esd->SetPeriodNumber(((id)[0]>>4)&0x0fffffff);
-
-    esd->SetTimeStamp((eventHeader->Get("Timestamp")));  
-    esd->SetEventType((eventHeader->Get("Type")));
-  }
+
+  esd->SetBunchCrossNumber(fRawReader->GetBCID());
+  esd->SetOrbitNumber(fRawReader->GetOrbitID());
+  esd->SetPeriodNumber(fRawReader->GetPeriod());
+
+  esd->SetTimeStamp(fRawReader->GetTimestamp());  
+  esd->SetEventType(fRawReader->GetType());
 
   return kTRUE;
 }