]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliAODHandler.h
Introducing event specie in QA (Yves)
[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 class AliAODMCHeader;
20 class AliGenEventHeader;
21
22
23
24 class AliAODHandler : public AliVEventHandler {
25     
26  public:
27     AliAODHandler();
28     AliAODHandler(const char* name, const char* title);
29     virtual ~AliAODHandler();
30     virtual void         SetOutputFileName(const char* fname);
31     virtual const char*  GetOutputFileName();
32     virtual Bool_t       Init(Option_t* option);
33     virtual Bool_t       Init(TTree* /*tree*/, Option_t* /*option*/)  {return kTRUE;}
34     virtual Bool_t       BeginEvent(Long64_t /*entry*/){return kTRUE;}
35     virtual Bool_t       Notify() { return AliVEventHandler::Notify(); };
36     virtual Bool_t       Notify(const char * /* path */) {return kTRUE;}
37     virtual Bool_t       FinishEvent();
38     virtual Bool_t       Terminate();
39     virtual Bool_t       TerminateIO();
40     //
41     virtual void         SetCreateNonStandardAOD()   {fIsStandard = kFALSE;}
42     virtual void         SetFillAOD(Bool_t b)      {fFillAOD = b;}
43     virtual void         SetNeedsHeaderReplication() {fNeedsHeaderReplication = kTRUE;}
44     virtual void         SetNeedsTracksBranchReplication() {fNeedsTracksBranchReplication = kTRUE;}
45     virtual void         SetNeedsVerticesBranchReplication() {fNeedsVerticesBranchReplication = kTRUE;}
46     virtual void         SetNeedsV0sBranchReplication() {fNeedsV0sBranchReplication = kTRUE;}
47     virtual void         SetNeedsTrackletsBranchReplication() {fNeedsTrackletsBranchReplication = kTRUE;}
48     virtual void         SetNeedsPMDClustersBranchReplication() {fNeedsPMDClustersBranchReplication = kTRUE;}
49     virtual void         SetNeedsJetsBranchReplication() {fNeedsJetsBranchReplication = kTRUE;}
50     virtual void         SetNeedsFMDClustersBranchReplication() {fNeedsFMDClustersBranchReplication = kTRUE;}
51     virtual void         SetNeedsCaloClustersBranchReplication() {fNeedsCaloClustersBranchReplication = kTRUE;}
52     virtual void         SetAODIsReplicated() {fAODIsReplicated = kTRUE;}
53     //
54     AliAODEvent*         GetAOD()  {return fAODEvent;}
55     virtual TTree*       GetTree() const {return fTreeA;}
56     void                 CreateTree(Int_t flag);
57     void                 FillTree();
58     void                 AddAODtoTreeUserInfo();
59     void                 AddBranch(const char* cname, void* addobj);
60     Bool_t               IsStandard() {return fIsStandard;}
61     Bool_t               GetFillAOD(){return fFillAOD;} 
62     Bool_t               NeedsHeaderReplication() {return  fNeedsHeaderReplication;}
63     Bool_t               NeedsTracksBranchReplication() {return  fNeedsTracksBranchReplication;}
64     Bool_t               NeedsVerticesBranchReplication() {return  fNeedsVerticesBranchReplication;}
65     Bool_t               NeedsV0sBranchReplication() {return  fNeedsV0sBranchReplication;}
66     Bool_t               NeedsTrackletsBranchReplication() {return  fNeedsTrackletsBranchReplication;}
67     Bool_t               NeedsPMDClustersBranchReplication() {return  fNeedsPMDClustersBranchReplication;}
68     Bool_t               NeedsJetsBranchReplication() {return  fNeedsJetsBranchReplication;}
69     Bool_t               NeedsFMDClustersBranchReplication() {return  fNeedsFMDClustersBranchReplication;}
70     Bool_t               NeedsCaloClustersBranchReplication() {return  fNeedsCaloClustersBranchReplication;}
71     Bool_t               AODIsReplicated() {return fAODIsReplicated;}
72     //
73     void                 SetInputTree(TTree* /*tree*/) {;}
74     void                 SetMCEventHandler(AliMCEventHandler* mcH) {fMCEventH = mcH;} // For internal use
75  private:
76     void StoreMCParticles();
77     void SetMCHeaderInfo(AliAODMCHeader *mcHeader,AliGenEventHeader *genHeader); // Utility function t catch different types of eventheaders
78     AliAODHandler(const AliAODHandler&);             // Not implemented
79     AliAODHandler& operator=(const AliAODHandler&);  // Not implemented
80  private:
81     Bool_t                   fIsStandard;                         // Flag for standard aod creation
82     Bool_t                   fFillAOD;                          // Flag for filling of the AOD tree at the end (all or nothing)
83     Bool_t                   fNeedsHeaderReplication;             // Flag for header replication
84     Bool_t                   fNeedsTracksBranchReplication;       // Flag for tracks replication
85     Bool_t                   fNeedsVerticesBranchReplication;     // Flag for vertices replication
86     Bool_t                   fNeedsV0sBranchReplication;          // Flag for V0s replication
87     Bool_t                   fNeedsTrackletsBranchReplication;    // Flag for Tracklets replication
88     Bool_t                   fNeedsPMDClustersBranchReplication;  // Flag for PMDClusters replication
89     Bool_t                   fNeedsJetsBranchReplication;         // Flag for Jets replication
90     Bool_t                   fNeedsFMDClustersBranchReplication;  // Flag for FMDClusters replication
91     Bool_t                   fNeedsCaloClustersBranchReplication; // Flag for CaloClusters replication
92     Bool_t                   fAODIsReplicated;                    // Flag true if replication as been executed
93     AliAODEvent             *fAODEvent;               //! Pointer to the AOD event
94     AliMCEventHandler       *fMCEventH;               //! Pointer to mc event handler needed not to depend on the manager
95     TTree                   *fTreeA;                  //! tree for AOD persistency
96     TFile                   *fFileA;                  //! Output file
97     TString                  fFileName;               //  Output file name
98     ClassDef(AliAODHandler, 3)
99 };
100
101 #endif