Added support for retrieving and merging dAOD's. The producer task has to call AliAna...
[u/mrichter/AliRoot.git] / ANALYSIS / AliAnalysisManager.h
index 6970cb1..32e3d05 100644 (file)
 
 class TClass;
 class TTree;
+class TFile;
+class AliAnalysisSelector;
 class AliAnalysisDataContainer;
 class AliAnalysisTask;
 class AliVEventHandler;
+class AliVEventPool;
+class AliAnalysisGrid;
 
 
 class AliAnalysisManager : public TNamed {
@@ -37,7 +41,8 @@ enum EAliAnalysisContType {
 enum EAliAnalysisExecMode {
    kLocalAnalysis    = 0,
    kProofAnalysis    = 1,
-   kGridAnalysis     = 2
+   kGridAnalysis     = 2,
+   kMixingAnalysis   = 3
 };
 
 enum EAliAnalysisFlags {
@@ -52,16 +57,17 @@ 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);}
    virtual Bool_t      Process(Long64_t entry);
    virtual Int_t       GetEntry(Long64_t entry, Int_t getall = 0);
+   TFile              *OpenProofFile(const char *name, const char *option);
    void                PackOutput(TList *target);
    void                UnpackOutput(TList *source);
    virtual void        Terminate();
@@ -81,19 +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, 
@@ -130,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
@@ -142,8 +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