]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliAODHandler.h
Minor changes
[u/mrichter/AliRoot.git] / STEER / AliAODHandler.h
1 #ifndef ALIAODHANDLER_H
2 #define ALIAODHANDLER_H
3 /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 //-------------------------------------------------------------------------
9 //     Implementation of the Event Handler Interface for AOD
10 //     Author: Andreas Morsch, CERN
11 //-------------------------------------------------------------------------
12
13 #include "AliVEventHandler.h"
14
15 class AliAODEvent;
16 class TFile;
17 class TTree;
18 class AliMCEventHandler;
19
20
21
22 class AliAODHandler : public AliVEventHandler {
23     
24  public:
25     AliAODHandler();
26     AliAODHandler(const char* name, const char* title);
27     virtual ~AliAODHandler();
28     virtual void         SetOutputFileName(const char* fname);
29     virtual const char*  GetOutputFileName();
30     virtual Bool_t       Init(Option_t* option);
31     virtual Bool_t       Init(TTree* /*tree*/, Option_t* /*option*/)  {return kTRUE;}
32     virtual Bool_t       BeginEvent(Long64_t /*entry*/){return kTRUE;}
33     virtual Bool_t       Notify() { return AliVEventHandler::Notify(); };
34     virtual Bool_t       Notify(const char * /* path */) {return kTRUE;}
35     virtual Bool_t       FinishEvent();
36     virtual Bool_t       Terminate();
37     virtual Bool_t       TerminateIO();
38     //
39     virtual void         SetCreateNonStandardAOD()   {fIsStandard = kFALSE;}
40     virtual void         SetFillAOD(Bool_t b)      {fFillAOD = b;}
41     virtual void         SetNeedsHeaderReplication() {fNeedsHeaderReplication = kTRUE;}
42     virtual void         SetNeedsTracksBranchReplication() {fNeedsTracksBranchReplication = kTRUE;}
43     virtual void         SetNeedsVerticesBranchReplication() {fNeedsVerticesBranchReplication = kTRUE;}
44     virtual void         SetNeedsV0sBranchReplication() {fNeedsV0sBranchReplication = kTRUE;}
45     virtual void         SetNeedsTrackletsBranchReplication() {fNeedsTrackletsBranchReplication = kTRUE;}
46     virtual void         SetNeedsPMDClustersBranchReplication() {fNeedsPMDClustersBranchReplication = kTRUE;}
47     virtual void         SetNeedsJetsBranchReplication() {fNeedsJetsBranchReplication = kTRUE;}
48     virtual void         SetNeedsFMDClustersBranchReplication() {fNeedsFMDClustersBranchReplication = kTRUE;}
49     virtual void         SetNeedsCaloClustersBranchReplication() {fNeedsCaloClustersBranchReplication = kTRUE;}
50     virtual void         SetAODIsReplicated() {fAODIsReplicated = kTRUE;}
51     //
52     AliAODEvent*         GetAOD()  {return fAODEvent;}
53     virtual TTree*       GetTree() const {return fTreeA;}
54     void                 CreateTree(Int_t flag);
55     void                 FillTree();
56     void                 AddAODtoTreeUserInfo();
57     void                 AddBranch(const char* cname, void* addobj);
58     Bool_t               IsStandard() {return fIsStandard;}
59     Bool_t               GetFillAOD(){return fFillAOD;} 
60     Bool_t               NeedsHeaderReplication() {return  fNeedsHeaderReplication;}
61     Bool_t               NeedsTracksBranchReplication() {return  fNeedsTracksBranchReplication;}
62     Bool_t               NeedsVerticesBranchReplication() {return  fNeedsVerticesBranchReplication;}
63     Bool_t               NeedsV0sBranchReplication() {return  fNeedsV0sBranchReplication;}
64     Bool_t               NeedsTrackletsBranchReplication() {return  fNeedsTrackletsBranchReplication;}
65     Bool_t               NeedsPMDClustersBranchReplication() {return  fNeedsPMDClustersBranchReplication;}
66     Bool_t               NeedsJetsBranchReplication() {return  fNeedsJetsBranchReplication;}
67     Bool_t               NeedsFMDClustersBranchReplication() {return  fNeedsFMDClustersBranchReplication;}
68     Bool_t               NeedsCaloClustersBranchReplication() {return  fNeedsCaloClustersBranchReplication;}
69     Bool_t               AODIsReplicated() {return fAODIsReplicated;}
70     //
71     void                 SetInputTree(TTree* /*tree*/) {;}
72     void                 SetMCEventHandler(AliMCEventHandler* mcH) {fMCEventH = mcH;} // For internal use
73  private:
74     void StoreMCParticles();
75     AliAODHandler(const AliAODHandler&);             // Not implemented
76     AliAODHandler& operator=(const AliAODHandler&);  // Not implemented
77  private:
78     Bool_t                   fIsStandard;                         // Flag for standard aod creation
79     Bool_t                   fFillAOD;                          // Flag for filling of the AOD tree at the end (all or nothing)
80     Bool_t                   fNeedsHeaderReplication;             // Flag for header replication
81     Bool_t                   fNeedsTracksBranchReplication;       // Flag for tracks replication
82     Bool_t                   fNeedsVerticesBranchReplication;     // Flag for vertices replication
83     Bool_t                   fNeedsV0sBranchReplication;          // Flag for V0s replication
84     Bool_t                   fNeedsTrackletsBranchReplication;    // Flag for Tracklets replication
85     Bool_t                   fNeedsPMDClustersBranchReplication;  // Flag for PMDClusters replication
86     Bool_t                   fNeedsJetsBranchReplication;         // Flag for Jets replication
87     Bool_t                   fNeedsFMDClustersBranchReplication;  // Flag for FMDClusters replication
88     Bool_t                   fNeedsCaloClustersBranchReplication; // Flag for CaloClusters replication
89     Bool_t                   fAODIsReplicated;                    // Flag true if replication as been executed
90     AliAODEvent             *fAODEvent;               //! Pointer to the AOD event
91     AliMCEventHandler       *fMCEventH;               //! Pointer to mc event handler needed not to depend on the manager
92     TTree                   *fTreeA;                  //! tree for AOD persistency
93     TFile                   *fFileA;                  //! Output file
94     TString                  fFileName;               //  Output file name
95     ClassDef(AliAODHandler, 3)
96 };
97
98 #endif