Adding a reminder for coders
[u/mrichter/AliRoot.git] / ANALYSIS / AliAnalysisTaskCfg.h
... / ...
CommitLineData
1#ifndef ALIANALYSISTASKCFG_H
2#define ALIANALYSISTASKCFG_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6// Author: Andrei Gheata, 12/08/2011
7
8//==============================================================================
9// AliAnalysysTaskCfg - Class embedding the configuration needed to run
10// a given analysis task: libraries to be loaded, location and name of the macro
11// used to add the task to the analysis manager, dependencies.
12//==============================================================================
13
14#ifndef ROOT_TNamed
15#include "TNamed.h"
16#endif
17
18class TMacro;
19class TObjArray;
20
21class AliAnalysisTaskCfg : public TNamed {
22public:
23enum ETaskCfgFlags {
24 kLoaded = BIT(14)
25};
26protected:
27 TString fMacroName; // Full path to AddTask macro
28 TString fMacroArgs; // Arguments to run the macro
29 TString fLibs; // List of custom libs needed to run the task (comma separated)
30 TString fDeps; // List of tasks this module depends on
31 TString fDataTypes; // List of supported data types (ESD, AOD, MC)
32 TMacro *fMacro; // Embedded AddTask macro
33 TMacro *fConfigDeps; // Macro used to configure the dependecies
34 // (utility tasks or input handlers). The data type is passed as argument.
35 TObject *fRAddTask; // Object returned by AddTask method
36public:
37 AliAnalysisTaskCfg();
38 AliAnalysisTaskCfg(const char *name);
39 AliAnalysisTaskCfg(const AliAnalysisTaskCfg &other);
40 virtual ~AliAnalysisTaskCfg();
41
42 // Assignment
43 AliAnalysisTaskCfg& operator=(const AliAnalysisTaskCfg &other);
44
45 // AddTask macro handling
46 const char *GetMacroName() const {return fMacroName;}
47 const char *GetMacroArgs() const {return fMacroArgs;}
48 void SetMacroName(const char *name) {fMacroName = name;}
49 void SetMacroArgs(const char *args) {fMacroArgs = args;}
50 TMacro *OpenMacro(const char *name="");
51 void SetMacro(TMacro *macro);
52 TMacro *GetMacro() const {return fMacro;}
53 Long64_t ExecuteMacro(const char *newargs="");
54
55 // Libraries
56 const char *GetLibs() const {return fLibs;}
57 Int_t GetNlibs() const;
58 const char * GetLibrary(Int_t i) const;
59 Bool_t NeedsLibrary(const char *lib) const;
60 void SetLibraries(const char *libs) {fLibs = libs;}
61
62 // Dependencies
63 const char *GetDeps() const {return fDeps;}
64 Int_t GetNdeps() const;
65 const char * GetDependency(Int_t i) const;
66 Bool_t NeedsDependency(const char *dep) const;
67 void SetDependencies(const char *deps) {fDeps = deps;}
68
69 // Customized macro to handle dependencies
70 TMacro *OpenConfigMacro(const char *name);
71 void SetConfigMacro(TMacro *macro);
72 Long64_t ExecuteConfigMacro();
73 TMacro *GetConfigMacro() const {return fConfigDeps;}
74
75 // Supported data types
76 const char *GetDataTypes() const {return fDataTypes;}
77 Bool_t SupportsData(const char *type) const;
78 void SetDataTypes(const char *types);
79
80 // Extra utilities
81 Bool_t CheckLoadLibraries() const;
82 static const char *DecodeValue(TString &line);
83 TObject *GetRAddTask() const {return fRAddTask;}
84 Bool_t IsLoaded() const {return TObject::TestBit(AliAnalysisTaskCfg::kLoaded);}
85 void Print(Option_t *option="") const;
86 void SaveAs(const char *filename, Option_t *option = "") const;
87 static TObjArray *ExtractModulesFrom(const char *filename);
88
89 ClassDef(AliAnalysisTaskCfg,1) // Class describing how to run a analysis task
90};
91#endif