adding implementations to extract event type and time stamp from RawReader
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 13 Aug 2010 06:15:46 +0000 (06:15 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 13 Aug 2010 06:15:46 +0000 (06:15 +0000)
HLT/rec/AliHLTMiscImplementation.cxx
HLT/rec/AliHLTMiscImplementation.h

index 86f03c6..6cc0c40 100644 (file)
@@ -29,6 +29,7 @@
 #include "AliCDBEntry.h"
 #include "AliGRPManager.h"
 #include "AliRawReader.h"
+#include "AliRawEventHeaderBase.h"
 #include "AliTracker.h"
 #ifndef HAVE_NOT_ALIESDHLTDECISION
 #include "AliESDHLTDecision.h"
@@ -203,6 +204,24 @@ AliHLTUInt64_t AliHLTMiscImplementation::GetTriggerMask(AliRawReader* rawReader)
   return trgMask;
 }
 
+AliHLTUInt32_t AliHLTMiscImplementation::GetTimeStamp(AliRawReader* rawReader) const
+{
+  // extract time stamp of the event from the event header
+  if (!rawReader) return 0;
+  const AliRawEventHeaderBase* eventHeader = rawReader->GetEventHeader();
+  if (!eventHeader) return 0;
+  return eventHeader->Get("Timestamp");
+}
+
+AliHLTUInt32_t AliHLTMiscImplementation::GetEventType(AliRawReader* rawReader) const
+{
+  // extract event type from the event header
+  if (!rawReader) return 0;
+  const AliRawEventHeaderBase* eventHeader = rawReader->GetEventHeader();
+  if (!eventHeader) return 0;
+  return eventHeader->Get("Type");
+}
+
 Double_t AliHLTMiscImplementation::GetBz()
 {
   // Returns Bz.
index cfc3d02..8946458 100644 (file)
@@ -35,6 +35,9 @@ class AliHLTMiscImplementation : public AliHLTMisc
 
   AliHLTUInt64_t GetTriggerMask(AliRawReader* rawReader) const;
 
+  AliHLTUInt32_t GetTimeStamp(AliRawReader* rawReader) const;
+  AliHLTUInt32_t GetEventType(AliRawReader* rawReader) const;
+
   Double_t GetBz();
   Double_t GetBz(const Double_t *r);
   void GetBxByBz(const Double_t r[3], Double_t b[3]);