Getting much more complete event info from both raw-data header and esd. Some needed...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Jul 2008 16:19:01 +0000 (16:19 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Jul 2008 16:19:01 +0000 (16:19 +0000)
EVE/EveBase/AliEveEventManager.cxx
EVE/EveBase/AliEveEventManagerEditor.cxx
RAW/AliDAQ.h
RAW/AliRawEventHeaderBase.cxx
RAW/AliRawEventHeaderBase.h

index ce9844e..2b92918 100644 (file)
@@ -14,6 +14,8 @@
 #include <AliRun.h>
 #include <AliESDEvent.h>
 #include <AliESDfriend.h>
+#include <AliDAQ.h>
+#include <AliRawEventHeaderBase.h>
 #include <AliRawReaderRoot.h>
 #include <AliRawReaderFile.h>
 #include <AliRawReaderDate.h>
@@ -596,17 +598,34 @@ const char* AliEveEventManager::GetEventInfo() const
 
   static TString eventInfo;
 
-  if (!fRawReader) return "No event information is available";
-
-  const UInt_t* id = fRawReader->GetEventId();
-  const UInt_t* pattern = fRawReader->GetTriggerPattern();
-  const UInt_t* attr = fRawReader->GetAttributes();
-  eventInfo.Form("Run#: %d\nEvent type: %d\nPeriod: %x\nOrbit: %x\nBC: %x\nTrigger: %x-%x\nDetectors: %x\nAttributes:%x-%x-%x",
-                fRawReader->GetRunNumber(),fRawReader->GetType(),
-                (((id)[0]>>4)&0x0fffffff),((((id)[0]<<20)&0xf00000)|(((id)[1]>>12)&0xfffff)),((id)[1]&0x00000fff),
-                pattern[0],pattern[1],
-                *fRawReader->GetDetectorPattern(),
-                attr[0],attr[1],attr[2]);
+  if (!fRawReader) {
+    eventInfo.Form("No raw-data event info is available!\n");
+  }
+  else {
+    const UInt_t* attr = fRawReader->GetAttributes();
+    eventInfo.Form("Raw-data event info:\nRun#: %d\nEvent type: %d (%s)\nPeriod: %x\nOrbit: %x   BC: %x\nTrigger: %llx\nDetectors: %x (%s)\nAttributes:%x-%x-%x\nTimestamp: %x\n",
+                  fRawReader->GetRunNumber(),fRawReader->GetType(),AliRawEventHeaderBase::GetTypeName(fRawReader->GetType()),
+                  fRawReader->GetPeriod(),fRawReader->GetOrbitID(),fRawReader->GetBCID(),
+                  fRawReader->GetClassMask(),
+                  *fRawReader->GetDetectorPattern(),AliDAQ::ListOfTriggeredDetectors(*fRawReader->GetDetectorPattern()),
+                  attr[0],attr[1],attr[2],
+                  fRawReader->GetTimestamp());
+  }
+  if (!fESD) {
+    eventInfo.Append(Form("\nNo ESD event info is available!\n"));
+  }
+  else {
+    TString acttrclasses = fESD->GetESDRun()->GetActiveTriggerClasses();
+    TString firedtrclasses = fESD->GetFiredTriggerClasses();
+    eventInfo.Append(Form("\nESD event info:\nRun#: %d\nActive trigger classes: %s\nEvent type: %d (%s)\nPeriod: %x\nOrbit: %x   BC: %x\nTrigger: %llx (%s)\nEvent# in file:%d\nTimestamp: %x\n",
+                         fESD->GetRunNumber(),
+                         acttrclasses.Data(),
+                         fESD->GetEventType(),AliRawEventHeaderBase::GetTypeName(fESD->GetEventType()),
+                         fESD->GetPeriodNumber(),fESD->GetOrbitNumber(),fESD->GetBunchCrossNumber(),
+                         fESD->GetTriggerMask(),firedtrclasses.Data(),
+                         fESD->GetEventNumberInFile(),
+                         fESD->GetTimeStamp()));
+  }
 
   return eventInfo.Data();
 }
index f871ee7..88f57fc 100644 (file)
@@ -76,7 +76,7 @@ AliEveEventManagerEditor::AliEveEventManagerEditor(const TGWindow *p, Int_t widt
     TGLabel *eventInfoLabel = new TGLabel(f, "Event Information:");
     f->AddFrame(eventInfoLabel, new TGLayoutHints(kLHintsNormal, 0,0,6,2));
 
-    fEventInfo = new TGTextView(f, 200, 200);
+    fEventInfo = new TGTextView(f, 200, 300);
     f->AddFrame(fEventInfo, new TGLayoutHints(kLHintsNormal | kLHintsExpandX));
 
     AddFrame(f, new TGLayoutHints(kLHintsNormal | kLHintsExpandX));
index fb49838..ca9e98b 100644 (file)
@@ -58,7 +58,7 @@ class AliDAQ: public TObject {
 
   static void        PrintConfig();
 
-  const  char       *ListOfTriggeredDetectors(Int_t detectorPattern);
+  static const char *ListOfTriggeredDetectors(Int_t detectorPattern);
 
   enum {
     kNDetectors = 21,    // Number of detectors
index 742d062..b70c775 100644 (file)
@@ -125,7 +125,17 @@ const char *AliRawEventHeaderBase::GetTypeName() const
    // Get event type as a string.
    // Will fail in case data header
    // does not contain eventType field
-   Int_t eventType = Get("Type");
+   UInt_t eventType = Get("Type");
+
+   return GetTypeName(eventType);
+}
+
+//______________________________________________________________________________
+const char *AliRawEventHeaderBase::GetTypeName(UInt_t eventType)
+{
+  // Get event type as a string.
+  // Static method that could be used
+  // from everywhere inside aliroot
 
    switch (eventType) {
       case kStartOfRun:
index da14989..97d6536 100644 (file)
@@ -44,6 +44,7 @@ public:
    char*         GetExtendedData() const { return fExtendedData; }
 
    const char *  GetTypeName() const;
+   static const char *  GetTypeName(UInt_t eventType);
    static AliRawEventHeaderBase* Create(char*& data);
    void          AllocateExtendedData(Int_t extsize);
    Int_t         ReadHeader(char*& data);