AliCollisionNormalization:
[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
17class AliAnalysisGrid : public TNamed {
18
19public:
20
21enum EPluginRunMode {
22 kFull = 0,
23 kTest = BIT(14),
24 kOffline = BIT(15),
25 kSubmit = BIT(16),
26 kMerge = BIT(17),
27 kUseTags = BIT(18),
28 kUseESD = BIT(19),
29 kUseAOD = BIT(20),
4e5c5506 30 kUseMC = BIT(21),
bb885a9e 31 kUsePars = BIT(22),
a3e84053 32 kDefaultOutputs = BIT(23)
c57f56b7 33};
348be253 34enum EPluginBits {
35 kBitMask32 = 0xffffffff,
36 kUseCopy = BIT(0),
37 kCheckCopy = BIT(1)
38};
c57f56b7 39
348be253 40 AliAnalysisGrid() : TNamed(), fSpecialBits(0) {}
41 AliAnalysisGrid(const char *name) : TNamed(name,""), fSpecialBits(0) {}
c57f56b7 42 virtual ~AliAnalysisGrid() {}
43 AliAnalysisGrid(const AliAnalysisGrid& other);
44 AliAnalysisGrid& operator=(const AliAnalysisGrid& other);
45// Getters
46 virtual EPluginRunMode GetRunMode() const;
47// Setters
f965131e 48 virtual void AddIncludePath(const char *path) = 0;
c57f56b7 49 virtual void AddRunNumber(Int_t run) = 0;
ee75cfc3 50 virtual void AddRunNumber(const char *run) = 0;
c57f56b7 51 virtual void AddDataFile(const char *lfn) = 0;
fe2d7fc2 52 virtual Bool_t IsSingleOutput() const = 0;
c57f56b7 53 virtual void SetExecutable(const char *name="analysis.sh") = 0;
54 virtual void SetArguments(const char *name="") = 0;
55 virtual void SetAnalysisMacro(const char *name="myAnalysis.C") = 0;
56 virtual void SetAnalysisSource(const char *name="myAnalysisClass.cxx") = 0;
57 virtual void SetAdditionalLibs(const char *list) = 0;
58 virtual void SetPrice(Int_t price=1) = 0;
c6cb3634 59 virtual void SetJobTag(const char *tag="") = 0;
c57f56b7 60 virtual void SetSplitMode(const char *type="se") = 0;
61 virtual void SetSplitMaxInputFileNumber(Int_t nfiles=100) = 0;
62 virtual void SetAPIVersion(const char *version) = 0;
63 virtual void SetROOTVersion(const char *version) = 0;
64 virtual void SetAliROOTVersion(const char *version) = 0;
65 virtual void SetUser(const char *user) = 0;
66 virtual void SetTTL(Int_t ttl=30000) = 0;
67 virtual void SetGridWorkingDir(const char *name="workdir") = 0;
68 virtual void SetGridDataDir(const char *name) = 0;
69 virtual void SetDataPattern(const char *pattern) = 0;
bb885a9e 70 virtual void SetDefaultOutputs(Bool_t flag=kTRUE) = 0;
c57f56b7 71 virtual void SetGridOutputDir(const char *name="output") = 0;
72 virtual void SetOutputArchive(const char *list="log_archive.zip:stdout,stderr root_archive.zip:*.root") = 0;
73 virtual void SetOutputFiles(const char *list) = 0;
74 virtual void SetInputFormat(const char *format="xml-single") = 0;
75 virtual void SetMaxInitFailed(Int_t nfail=5) = 0;
bb885a9e 76 virtual void SetMergeExcludes(const char *list) = 0;
0f389141 77 virtual void SetMergeViaJDL(Bool_t on=kTRUE) = 0;
c57f56b7 78 virtual void SetMasterResubmitThreshold(Int_t percentage) = 0;
bb885a9e 79 virtual void SetNtestFiles(Int_t nfiles) = 0;
c57f56b7 80 virtual void SetJDLName(const char *name="analysis.jdl") = 0;
43da816a 81 virtual void SetPreferedSE(const char *se) = 0;
0f389141 82 virtual void SetProductionMode(Int_t mode=1) = 0;
83 virtual void SetRunPrefix(const char *prefix) = 0;
84 virtual void SetOutputSingleFolder(const char *folder) = 0;
85 virtual void SetFastReadOption(Bool_t on=kTRUE) = 0;
86 virtual void SetOverwriteMode(Bool_t on=kTRUE) = 0;
c57f56b7 87
88 // Set run mode. Can be "full", "test", "offline", "submit" or "merge"
89 virtual void SetRunMode(const char *mode="full");
90//Utilities
91 static Bool_t CreateToken(const char *username=0);
92 virtual Bool_t CreateDataset(const char *pattern) = 0;
93 virtual Bool_t CreateJDL() = 0;
4e5c5506 94 virtual void EnablePackage(const char *package) = 0;
c57f56b7 95 virtual Bool_t MergeOutputs() = 0;
5513444a 96 virtual Bool_t StartAnalysis(Long64_t nentries=123456789, Long64_t firstentry=0) = 0;
c57f56b7 97 virtual void WriteAnalysisFile() = 0;
98 virtual void WriteAnalysisMacro() = 0;
99 virtual void WriteExecutable() = 0;
0f389141 100 virtual void WriteValidationScript(Bool_t merge=kFALSE) = 0;
c57f56b7 101
348be253 102// Flags
103 Bool_t IsUseCopy() const {return TestSpecialBit(kUseCopy);}
104 void SetUseCopy(Bool_t flag=kTRUE) {SetSpecialBit(kUseCopy,flag);}
105 Bool_t IsCheckCopy() const {return TestSpecialBit(kCheckCopy);}
106 void SetCheckCopy(Bool_t flag=kTRUE) {SetSpecialBit(kCheckCopy,flag);}
107
c57f56b7 108protected:
348be253 109// Methods
c57f56b7 110 virtual Bool_t Connect() = 0;
348be253 111 virtual void SetDefaults() = 0;
112 void SetSpecialBit(UInt_t f) { fSpecialBits |= f & kBitMask32; }
113 void ResetSpecialBit(UInt_t f) { fSpecialBits &= ~(f & kBitMask32); }
114 void SetSpecialBit(UInt_t f, Bool_t set) {(set)?SetSpecialBit(f):ResetSpecialBit(f);}
115 Bool_t TestSpecialBit(UInt_t f) const { return (Bool_t) ((fSpecialBits & f) != 0); }
116 Int_t TestSpecialBits(UInt_t f) const { return (Int_t) (fSpecialBits & f); }
117 void InvertSpecialBit(UInt_t f) { fSpecialBits ^= f & kBitMask32; }
118
119protected:
120 UInt_t fSpecialBits; // special bits
121
122
123 ClassDef(AliAnalysisGrid, 2) // Base class for GRID utilities
c57f56b7 124};
125#endif