]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliMCEvent.h
Removing obsolete field maps
[u/mrichter/AliRoot.git] / STEER / AliMCEvent.h
index 572d67b6113b8abb04c28c59ebc44f0bf5e8ae9f..6534b5826a7e549b28ea5f18484d5f9b39b5bd78 100644 (file)
 
 //-------------------------------------------------------------------------
 //                          Class AliMCEvent
-// This class gives access to MC truth during the analysis.
-// Monte Carlo truth is containe in the kinematics tree (produced particles) and 
-// the tree of reference hits.
 //      
-// Origin: Andreas Morsch, CERN, andreas.morsch@cern.ch 
+// Origin: Andreas.Morsch, CERN, andreas.morsch@cern.ch 
 //-------------------------------------------------------------------------
 
-#include "AliVirtualEventHandler.h"
-class TFile;
-class TTree;
-class TParticle;
-class TClonesArray;
-class AliHeader;
+
+#include <TTree.h>
+#include <TRefArray.h>
+
+#include <AliVEvent.h>
+#include "AliVHeader.h"
+#include "AliMCParticle.h"
+
 class AliStack;
+class AliHeader;
+class AliGenEventHeader;
 
+class TClonesArray;
+
+class AliMCEvent : public AliVEvent {
 
-class AliMCEvent : public AliVirtualEventHandler 
-{
 public:
+
     AliMCEvent();
-    AliMCEvent(const char* name, const char* title);
-    virtual ~AliMCEvent();
-    virtual void         SetOutputFileName(char* /* fname */) {;}
-    virtual char*        GetOutputFileName() {return 0;}
-    virtual Bool_t       InitIO(Option_t* opt);
-    virtual Bool_t       BeginEvent();
-    virtual Bool_t       FinishEvent();
-    virtual Bool_t       Terminate();
-    virtual Bool_t       TerminateIO();
+    virtual ~AliMCEvent() {;} 
+    AliMCEvent(const AliMCEvent& mcEvnt); 
+    AliMCEvent& operator=(const AliMCEvent& mcEvnt);
+    //
+    // Methods implementing the interface
+    //
+    // Services
+    virtual void AddObject(TObject* /*obj*/)               {;}
+    virtual TObject* FindListObject(const char */*name*/)  {return 0;}
+    virtual TList* GetList() const                         {return 0;}
+    virtual void CreateStdContent()                        {;} 
+    virtual void GetStdContent()                           {;}
+    virtual void ReadFromTree(TTree * /*tree*/, Option_t* /*opt*/) {;}
+    virtual void WriteToTree(TTree* /*tree*/)  const {;}
+
+    virtual void SetStdNames()                             {;}
+    virtual void Print(Option_t */*option=""*/)  const     {;}
+    
+
+    // Header
+    virtual AliVHeader* GetHeader()          const         {return 0;}
+
+    // Delegated methods for fESDRun or AODHeader
+  
+    virtual void     SetRunNumber(Int_t /*n*/)             {;}
+    virtual void     SetPeriodNumber(UInt_t /*n*/)         {;}
+    virtual void     SetMagneticField(Double_t /*mf*/)     {;}
+    
+  
+    virtual Int_t    GetRunNumber()          const         {return 0;}
+    virtual UInt_t   GetPeriodNumber()       const {return 0;}
+    virtual Double_t GetMagneticField()      const         {return 0.;}
+
+    // Setters not needed
+    virtual void      SetOrbitNumber(UInt_t /*n*/)         {;}
+    virtual void      SetBunchCrossNumber(UShort_t /*n*/)  {;}
+    virtual void      SetEventType(UInt_t /*eventType*/)   {;}
+    virtual void      SetTriggerMask(ULong64_t /*n*/)      {;}
+    virtual void      SetTriggerCluster(UChar_t /*n*/)     {;} 
+
+    virtual UInt_t    GetOrbitNumber()       const {return 0;}
+    virtual UShort_t  GetBunchCrossNumber()  const {return 0;}
+    
+    virtual UInt_t    GetEventType()         const {return 0;}
+
+    virtual ULong64_t GetTriggerMask()        const {return 0;}
+    virtual UChar_t   GetTriggerCluster()     const {return 0;}
+    virtual Double_t  GetZDCN1Energy()        const {return 0.;}
+    virtual Double_t  GetZDCP1Energy()        const {return 0.;}
+    virtual Double_t  GetZDCN2Energy()        const {return 0.;}
+    virtual Double_t  GetZDCP2Energy()        const {return 0.;}
+    virtual Double_t  GetZDCEMEnergy(Int_t /*i*/) 
+                                              const {return 0.;}
+    // Tracks
+    virtual AliMCParticle *GetTrack(Int_t i) const;
+    virtual Int_t     GetNumberOfTracks()    const {return fNparticles;}
+    virtual Int_t     GetNumberOfV0s()       const {return -1;}
+
+    //
+    // MC Specific methods
     //
-    AliStack* Stack()  {return fStack;}
-    TTree*    TreeTR() {return fTreeTR;}
-    Int_t     GetParticleAndTR(Int_t i, TParticle*& particle, TClonesArray*& trefs);
-    void      DrawCheck(Int_t i);
-           
+    // Getters
+    AliStack*    Stack()   {return fStack;}
+    AliHeader*   Header()  {return fHeader;}
+    AliGenEventHeader* GenEventHeader();
+    // Services
+    virtual void      ConnectTreeE (TTree* tree);
+    virtual void      ConnectTreeK (TTree* tree);
+    virtual void      ConnectTreeTR(TTree* tree);
+    virtual void      Clean();
+    virtual void      FinishEvent();
+    virtual Int_t     GetParticleAndTR(Int_t i, TParticle*& particle, TClonesArray*& trefs);
+    virtual void      DrawCheck(Int_t i, Int_t search);
+private:
+    virtual void      ReorderAndExpandTreeTR();
+    
 private:
-    TFile            *fFileE;            //! File with TreeE
-    TFile            *fFileK;            //! File with TreeK
-    TFile            *fFileTR;           //! File with TreeTR
-    TTree            *fTreeE;            //! TreeE  (Event Headers)
-    TTree            *fTreeK;            //! TreeK  (kinematics tree)
-    TTree            *fTreeTR;           //! TreeTR (track references tree)
-    AliStack         *fStack;            //! Current pointer to stack
-    AliHeader        *fHeader;           //! Current pointer to header
-    TClonesArray     *fTrackReferences;  //! Current list of tarck references
-    Int_t             fNEvent;           //! Number of events
-    Int_t             fEvent;            //! Current event
-    Int_t             fNprimaries;       //! Number of primaries
-    Int_t             fNparticles;       //! Number of particles 
-    ClassDef(AliMCEvent,1)  //MCEvent class 
+    AliStack         *fStack;           //! Current pointer to stack
+    TClonesArray     *fMCParticles;     //! Pointer to list of particles
+    TRefArray        *fMCParticleMap;   //! Map of MC Particles
+    AliHeader        *fHeader;          //! Current pointer to header
+    TClonesArray     *fTRBuffer;        //! Track reference buffer    
+    TClonesArray     *fTrackReferences; //! Array of track references
+    TTree            *fTreeTR;          //! Pointer to Track Reference Tree
+    TTree            *fTmpTreeTR;       //! Temporary tree TR to read old format
+    TFile            *fTmpFileTR;       //! Temporary file with TreeTR to read old format
+    Int_t             fNprimaries;      //! Number of primaries
+    Int_t             fNparticles;      //! Number of particles
+    ClassDef(AliMCEvent, 0)  // AliVEvent realisation for MC data
 };
+
+
 #endif