Added getters for most data members of AliAnalysisalien
[u/mrichter/AliRoot.git] / ANALYSIS / AliAnalysisGrid.h
CommitLineData
c57f56b7 1#ifndef ALIANALYSISGRID_H
2#define ALIANALYSISGRID_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6// Author: Mihaela Gheata, 01/09/2008
7
8//==============================================================================
9// AliAnalysisGrid - Base grid utility class. Provides interface for creating
10// a personalized JDL, finding and creating a dataset.
11//==============================================================================
12
13#ifndef ROOT_TNamed
14#include <TNamed.h>
15#endif
16
3bdcb562 17class TChain;
18
c57f56b7 19class AliAnalysisGrid : public TNamed {
20
21public:
22
23enum EPluginRunMode {
24 kFull = 0,
25 kTest = BIT(14),
26 kOffline = BIT(15),
27 kSubmit = BIT(16),
28 kMerge = BIT(17),
29 kUseTags = BIT(18),
30 kUseESD = BIT(19),
31 kUseAOD = BIT(20),
4e5c5506 32 kUseMC = BIT(21),
bb885a9e 33 kUsePars = BIT(22),
a3e84053 34 kDefaultOutputs = BIT(23)
c57f56b7 35};
348be253 36enum EPluginBits {
37 kBitMask32 = 0xffffffff,
38 kUseCopy = BIT(0),
149d288c 39 kCheckCopy = BIT(1),
3bdcb562 40 kKeepLogs = BIT(2),
41 kClearPackages = BIT(3),
27734f0e 42 kUseSubmitPolicy = BIT(4),
d3b18c4c 43 kProofConnectGrid = BIT(5),
c85cfc0f 44 kOneStageMerging = BIT(6),
21ca8e59 45 kUseMCchain = BIT(7),
d87f72d5 46 kLocalTest = BIT(8),
47 kMergeAOD = BIT(9)
348be253 48};
c57f56b7 49
348be253 50 AliAnalysisGrid() : TNamed(), fSpecialBits(0) {}
51 AliAnalysisGrid(const char *name) : TNamed(name,""), fSpecialBits(0) {}
c57f56b7 52 virtual ~AliAnalysisGrid() {}
53 AliAnalysisGrid(const AliAnalysisGrid& other);
54 AliAnalysisGrid& operator=(const AliAnalysisGrid& other);
55// Getters
56 virtual EPluginRunMode GetRunMode() const;
57// Setters
37d21c01 58 virtual void AddAdditionalLibrary(const char *name) = 0;
f965131e 59 virtual void AddIncludePath(const char *path) = 0;
c57f56b7 60 virtual void AddRunNumber(Int_t run) = 0;
ee75cfc3 61 virtual void AddRunNumber(const char *run) = 0;
c57f56b7 62 virtual void AddDataFile(const char *lfn) = 0;
fe2d7fc2 63 virtual Bool_t IsSingleOutput() const = 0;
c57f56b7 64 virtual void SetExecutable(const char *name="analysis.sh") = 0;
65 virtual void SetArguments(const char *name="") = 0;
66 virtual void SetAnalysisMacro(const char *name="myAnalysis.C") = 0;
67 virtual void SetAnalysisSource(const char *name="myAnalysisClass.cxx") = 0;
d3b18c4c 68 virtual void SetValidationScript(const char *name="validation.sh") = 0;
c57f56b7 69 virtual void SetAdditionalLibs(const char *list) = 0;
70 virtual void SetPrice(Int_t price=1) = 0;
c6cb3634 71 virtual void SetJobTag(const char *tag="") = 0;
c57f56b7 72 virtual void SetSplitMode(const char *type="se") = 0;
73 virtual void SetSplitMaxInputFileNumber(Int_t nfiles=100) = 0;
74 virtual void SetAPIVersion(const char *version) = 0;
75 virtual void SetROOTVersion(const char *version) = 0;
76 virtual void SetAliROOTVersion(const char *version) = 0;
77 virtual void SetUser(const char *user) = 0;
78 virtual void SetTTL(Int_t ttl=30000) = 0;
79 virtual void SetGridWorkingDir(const char *name="workdir") = 0;
80 virtual void SetGridDataDir(const char *name) = 0;
81 virtual void SetDataPattern(const char *pattern) = 0;
bb885a9e 82 virtual void SetDefaultOutputs(Bool_t flag=kTRUE) = 0;
c57f56b7 83 virtual void SetGridOutputDir(const char *name="output") = 0;
149d288c 84 virtual void SetOutputArchive(const char *list="log_archive.zip:std*@disk=1 root_archive.zip:*.root@disk=2") = 0;
c57f56b7 85 virtual void SetOutputFiles(const char *list) = 0;
86 virtual void SetInputFormat(const char *format="xml-single") = 0;
87 virtual void SetMaxInitFailed(Int_t nfail=5) = 0;
d3b18c4c 88 virtual void SetTerminateFiles(const char *list) = 0;
bb885a9e 89 virtual void SetMergeExcludes(const char *list) = 0;
0f389141 90 virtual void SetMergeViaJDL(Bool_t on=kTRUE) = 0;
c57f56b7 91 virtual void SetMasterResubmitThreshold(Int_t percentage) = 0;
bb885a9e 92 virtual void SetNtestFiles(Int_t nfiles) = 0;
c57f56b7 93 virtual void SetJDLName(const char *name="analysis.jdl") = 0;
0f389141 94 virtual void SetProductionMode(Int_t mode=1) = 0;
37d21c01 95 virtual void SetRegisterExcludes(const char *list) = 0;
0f389141 96 virtual void SetRunPrefix(const char *prefix) = 0;
97 virtual void SetOutputSingleFolder(const char *folder) = 0;
98 virtual void SetFastReadOption(Bool_t on=kTRUE) = 0;
99 virtual void SetOverwriteMode(Bool_t on=kTRUE) = 0;
c57f56b7 100
101 // Set run mode. Can be "full", "test", "offline", "submit" or "merge"
102 virtual void SetRunMode(const char *mode="full");
103//Utilities
104 static Bool_t CreateToken(const char *username=0);
105 virtual Bool_t CreateDataset(const char *pattern) = 0;
106 virtual Bool_t CreateJDL() = 0;
4e5c5506 107 virtual void EnablePackage(const char *package) = 0;
c57f56b7 108 virtual Bool_t MergeOutputs() = 0;
5513444a 109 virtual Bool_t StartAnalysis(Long64_t nentries=123456789, Long64_t firstentry=0) = 0;
c57f56b7 110 virtual void WriteAnalysisFile() = 0;
111 virtual void WriteAnalysisMacro() = 0;
112 virtual void WriteExecutable() = 0;
0f389141 113 virtual void WriteValidationScript(Bool_t merge=kFALSE) = 0;
c57f56b7 114
348be253 115// Flags
116 Bool_t IsUseCopy() const {return TestSpecialBit(kUseCopy);}
117 void SetUseCopy(Bool_t flag=kTRUE) {SetSpecialBit(kUseCopy,flag);}
118 Bool_t IsCheckCopy() const {return TestSpecialBit(kCheckCopy);}
119 void SetCheckCopy(Bool_t flag=kTRUE) {SetSpecialBit(kCheckCopy,flag);}
149d288c 120 Bool_t IsKeepLogs() const {return TestSpecialBit(kKeepLogs);}
121 void SetKeepLogs(Bool_t flag=kTRUE) {SetSpecialBit(kKeepLogs,flag);}
3bdcb562 122 Bool_t IsUseSubmitPolicy() const {return TestSpecialBit(kUseSubmitPolicy);}
123 void SetUseSubmitPolicy(Bool_t flag=kTRUE) {SetSpecialBit(kUseSubmitPolicy,flag);}
d3b18c4c 124 Bool_t IsOneStageMerging() const {return TestSpecialBit(kOneStageMerging);}
125 void SetOneStageMerging(Bool_t flag) {SetSpecialBit(kOneStageMerging,flag);}
c85cfc0f 126 Bool_t IsUseMCchain() const {return TestSpecialBit(kUseMCchain);}
127 void SetUseMCchain(Bool_t flag=kTRUE) {SetSpecialBit(kUseMCchain,flag);}
21ca8e59 128 Bool_t IsLocalTest() const {return TestSpecialBit(kLocalTest);}
129 void SetLocalTest(Bool_t flag=kTRUE) {SetSpecialBit(kLocalTest,flag);}
d87f72d5 130 Bool_t IsMergeAOD() const {return TestSpecialBit(kMergeAOD);}
131 virtual void SetMergeAOD(Bool_t flag=kTRUE) {SetSpecialBit(kMergeAOD,flag);}
3bdcb562 132
133// PROOF mode
134 virtual void SetProofCluster(const char *cluster) = 0;
135 virtual void SetProofDataSet(const char *dataset) = 0;
136 virtual const char *GetProofDataSet() const = 0;
137 virtual void SetProofReset(Int_t mode) = 0;
138 virtual void SetClearPackages(Bool_t flag=kTRUE) {SetSpecialBit(kClearPackages,flag);}
27734f0e 139 virtual void SetProofConnectGrid(Bool_t flag=kTRUE) {SetSpecialBit(kProofConnectGrid,flag);}
3bdcb562 140 virtual void SetNproofWorkers(Int_t nworkers) = 0;
27734f0e 141 virtual void SetNproofWorkersPerSlave(Int_t nworkers) = 0;
3bdcb562 142 virtual void SetRootVersionForProof(const char *version) = 0;
143 virtual void SetAliRootMode(const char *mode) = 0;
d88e4159 144 virtual void SetProofProcessOpt(const char *proofOpt="") = 0;
145 virtual TString GetProofProcessOpt() = 0;
3bdcb562 146 // .txt file containing the list of files to be chained in test mode
147 virtual void SetFileForTestMode(const char *filename) = 0;
148 virtual TChain *GetChainForTestMode(const char *treeName) const = 0;
348be253 149
c57f56b7 150protected:
348be253 151// Methods
c57f56b7 152 virtual Bool_t Connect() = 0;
348be253 153 virtual void SetDefaults() = 0;
154 void SetSpecialBit(UInt_t f) { fSpecialBits |= f & kBitMask32; }
155 void ResetSpecialBit(UInt_t f) { fSpecialBits &= ~(f & kBitMask32); }
156 void SetSpecialBit(UInt_t f, Bool_t set) {(set)?SetSpecialBit(f):ResetSpecialBit(f);}
157 Bool_t TestSpecialBit(UInt_t f) const { return (Bool_t) ((fSpecialBits & f) != 0); }
158 Int_t TestSpecialBits(UInt_t f) const { return (Int_t) (fSpecialBits & f); }
159 void InvertSpecialBit(UInt_t f) { fSpecialBits ^= f & kBitMask32; }
160
161protected:
162 UInt_t fSpecialBits; // special bits
163
164
165 ClassDef(AliAnalysisGrid, 2) // Base class for GRID utilities
c57f56b7 166};
167#endif