AliRoot Core  3dc7879 (3dc7879)
AliAODExtension.h
Go to the documentation of this file.
1 #ifndef ALIAODEXTENSION_H
2 #define ALIAODEXTENSION_H
3 
4 /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice */
6 
7 /* $Id$ */
8 
17 
18 #ifndef ROOT_TNamed
19 # include "TNamed.h"
20 #endif
21 
23 class AliAODEvent;
24 class TFile;
25 class TList;
26 class TMap;
27 class TTree;
28 
29 class AliAODExtension : public TNamed {
30 
31 public:
32 
34  kFilteredAOD = BIT(14),
36  kToMerge = BIT(16)
37  };
38 
40  AliAODExtension(const char* name, const char* title, Bool_t isfilter=kFALSE);
41  virtual ~AliAODExtension();
42  void AddBranch(const char* cname, void* addobj);
43  Bool_t FinishEvent();
44  Int_t GetNtotal() const {return fNtotal;}
45  Int_t GetNpassed() const {return fNpassed;}
46  const char* GetOutputFileName() const {return TNamed::GetName();}
47  AliAODEvent* GetAOD() const {return fAODEvent;}
48  TTree* GetTree() const {return fTreeE;}
49  Bool_t Init(Option_t *option);
50  Bool_t IsFilteredAOD() const {return TObject::TestBit(kFilteredAOD);}
51  Bool_t IsEventSelected() const {return fSelected;}
52  Bool_t IsToMerge() const {return TObject::TestBit(kToMerge);}
53  void SelectEvent(Bool_t flag=kTRUE) {fSelected = flag;}
54  void SetEvent(AliAODEvent* event);
55  void SetOutputFileName(const char* fname) {TNamed::SetName(fname);}
56  void SetToMerge(Bool_t flag) {TObject::SetBit(kToMerge,flag);}
57  void SetTreeBuffSize(Long64_t sz=30000000) {fTreeBuffSize = sz;}
58  Bool_t TerminateIO();
59 
60  void Print(Option_t* opt="") const;
61 
62  // Branches not specified in any FilterBranch call will be dropped by default
64 
65  // Branches not specified in any FilterBranch call will be kept by default
66  void KeepUnspecifiedBranches() { TObject::ResetBit(kDropUnspecifiedBranches); }
67 
68  void FilterBranch(const char* branchName, AliAODBranchReplicator* replicator=0x0);
69 
70  /* Use DisableReferences if and only if the output AOD contains no TRef or TRefArray,
71  otherwise the produced AOD won't be valid.
72  */
74 
76 
77  void AddAODtoTreeUserInfo();
78  void FillTree();
79 
80 private:
81  AliAODExtension(const AliAODExtension&); // Not implemented
82  AliAODExtension& operator=(const AliAODExtension&); // Not implemented
83 
84 private:
86  TTree *fTreeE;
87  TFile *fFileE;
88  Int_t fNtotal;
89  Int_t fNpassed;
90  Bool_t fSelected;
91  Long64_t fTreeBuffSize;
92  Long64_t fMemCountAOD;
93 
94  TMap* fRepFiMap;
95  TList* fRepFiList;
96 
98  TList* fObjectList;
99 
100  ClassDef(AliAODExtension, 3) // Support for extra AOD branches in a separate AOD file
101 };
102 
103 #endif
Int_t GetNtotal() const
Bool_t fSelected
! Select current event for filtered AOD's. Made false at event start.
void AddBranch(const char *cname, void *addobj)
void SetEvent(AliAODEvent *event)
TFile * fFileE
! Output file
TList * fObjectList
! internal list of which objects to keep
Bool_t fEnableReferences
whether or not to enable the TRefTable branch
Int_t GetNpassed() const
const char * GetOutputFileName() const
void SelectEvent(Bool_t flag=kTRUE)
AliAODEvent * fAODEvent
! Pointer to the AOD event
Long64_t fMemCountAOD
Number of bytes filled in tree (accumulates until requested bytes reached)
TList * fRepFiList
list of unique filter/replicator
void SetTreeBuffSize(Long64_t sz=30000000)
AliAODEvent * GetAOD() const
void DropUnspecifiedBranches()
Bool_t IsToMerge() const
AliAODExtension & operator=(const AliAODExtension &)
Bool_t IsEventSelected() const
void FilterBranch(const char *branchName, AliAODBranchReplicator *replicator=0x0)
TTree * fTreeE
! tree for AOD persistency
void Print(Option_t *opt="") const
Int_t fNpassed
! Number of events that passed the filter
AOD base class.
Definition: AliAODEvent.h:48
Bool_t IsFilteredAOD() const
TMap * fRepFiMap
which branch(es) to filter out / and or replicate
Bool_t Init(Option_t *option)
Long64_t fTreeBuffSize
Requested buffer size for AOD tree.
void KeepUnspecifiedBranches()
void DisableReferences()
void SetOutputFileName(const char *fname)
void SetToMerge(Bool_t flag)
TTree * GetTree() const
char * fname
Base class of an object used for the replication.
Support class for AOD extensions. This is created by the user analysis.
virtual ~AliAODExtension()
Int_t fNtotal
! Number of processed events