Updating the AliAnalysisFemtoTask to work with
[u/mrichter/AliRoot.git] / SHUTTLE / AliShuttleConfig.h
CommitLineData
73abe331 1#ifndef ALI_SHUTTLE_CONFIG_H
2#define ALI_SHUTTLE_CONFIG_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7/* $Id$ */
8
9//
10// This class keeps the AliShuttle configuration.
11// It reads the configuration for LDAP server.
58bc3020 12// For more info see AliShuttleConfig.cxx
73abe331 13//
14
15#include <TObject.h>
16#include <TString.h>
d477ad88 17#include <TObjArray.h>
73abe331 18#include <TMap.h>
19#include <TLDAPServer.h>
20
21class AliShuttleConfig: public TObject {
22public:
7d4cf768 23 enum RunMode {kTest=0, kProd};
fb40ead4 24 enum SystemCode { kDAQ = 0, kDCS, kHLT, kGlobal, kAmanda };
7d4cf768 25
b948db8d 26 AliShuttleConfig(const char* host, Int_t port = LDAP_PORT,
27 const char* binddn = 0, const char* password = 0,
28 const char* basedn = "o=alice,dc=cern,dc=ch");
73abe331 29 virtual ~AliShuttleConfig();
30
31 Bool_t IsValid() const {return fIsValid;};
32
57c1a579 33 const char* GetConfigHost() const {return fConfigHost.Data();}
34
57f50b3c 35 const char* GetDAQlbHost() const {return fDAQlbHost.Data();}
fc5a4708 36 UInt_t GetDAQlbPort() const {return fDAQlbPort;}
57f50b3c 37 const char* GetDAQlbUser() const {return fDAQlbUser.Data();}
38 const char* GetDAQlbPass() const {return fDAQlbPass.Data();}
2c15234c 39 const char* GetDAQlbDB() const {return fDAQlbDB.Data();}
40 const char* GetDAQlbTable() const {return fDAQlbTable.Data();}
441b0e9c 41 const char* GetShuttlelbTable() const {return fShuttlelbTable.Data();}
42 const char* GetRunTypelbTable() const {return fRunTypelbTable.Data();}
b948db8d 43
fb40ead4 44 const char* GetFXSHost(Int_t sys) const {return fFXSHost[sys].Data();}
45 UInt_t GetFXSPort(Int_t sys) const {return fFXSPort[sys];}
46 const char* GetFXSUser(Int_t sys) const {return fFXSUser[sys].Data();}
47 const char* GetFXSPass(Int_t sys) const {return fFXSPass[sys].Data();}
57f50b3c 48
fb40ead4 49 const char* GetFXSdbHost(Int_t sys) const {return fFXSdbHost[sys].Data();}
50 UInt_t GetFXSdbPort(Int_t sys) const {return fFXSdbPort[sys];}
51 const char* GetFXSdbUser(Int_t sys) const {return fFXSdbUser[sys].Data();}
52 const char* GetFXSdbPass(Int_t sys) const {return fFXSdbPass[sys].Data();}
53 const char* GetFXSdbName(Int_t sys) const {return fFXSdbName[sys].Data();}
54 const char* GetFXSdbTable(Int_t sys) const {return fFXSdbTable[sys].Data();}
d477ad88 55
fb40ead4 56 const TObjArray* GetAdmins(Int_t sys) const;
57
58 Bool_t SendMail() const { return fSendMail; }
59
2bb7b766 60 Int_t GetMaxRetries() const { return fMaxRetries; }
5164a766 61
cb343cfd 62 Int_t GetPPTimeOut() const { return fPPTimeOut; }
ff3781ad 63 Int_t GetDCSTimeOut() const { return fDCSTimeOut; }
64 Int_t GetDCSRetries() const { return fDCSRetries; }
9827400b 65 Int_t GetPPMaxMem() const { return fPPMaxMem; }
fb40ead4 66
67 Bool_t KeepDCSMap() const { return fKeepDCSMap; }
68 Bool_t KeepTempFolder() const { return fKeepTempFolder; }
b832ec02 69
fb40ead4 70
b832ec02 71 const char* GetMonitorHost() const {return fMonitorHost.Data();}
72 const char* GetMonitorTable() const {return fMonitorTable.Data();}
cb343cfd 73
7d4cf768 74 Int_t GetTriggerWait() const {return fTriggerWait;}
75
76 RunMode GetRunMode() const {return fRunMode;}
77
36c99a6a 78 const TObjArray* GetDetectors() const;
73abe331 79
80 Bool_t HasDetector(const char* detector) const;
1d172743 81
82 Int_t GetNServers(const char* detector) const;
83
84 const char* GetDCSHost(const char* detector, Int_t iServ) const;
85 Int_t GetDCSPort(const char* detector, Int_t iServ) const;
86
542b6cc8 87 Int_t GetMultiSplit(const char* detector, Int_t iServ) const;
88
1d172743 89 const TObjArray* GetDCSAliases(const char* detector, Int_t iServ) const;
90 const TObjArray* GetDCSDataPoints(const char* detector, Int_t iServ) const;
91 const TObjArray* GetCompactDCSAliases(const char* detector, Int_t iServ) const;
92 const TObjArray* GetCompactDCSDataPoints(const char* detector, Int_t iServ) const;
93
57c1a579 94 const TObjArray* GetResponsibles(const char* detector) const;
be48e3ea 95 Bool_t StrictRunOrder(const char* detector) const;
b948db8d 96
97 void SetProcessAll(Bool_t flag=kTRUE) {fProcessAll=flag;}
58bc3020 98 Bool_t ProcessAll() const {return fProcessAll;}
b948db8d 99
100 Bool_t HostProcessDetector(const char* detector) const;
73abe331 101
102 virtual void Print(Option_t* option = NULL) const;
103
104private:
b948db8d 105
1d172743 106 class AliShuttleDCSConfigHolder: public TObject {
73abe331 107 public:
1d172743 108 AliShuttleDCSConfigHolder(const TLDAPEntry* entry);
109 ~AliShuttleDCSConfigHolder();
110
111 const char* GetDCSHost() const {return fDCSHost;}
57f50b3c 112 Int_t GetDCSPort() const {return fDCSPort;}
542b6cc8 113 Int_t GetMultiSplit() const {return fMultiSplit;}
114
2bb7b766 115 const TObjArray* GetDCSAliases() const {return fDCSAliases;}
2c15234c 116 const TObjArray* GetDCSDataPoints() const {return fDCSDataPoints;}
36c99a6a 117 const TObjArray* GetCompactDCSAliases() const {return fDCSAliasesComp;}
118 const TObjArray* GetCompactDCSDataPoints() const {return fDCSDataPointsComp;}
1d172743 119
f59d2f8f 120 void ExpandAndAdd(TObjArray* target, const char* entry);
1d172743 121 Bool_t IsValid() const {return fIsValid;}
40150741 122
58bc3020 123 private:
1d172743 124 AliShuttleDCSConfigHolder(const AliShuttleDCSConfigHolder& other); // not implemented
125 AliShuttleDCSConfigHolder& operator= (const AliShuttleDCSConfigHolder& other); // not implemented
1bcd28db 126
58bc3020 127 TString fDCSHost; // Host name of the DCS server
128 Int_t fDCSPort; // port of the DCS server
542b6cc8 129 Int_t fMultiSplit; // N. of DPs to be queried in each query chunk
2bb7b766 130 TObjArray* fDCSAliases; // List of DCS aliases to be retrieved
1d172743 131 TObjArray* fDCSDataPoints; // List of DCS data points to be retrieved
132 TObjArray* fDCSAliasesComp; // Compact list of DCS aliases to be printed
36c99a6a 133 TObjArray* fDCSDataPointsComp; // Compact list of DCS data points to be printed
1d172743 134 Bool_t fIsValid; // flag for the validity of the configuration
135
136 ClassDef(AliShuttleDCSConfigHolder, 0);
137 };
138
139 class AliShuttleDetConfigHolder: public TObject {
140 public:
141 AliShuttleDetConfigHolder(const TLDAPEntry* entry);
142 ~AliShuttleDetConfigHolder();
143
144 const char* GetDetector() const {return fDetector.Data();}
145 const TObjArray* GetDCSConfig() const {return fDCSConfig;}
146 void AddDCSConfig(AliShuttleDCSConfigHolder* holder);
147
148 Int_t GetNServers() const {return fDCSConfig ? fDCSConfig->GetEntries() : 0;}
149
150 const char* GetDCSHost(Int_t iServ) const;
151 Int_t GetDCSPort(Int_t iServ) const;
542b6cc8 152 Int_t GetMultiSplit(Int_t iServ) const;
153
1d172743 154 const TObjArray* GetDCSAliases(Int_t iServ) const;
155 const TObjArray* GetDCSDataPoints(Int_t iServ) const;
156 const TObjArray* GetCompactDCSAliases(Int_t iServ) const;
157 const TObjArray* GetCompactDCSDataPoints(Int_t iServ) const;
158
159 const TObjArray* GetResponsibles() const {return fResponsibles;}
160 Bool_t IsValid() const {return fIsValid;}
161 Bool_t SkipDCSQuery() const {return fSkipDCSQuery;}
162 Bool_t StrictRunOrder() const {return fStrictRunOrder;}
163
164 private:
165 AliShuttleDetConfigHolder(const AliShuttleDetConfigHolder& other); // not implemented
166 AliShuttleDetConfigHolder& operator= (const AliShuttleDetConfigHolder& other); // not implemented
167
168 TString fDetector; // Detector name
169 TObjArray* fDCSConfig; // Array of DCS configuration objects (AliShuttleDCSConfigHolder)
57c1a579 170 TObjArray* fResponsibles; // List of email addresses of the detector's responsible(s)
58bc3020 171 Bool_t fIsValid; // flag for the validity of the configuration
57f50b3c 172 Bool_t fSkipDCSQuery; // flag - if TRUE (-> DCS config empty) skip DCS archive data query
be48e3ea 173 Bool_t fStrictRunOrder; // flag - if TRUE connect data in a strict run ordering
58bc3020 174
1d172743 175 ClassDef(AliShuttleDetConfigHolder, 0);
73abe331 176 };
177
178
1d172743 179 UInt_t SetGlobalConfig(TList* globalList);
180 UInt_t SetSysConfig(TList* sysList);
181 UInt_t SetDetConfig(TList* detList, TList* dcsList);
182 UInt_t SetHostConfig(TList* hostList);
183
b832ec02 184 TString fConfigHost; // Host of the Shuttle configuration LDAP server
185
186 TString fDAQlbHost; // Host of the DAQ logbook MySQL Server
187 UInt_t fDAQlbPort; // port of the DAQ logbook MySQL Server
188 TString fDAQlbUser; // username of the DAQ logbook MySQL Server
189 TString fDAQlbPass; // password of the DAQ logbook MySQL Server
190 TString fDAQlbDB; // DB name of the DAQ logbook MySQL Server
191 TString fDAQlbTable; // Table name of the DAQ logbook
192 TString fShuttlelbTable; // Table name of the Shuttle logbook
193 TString fRunTypelbTable; // Table name of the Run typr logbook
194
195 TString fFXSHost[3]; // Host of the [DAQ, DCS, HLT] File eXchange Server
196 UInt_t fFXSPort[3]; // Port of the [DAQ, DCS, HLT] File eXchange Server
197 TString fFXSUser[3]; // username of the [DAQ, DCS, HLT] File eXchange Server
198 TString fFXSPass[3]; // password of the [DAQ, DCS, HLT] File eXchange Server
199
200 TString fFXSdbHost[3]; // Host of the [DAQ, DCS, HLT] FXS database
201 UInt_t fFXSdbPort[3]; // Port of the [DAQ, DCS, HLT] FXS database
202 TString fFXSdbUser[3]; // username of the [DAQ, DCS, HLT] FXS database
203 TString fFXSdbPass[3]; // password of the [DAQ, DCS, HLT] FXS database
204 TString fFXSdbName[3]; // name of the [DAQ, DCS, HLT] FXS database
205 TString fFXSdbTable[3]; // Table name of the [DAQ, DCS, HLT] FXS database
206
207 Int_t fMaxRetries; // number of retries of a failed preprocessor
208
209 Int_t fPPTimeOut; // timeout until a preprocessor is killed
ff3781ad 210 Int_t fDCSTimeOut; // timeout until the query to DCS is terminated
211 Int_t fDCSRetries; // number of retries until the query to DCS connection is terminated
b832ec02 212 Int_t fPPMaxMem; // maximum allowed memory until a preprocessor is killed
213
214 TString fMonitorHost; // host of the MonaLisa monitoring server
215 TString fMonitorTable; // Monalisa's SHUTTLE table name
7d4cf768 216
217 Int_t fTriggerWait; // time to wait for DIM trigger before starting new collection
218 RunMode fRunMode; // Working mode (0=test; 1=prod)
b832ec02 219
220 TMap fDetectorMap; // Map of the detector-by-detector configuration
221 TObjArray fDetectorList; // List of detectors with valid configuration
fb40ead4 222
223 TObjArray *fAdmin[4]; // Array of system administrators' email addresses (DAQ, DCS, HLT, Global, Amanda)
b832ec02 224
225 TString fShuttleInstanceHost; // Instance of the SHUTTLE
226 TObjArray fProcessedDetectors; // list of the detector to be processed by this machine
fb40ead4 227
228 Bool_t fKeepDCSMap; // Flag to keep DCS map also in case of success
229 Bool_t fKeepTempFolder; // Flag to keep temp folder also in case of success
230
231 Bool_t fSendMail; // Send mail flag
232
b832ec02 233 Bool_t fProcessAll; // flag indicating that all detectors will be processed
234 Bool_t fIsValid; // flag for the validity of the configuration
73abe331 235
236 ClassDef(AliShuttleConfig, 0);
237};
238
239#endif
240