Interaction record array added.
[u/mrichter/AliRoot.git] / STEER / AliESDHeader.cxx
index 40e5e31..bf16d89 100644 (file)
 //-------------------------------------------------------------------------
 
 #include "AliESDHeader.h"
-
+#include "AliTriggerScalersESD.h"
+#include "AliTriggerScalersRecordESD.h"
+#include "AliTriggerIR.h"
 
 ClassImp(AliESDHeader)
 
 //______________________________________________________________________________
 AliESDHeader::AliESDHeader() :
-  TObject(),
+  AliVHeader(),
   fTriggerMask(0),
   fOrbitNumber(0),
   fTimeStamp(0),
   fEventType(0),
+  fPeriodNumber(0),
   fEventNumberInFile(0),
   fBunchCrossNumber(0),
-  fTriggerCluster(0)
+  fTriggerCluster(0),
+  fL0TriggerInputs(0),
+  fL1TriggerInputs(0),
+  fL2TriggerInputs(0),
+  fTriggerScalers(),
+  fIRArray("AliTriggerIR",3)
+{
+  // default constructor
+
+  SetName("AliESDHeader");
+}
+AliESDHeader::~AliESDHeader() 
 {
+  // destructor
 }
 
 
 AliESDHeader::AliESDHeader(const AliESDHeader &header) :
-  TObject(header),
+  AliVHeader(header),
   fTriggerMask(header.fTriggerMask),
   fOrbitNumber(header.fOrbitNumber),
   fTimeStamp(header.fTimeStamp),
   fEventType(header.fEventType),
+  fPeriodNumber(header.fPeriodNumber),
   fEventNumberInFile(header.fEventNumberInFile),
   fBunchCrossNumber(header.fBunchCrossNumber),
-  fTriggerCluster(header.fTriggerCluster)
+  fTriggerCluster(header.fTriggerCluster),
+  fL0TriggerInputs(header.fL0TriggerInputs),
+  fL1TriggerInputs(header.fL1TriggerInputs),
+  fL2TriggerInputs(header.fL2TriggerInputs),
+  fTriggerScalers(header.fTriggerScalers),
+  fIRArray(*((TClonesArray*)header.fIRArray.Clone()))
 {
   // copy constructor
+  SetName(header.fName);
+  SetTitle(header.fTitle);
 }
 
 AliESDHeader& AliESDHeader::operator=(const AliESDHeader &header)
 { 
   // assigment operator
   if(this!=&header) {
-    TObject::operator=(header);
+    AliVHeader::operator=(header);
     fTriggerMask = header.fTriggerMask;
     fOrbitNumber = header.fOrbitNumber;
     fTimeStamp = header.fTimeStamp;
     fEventType = header.fEventType;
+    fPeriodNumber = header.fPeriodNumber;
     fEventNumberInFile = header.fEventNumberInFile;
     fBunchCrossNumber = header.fBunchCrossNumber;
     fTriggerCluster = header.fTriggerCluster;
+    fL0TriggerInputs = header.fL0TriggerInputs;
+    fL1TriggerInputs = header.fL1TriggerInputs;
+    fL2TriggerInputs = header.fL2TriggerInputs;
+    fTriggerScalers = header.fTriggerScalers;
+    fIRArray = header.fIRArray;
+    SetName(header.fName);
+    SetTitle(header.fTitle);
+
   } 
   return *this;
 }
 
+void AliESDHeader::Copy(TObject &obj) const 
+{  
+  // this overwrites the virtual TOBject::Copy()
+  // to allow run time copying without casting
+  // in AliESDEvent
 
+  if(this==&obj)return;
+  AliESDHeader *robj = dynamic_cast<AliESDHeader*>(&obj);
+  if(!robj)return; // not an AliESDHeader
+  *robj = *this;
 
+}
 //______________________________________________________________________________
 void AliESDHeader::Reset()
 {
@@ -78,9 +120,15 @@ void AliESDHeader::Reset()
   fOrbitNumber       = 0;
   fTimeStamp         = 0;
   fEventType         = 0;
+  fPeriodNumber      = 0;
   fEventNumberInFile = 0;
   fBunchCrossNumber  = 0;
   fTriggerCluster    = 0;
+  fL0TriggerInputs   = 0;
+  fL1TriggerInputs   = 0;
+  fL2TriggerInputs   = 0;
+  fTriggerScalers.Reset();
+  fIRArray.Clear();
 }
 
 //______________________________________________________________________________