]>
Commit | Line | Data |
---|---|---|
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" |
d815d7c4 | 14 | #include "AliAODExtension.h" |
ec4af4c1 | 15 | |
16 | class AliAODEvent; | |
17 | class TFile; | |
18 | class TTree; | |
9066c676 | 19 | class TObjArray; |
da97a08a | 20 | class AliMCEventHandler; |
dce1b636 | 21 | class AliAODMCHeader; |
22 | class AliGenEventHeader; | |
26ba01d4 | 23 | class TMap; |
24 | class AliAnalysisFilter; | |
ec4af4c1 | 25 | |
f3214a54 | 26 | class 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); |
fdbaa4ce | 33 | virtual const char* GetOutputFileName() const; |
90d50a8c | 34 | // Extra outputs as a string separated by commas |
35 | virtual const char* GetExtraOutputs() const; | |
300d5701 | 36 | virtual Bool_t Init(Option_t* option); |
37 | virtual Bool_t Init(TTree* /*tree*/, Option_t* /*option*/) {return kTRUE;} | |
0d6a82a5 | 38 | virtual Bool_t GetEntry() {return kTRUE;} |
39 | ||
307b6330 | 40 | virtual Bool_t BeginEvent(Long64_t /*entry*/) {fFillAOD=kFALSE; fFillExtension=kFALSE; return kTRUE;} |
276be602 | 41 | virtual Bool_t Notify() { return AliVEventHandler::Notify(); }; |
890126ab | 42 | virtual Bool_t Notify(const char * /* path */) {return kTRUE;} |
5f380da9 | 43 | virtual Bool_t FinishEvent(); |
ec4af4c1 | 44 | virtual Bool_t Terminate(); |
45 | virtual Bool_t TerminateIO(); | |
ec4af4c1 | 46 | // |
59e0dcd5 | 47 | virtual void SetCreateNonStandardAOD() {Changed(); fIsStandard = kFALSE;} |
48 | virtual void SetFillAOD(Bool_t b) {Changed(); fFillAOD = b;} | |
49 | virtual void SetFillExtension(Bool_t b) {Changed(); fFillExtension = b;} | |
50 | virtual void SetFillAODforRun(Bool_t b) {Changed(); fFillAODRun = b;} | |
3549c522 | 51 | virtual void SetNeedsHeaderReplication() {fNeedsHeaderReplication = kTRUE;} |
2981307f | 52 | virtual void SetNeedsTOFHeaderReplication() {fNeedsTOFHeaderReplication = kTRUE;} |
53 | virtual void SetNeedsVZEROReplication() {fNeedsVZEROReplication = kTRUE;} | |
3549c522 | 54 | virtual void SetNeedsTracksBranchReplication() {fNeedsTracksBranchReplication = kTRUE;} |
55 | virtual void SetNeedsVerticesBranchReplication() {fNeedsVerticesBranchReplication = kTRUE;} | |
56 | virtual void SetNeedsV0sBranchReplication() {fNeedsV0sBranchReplication = kTRUE;} | |
e0107012 | 57 | virtual void SetNeedsCascadesBranchReplication() {fNeedsCascadesBranchReplication = kTRUE;} |
3549c522 | 58 | virtual void SetNeedsTrackletsBranchReplication() {fNeedsTrackletsBranchReplication = kTRUE;} |
59 | virtual void SetNeedsPMDClustersBranchReplication() {fNeedsPMDClustersBranchReplication = kTRUE;} | |
60 | virtual void SetNeedsJetsBranchReplication() {fNeedsJetsBranchReplication = kTRUE;} | |
61 | virtual void SetNeedsFMDClustersBranchReplication() {fNeedsFMDClustersBranchReplication = kTRUE;} | |
75754ba8 | 62 | virtual void SetNeedsCaloClustersBranchReplication() {fNeedsCaloClustersBranchReplication = kTRUE;} |
720f7306 | 63 | virtual void SetNeedsCaloTriggerBranchReplication() {fNeedsCaloTriggerBranchReplication = kTRUE;} |
fa8b0e56 | 64 | virtual void SetNeedsMCParticlesBranchReplication() {fNeedsMCParticlesBranchReplication = kTRUE;} |
866d8d78 | 65 | virtual void SetNeedsDimuonsBranchReplication() {fNeedsDimuonsBranchReplication = kTRUE;} |
fc05a533 | 66 | virtual void SetNeedsHMPIDBranchReplication() {fNeedsHMPIDBranchReplication = kTRUE;} |
59e0dcd5 | 67 | virtual void SetAODIsReplicated() {Changed(); fAODIsReplicated = kTRUE;} |
68 | virtual void SetAODExtensionMode() {Changed(); fIsStandard=kFALSE; fFillAOD=kFALSE; fFillAODRun=kFALSE; fFillExtension=kTRUE;} | |
78f7f935 | 69 | // |
ec4af4c1 | 70 | AliAODEvent* GetAOD() {return fAODEvent;} |
11326411 | 71 | virtual TTree* GetTree() const {return fTreeA;} |
9066c676 | 72 | TObjArray* GetExtensions() const {return fExtensions;} |
582cfeb5 | 73 | AliAODExtension* GetExtension(const char *filename) const; |
74 | TObjArray* GetFilters() const {return fFilters;} | |
75 | AliAODExtension* GetFilteredAOD(const char *filename) const; | |
954526ed | 76 | void CreateTree(Int_t flag); |
ec4af4c1 | 77 | void FillTree(); |
78 | void AddAODtoTreeUserInfo(); | |
9066c676 | 79 | void AddBranch(const char* cname, void* addobj, const char *fname=""); |
14d6fad5 | 80 | |
9066c676 | 81 | AliAODExtension* AddExtension(const char *filename, const char *title=""); |
582cfeb5 | 82 | AliAODExtension* AddFilteredAOD(const char *filename, const char *filtername); |
14d6fad5 | 83 | // AliAODExtension* FindExtensionContainingBranch(const char* bname) const; |
3549c522 | 84 | Bool_t IsStandard() const {return fIsStandard;} |
85 | Bool_t GetFillAOD() const {return fFillAOD;} | |
86 | Bool_t NeedsHeaderReplication() const {return fNeedsHeaderReplication;} | |
2981307f | 87 | Bool_t NeedsTOFHeaderReplication() const {return fNeedsTOFHeaderReplication;} |
88 | Bool_t NeedsVZEROReplication() const {return fNeedsVZEROReplication;} | |
3549c522 | 89 | Bool_t NeedsTracksBranchReplication() const {return fNeedsTracksBranchReplication;} |
90 | Bool_t NeedsVerticesBranchReplication() const {return fNeedsVerticesBranchReplication;} | |
91 | Bool_t NeedsV0sBranchReplication() const {return fNeedsV0sBranchReplication;} | |
e0107012 | 92 | Bool_t NeedsCascadesBranchReplication() const {return fNeedsCascadesBranchReplication;} |
3549c522 | 93 | Bool_t NeedsTrackletsBranchReplication() const {return fNeedsTrackletsBranchReplication;} |
94 | Bool_t NeedsPMDClustersBranchReplication() const {return fNeedsPMDClustersBranchReplication;} | |
95 | Bool_t NeedsJetsBranchReplication() const {return fNeedsJetsBranchReplication;} | |
96 | Bool_t NeedsFMDClustersBranchReplication() const {return fNeedsFMDClustersBranchReplication;} | |
97 | Bool_t NeedsCaloClustersBranchReplication() const {return fNeedsCaloClustersBranchReplication;} | |
720f7306 | 98 | Bool_t NeedsCaloTriggerBranchReplication() const {return fNeedsCaloTriggerBranchReplication;} |
3549c522 | 99 | Bool_t NeedsMCParticlesBranchReplication() const {return fNeedsMCParticlesBranchReplication;} |
866d8d78 | 100 | Bool_t NeedsDimuonsBranchReplication() const {return fNeedsDimuonsBranchReplication;} |
fc05a533 | 101 | Bool_t NeedsHMPIDBranchReplication() const {return fNeedsHMPIDBranchReplication;} |
3549c522 | 102 | Bool_t AODIsReplicated() const {return fAODIsReplicated;} |
933fd60f | 103 | // |
104 | void SetInputTree(TTree* /*tree*/) {;} | |
da97a08a | 105 | void SetMCEventHandler(AliMCEventHandler* mcH) {fMCEventH = mcH;} // For internal use |
522aca31 | 106 | void StoreMCParticles(); // Store MC particles, only to be called from AliAnalyisTaskMCParticleFilter |
107 | ||
14d6fad5 | 108 | Bool_t HasExtensions() const; |
109 | ||
26ba01d4 | 110 | void Print(Option_t* opt="") const; |
111 | ||
ec4af4c1 | 112 | private: |
14d6fad5 | 113 | void SetMCHeaderInfo(AliAODMCHeader *mcHeader,AliGenEventHeader *genHeader); // Utility function t catch different types of eventheaders |
114 | AliAODHandler(const AliAODHandler&); // Not implemented | |
115 | AliAODHandler& operator=(const AliAODHandler&); // Not implemented | |
b5b9155e | 116 | void PrintExtensions(const TObjArray& array) const; |
14d6fad5 | 117 | |
ec4af4c1 | 118 | private: |
75754ba8 | 119 | Bool_t fIsStandard; // Flag for standard aod creation |
41b01ae4 | 120 | Bool_t fFillAOD; // Flag for filling of the AOD tree at the end (all or nothing evt by evt) |
121 | Bool_t fFillAODRun; // Flag for filling of the AOD tree at the end (run) | |
ca2834f6 | 122 | Bool_t fFillExtension; // Flag for filling or the delta AOD tree at the end |
75754ba8 | 123 | Bool_t fNeedsHeaderReplication; // Flag for header replication |
2981307f | 124 | Bool_t fNeedsTOFHeaderReplication; // Flag for header replication |
125 | Bool_t fNeedsVZEROReplication; // Flag for header replication | |
75754ba8 | 126 | Bool_t fNeedsTracksBranchReplication; // Flag for tracks replication |
127 | Bool_t fNeedsVerticesBranchReplication; // Flag for vertices replication | |
128 | Bool_t fNeedsV0sBranchReplication; // Flag for V0s replication | |
e0107012 | 129 | Bool_t fNeedsCascadesBranchReplication; // Flag for Cascade replication |
75754ba8 | 130 | Bool_t fNeedsTrackletsBranchReplication; // Flag for Tracklets replication |
131 | Bool_t fNeedsPMDClustersBranchReplication; // Flag for PMDClusters replication | |
132 | Bool_t fNeedsJetsBranchReplication; // Flag for Jets replication | |
133 | Bool_t fNeedsFMDClustersBranchReplication; // Flag for FMDClusters replication | |
134 | Bool_t fNeedsCaloClustersBranchReplication; // Flag for CaloClusters replication | |
720f7306 | 135 | Bool_t fNeedsCaloTriggerBranchReplication; // Flag for Calo Trigger replication |
3549c522 | 136 | Bool_t fNeedsMCParticlesBranchReplication; // Flag for MCParticles replication |
866d8d78 | 137 | Bool_t fNeedsDimuonsBranchReplication; // Flag for Dimuons replication |
fc05a533 | 138 | Bool_t fNeedsHMPIDBranchReplication; // Flag for HMPID replication |
75754ba8 | 139 | Bool_t fAODIsReplicated; // Flag true if replication as been executed |
7c3a9fbf | 140 | AliAODEvent *fAODEvent; //! Pointer to the AOD event |
da97a08a | 141 | AliMCEventHandler *fMCEventH; //! Pointer to mc event handler needed not to depend on the manager |
7c3a9fbf | 142 | TTree *fTreeA; //! tree for AOD persistency |
143 | TFile *fFileA; //! Output file | |
144 | TString fFileName; // Output file name | |
9066c676 | 145 | TObjArray *fExtensions; // List of extensions |
e0107012 | 146 | TObjArray *fFilters; // List of filtered AOD's |
582cfeb5 | 147 | |
ca2834f6 | 148 | ClassDef(AliAODHandler, 7) |
582cfeb5 | 149 | }; |
26ba01d4 | 150 | |
ec4af4c1 | 151 | #endif |