Virual base classes for AOD and ESD, organized in libSTEERBase (Markus)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 7 Aug 2007 20:28:06 +0000 (20:28 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 7 Aug 2007 20:28:06 +0000 (20:28 +0000)
12 files changed:
STEER/AliVEvent.cxx [new file with mode: 0644]
STEER/AliVEvent.h [new file with mode: 0644]
STEER/AliVEventHandler.cxx [new file with mode: 0644]
STEER/AliVEventHandler.h [new file with mode: 0644]
STEER/AliVHeader.cxx [new file with mode: 0644]
STEER/AliVHeader.h [new file with mode: 0644]
STEER/AliVParticle.cxx [new file with mode: 0644]
STEER/AliVParticle.h [new file with mode: 0644]
STEER/PROOF-INF.STEERBase/BUILD.sh [new file with mode: 0755]
STEER/PROOF-INF.STEERBase/SETUP.C [new file with mode: 0644]
STEER/STEERBaseLinkDef.h [new file with mode: 0644]
STEER/libSTEERBase.pkg [new file with mode: 0644]

diff --git a/STEER/AliVEvent.cxx b/STEER/AliVEvent.cxx
new file mode 100644 (file)
index 0000000..d9b8523
--- /dev/null
@@ -0,0 +1,38 @@
+/**************************************************************************
+ * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+//-------------------------------------------------------------------------
+//     base class for ESD and AOD events
+//     Author: Markus Oldenburg, CERN
+//-------------------------------------------------------------------------
+
+#include "AliVEvent.h"
+
+
+AliVEvent::AliVEvent(const AliVEvent& vEvnt) :
+  TObject(vEvnt) { } // Copy constructor
+
+AliVEvent& AliVEvent::operator=(const AliVEvent& vEvnt)
+{ if (this!=&vEvnt) { 
+    TObject::operator=(vEvnt); 
+  }
+  
+  return *this; 
+}
+
+
+ClassImp(AliVEvent)
diff --git a/STEER/AliVEvent.h b/STEER/AliVEvent.h
new file mode 100644 (file)
index 0000000..860b06c
--- /dev/null
@@ -0,0 +1,145 @@
+// -*- mode: C++ -*- 
+#ifndef ALIVEVENT_H
+#define ALIVEVENT_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+
+/* $Id$ */
+
+//-------------------------------------------------------------------------
+//                          Class AliVEvent
+//      
+// Origin: Markus Oldenburg, CERN, Markus.Oldenburg@cern.ch 
+//-------------------------------------------------------------------------
+
+#include <TObject.h>
+#include <TTree.h>
+#include "AliVHeader.h"
+#include "AliVParticle.h"
+
+class AliVEvent : public TObject {
+
+public:
+
+  AliVEvent() { }
+  virtual ~AliVEvent() { } 
+  AliVEvent(const AliVEvent& vEvnt); 
+  AliVEvent& operator=(const AliVEvent& vEvnt);
+
+  // Services
+  virtual void AddObject(TObject* obj) = 0;
+  virtual TObject* FindListObject(const char *name) = 0;
+  virtual TList* GetList() const = 0;
+
+  virtual void CreateStdContent() = 0;
+  virtual void GetStdContent() = 0;
+
+  virtual void ReadFromTree(TTree *tree) = 0;
+  virtual const void WriteToTree(TTree* tree) const = 0;
+
+  //virtual void Reset() = 0;
+  //virtual void ResetStdContent() = 0;
+  virtual void SetStdNames() = 0;
+
+  virtual void Print(Option_t *option="") const = 0;
+
+  // Header
+  virtual AliVHeader* GetHeader() const = 0;
+
+  // Delegated methods for fESDRun or AODHeader
+  
+  virtual void     SetRunNumber(Int_t n) = 0;
+  virtual void     SetPeriodNumber(UInt_t n) = 0;
+  virtual void     SetMagneticField(Double_t mf) = 0;
+  
+  virtual Int_t    GetRunNumber() const = 0;
+  virtual UInt_t   GetPeriodNumber() const = 0;
+  virtual Double_t GetMagneticField() const = 0;
+
+  // Delegated methods for fHeader
+  virtual void      SetOrbitNumber(UInt_t n) = 0;
+  virtual void      SetBunchCrossNumber(UShort_t n) = 0;
+  virtual void      SetEventType(UInt_t eventType)= 0;
+  virtual void      SetTriggerMask(ULong64_t n) = 0;
+  virtual void      SetTriggerCluster(UChar_t n) = 0;
+
+  virtual UInt_t    GetOrbitNumber() const = 0;
+  virtual UShort_t  GetBunchCrossNumber() const = 0;
+  virtual UInt_t    GetEventType()  const = 0;
+  virtual ULong64_t GetTriggerMask() const = 0;
+  virtual UChar_t   GetTriggerCluster() const = 0;
+
+  virtual Double_t  GetZDCN1Energy() const = 0;
+  virtual Double_t  GetZDCP1Energy() const = 0;
+  virtual Double_t  GetZDCN2Energy() const = 0;
+  virtual Double_t  GetZDCP2Energy() const = 0;
+  virtual Double_t  GetZDCEMEnergy() const = 0;
+  // Tracks
+  virtual AliVParticle *GetTrack(Int_t i) const = 0;
+  //virtual Int_t        AddTrack(const AliVParticle *t) = 0;
+  virtual Int_t        GetNumberOfTracks() const = 0;
+
+  //---------- end of new stuff
+
+
+  /*  to be considered to go in here be implemented
+
+  void SetPrimaryVertex(const AliESDVertex *vertex) {
+    *fPrimaryVertex = *vertex;
+    fPrimaryVertex->SetName("PrimaryVertex");// error prone use class wide names?
+  }
+  const AliESDVertex *GetPrimaryVertex() const {return fPrimaryVertex;}
+
+  void SetMultiplicity(const AliMultiplicity *mul) {
+    *fSPDMult = *mul;
+    // CKB 
+    //     new (&fSPDMult) AliMultiplicity(*mul);
+  }
+  const AliMultiplicity *GetMultiplicity() const {return fSPDMult;}
+  
+  
+  AliESDMuonTrack *GetMuonTrack(Int_t i) const {
+    return (AliESDMuonTrack *)fMuonTracks->UncheckedAt(i);
+  }
+  void AddMuonTrack(const AliESDMuonTrack *t) {
+    TClonesArray &fmu = *fMuonTracks;
+    new(fmu[fMuonTracks->GetEntriesFast()]) AliESDMuonTrack(*t);
+  }
+
+  AliESDv0 *GetV0(Int_t i) const {
+    return (AliESDv0*)fV0s->UncheckedAt(i);
+  }
+  Int_t AddV0(const AliESDv0 *v);
+
+  AliESDcascade *GetCascade(Int_t i) const {
+    return (AliESDcascade *)fCascades->UncheckedAt(i);
+  }
+  void AddCascade(const AliESDcascade *c) {
+    TClonesArray &fc = *fCascades;
+    new(fc[fCascades->GetEntriesFast()]) AliESDcascade(*c);
+  }
+
+  AliESDkink *GetKink(Int_t i) const {
+    return (AliESDkink *)fKinks->UncheckedAt(i);
+  }
+  Int_t AddKink(const AliESDkink *c);
+
+  AliESDCaloCluster *GetCaloCluster(Int_t i) const {
+    return (AliESDCaloCluster *)fCaloClusters->UncheckedAt(i);
+  }
+  Int_t AddCaloCluster(const AliESDCaloCluster *c);
+
+  Int_t GetNumberOfMuonTracks() const {return fMuonTracks->GetEntriesFast();}
+  Int_t GetNumberOfV0s()      const {return fV0s->GetEntriesFast();}
+  Int_t GetNumberOfCascades() const {return fCascades->GetEntriesFast();}
+  Int_t GetNumberOfKinks() const {return fKinks->GetEntriesFast();}
+  Int_t GetNumberOfCaloClusters() const {return fCaloClusters->GetEntriesFast();}
+
+  */
+
+  ClassDef(AliVEvent,0)  // base class for AliEvent data
+};
+#endif 
+
diff --git a/STEER/AliVEventHandler.cxx b/STEER/AliVEventHandler.cxx
new file mode 100644 (file)
index 0000000..03e2a3a
--- /dev/null
@@ -0,0 +1,44 @@
+/**************************************************************************
+ * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+//-------------------------------------------------------------------------
+//     Event IO handler base class
+//     Author: Andreas Morsch, CERN
+//-------------------------------------------------------------------------
+
+#include "AliVEventHandler.h"
+
+ClassImp(AliVEventHandler)
+
+//______________________________________________________________________________
+AliVEventHandler::AliVEventHandler() :
+  TNamed()
+{
+  // default constructor
+}
+
+//______________________________________________________________________________
+AliVEventHandler::~AliVEventHandler() 
+{
+// destructor
+}
+
+//______________________________________________________________________________
+AliVEventHandler::AliVEventHandler(const char* name, const char* title):
+    TNamed(name, title)
+{
+}
diff --git a/STEER/AliVEventHandler.h b/STEER/AliVEventHandler.h
new file mode 100644 (file)
index 0000000..963ed67
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef ALIVEVENTHANDLER_H
+#define ALIVEVENTHANDLER_H
+/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+//-------------------------------------------------------------------------
+//     Event Handler base class
+//     Author: Andreas Morsch, CERN
+//-------------------------------------------------------------------------
+
+#include <TNamed.h>
+
+
+class AliVEventHandler : public TNamed {
+
+ public:
+    AliVEventHandler();
+    AliVEventHandler(const char* name, const char* title);
+    virtual ~AliVEventHandler();
+    virtual void         SetOutputFileName(char* fname)  = 0;
+    virtual char*        GetOutputFileName()             = 0;
+    virtual Bool_t       InitIO(Option_t* opt)           = 0;
+    virtual Bool_t       BeginEvent()                    = 0;
+    virtual Bool_t       Notify(const char *path)                        = 0;    
+    virtual Bool_t       FinishEvent()                   = 0;
+    virtual Bool_t       Terminate()                     = 0;
+    virtual Bool_t       TerminateIO()                   = 0;
+ private :
+  ClassDef(AliVEventHandler, 0);
+};
+
+#endif
diff --git a/STEER/AliVHeader.cxx b/STEER/AliVHeader.cxx
new file mode 100644 (file)
index 0000000..42e16c6
--- /dev/null
@@ -0,0 +1,43 @@
+/**************************************************************************
+ * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+//-------------------------------------------------------------------------
+//     Event header base class
+//     Author: Markus Oldenburg, CERN
+//-------------------------------------------------------------------------
+
+#include "AliVHeader.h"
+
+ClassImp(AliVHeader)
+
+//______________________________________________________________________________
+AliVHeader::AliVHeader() : 
+  TNamed("header","") { } // default constructor 
+
+//______________________________________________________________________________
+AliVHeader::AliVHeader(const AliVHeader& hdr) :
+  TNamed(hdr) { } // Copy constructor
+
+//______________________________________________________________________________
+AliVHeader& AliVHeader::operator=(const AliVHeader& hdr)
+{
+  // Assignment operator
+  if(this!=&hdr) { 
+    TNamed::operator=(hdr);
+  }
+  return *this;
+}
diff --git a/STEER/AliVHeader.h b/STEER/AliVHeader.h
new file mode 100644 (file)
index 0000000..5613b24
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef AliVHeader_H
+#define AliVHeader_H
+/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+//-------------------------------------------------------------------------
+//     Event header base class
+//     Author: Markus Oldenburg, CERN
+//-------------------------------------------------------------------------
+
+#include <TNamed.h>
+
+class AliVHeader : public TNamed {
+
+ public :
+  AliVHeader(); 
+  virtual ~AliVHeader() { };
+  AliVHeader(const AliVHeader& evt); 
+  AliVHeader& operator=(const AliVHeader& evt);
+  
+  virtual UShort_t  GetBunchCrossNumber()   const = 0;
+  virtual UInt_t    GetOrbitNumber()        const = 0;
+  virtual UInt_t    GetPeriodNumber()       const = 0;
+  virtual ULong64_t GetTriggerMask()        const = 0;
+  virtual UChar_t   GetTriggerCluster()     const = 0;
+  virtual UInt_t    GetEventType()          const = 0;
+  
+  /*
+  virtual void SetBunchCrossNumber(UShort_t nBx)   = 0;
+  virtual void SetOrbitNumber(UInt_t nOr)          = 0;
+  virtual void SetPeriodNumber(UInt_t nPer)        = 0;
+  virtual void SetTriggerMask(ULong64_t trigMsk)   = 0;
+  virtual void SetTriggerCluster(UChar_t trigClus) = 0;
+  virtual void SetEventType(UInt_t evttype)        = 0;
+  */
+
+  virtual void Print(Option_t* option = "") const  = 0;
+    
+  ClassDef(AliVHeader,0);
+};
+
+#endif
diff --git a/STEER/AliVParticle.cxx b/STEER/AliVParticle.cxx
new file mode 100644 (file)
index 0000000..56effb0
--- /dev/null
@@ -0,0 +1,36 @@
+/**************************************************************************
+ * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+//-------------------------------------------------------------------------
+//     base class for ESD and AOD particles
+//     Author: Markus Oldenburg, CERN
+//-------------------------------------------------------------------------
+
+#include "AliVParticle.h"
+
+ClassImp(AliVParticle)
+
+AliVParticle::AliVParticle(const AliVParticle& vPart) :
+  TObject(vPart) { } // Copy constructor
+
+AliVParticle& AliVParticle::operator=(const AliVParticle& vPart)
+{ if (this!=&vPart) { 
+    TObject::operator=(vPart); 
+  }
+  
+  return *this; 
+}
diff --git a/STEER/AliVParticle.h b/STEER/AliVParticle.h
new file mode 100644 (file)
index 0000000..2382653
--- /dev/null
@@ -0,0 +1,51 @@
+#ifndef AliVParticle_H
+#define AliVParticle_H
+/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+//-------------------------------------------------------------------------
+//     base class for ESD and AOD particles
+//     Author: Markus Oldenburg, CERN
+//-------------------------------------------------------------------------
+
+#include <Rtypes.h>
+#include <TObject.h>
+
+class AliVParticle: public TObject {
+
+public:
+  AliVParticle() { }
+  virtual ~AliVParticle() { }
+  AliVParticle(const AliVParticle& vPart); 
+  AliVParticle& operator=(const AliVParticle& vPart);
+
+  // kinematics
+  virtual Double_t Px() const = 0;
+  virtual Double_t Py() const = 0;
+  virtual Double_t Pz() const = 0;
+  virtual Double_t Pt() const = 0;
+  virtual Double_t P() const = 0;
+
+  virtual Double_t OneOverPt() const = 0;
+  virtual Double_t Phi() const = 0;
+  virtual Double_t Theta() const = 0;
+
+
+  virtual Double_t E() const = 0;
+  virtual Double_t M() const = 0;
+  
+  virtual Double_t Eta() const = 0;
+  virtual Double_t Y() const = 0;
+  
+  virtual Short_t Charge() const = 0;
+
+  // PID
+  virtual const Double_t *PID() const = 0; // return PID object (to be defined, still)
+
+
+  ClassDef(AliVParticle,0)  // base class for particles
+};
+
+#endif
diff --git a/STEER/PROOF-INF.STEERBase/BUILD.sh b/STEER/PROOF-INF.STEERBase/BUILD.sh
new file mode 100755 (executable)
index 0000000..fc9490a
--- /dev/null
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+make 
diff --git a/STEER/PROOF-INF.STEERBase/SETUP.C b/STEER/PROOF-INF.STEERBase/SETUP.C
new file mode 100644 (file)
index 0000000..467dd4f
--- /dev/null
@@ -0,0 +1,12 @@
+void SETUP()
+{
+   // Load the ESD library
+   gSystem->Load("libSTEERBase");
+
+   // Set the Inlucde paths
+   gSystem->SetIncludePath("-I$ROOTSYS/include -ISTEERBase");
+   gROOT->ProcessLine(".include STEERBase");
+
+   // Set our location, so that other packages can find us
+   gSystem->Setenv("STEERBase_INCLUDE", "STEERBase");
+}
diff --git a/STEER/STEERBaseLinkDef.h b/STEER/STEERBaseLinkDef.h
new file mode 100644 (file)
index 0000000..4b9d246
--- /dev/null
@@ -0,0 +1,16 @@
+#ifdef __CINT__
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+#pragma link C++ class AliVParticle+;
+#pragma link C++ class AliVEvent+;
+#pragma link C++ class AliVHeader+;
+#pragma link C++ class AliVEventHandler+;
+
+#endif
diff --git a/STEER/libSTEERBase.pkg b/STEER/libSTEERBase.pkg
new file mode 100644 (file)
index 0000000..084db3c
--- /dev/null
@@ -0,0 +1,10 @@
+SRCS = AliVParticle.cxx \
+       AliVEvent.cxx \
+       AliVHeader.cxx \
+       AliVEventHandler.cxx \
+
+HDRS:= $(SRCS:.cxx=.h) 
+
+DHDR= STEERBaseLinkDef.h
+
+EXPORT:=$(SRCS:.cxx=.h)