+//-------------------------------------------------------------------------
+// Support class for AOD extensions. This is created by the user analysis
+// that requires a separate file for some AOD branches. The name of the
+// AliAODExtension object is the file name where the AOD branches will be
+// stored.
+// Author: Andrei Gheata, CERN
+//-------------------------------------------------------------------------
+
+class AliAODExtension : public TNamed {
+
+public:
+
+enum EAliAODExtensionFlags {
+ kFilteredAOD = BIT(14)
+};
+
+ AliAODExtension() : TNamed(), fAODEvent(0), fTreeE(0), fFileE(0), fNtotal(0), fNpassed(0), fSelected(kFALSE) {}
+ AliAODExtension(const char* name, const char* title, Bool_t isfilter=kFALSE);
+ virtual ~AliAODExtension();
+ void AddBranch(const char* cname, void* addobj);
+ Bool_t FinishEvent();
+ Int_t GetNtotal() const {return fNtotal;}
+ Int_t GetNpassed() const {return fNpassed;}
+ const char* GetOutputFileName() const {return TNamed::GetName();}
+ AliAODEvent* GetAOD() const {return fAODEvent;}
+ TTree* GetTree() const {return fTreeE;}
+ Bool_t Init(Option_t *option);
+ Bool_t IsFilteredAOD() const {return TObject::TestBit(kFilteredAOD);}
+ Bool_t IsEventSelected() const {return fSelected;}
+ void SelectEvent(Bool_t flag=kTRUE) {fSelected = flag;}
+ void SetEvent(AliAODEvent *event);
+ void SetOutputFileName(const char* fname) {TNamed::SetName(fname);}
+ Bool_t TerminateIO();
+ private:
+ AliAODExtension(const AliAODExtension&); // Not implemented
+ AliAODExtension& operator=(const AliAODExtension&); // Not implemented
+
+ private:
+ AliAODEvent *fAODEvent; //! Pointer to the AOD event
+ TTree *fTreeE; //! tree for AOD persistency
+ TFile *fFileE; //! Output file
+ Int_t fNtotal; //! Number of processed events
+ Int_t fNpassed; //! Number of events that passed the filter
+ Bool_t fSelected; //! Select current event for filtered AOD's. Made false at event start.
+ ClassDef(AliAODExtension, 1) // Support for extra AOD branches in a separate AOD file
+};