Implementation of TRD trigger flags (Jochen)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 27 Sep 2011 18:04:22 +0000 (18:04 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 27 Sep 2011 18:04:22 +0000 (18:04 +0000)
STEER/CMakelibESD.pkg
STEER/ESD/AliESDEvent.cxx
STEER/ESD/AliESDEvent.h
STEER/ESD/AliESDTrdTrigger.cxx [new file with mode: 0644]
STEER/ESD/AliESDTrdTrigger.h [new file with mode: 0644]
STEER/ESDLinkDef.h

index fbf1015..d4870ad 100644 (file)
@@ -12,6 +12,7 @@ set ( SRCS
     ESD/AliESDPmdTrack.cxx 
     ESD/AliESDTrdTrack.cxx 
     ESD/AliESDTrdTracklet.cxx 
+    ESD/AliESDTrdTrigger.cxx 
     ESD/AliESDHLTtrack.cxx 
     ESD/AliESDv0.cxx 
     ESD/AliESDcascade.cxx 
index f15f5e7..3ec223e 100644 (file)
@@ -49,6 +49,7 @@
 #include "AliESDVertex.h"
 #include "AliESDcascade.h"
 #include "AliESDPmdTrack.h"
+#include "AliESDTrdTrigger.h"
 #include "AliESDTrdTrack.h"
 #include "AliESDTrdTracklet.h"
 #include "AliESDVertex.h"
@@ -93,6 +94,7 @@ ClassImp(AliESDEvent)
                                                        "Tracks",
                                                        "MuonTracks",
                                                        "PmdTracks",
+                                                       "AliESDTrdTrigger",
                                                        "TrdTracks",
                                                        "TrdTracklets",
                                                        "V0s",
@@ -122,6 +124,7 @@ AliESDEvent::AliESDEvent():
   fPHOSTrigger(0),
   fEMCALTrigger(0),
   fESDACORDE(0),
+  fTrdTrigger(0),
   fSPDPileupVertices(0),
   fTrkPileupVertices(0),
   fTracks(0),
@@ -161,6 +164,7 @@ AliESDEvent::AliESDEvent(const AliESDEvent& esd):
   fPHOSTrigger(new AliESDCaloTrigger(*esd.fPHOSTrigger)),
   fEMCALTrigger(new AliESDCaloTrigger(*esd.fEMCALTrigger)),
   fESDACORDE(new AliESDACORDE(*esd.fESDACORDE)),
+  fTrdTrigger(new AliESDTrdTrigger(*esd.fTrdTrigger)),
   fSPDPileupVertices(new TClonesArray(*esd.fSPDPileupVertices)),
   fTrkPileupVertices(new TClonesArray(*esd.fTrkPileupVertices)),
   fTracks(new TClonesArray(*esd.fTracks)),
@@ -196,6 +200,7 @@ AliESDEvent::AliESDEvent(const AliESDEvent& esd):
   AddObject(fSPDMult);
   AddObject(fPHOSTrigger);
   AddObject(fEMCALTrigger);
+  AddObject(fTrdTrigger);
   AddObject(fSPDPileupVertices);
   AddObject(fTrkPileupVertices);
   AddObject(fTracks);
@@ -452,6 +457,10 @@ void AliESDEvent::ResetStdContent()
     new (fTOFHeader) AliTOFHeader();
     //fTOFHeader->SetName(fgkESDListName[kTOFHeader]);
   }
+  if (fTrdTrigger) {
+    fTrdTrigger->~AliESDTrdTrigger();
+    new (fTrdTrigger) AliESDTrdTrigger();
+  }
   if(fPHOSTrigger)fPHOSTrigger->DeAllocate(); 
   if(fEMCALTrigger)fEMCALTrigger->DeAllocate(); 
   if(fSPDPileupVertices)fSPDPileupVertices->Delete();
@@ -942,6 +951,11 @@ void AliESDEvent::AddPmdTrack(const AliESDPmdTrack *t)
   new(fpmd[fPmdTracks->GetEntriesFast()]) AliESDPmdTrack(*t);
 }
 
+void AliESDEvent::SetTrdTrigger(const AliESDTrdTrigger *t)
+{
+  *fTrdTrigger = *t;
+}
+
 void AliESDEvent::AddTrdTrack(const AliESDTrdTrack *t) 
 {
   TClonesArray &ftrd = *fTrdTracks;
@@ -1156,6 +1170,7 @@ void AliESDEvent::GetStdContent()
   fTracks = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kTracks]);
   fMuonTracks = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kMuonTracks]);
   fPmdTracks = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kPmdTracks]);
+  fTrdTrigger = (AliESDTrdTrigger*)fESDObjects->FindObject(fgkESDListName[kTrdTrigger]);
   fTrdTracks = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kTrdTracks]);
   fTrdTracklets = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kTrdTracklets]);
   fV0s = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kV0s]);
@@ -1216,6 +1231,7 @@ void AliESDEvent::CreateStdContent()
   AddObject(new TClonesArray("AliESDtrack",0));
   AddObject(new TClonesArray("AliESDMuonTrack",0));
   AddObject(new TClonesArray("AliESDPmdTrack",0));
+  AddObject(new AliESDTrdTrigger());
   AddObject(new TClonesArray("AliESDTrdTrack",0));
   AddObject(new TClonesArray("AliESDTrdTracklet",0));
   AddObject(new TClonesArray("AliESDv0",0));
index 436b2ac..e74f556 100644 (file)
@@ -53,6 +53,7 @@ class AliESDv0;
 class AliMultiplicity;
 class AliRawDataErrorLog;
 class AliESDRun;
+class AliESDTrdTrigger;
 class AliESDTrdTrack;
 class AliESDTrdTracklet;
 class AliESDMuonTrack;
@@ -89,6 +90,7 @@ public:
                       kTracks,
                       kMuonTracks,
                       kPmdTracks,
+                      kTrdTrigger,
                       kTrdTracks,
                       kTrdTracklets,
                       kV0s,
@@ -345,6 +347,12 @@ public:
   }
 
   
+  void SetTrdTrigger(const AliESDTrdTrigger *t);
+
+  AliESDTrdTrigger* GetTrdTrigger() const {
+    return (AliESDTrdTrigger*)(fTrdTrigger);
+  }
+
   void AddTrdTrack(const AliESDTrdTrack *t);
 
   AliESDTrdTracklet* GetTrdTracklet(Int_t idx) const {
@@ -464,6 +472,7 @@ protected:
   AliESDCaloTrigger* fPHOSTrigger;     //! PHOS Trigger information
   AliESDCaloTrigger* fEMCALTrigger;    //! PHOS Trigger information
   AliESDACORDE    *fESDACORDE;        //! ACORDE ESD object caontaining bit pattern
+  AliESDTrdTrigger *fTrdTrigger;      //! TRD trigger information
 
   TClonesArray *fSPDPileupVertices;//! Pileup primary vertices reconstructed by SPD 
   TClonesArray *fTrkPileupVertices;//! Pileup primary vertices reconstructed using the tracks 
@@ -495,7 +504,7 @@ protected:
                              //  and T0spread as written in OCDB
   AliCentrality *fCentrality; //! Centrality for AA collision
   AliEventplane *fEventplane; //! Event plane for AA collision
-  ClassDef(AliESDEvent,14)  //ESDEvent class 
+  ClassDef(AliESDEvent,15)  //ESDEvent class 
 };
 #endif 
 
diff --git a/STEER/ESD/AliESDTrdTrigger.cxx b/STEER/ESD/AliESDTrdTrigger.cxx
new file mode 100644 (file)
index 0000000..6cf17fa
--- /dev/null
@@ -0,0 +1,42 @@
+#include "TObject.h"
+
+#include "AliESDTrdTrigger.h"
+
+AliESDTrdTrigger::AliESDTrdTrigger() : 
+  TObject()
+{
+  // default ctor
+
+  for (Int_t iSector = 0; iSector < fgkNsectors; iSector++) {
+    fFlags[iSector] = 0x0;
+  }
+}
+
+AliESDTrdTrigger::AliESDTrdTrigger(const AliESDTrdTrigger &rhs) :
+  TObject(rhs)
+{
+  // copy ctor
+
+  for (Int_t iSector = 0; iSector < fgkNsectors; iSector++) {
+    fFlags[iSector] = rhs.fFlags[iSector];
+  }
+}
+
+AliESDTrdTrigger& AliESDTrdTrigger::operator=(const AliESDTrdTrigger &rhs)
+{
+  // assignment operator
+  if (&rhs != this) {
+    TObject::operator=(rhs);
+    for (Int_t iSector = 0; iSector < fgkNsectors; iSector++) {
+      fFlags[iSector] = rhs.fFlags[iSector];
+    }
+  }
+
+  return *this;
+}
+
+AliESDTrdTrigger::~AliESDTrdTrigger()
+{
+  // dtor
+
+}
diff --git a/STEER/ESD/AliESDTrdTrigger.h b/STEER/ESD/AliESDTrdTrigger.h
new file mode 100644 (file)
index 0000000..15d51d0
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef ALIESDTRDTRIGGER_H
+#define ALIESDTRDTRIGGER_H
+
+#include "TObject.h"
+
+class AliESDTrdTrigger : public TObject
+{
+ public:
+  AliESDTrdTrigger();
+  AliESDTrdTrigger(const AliESDTrdTrigger &rhs);
+  AliESDTrdTrigger& operator=(const AliESDTrdTrigger &rhs);
+  ~AliESDTrdTrigger();
+
+  UInt_t GetFlags(const Int_t sector) const { return fFlags[sector]; }
+
+  void SetFlags(const Int_t sector, const UInt_t flags) { fFlags[sector] = flags; }
+
+ protected:
+  static const Int_t fgkNsectors = 18;   // number of sectors
+
+  UInt_t fFlags[fgkNsectors];            // trigger flags for every sector
+
+  ClassDef(AliESDTrdTrigger, 1);
+};
+
+#endif
index 036f68c..98e16d5 100644 (file)
@@ -38,6 +38,7 @@
 #pragma link C++ class  AliESDfriendTrack+;
 #pragma link C++ class  AliESDMuonTrack+;
 #pragma link C++ class  AliESDPmdTrack+;
+#pragma link C++ class  AliESDTrdTrigger+;
 #pragma link C++ class  AliESDTrdTrack+;
 #pragma link C++ class  AliESDTrdTracklet+;
 #pragma link C++ class  AliESDHLTtrack+;