]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliAODHandler.h
Bug fix in copy constructor and assignement operator (Matthias + me)
[u/mrichter/AliRoot.git] / STEER / AliAODHandler.h
CommitLineData
ec4af4c1 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
f3214a54 13#include "AliVEventHandler.h"
ec4af4c1 14
15class AliAODEvent;
16class TFile;
17class TTree;
9066c676 18class TObjArray;
da97a08a 19class AliMCEventHandler;
dce1b636 20class AliAODMCHeader;
9066c676 21class AliAODExtension;
dce1b636 22class AliGenEventHeader;
ec4af4c1 23
24
25
f3214a54 26class AliAODHandler : public AliVEventHandler {
ec4af4c1 27
28 public:
29 AliAODHandler();
30 AliAODHandler(const char* name, const char* title);
31 virtual ~AliAODHandler();
7970f4ac 32 virtual void SetOutputFileName(const char* fname);
33 virtual const char* GetOutputFileName();
300d5701 34 virtual Bool_t Init(Option_t* option);
35 virtual Bool_t Init(TTree* /*tree*/, Option_t* /*option*/) {return kTRUE;}
da97a08a 36 virtual Bool_t BeginEvent(Long64_t /*entry*/){return kTRUE;}
276be602 37 virtual Bool_t Notify() { return AliVEventHandler::Notify(); };
890126ab 38 virtual Bool_t Notify(const char * /* path */) {return kTRUE;}
5f380da9 39 virtual Bool_t FinishEvent();
ec4af4c1 40 virtual Bool_t Terminate();
41 virtual Bool_t TerminateIO();
ec4af4c1 42 //
7c3a9fbf 43 virtual void SetCreateNonStandardAOD() {fIsStandard = kFALSE;}
da97a08a 44 virtual void SetFillAOD(Bool_t b) {fFillAOD = b;}
3549c522 45 virtual void SetNeedsHeaderReplication() {fNeedsHeaderReplication = kTRUE;}
46 virtual void SetNeedsTracksBranchReplication() {fNeedsTracksBranchReplication = kTRUE;}
47 virtual void SetNeedsVerticesBranchReplication() {fNeedsVerticesBranchReplication = kTRUE;}
48 virtual void SetNeedsV0sBranchReplication() {fNeedsV0sBranchReplication = kTRUE;}
49 virtual void SetNeedsTrackletsBranchReplication() {fNeedsTrackletsBranchReplication = kTRUE;}
50 virtual void SetNeedsPMDClustersBranchReplication() {fNeedsPMDClustersBranchReplication = kTRUE;}
51 virtual void SetNeedsJetsBranchReplication() {fNeedsJetsBranchReplication = kTRUE;}
52 virtual void SetNeedsFMDClustersBranchReplication() {fNeedsFMDClustersBranchReplication = kTRUE;}
75754ba8 53 virtual void SetNeedsCaloClustersBranchReplication() {fNeedsCaloClustersBranchReplication = kTRUE;}
3549c522 54 virtual void SetNeedsMCParticlesBranchReplication() {fNeedsCaloClustersBranchReplication = kTRUE;}
75754ba8 55 virtual void SetAODIsReplicated() {fAODIsReplicated = kTRUE;}
78f7f935 56 //
ec4af4c1 57 AliAODEvent* GetAOD() {return fAODEvent;}
11326411 58 virtual TTree* GetTree() const {return fTreeA;}
9066c676 59 TObjArray* GetExtensions() const {return fExtensions;}
954526ed 60 void CreateTree(Int_t flag);
ec4af4c1 61 void FillTree();
62 void AddAODtoTreeUserInfo();
9066c676 63 void AddBranch(const char* cname, void* addobj, const char *fname="");
64 AliAODExtension* AddExtension(const char *filename, const char *title="");
3549c522 65 Bool_t IsStandard() const {return fIsStandard;}
66 Bool_t GetFillAOD() const {return fFillAOD;}
67 Bool_t NeedsHeaderReplication() const {return fNeedsHeaderReplication;}
68 Bool_t NeedsTracksBranchReplication() const {return fNeedsTracksBranchReplication;}
69 Bool_t NeedsVerticesBranchReplication() const {return fNeedsVerticesBranchReplication;}
70 Bool_t NeedsV0sBranchReplication() const {return fNeedsV0sBranchReplication;}
71 Bool_t NeedsTrackletsBranchReplication() const {return fNeedsTrackletsBranchReplication;}
72 Bool_t NeedsPMDClustersBranchReplication() const {return fNeedsPMDClustersBranchReplication;}
73 Bool_t NeedsJetsBranchReplication() const {return fNeedsJetsBranchReplication;}
74 Bool_t NeedsFMDClustersBranchReplication() const {return fNeedsFMDClustersBranchReplication;}
75 Bool_t NeedsCaloClustersBranchReplication() const {return fNeedsCaloClustersBranchReplication;}
76 Bool_t NeedsMCParticlesBranchReplication() const {return fNeedsMCParticlesBranchReplication;}
77 Bool_t AODIsReplicated() const {return fAODIsReplicated;}
933fd60f 78 //
79 void SetInputTree(TTree* /*tree*/) {;}
da97a08a 80 void SetMCEventHandler(AliMCEventHandler* mcH) {fMCEventH = mcH;} // For internal use
522aca31 81 void StoreMCParticles(); // Store MC particles, only to be called from AliAnalyisTaskMCParticleFilter
82
ec4af4c1 83 private:
dce1b636 84 void SetMCHeaderInfo(AliAODMCHeader *mcHeader,AliGenEventHeader *genHeader); // Utility function t catch different types of eventheaders
ec4af4c1 85 AliAODHandler(const AliAODHandler&); // Not implemented
86 AliAODHandler& operator=(const AliAODHandler&); // Not implemented
87 private:
75754ba8 88 Bool_t fIsStandard; // Flag for standard aod creation
3549c522 89 Bool_t fFillAOD; // Flag for filling of the AOD tree at the end (all or nothing)
75754ba8 90 Bool_t fNeedsHeaderReplication; // Flag for header replication
91 Bool_t fNeedsTracksBranchReplication; // Flag for tracks replication
92 Bool_t fNeedsVerticesBranchReplication; // Flag for vertices replication
93 Bool_t fNeedsV0sBranchReplication; // Flag for V0s replication
94 Bool_t fNeedsTrackletsBranchReplication; // Flag for Tracklets replication
95 Bool_t fNeedsPMDClustersBranchReplication; // Flag for PMDClusters replication
96 Bool_t fNeedsJetsBranchReplication; // Flag for Jets replication
97 Bool_t fNeedsFMDClustersBranchReplication; // Flag for FMDClusters replication
98 Bool_t fNeedsCaloClustersBranchReplication; // Flag for CaloClusters replication
3549c522 99 Bool_t fNeedsMCParticlesBranchReplication; // Flag for MCParticles replication
75754ba8 100 Bool_t fAODIsReplicated; // Flag true if replication as been executed
7c3a9fbf 101 AliAODEvent *fAODEvent; //! Pointer to the AOD event
da97a08a 102 AliMCEventHandler *fMCEventH; //! Pointer to mc event handler needed not to depend on the manager
7c3a9fbf 103 TTree *fTreeA; //! tree for AOD persistency
104 TFile *fFileA; //! Output file
105 TString fFileName; // Output file name
9066c676 106 TObjArray *fExtensions; // List of extensions
107 ClassDef(AliAODHandler, 4)
ec4af4c1 108};
109
9066c676 110//-------------------------------------------------------------------------
111// Support class for AOD extensions. This is created by the user analysis
112// that requires a separate file for some AOD branches. The name of the
113// AliAODExtension object is the file name where the AOD branches will be
114// stored.
115// Author: Andrei Gheata, CERN
116//-------------------------------------------------------------------------
117
118class AliAODExtension : public TNamed {
119
120 public:
121 AliAODExtension() : TNamed(), fAODEvent(0), fTreeE(0), fFileE(0) {;}
122 AliAODExtension(const char* name, const char* title) : TNamed(name,title), fAODEvent(0), fTreeE(0), fFileE(0) {;}
123 virtual ~AliAODExtension();
124 void AddBranch(const char* cname, void* addobj);
125 const char* GetOutputFileName() const {return TNamed::GetName();}
126 AliAODEvent* GetAOD() const {return fAODEvent;}
127 TTree* GetTree() const {return fTreeE;}
128 Bool_t Init(Option_t *option);
129 void SetOutputFileName(const char* fname) {TNamed::SetName(fname);}
130 Bool_t TerminateIO();
131 private:
132 AliAODExtension(const AliAODExtension&); // Not implemented
133 AliAODExtension& operator=(const AliAODExtension&); // Not implemented
134
135 private:
136 AliAODEvent *fAODEvent; //! Pointer to the AOD event
137 TTree *fTreeE; //! tree for AOD persistency
138 TFile *fFileE; //! Output file
139 ClassDef(AliAODExtension, 1) // Support for extra AOD branches in a separate AOD file
140};
ec4af4c1 141#endif