end-of-line normalization
[u/mrichter/AliRoot.git] / ANALYSIS / AliAnalysisTaskCfg.h
CommitLineData
4579e070 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 {
77f34eae 22public:
23enum ETaskCfgFlags {
24 kLoaded = BIT(14)
25};
4579e070 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)
192ddca2 32 TString fOutputFile; // Desired output file name (via SetCommonFileName)
33 TString fTerminateFile; // Custom output file written in Terminate
4579e070 34 TMacro *fMacro; // Embedded AddTask macro
35 TMacro *fConfigDeps; // Macro used to configure the dependecies
36 // (utility tasks or input handlers). The data type is passed as argument.
15f0154e 37 TObject *fRAddTask; // Object returned by AddTask method
4579e070 38public:
39 AliAnalysisTaskCfg();
40 AliAnalysisTaskCfg(const char *name);
41 AliAnalysisTaskCfg(const AliAnalysisTaskCfg &other);
42 virtual ~AliAnalysisTaskCfg();
43
44 // Assignment
45 AliAnalysisTaskCfg& operator=(const AliAnalysisTaskCfg &other);
46
47 // AddTask macro handling
48 const char *GetMacroName() const {return fMacroName;}
49 const char *GetMacroArgs() const {return fMacroArgs;}
50 void SetMacroName(const char *name) {fMacroName = name;}
51 void SetMacroArgs(const char *args) {fMacroArgs = args;}
52 TMacro *OpenMacro(const char *name="");
53 void SetMacro(TMacro *macro);
54 TMacro *GetMacro() const {return fMacro;}
55 Long64_t ExecuteMacro(const char *newargs="");
56
57 // Libraries
58 const char *GetLibs() const {return fLibs;}
59 Int_t GetNlibs() const;
60 const char * GetLibrary(Int_t i) const;
61 Bool_t NeedsLibrary(const char *lib) const;
62 void SetLibraries(const char *libs) {fLibs = libs;}
63
64 // Dependencies
65 const char *GetDeps() const {return fDeps;}
66 Int_t GetNdeps() const;
67 const char * GetDependency(Int_t i) const;
68 Bool_t NeedsDependency(const char *dep) const;
69 void SetDependencies(const char *deps) {fDeps = deps;}
70
71 // Customized macro to handle dependencies
72 TMacro *OpenConfigMacro(const char *name);
73 void SetConfigMacro(TMacro *macro);
74 Long64_t ExecuteConfigMacro();
75 TMacro *GetConfigMacro() const {return fConfigDeps;}
76
77 // Supported data types
78 const char *GetDataTypes() const {return fDataTypes;}
79 Bool_t SupportsData(const char *type) const;
80 void SetDataTypes(const char *types);
192ddca2 81
82 // Output files
83 const char *GetOutputFileName() const {return fOutputFile;}
84 const char *GetTerminateFileName() const {return fTerminateFile;}
85 void SetOutputFileName(const char *name) {fOutputFile = name;}
86 void SetTerminateFileName(const char *name) {fTerminateFile = name;}
4579e070 87
88 // Extra utilities
89 Bool_t CheckLoadLibraries() const;
90 static const char *DecodeValue(TString &line);
15f0154e 91 TObject *GetRAddTask() const {return fRAddTask;}
21ca8e59 92 Bool_t IsLoaded() const {return TObject::TestBit(AliAnalysisTaskCfg::kLoaded);}
4579e070 93 void Print(Option_t *option="") const;
94 void SaveAs(const char *filename, Option_t *option = "") const;
95 static TObjArray *ExtractModulesFrom(const char *filename);
96
192ddca2 97 ClassDef(AliAnalysisTaskCfg,2) // Class describing how to run a analysis task
4579e070 98};
99#endif