New plugin supporting GRID mode for the analysis framework (M.Gheata)
[u/mrichter/AliRoot.git] / ANALYSIS / AliAnalysisAlien.h
CommitLineData
c57f56b7 1#ifndef ALIANALYSISALIEN_H
2#define ALIANALYSISALIEN_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// AliAnalysisAlien - AliEn utility class. Provides interface for creating
10// a personalized JDL, finding and creating a dataset.
11//==============================================================================
12
13#ifndef ALIANALYSISGRID_H
14#include "AliAnalysisGrid.h"
15#endif
16
17#ifndef ROOT_TString
18#include <TString.h>
19#endif
20
21class TGridJDL;
22
23class AliAnalysisAlien : public AliAnalysisGrid {
24
25public:
26
27 AliAnalysisAlien();
28 AliAnalysisAlien(const char *name);
29 virtual ~AliAnalysisAlien();
30 AliAnalysisAlien(const AliAnalysisAlien& other);
31 AliAnalysisAlien& operator=(const AliAnalysisAlien& other);
32// Setters
33 virtual void AddRunNumber(Int_t run);
34 virtual void AddDataFile(const char *lfn);
35 virtual void SetExecutable(const char *name="analysis.sh") {fExecutable = name;}
36 virtual void SetArguments(const char *name="") {fArguments = name;}
37 virtual void SetAnalysisMacro(const char *name="myAnalysis.C") {fAnalysisMacro = name;}
38 virtual void SetAnalysisSource(const char *name="myAnalysisClass.cxx") {fAnalysisSource = name;}
39 virtual void SetAdditionalLibs(const char *list) {fAdditionalLibs = list;}
40 virtual void SetPrice(Int_t price=1) {fPrice = price;}
41 virtual void SetSplitMode(const char *type="se") {fSplitMode = type;}
42 virtual void SetSplitMaxInputFileNumber(Int_t nfiles=100) {fSplitMaxInputFileNumber = nfiles;}
43 virtual void SetAPIVersion(const char *version="V2.4") {fAPIVersion = version;}
44 virtual void SetROOTVersion(const char *version="v5-21-01-alice") {fROOTVersion = version;}
45 virtual void SetAliROOTVersion(const char *version="v4-14-Rev-02") {fAliROOTVersion=version;}
46 virtual void SetUser(const char *user) {fUser = user;}
47 virtual void SetTTL(Int_t ttl=30000) {fTTL = ttl;}
48 virtual void SetGridWorkingDir(const char *name="workdir") {fGridWorkingDir = name;}
49 virtual void SetGridDataDir(const char *name) {fGridDataDir = name;}
50 virtual void SetDataPattern(const char *pattern="*AliESDs.root") {fDataPattern = pattern;}
51 virtual void SetGridOutputDir(const char *name="output") {fGridOutputDir = name;}
52 virtual void SetOutputArchive(const char *list="log_archive.zip:stdout,stderr root_archive.zip:*.root") {fOutputArchive = list;}
53 virtual void SetOutputFiles(const char *list) {fOutputFiles = list;}
54 virtual void SetInputFormat(const char *format="xml-single") {fInputFormat = format;}
55 virtual void SetMaxInitFailed(Int_t nfail=5) {fMaxInitFailed = nfail;}
56 virtual void SetMasterResubmitThreshold(Int_t percentage) {fMasterResubmitThreshold = percentage;}
57 virtual void SetJDLName(const char *name="analysis.jdl") {fJDLName = name;}
58
59 TGridJDL *GetGridJDL() {return fGridJDL;}
60//Utilities
61 virtual Bool_t CreateDataset(const char *pattern);
62 virtual Bool_t CreateJDL();
63 virtual Bool_t MergeOutputs();
64 virtual void StartAnalysis(Long64_t nentries=123456789, Long64_t firstentry=0);
65 virtual void WriteAnalysisFile();
66 virtual void WriteAnalysisMacro();
67 virtual void WriteExecutable();
68 virtual void WriteValidationScript();
69
70protected:
71 void CdWork();
72 Bool_t CheckInputData();
73 void CheckDataType(const char *lfn, Bool_t &is_collection, Bool_t &is_xml, Bool_t &use_tags);
74 virtual Bool_t Connect();
75 virtual void SetDefaults();
76
77 Bool_t FileExists(const char *lfn) const;
78 Bool_t IsCollection(const char *lfn) const;
79 Bool_t IsUsingTags() const {return TObject::TestBit(AliAnalysisGrid::kUseTags);}
80
81private:
82 TGridJDL *fGridJDL; //! JDL maker
83 Int_t fPrice; // Grid price for the job;
84 Int_t fTTL; // Time to live.
85 Int_t fSplitMaxInputFileNumber; // Maximum number of files to be processed per subjob
86 Int_t fMaxInitFailed; // Maximum initial consecutive subjobs accepted to fail
87 Int_t fMasterResubmitThreshold; // Failed jobs will be resubmitted until this DONE ratio
88 TString fRunNumbers; // List of runs to be processed
89 TString fExecutable; // Executable script for AliEn job
90 TString fArguments; // Arguments for the executable script
91 TString fAnalysisMacro; // Root macro steering the analysis
92 TString fAnalysisSource; // User analysis implementation (.cxx) file(s)
93 TString fAdditionalLibs; // List (separated by blacs) of additional libraries needed for the analysis
94 TString fSplitMode; // Job split mode
95 TString fAPIVersion; // API version
96 TString fROOTVersion; // ROOT version
97 TString fAliROOTVersion; // AliROOT version
98 TString fUser; // AliEn user name
99 TString fGridWorkingDir; // AliEn directory containing the input packages
100 TString fGridDataDir; // AliEn data production directory
101 TString fDataPattern; // Data pattern for 'find' command
102 TString fGridOutputDir; // AliEn directory (wrt work dir) where the output should be written
103 TString fOutputArchive; // List of output archives separated by blancs
104 TString fOutputFiles; // List of output files separated by blancs
105 TString fInputFormat; // Input format (xml-single)
106 TString fDatasetName; // Dataset xml file to be created
107 TString fJDLName; // JDL file to be generated
108 TObjArray *fInputFiles; // List of input files to be processed by the job
109
110 ClassDef(AliAnalysisAlien, 1) // Class providing some AliEn utilities
111};
112#endif