]>
Commit | Line | Data |
---|---|---|
a58729a5 | 1 | #ifndef ALIMUONACCEFFSUBMITTER_H |
2 | #define ALIMUONACCEFFSUBMITTER_H | |
3 | ||
4 | #include "TObject.h" | |
5 | #include "TString.h" | |
6 | #include "Riostream.h" | |
7 | ||
8 | class AliAnalysisTriggerScalers; | |
9 | class TMap; | |
10 | ||
11 | class AliMuonAccEffSubmitter : public TObject | |
12 | { | |
13 | public: | |
14 | AliMuonAccEffSubmitter(); | |
15 | ||
16 | virtual ~AliMuonAccEffSubmitter(); | |
17 | ||
18 | Bool_t SetRemoteDir(const char* dir, Bool_t create = kTRUE); | |
19 | void SetLocalDir(const char* LocalDir) { fLocalDir = LocalDir; } | |
20 | Bool_t SetMergedDir(const char* dir, Bool_t create = kTRUE); | |
21 | ||
22 | void UseOCDBSnapshots(Bool_t flag); | |
23 | ||
24 | void UseExternalConfig(const char* externalConfigFullFilePath) { fExternalConfig = externalConfigFullFilePath; } | |
25 | ||
26 | Bool_t CheckLocal() const; | |
27 | Bool_t CheckRemote() const; | |
28 | ||
29 | void CleanLocal(Bool_t cleanSnapshots=kFALSE) const; | |
30 | void CleanRemote() const; | |
31 | ||
32 | TString MergedDir() const { return fMergedDir; } | |
33 | TString RemoteDir() const { return fRemoteDir; } | |
34 | TString LocalDir() const { return fLocalDir; } | |
35 | ||
36 | TString FilePath(const char* what) const; | |
37 | ||
38 | Int_t MaxEventsPerChunk() const { return fMaxEventsPerChunk; } | |
39 | void SetMaxEventsPerChunk(Int_t n) { fMaxEventsPerChunk = n; } | |
40 | ||
41 | UInt_t NofRuns() const; | |
42 | ||
43 | void SetRatio(Float_t ratio) { fRatio = ratio; } | |
44 | void SetOCDBPath(const char* ocdbPath) { fOCDBPath = ocdbPath; } | |
45 | ||
46 | void MakeNofEventsPropToTriggerCount(const char* trigger="CMUL8-S-NOPF-MUON", Float_t ratio=1.0) { fReferenceTrigger = trigger; fRatio = ratio; } | |
47 | void MakeNofEventsFixed(Int_t nevents) { fFixedNofEvents = nevents; fReferenceTrigger=""; fRatio=0.0; } | |
48 | ||
49 | void SetRunList(const char* runlist); | |
50 | void SetRunList(int runNumber); | |
51 | ||
52 | TString ReferenceTrigger() const { return fReferenceTrigger; } | |
53 | ||
54 | Bool_t Run(const char* mode); | |
55 | ||
56 | Bool_t Merge(Int_t stage, Bool_t dryRun=kTRUE); | |
57 | ||
58 | Int_t Submit(Bool_t dryRun=kTRUE); | |
59 | ||
60 | TString RunJDLName() const { return "run.jdl"; } | |
61 | ||
62 | TString MergeJDLName(Bool_t final) const { return (final ? "AOD_merge_final.jdl" : "AOD_merge.jdl"); } | |
63 | ||
64 | virtual void Print(Option_t* opt="") const; | |
65 | ||
66 | Bool_t CopyLocalFilesToRemote(); | |
67 | ||
68 | Bool_t CopyTemplateFilesToLocal(); | |
69 | ||
70 | Bool_t GenerateRunJDL(const char* name); | |
71 | ||
72 | Bool_t GenerateMergeJDL(const char* name); | |
73 | ||
74 | void SetPackages(const char* aliroot, const char* root, const char* geant3, | |
75 | const char* api="VO_ALICE@APISCONFIG::V1.1x"); | |
76 | ||
77 | void SetSplitMaxInputFileNumber(Int_t n) { fSplitMaxInputFileNumber = n; } | |
78 | ||
79 | Int_t GetSplitMaxInputFileNumber() const { return fSplitMaxInputFileNumber; } | |
80 | ||
81 | Int_t CompactMode() const { return fCompactMode; } | |
82 | ||
83 | void SetCompactMode(Int_t mode) { fCompactMode=mode; } | |
84 | ||
85 | Bool_t ShouldOverwriteFiles() const { return fShouldOverwriteFiles; } | |
86 | ||
87 | void ShouldOverwriteFiles(Bool_t flag) { fShouldOverwriteFiles = flag; } | |
88 | ||
89 | Bool_t SetVar(const char* varname, const char* value); | |
90 | ||
91 | Bool_t MakeOCDBSnapshots(); | |
92 | ||
93 | void SetOCDBSnapshotDir(const char* dir); | |
94 | ||
95 | private: | |
96 | ||
97 | TString GetRemoteDir(const char* dir, Bool_t create); | |
98 | ||
99 | std::ostream* CreateJDLFile(const char* name) const; | |
100 | ||
101 | Bool_t CheckRemoteDir() const; | |
102 | ||
103 | Bool_t CopyFile(const char* localFile); | |
104 | ||
105 | Bool_t GetLastStage(const char* remoteDir) const; | |
106 | ||
107 | Bool_t RemoteDirectoryExists(const char *dirname) const; | |
108 | Bool_t RemoteFileExists(const char *lfn) const; | |
109 | ||
110 | void Output(std::ostream& out, const char* key, const char* v1, | |
111 | const char* v2="", const char* v3="", const char* v4="", const char* v5="", | |
112 | const char* v6="", const char* v7="", const char* v8="", const char* v9="") const; | |
113 | ||
114 | void Output(std::ostream& out, const char* key, const TObjArray& values) const; | |
115 | ||
116 | Bool_t ReplaceVars(const char* file); | |
117 | ||
118 | TObjArray* TemplateFileList() const; | |
119 | ||
120 | TObjArray* LocalFileList() const; | |
121 | ||
122 | Bool_t IsValid() const { return fIsValid; } | |
123 | ||
124 | Bool_t HasVars(const char* localFile) const; | |
125 | ||
126 | void UpdateLocalFileList(Bool_t clearSnapshot=kFALSE); | |
127 | ||
128 | TString SnapshotDir() const { return fSnapshotDir; } | |
129 | ||
130 | private: | |
131 | AliAnalysisTriggerScalers* fScalers; | |
132 | TString fRemoteDir; | |
133 | TString fReferenceTrigger; | |
134 | Float_t fRatio; | |
135 | Int_t fFixedNofEvents; | |
136 | Int_t fMaxEventsPerChunk; | |
137 | TString fLocalDir; | |
138 | TString fOCDBPath; | |
139 | TString fTemplateDir; | |
140 | TString fPackageAliroot; | |
141 | TString fPackageGeant3; | |
142 | TString fPackageRoot; | |
143 | TString fPackageApi; | |
144 | TString fMergedDir; | |
145 | Int_t fSplitMaxInputFileNumber; | |
146 | Int_t fCompactMode; | |
147 | Bool_t fShouldOverwriteFiles; | |
148 | TMap* fVars; | |
149 | TString fExternalConfig; | |
150 | Bool_t fUseOCDBSnapshots; | |
151 | Bool_t fIsValid; | |
152 | mutable TObjArray* fTemplateFileList; | |
153 | mutable TObjArray* fLocalFileList; | |
154 | TString fSnapshotDir; | |
155 | ||
156 | ClassDef(AliMuonAccEffSubmitter,1) // Helper class to submit AccxEff single particle simulations | |
157 | }; | |
158 | ||
159 | #endif | |
160 |