Added support for retrieving and merging dAOD's. The producer task has to call AliAna...
[u/mrichter/AliRoot.git] / ANALYSIS / AliAnalysisManager.h
index 5cb07f9..32e3d05 100644 (file)
@@ -24,6 +24,8 @@ class AliAnalysisSelector;
 class AliAnalysisDataContainer;
 class AliAnalysisTask;
 class AliVEventHandler;
+class AliVEventPool;
+class AliAnalysisGrid;
 
 
 class AliAnalysisManager : public TNamed {
@@ -39,7 +41,8 @@ enum EAliAnalysisContType {
 enum EAliAnalysisExecMode {
    kLocalAnalysis    = 0,
    kProofAnalysis    = 1,
-   kGridAnalysis     = 2
+   kGridAnalysis     = 2,
+   kMixingAnalysis   = 3
 };
 
 enum EAliAnalysisFlags {
@@ -54,11 +57,11 @@ enum EAliAnalysisFlags {
    AliAnalysisManager(const AliAnalysisManager& other);
    AliAnalysisManager& operator=(const AliAnalysisManager& other);
    
-   // Management
+   // Management methods called by the framework
    void                StartAnalysis(const char *type="local", TTree *tree=0, Long64_t nentries=1234567890, Long64_t firstentry=0);
    void                StartAnalysis(const char *type, const char *dataset, Long64_t nentries=1234567890, Long64_t firstentry=0);
 
-   virtual void        Init(TTree *tree);   
+   virtual Bool_t      Init(TTree *tree);   
    virtual Bool_t      Notify();
    virtual void        SlaveBegin(TTree *tree);
    virtual Bool_t      ProcessCut(Long64_t entry) {return Process(entry);}
@@ -84,20 +87,29 @@ enum EAliAnalysisFlags {
                        GetAnalysisType() const {return fMode;}
    Bool_t              IsUsingDataSet() const  {return TObject::TestBit(kUseDataSet);}
 
+   void                RegisterExtraFile(const char *fname);
    void                SetAnalysisType(EAliAnalysisExecMode mode) {fMode = mode;}
    void                SetCurrentEntry(Long64_t entry) {fCurrentEntry = entry;}
    void                SetDebugLevel(UInt_t level) {fDebug = level;}
    void                SetSpecialOutputLocation(const char *location) {fSpecialOutputLocation = location;}
    void                SetDisableBranches(Bool_t disable=kTRUE) {TObject::SetBit(kDisableBranches,disable);}
    void                SetCollectSysInfoEach(Int_t nevents=0) {fNSysInfo = nevents;}
-   void                SetInputEventHandler(AliVEventHandler*  handler)  {fInputEventHandler   = handler;}
-   void                SetOutputEventHandler(AliVEventHandler*  handler) {fOutputEventHandler  = handler;}
+   void                SetInputEventHandler(AliVEventHandler*  handler);
+   void                SetOutputEventHandler(AliVEventHandler*  handler);
    void                SetMCtruthEventHandler(AliVEventHandler* handler) {fMCtruthEventHandler = handler;}
+   void                SetGridHandler(AliAnalysisGrid *handler) {fGridHandler = handler;}
+   void                SetEventPool(AliVEventPool* epool) {fEventPool = epool;}
    void                SetNSysInfo(Long64_t nevents) {fNSysInfo = nevents;}
    void                SetSelector(AliAnalysisSelector *sel) {fSelector = sel;}
    AliVEventHandler*   GetInputEventHandler()   {return fInputEventHandler;}
    AliVEventHandler*   GetOutputEventHandler()  {return fOutputEventHandler;}
    AliVEventHandler*   GetMCtruthEventHandler() {return fMCtruthEventHandler;}
+   AliAnalysisDataContainer *GetCommonInputContainer() {return fCommonInput;}
+   AliAnalysisDataContainer *GetCommonOutputContainer() {return fCommonOutput;}
+   AliAnalysisGrid*    GetGridHandler()         {return fGridHandler;}
+   AliVEventPool*      GetEventPool()           {return fEventPool;}
+   Bool_t              GetFileFromWrapper(const char *filename, TList *source);
+   TString             GetExtraFiles() const {return fExtraFiles;}
 
    // Container handling
    AliAnalysisDataContainer *CreateContainer(const char *name, TClass *datatype, 
@@ -134,6 +146,7 @@ private:
    AliVEventHandler       *fInputEventHandler;   //  Optional common input  event handler
    AliVEventHandler       *fOutputEventHandler;  //  Optional common output event handler
    AliVEventHandler       *fMCtruthEventHandler; //  Optional common MC Truth event handler
+   AliVEventPool          *fEventPool;           //  Event pool for mixing analysis
    Long64_t                fCurrentEntry;        //! Current processed entry in the tree
    Long64_t                fNSysInfo;            // Event frequency for collecting system information
    EAliAnalysisExecMode    fMode;                // Execution mode
@@ -146,9 +159,13 @@ private:
    TObjArray              *fContainers;          // List of all containers
    TObjArray              *fInputs;              // List of containers with input data
    TObjArray              *fOutputs;             // List of containers with results
+   AliAnalysisDataContainer *fCommonInput;       // Common input container
+   AliAnalysisDataContainer *fCommonOutput;      // Common output container
    AliAnalysisSelector    *fSelector;            //! Current selector
+   AliAnalysisGrid        *fGridHandler;         //! Grid handler plugin
+   TString                 fExtraFiles;          //! List of extra files to be merged
 
    static AliAnalysisManager *fgAnalysisManager; //! static pointer to object instance
-   ClassDef(AliAnalysisManager,3)  // Analysis manager class
+   ClassDef(AliAnalysisManager,4)  // Analysis manager class
 };   
 #endif