Temporary replacement of Form by sprintf to avoid problems on some platforms (alpahli...
[u/mrichter/AliRoot.git] / ANALYSIS / AliAnalysisManager.h
CommitLineData
d3106602 1#ifndef ALIANALYSISMANAGER_H
2#define ALIANALYSISMANAGER_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7// Author: Andrei Gheata, 31/05/2006
8
9//==============================================================================
10// AliAnalysysManager - Manager analysis class. Allows creation of several
11// analysis tasks and data containers storing their input/output. Allows
12// connecting/chaining tasks via shared data containers. Serializes the current
13// event for all tasks depending only on initial input data.
14//==============================================================================
15
16#ifndef ROOT_TSelector
17#include "TSelector.h"
18#endif
19
20class TClass;
21class AliAnalysisDataContainer;
22class AliAnalysisTask;
23
24class AliAnalysisManager : public TSelector {
25
26public:
27
28enum EAliAnalysisContType {
29 kNormalContainer = 0,
30 kInputContainer = 1,
31 kOutputContainer = 2
32};
33 AliAnalysisManager();
d3106602 34 virtual ~AliAnalysisManager();
35
36 // Selector-specific methods
37 virtual void Init(TTree *tree);
38 virtual void Begin(TTree *tree);
39 virtual void SlaveBegin(TTree *tree);
40 virtual Bool_t Process(Long64_t entry);
41 virtual void SlaveTerminate();
42 virtual void Terminate();
43
44 // Getters
45 TObjArray *GetContainers() const {return fContainers;}
46 TObjArray *GetInputs() const {return fInputs;}
47 TObjArray *GetOutputs() const {return fOutputs;}
48 TObjArray *GetTasks() const {return fTasks;}
49 TObjArray *GetTopTasks() const {return fTopTasks;}
50 TObjArray *GetZombieTasks() const {return fZombies;}
51// AliAnalysisInfo *GetStatus() const {return fStatus;}
52
53 // Container handling
54 AliAnalysisDataContainer *CreateContainer(const char *name, TClass *datatype,
55 EAliAnalysisContType type=kNormalContainer);
56
57 // Including tasks and getting them
58 void AddTask(AliAnalysisTask *task);
59 AliAnalysisTask *GetTask(const char *name) const;
60
61 // Connecting data containers to task inputs/outputs
62 Bool_t ConnectInput(AliAnalysisTask *task, Int_t islot,
63 AliAnalysisDataContainer *cont);
64 Bool_t ConnectOutput(AliAnalysisTask *task, Int_t islot,
65 AliAnalysisDataContainer *cont);
66 // Garbage collection
67 void CleanContainers();
68
69 // Analysis initialization and execution, status
70 Bool_t InitAnalysis();
71 Bool_t IsInitialized() const {return fInitOK;}
72 void ResetAnalysis();
73 void ExecAnalysis(Option_t *option="");
74 void FinishAnalysis();
75 void PrintStatus(Option_t *option="all") const;
76
77protected:
78 Bool_t fInitOK; // Initialisation done
79 TObjArray *fContainers; //-> List of all containers
80 TObjArray *fInputs; //-> List of containers with input data
81 TObjArray *fOutputs; //-> List of containers with results
82 TObjArray *fTasks; //-> List of analysis tasks
83 TObjArray *fTopTasks; //-> List of top tasks
84 TObjArray *fZombies; //-> List of zombie tasks
85// AliAnalysisInfo *fStatus; // Analysis info object
86
5daf9fd2 87private:
88 AliAnalysisManager(const AliAnalysisManager& other);
89 AliAnalysisManager& operator=(const AliAnalysisManager& other);
90
91
d3106602 92 ClassDef(AliAnalysisManager,1) // Analysis manager class
93};
94#endif