]> git.uio.no Git - u/mrichter/AliRoot.git/blame - SHUTTLE/AliShuttleConfig.cxx
Bug fix (Jan Fiete): recovering from StoreError, if the store to OCDB is successful,
[u/mrichter/AliRoot.git] / SHUTTLE / AliShuttleConfig.cxx
CommitLineData
73abe331 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/*
17$Log$
4508ab8b 18Revision 1.26 2007/12/07 19:14:36 acolla
19in AliShuttleTrigger:
20
21Added automatic collection of new runs on a regular time basis (settable from the configuration)
22
23in AliShuttleConfig: new members
24
25- triggerWait: time to wait for DIM trigger (s) before starting automatic collection of new runs
26- mode: run mode (test, prod) -> used to build log folder (logs or logs_PROD)
27
28in AliShuttle:
29
30- logs now stored in logs/#RUN/DET_#RUN.log
31
7d4cf768 32Revision 1.25 2007/11/26 16:58:37 acolla
33Monalisa configuration added: host and table name
34
b832ec02 35Revision 1.24 2007/10/24 10:44:08 acolla
36
37debug AliInfo removed
38
cb03e6c1 39Revision 1.23 2007/09/28 15:27:40 acolla
40
41AliDCSClient "multiSplit" option added in the DCS configuration
42in AliDCSMessage: variable MAX_BODY_SIZE set to 500000
43
542b6cc8 44Revision 1.22 2007/09/27 16:53:13 acolla
45Detectors can have more than one AMANDA server. SHUTTLE queries the servers sequentially,
46merges the dcs aliases/DPs in one TMap and sends it to the preprocessor.
47
1d172743 48Revision 1.21 2007/04/27 07:06:48 jgrosseo
49GetFileSources returns empty list in case of no files, but successful query
50No mails sent in testmode
51
86aa42c3 52Revision 1.20 2007/04/04 10:33:36 jgrosseo
531) Storing of files to the Grid is now done _after_ your preprocessors succeeded. This is transparent, which means that you can still use the same functions (Store, StoreReferenceData) to store files to the Grid. However, the Shuttle first stores them locally and transfers them after the preprocessor finished. The return code of these two functions has changed from UInt_t to Bool_t which gives you the success of the storing.
54In case of an error with the Grid, the Shuttle will retry the storing later, the preprocessor does not need to be run again.
55
562) The meaning of the return code of the preprocessor has changed. 0 is now success and any other value means failure. This value is stored in the log and you can use it to keep details about the error condition.
57
583) New function StoreReferenceFile to _directly_ store a file (without opening it) to the reference storage.
59
604) The memory usage of the preprocessor is monitored. If it exceeds 2 GB it is terminated.
61
625) New function AliPreprocessor::ProcessDCS(). If you do not need to have DCS data in all cases, you can skip the processing by implemting this function and returning kFALSE under certain conditions. E.g. if there is a certain run type.
63If you always need DCS data (like before), you do not need to implement it.
64
656) The run type has been added to the monitoring page
66
9827400b 67Revision 1.19 2007/02/28 10:41:56 acolla
68Run type field added in SHUTTLE framework. Run type is read from "run type" logbook and retrieved by
69AliPreprocessor::GetRunType() function.
70Added some ldap definition files.
71
441b0e9c 72Revision 1.18 2007/01/23 19:20:03 acolla
73Removed old ldif files, added TOF, MCH ldif files. Added some options in
74AliShuttleConfig::Print. Added in Ali Shuttle: SetShuttleTempDir and
75SetShuttleLogDir
76
36c99a6a 77Revision 1.17 2007/01/18 11:17:47 jgrosseo
78changing spaces to tabs ;-)
79
f59d2f8f 80Revision 1.16 2007/01/18 11:10:35 jgrosseo
81adding the possibility of defining DCS alias and data points with patterns
82first pattern introduced: [N..M] to add all names between the two digits, this works also recursively.
83
40150741 84Revision 1.15 2007/01/15 18:27:11 acolla
85implementation of sending mail to subdetector expert in case the preprocessor fails.
86shuttle.schema updated with expert's email entry
87
fc5a4708 88Revision 1.13 2006/12/07 08:51:26 jgrosseo
89update (alberto):
90table, db names in ldap configuration
91added GRP preprocessor
92DCS data can also be retrieved by data point
93
2c15234c 94Revision 1.12 2006/11/16 16:16:48 jgrosseo
95introducing strict run ordering flag
96removed giving preprocessor name to preprocessor, they have to know their name themselves ;-)
97
be48e3ea 98Revision 1.11 2006/11/06 14:23:04 jgrosseo
99major update (Alberto)
100o) reading of run parameters from the logbook
101o) online offline naming conversion
102o) standalone DCSclient package
103
eba76848 104Revision 1.10 2006/10/20 15:22:59 jgrosseo
105o) Adding time out to the execution of the preprocessors: The Shuttle forks and the parent process monitors the child
106o) Merging Collect, CollectAll, CollectNew function
107o) Removing implementation of empty copy constructors (declaration still there!)
108
cb343cfd 109Revision 1.9 2006/10/02 16:38:39 jgrosseo
110update (alberto):
111fixed memory leaks
112storing of objects that failed to be stored to the grid before
113interfacing of shuttle status table in daq system
114
2bb7b766 115Revision 1.8 2006/08/15 10:50:00 jgrosseo
116effc++ corrections (alberto)
117
4f0ab988 118Revision 1.7 2006/07/20 09:54:40 jgrosseo
119introducing status management: The processing per subdetector is divided into several steps,
120after each step the status is stored on disk. If the system crashes in any of the steps the Shuttle
121can keep track of the number of failures and skips further processing after a certain threshold is
122exceeded. These thresholds can be configured in LDAP.
123
5164a766 124Revision 1.6 2006/07/19 10:09:55 jgrosseo
125new configuration, accesst to DAQ FES (Alberto)
126
57f50b3c 127Revision 1.5 2006/07/10 13:01:41 jgrosseo
128enhanced storing of last sucessfully processed run (alberto)
129
a7160fe9 130Revision 1.4 2006/06/12 09:11:16 jgrosseo
131coding conventions (Alberto)
132
58bc3020 133Revision 1.3 2006/06/06 14:26:40 jgrosseo
134o) removed files that were moved to STEER
135o) shuttle updated to follow the new interface (Alberto)
136
b948db8d 137Revision 1.7 2006/05/12 09:07:16 colla
13812/05/06
139New configuration complete
140
141Revision 1.2 2006/03/07 07:52:34 hristov
142New version (B.Yordanov)
143
d477ad88 144Revision 1.4 2005/11/19 14:20:31 byordano
145logbook config added to AliShuttleConfig
146
147Revision 1.3 2005/11/17 19:24:25 byordano
148TList changed to TObjArray in AliShuttleConfig
149
150Revision 1.2 2005/11/17 14:43:23 byordano
151import to local CVS
152
153Revision 1.1.1.1 2005/10/28 07:33:58 hristov
154Initial import as subdirectory in AliRoot
155
73abe331 156Revision 1.1.1.1 2005/09/12 22:11:40 byordano
157SHUTTLE package
158
159Revision 1.3 2005/08/30 09:13:02 byordano
160some docs added
161
162*/
163
164
165//
166// This class keeps the AliShuttle configuration.
167// It reads the configuration for LDAP server.
168// For every child entry in basedn which has schema type 'shuttleConfig'
169// it creates a detector configuration. This configuration includes:
170// DCS server host and port and the set of aliases for which data from
171// will be retrieved (used by AliShuttle).
172//
173
174
175#include "AliShuttleConfig.h"
57f50b3c 176#include "AliShuttleInterface.h"
73abe331 177
178#include "AliLog.h"
179
b948db8d 180#include <TSystem.h>
73abe331 181#include <TObjString.h>
182#include <TLDAPResult.h>
183#include <TLDAPEntry.h>
184#include <TLDAPAttribute.h>
185
57f50b3c 186
1d172743 187AliShuttleConfig::AliShuttleDCSConfigHolder::AliShuttleDCSConfigHolder(const TLDAPEntry* entry):
57f50b3c 188fDCSHost(""),
189fDCSPort(0),
542b6cc8 190fMultiSplit(100),
fc5a4708 191fDCSAliases(0),
192fDCSDataPoints(0),
36c99a6a 193fDCSAliasesComp(0),
194fDCSDataPointsComp(0),
1d172743 195fIsValid(kFALSE)
73abe331 196{
1d172743 197// constructor of the shuttle DCS configuration holder
58bc3020 198
73abe331 199 TLDAPAttribute* anAttribute;
2bb7b766 200 fDCSAliases = new TObjArray();
201 fDCSAliases->SetOwner(1);
2c15234c 202 fDCSDataPoints = new TObjArray();
203 fDCSDataPoints->SetOwner(1);
36c99a6a 204 fDCSAliasesComp = new TObjArray();
205 fDCSAliasesComp->SetOwner(1);
206 fDCSDataPointsComp = new TObjArray();
207 fDCSDataPointsComp->SetOwner(1);
73abe331 208
86aa42c3 209
1d172743 210 anAttribute = entry->GetAttribute("dcsHost");
2c15234c 211 if (!anAttribute)
212 {
1d172743 213 AliError("Unexpected: no DCS host!");
73abe331 214 return;
215 }
57f50b3c 216
b948db8d 217 fDCSHost = anAttribute->GetValue();
73abe331 218
1d172743 219 anAttribute = entry->GetAttribute("dcsPort");
2c15234c 220 if (!anAttribute)
221 {
1d172743 222 AliError("Unexpected: no DCS port!");
73abe331 223 return;
224 }
225 TString portStr = anAttribute->GetValue();
b948db8d 226 fDCSPort = portStr.Atoi();
73abe331 227
542b6cc8 228 anAttribute = entry->GetAttribute("multiSplit"); // MAY
229 if (anAttribute)
230 {
231 TString multiSplitStr = anAttribute->GetValue();
232 fMultiSplit = multiSplitStr.Atoi();
233 if(fMultiSplit == 0) {
234 AliError("MultiSplit must be a positive integer!");
235 return;
236 }
237
238 }
239
1d172743 240 anAttribute = entry->GetAttribute("dcsAlias"); // MAY
2c15234c 241 if (anAttribute)
242 {
243 const char* anAlias;
244 while ((anAlias = anAttribute->GetValue()))
245 {
36c99a6a 246 fDCSAliasesComp->AddLast(new TObjString(anAlias));
40150741 247 ExpandAndAdd(fDCSAliases, anAlias);
2c15234c 248 }
73abe331 249 }
57f50b3c 250
1d172743 251 anAttribute = entry->GetAttribute("dcsDP"); // MAY
2c15234c 252 if (anAttribute)
253 {
254 const char* aDataPoint;
255 while ((aDataPoint = anAttribute->GetValue()))
256 {
36c99a6a 257 fDCSDataPointsComp->AddLast(new TObjString(aDataPoint));
258 ExpandAndAdd(fDCSDataPoints, aDataPoint);
2c15234c 259 }
b948db8d 260 }
261
73abe331 262 fIsValid = kTRUE;
263}
264
40150741 265//______________________________________________________________________________________________
1d172743 266void AliShuttleConfig::AliShuttleDCSConfigHolder::ExpandAndAdd(TObjArray* target, const char* entry)
40150741 267{
f59d2f8f 268 //
269 // adds <entry> to <target> applying expanding of the name
270 // [N..M] creates M-N+1 names with the corresponding digits
271 //
40150741 272
f59d2f8f 273 TString entryStr(entry);
40150741 274
f59d2f8f 275 Int_t begin = entryStr.Index("[");
276 Int_t end = entryStr.Index("]");
277 if (begin != -1 && end != -1 && end > begin)
278 {
279 TString before(entryStr(0, begin));
280 TString after(entryStr(end+1, entryStr.Length()));
40150741 281
f59d2f8f 282 AliDebug(2, Form("Found [] pattern. Splitted input string %s %s", before.Data(), after.Data()));
40150741 283
f59d2f8f 284 Int_t dotdot = entryStr.Index("..");
40150741 285
f59d2f8f 286 TString nStr(entryStr(begin+1, dotdot-begin-1));
287 TString mStr(entryStr(dotdot+2, end-dotdot-2));
40150741 288
f59d2f8f 289 AliDebug(2, Form("Found [N..M] pattern. %s %s", nStr.Data(), mStr.Data()));
40150741 290
f59d2f8f 291 if (nStr.IsDigit() && mStr.IsDigit())
292 {
293 Int_t n = nStr.Atoi();
294 Int_t m = mStr.Atoi();
40150741 295
f59d2f8f 296 Int_t nDigits = nStr.Length();
297 TString formatStr;
298 formatStr.Form("%%s%%0%dd%%s", nDigits);
40150741 299
f59d2f8f 300 AliDebug(2, Form("Format string is %s", formatStr.Data()));
40150741 301
f59d2f8f 302 for (Int_t current = n; current<=m; ++current)
303 {
304 TString newEntry;
305 newEntry.Form(formatStr.Data(), before.Data(), current, after.Data());
40150741 306
f59d2f8f 307 AliDebug(2, Form("Calling recursive with %s", newEntry.Data()));
40150741 308
f59d2f8f 309 // and go recursive
310 ExpandAndAdd(target, newEntry);
311 }
40150741 312
f59d2f8f 313 // return here because we processed the entries already recursively.
314 return;
315 }
316 }
40150741 317
f59d2f8f 318 AliDebug(2, Form("Adding name %s", entry));
319 target->AddLast(new TObjString(entry));
40150741 320}
321
a7160fe9 322//______________________________________________________________________________________________
1d172743 323AliShuttleConfig::AliShuttleDCSConfigHolder::~AliShuttleDCSConfigHolder()
58bc3020 324{
325// destructor of the shuttle configuration holder
326
2bb7b766 327 delete fDCSAliases;
2c15234c 328 delete fDCSDataPoints;
1d172743 329 delete fDCSAliasesComp;
330 delete fDCSDataPointsComp;
331}
332
333//______________________________________________________________________________________________
334AliShuttleConfig::AliShuttleDetConfigHolder::AliShuttleDetConfigHolder(const TLDAPEntry* entry):
335fDetector(""),
336fDCSConfig(),
337fResponsibles(0),
338fIsValid(kFALSE),
339fSkipDCSQuery(kFALSE),
340fStrictRunOrder(kFALSE)
341{
342// constructor of the shuttle configuration holder
343
344 TLDAPAttribute* anAttribute;
345
346 fResponsibles = new TObjArray();
347 fResponsibles->SetOwner(1);
348 fDCSConfig = new TObjArray();
349 fDCSConfig->SetOwner(1);
350
351 anAttribute = entry->GetAttribute("det"); // MUST
352 if (!anAttribute)
353 {
354 AliError(Form("No \"det\" attribute!"));
355 return;
356 }
357 fDetector = anAttribute->GetValue();
358
359 anAttribute = entry->GetAttribute("strictRunOrder"); // MAY
360 if (!anAttribute)
361 {
362 AliWarning(Form("%s did not set strictRunOrder flag - the default is FALSE",
363 fDetector.Data()));
364 } else {
365 TString strictRunStr = anAttribute->GetValue();
366 if (!(strictRunStr == "0" || strictRunStr == "1"))
367 {
368 AliError("strictRunOrder flag must be 0 or 1!");
369 return;
370 }
371 fStrictRunOrder = (Bool_t) strictRunStr.Atoi();
372 }
373
374 anAttribute = entry->GetAttribute("responsible"); // MAY
375 if (!anAttribute)
376 {
377 AliDebug(2, "Warning! No \"responsible\" attribute!");
378 }
379 else
380 {
381 const char* aResponsible;
382 while ((aResponsible = anAttribute->GetValue()))
383 {
384 fResponsibles->AddLast(new TObjString(aResponsible));
385 }
386 }
387
388 fIsValid = kTRUE;
389}
390
391//______________________________________________________________________________________________
392AliShuttleConfig::AliShuttleDetConfigHolder::~AliShuttleDetConfigHolder()
393{
394// destructor of the shuttle configuration holder
395
57c1a579 396 delete fResponsibles;
1d172743 397 delete fDCSConfig;
398}
399
400//______________________________________________________________________________________________
401const char* AliShuttleConfig::AliShuttleDetConfigHolder::GetDCSHost(Int_t iServ) const
402{
403 //
404 // returns DCS server host
405 //
406
407 if (iServ < 0 || iServ >= GetNServers()) return 0;
408
409 AliShuttleDCSConfigHolder *aHolder = dynamic_cast<AliShuttleDCSConfigHolder *>
410 (fDCSConfig->At(iServ));
411
412 return aHolder->GetDCSHost();
413}
414
415//______________________________________________________________________________________________
416Int_t AliShuttleConfig::AliShuttleDetConfigHolder::GetDCSPort(Int_t iServ) const
417{
418 //
419 // returns DCS server port
420 //
421
422 if (iServ < 0 || iServ >= GetNServers()) return 0;
423
424 AliShuttleDCSConfigHolder *aHolder = dynamic_cast<AliShuttleDCSConfigHolder *>
425 (fDCSConfig->At(iServ));
426
427 return aHolder->GetDCSPort();
428}
429
542b6cc8 430//______________________________________________________________________________________________
431Int_t AliShuttleConfig::AliShuttleDetConfigHolder::GetMultiSplit(Int_t iServ) const
432{
433 //
434 // returns DCS "multi split" value
435 //
436
437 if (iServ < 0 || iServ >= GetNServers()) return 0;
438
439 AliShuttleDCSConfigHolder *aHolder = dynamic_cast<AliShuttleDCSConfigHolder *>
440 (fDCSConfig->At(iServ));
441
442 return aHolder->GetMultiSplit();
443}
444
1d172743 445//______________________________________________________________________________________________
446const TObjArray* AliShuttleConfig::AliShuttleDetConfigHolder::GetDCSAliases(Int_t iServ) const
447{
448 //
449 // returns collection of TObjString which represents the set of aliases
450 // which used for data retrieval for particular detector
451 //
452
453 if (iServ < 0 || iServ >= GetNServers()) return 0;
454
455 AliShuttleDCSConfigHolder *aHolder = dynamic_cast<AliShuttleDCSConfigHolder *>
456 (fDCSConfig->At(iServ));
457
458 return aHolder->GetDCSAliases();
459}
460
461//______________________________________________________________________________________________
462const TObjArray* AliShuttleConfig::AliShuttleDetConfigHolder::GetDCSDataPoints(Int_t iServ) const
463{
464 //
465 // returns collection of TObjString which represents the set of aliases
466 // which used for data retrieval for particular detector
467 //
468
469 if (iServ < 0 || iServ >= GetNServers()) return 0;
470
471 AliShuttleDCSConfigHolder *aHolder = dynamic_cast<AliShuttleDCSConfigHolder *>
472 (fDCSConfig->At(iServ));
473
474 return aHolder->GetDCSDataPoints();
475}
476
477//______________________________________________________________________________________________
478const TObjArray* AliShuttleConfig::AliShuttleDetConfigHolder::GetCompactDCSAliases(Int_t iServ) const
479{
480 //
481 // returns collection of TObjString which represents the set of aliases
482 // which used for data retrieval for particular detector (Compact style)
483 //
484
485 if (iServ < 0 || iServ >= GetNServers()) return 0;
486
487 AliShuttleDCSConfigHolder *aHolder = dynamic_cast<AliShuttleDCSConfigHolder *>
488 (fDCSConfig->At(iServ));
489
490 return aHolder->GetCompactDCSAliases();
491}
492
493//______________________________________________________________________________________________
494const TObjArray* AliShuttleConfig::AliShuttleDetConfigHolder::GetCompactDCSDataPoints(Int_t iServ) const
495{
496 //
497 // returns collection of TObjString which represents the set of aliases
498 // which used for data retrieval for particular detector (Compact style)
499 //
500
501 if (iServ < 0 || iServ >= GetNServers()) return 0;
502
503 AliShuttleDCSConfigHolder *aHolder = dynamic_cast<AliShuttleDCSConfigHolder *>
504 (fDCSConfig->At(iServ));
505
506 return aHolder->GetCompactDCSDataPoints();
507}
508
509//______________________________________________________________________________________________
510void AliShuttleConfig::AliShuttleDetConfigHolder::AddDCSConfig(AliShuttleDCSConfigHolder* holder)
511{
512 //
513 // adds a DCS configuration set in the array of DCS configurations
514 //
515
516 if(!holder) return;
517 fDCSConfig->AddLast(holder);
73abe331 518}
519
520ClassImp(AliShuttleConfig)
521
a7160fe9 522//______________________________________________________________________________________________
523AliShuttleConfig::AliShuttleConfig(const char* host, Int_t port,
73abe331 524 const char* binddn, const char* password, const char* basedn):
1d172743 525 fConfigHost(host),
526 fDAQlbHost(""),
527 fDAQlbPort(),
528 fDAQlbUser(""),
529 fDAQlbPass(""),
530 fDAQlbDB(""),
531 fDAQlbTable(""),
532 fShuttlelbTable(""),
533 fRunTypelbTable(""),
534 fMaxRetries(0),
535 fPPTimeOut(0),
536 fPPMaxMem(0),
b832ec02 537 fMonitorHost(""),
538 fMonitorTable(""),
7d4cf768 539 fTriggerWait(3600),
540 fRunMode(kTest),
1d172743 541 fDetectorMap(),
542 fDetectorList(),
543 fShuttleInstanceHost(""),
544 fProcessedDetectors(),
545 fProcessAll(kFALSE),
546 fIsValid(kFALSE)
73abe331 547{
548 //
549 // host: ldap server host
550 // port: ldap server port
551 // binddn: binddn used for ldap binding (simple bind is used!).
552 // password: password for binddn
b948db8d 553 // basedn: this is basedn whose childeren entries which have
73abe331 554 //
555
1d172743 556 fDetectorMap.SetOwner(1);
2bb7b766 557 fDetectorList.SetOwner(0); //fDetectorList and fDetectorMap share the same object!
558 fProcessedDetectors.SetOwner();
559
b948db8d 560 TLDAPServer aServer(host, port, binddn, password, 3);
57f50b3c 561
73abe331 562 if (!aServer.IsConnected()) {
2bb7b766 563 AliError(Form("Can't connect to ldap server %s:%d",
73abe331 564 host, port));
565 return;
566 }
567
b948db8d 568 // reads configuration for the shuttle running on this machine
1d172743 569
570 TLDAPResult* aResult = 0;
571 TLDAPEntry* anEntry = 0;
572
573 TList dcsList;
574 dcsList.SetOwner(1);
575 TList detList;
576 detList.SetOwner(1);
577 TList globalList;
578 globalList.SetOwner(1);
579 TList sysList;
580 sysList.SetOwner(1);
581 TList hostList;
582 hostList.SetOwner(1);
583
584 aResult = aServer.Search(basedn, LDAP_SCOPE_SUBTREE, 0, 0);
585
586 if (!aResult)
587 {
588 AliError(Form("Can't find configuration with base DN: %s !", basedn));
73abe331 589 return;
590 }
1d172743 591
592 while ((anEntry = aResult->GetNext()))
593 {
594 TString dn = anEntry->GetDn();
595
596 if (dn.BeginsWith("dcsHost="))
597 {
598 dcsList.Add(anEntry);
599 }
600 else if (dn.BeginsWith("det="))
601 {
602 detList.Add(anEntry);
603 }
604 else if (dn.BeginsWith("name=globalConfig"))
605 {
606 globalList.Add(anEntry);
607 }
608 else if (dn.BeginsWith("system="))
609 {
610 sysList.Add(anEntry);
611 }
612 else if (dn.BeginsWith("shuttleHost="))
613 {
614 hostList.Add(anEntry);
615 }
616 else
617 {
618 delete anEntry;
619 }
620
b948db8d 621 }
1d172743 622 delete aResult;
623
624 Int_t result=0;
625
626 result += SetGlobalConfig(&globalList);
627 result += SetSysConfig(&sysList);
628 result += SetDetConfig(&detList,&dcsList);
629 result += SetHostConfig(&hostList);
630
631 if(result)
632 {
633 AliError("Configuration is INVALID!");
b948db8d 634 }
1d172743 635 else
636 {
637 fIsValid = kTRUE;
b948db8d 638 }
1d172743 639}
b948db8d 640
1d172743 641//______________________________________________________________________________________________
642AliShuttleConfig::~AliShuttleConfig()
643{
644// destructor
57f50b3c 645
1d172743 646 fDetectorMap.DeleteAll();
647 fDetectorList.Clear();
648 fProcessedDetectors.Delete();
649}
b948db8d 650
1d172743 651//______________________________________________________________________________________________
652const TObjArray* AliShuttleConfig::GetDetectors() const
653{
654 //
655 // returns collection of TObjString which contains the name
656 // of every detector which is in the configuration.
657 //
57f50b3c 658
1d172743 659 return &fDetectorList;
660}
73abe331 661
1d172743 662//______________________________________________________________________________________________
663Bool_t AliShuttleConfig::HasDetector(const char* detector) const
664{
665 //
666 // checks for paricular detector in the configuration.
667 //
668 return fDetectorMap.GetValue(detector) != NULL;
669}
73abe331 670
1d172743 671//______________________________________________________________________________________________
672Int_t AliShuttleConfig::GetNServers(const char* detector) const
673{
674 //
675 // returns number of DCS servers for detector
676 //
677
678 AliShuttleDetConfigHolder* aHolder = (AliShuttleDetConfigHolder*) fDetectorMap.GetValue(detector);
679 if (!aHolder) {
680 AliError(Form("There isn't configuration for detector: %s",
681 detector));
682 return 0;
57f50b3c 683 }
684
1d172743 685 return aHolder->GetNServers();
686}
d477ad88 687
d477ad88 688
1d172743 689//______________________________________________________________________________________________
690const char* AliShuttleConfig::GetDCSHost(const char* detector, Int_t iServ) const
691{
692 //
693 // returns i-th DCS server host used by particular detector
694 //
695
696 AliShuttleDetConfigHolder* aHolder = (AliShuttleDetConfigHolder*) fDetectorMap.GetValue(detector);
697 if (!aHolder) {
698 AliError(Form("There isn't configuration for detector: %s",
699 detector));
700 return NULL;
d477ad88 701 }
702
1d172743 703 return aHolder->GetDCSHost(iServ);
704}
705
706//______________________________________________________________________________________________
707Int_t AliShuttleConfig::GetDCSPort(const char* detector, Int_t iServ) const
708{
709 //
710 // returns i-th DCS server port used by particular detector
711 //
712
713
714 AliShuttleDetConfigHolder* aHolder = (AliShuttleDetConfigHolder*) fDetectorMap.GetValue(detector);
715 if (!aHolder) {
716 AliError(Form("There isn't configuration for detector: %s",
717 detector));
718 return 0;
719 }
720
721 return aHolder->GetDCSPort(iServ);
722}
723
542b6cc8 724//______________________________________________________________________________________________
725Int_t AliShuttleConfig::GetMultiSplit(const char* detector, Int_t iServ) const
726{
727 //
728 // returns i-th DCS "multi split" value
729 //
730
731
732 AliShuttleDetConfigHolder* aHolder = (AliShuttleDetConfigHolder*) fDetectorMap.GetValue(detector);
733 if (!aHolder) {
734 AliError(Form("There isn't configuration for detector: %s",
735 detector));
736 return 0;
737 }
738
739 return aHolder->GetMultiSplit(iServ);
740}
741
1d172743 742//______________________________________________________________________________________________
743const TObjArray* AliShuttleConfig::GetDCSAliases(const char* detector, Int_t iServ) const
744{
745 //
746 // returns collection of TObjString which represents the i-th set of aliases
747 // which used for data retrieval for particular detector
748 //
749
750 AliShuttleDetConfigHolder* aHolder = (AliShuttleDetConfigHolder*) fDetectorMap.GetValue(detector);
751 if (!aHolder) {
752 AliError(Form("There isn't configuration for detector: %s",
753 detector));
754 return NULL;
755 }
756
757 return aHolder->GetDCSAliases(iServ);
758}
759
760//______________________________________________________________________________________________
761const TObjArray* AliShuttleConfig::GetDCSDataPoints(const char* detector, Int_t iServ) const
762{
763 //
764 // returns collection of TObjString which represents the set of aliases
765 // which used for data retrieval for particular detector
766 //
767
768 AliShuttleDetConfigHolder* aHolder = (AliShuttleDetConfigHolder*) fDetectorMap.GetValue(detector);
769 if (!aHolder) {
770 AliError(Form("There isn't configuration for detector: %s",
771 detector));
772 return NULL;
773 }
774
775 return aHolder->GetDCSDataPoints(iServ);
776}
777
778//______________________________________________________________________________________________
779const TObjArray* AliShuttleConfig::GetCompactDCSAliases(const char* detector, Int_t iServ) const
780{
781 //
782 // returns collection of TObjString which represents the i-th set of aliases
783 // which used for data retrieval for particular detector (Compact style)
784 //
785
786 AliShuttleDetConfigHolder* aHolder = (AliShuttleDetConfigHolder*) fDetectorMap.GetValue(detector);
787 if (!aHolder) {
788 AliError(Form("There isn't configuration for detector: %s",
789 detector));
790 return NULL;
791 }
792
793 return aHolder->GetCompactDCSAliases(iServ);
794}
795
796//______________________________________________________________________________________________
797const TObjArray* AliShuttleConfig::GetCompactDCSDataPoints(const char* detector, Int_t iServ) const
798{
799 //
800 // returns collection of TObjString which represents the set of aliases
801 // which used for data retrieval for particular detector (Compact style)
802 //
803
804 AliShuttleDetConfigHolder* aHolder = (AliShuttleDetConfigHolder*) fDetectorMap.GetValue(detector);
805 if (!aHolder) {
806 AliError(Form("There isn't configuration for detector: %s",
807 detector));
808 return NULL;
809 }
810
811 return aHolder->GetCompactDCSDataPoints(iServ);
812}
813
814//______________________________________________________________________________________________
815const TObjArray* AliShuttleConfig::GetResponsibles(const char* detector) const
816{
817 //
818 // returns collection of TObjString which represents the list of mail addresses
819 // of the detector's responsible(s)
820 //
821
822 AliShuttleDetConfigHolder* aHolder = (AliShuttleDetConfigHolder*) fDetectorMap.GetValue(detector);
823 if (!aHolder) {
824 AliError(Form("There isn't configuration for detector: %s",
825 detector));
826 return NULL;
827 }
828
829 return aHolder->GetResponsibles();
830}
831
832//______________________________________________________________________________________________
833Bool_t AliShuttleConfig::HostProcessDetector(const char* detector) const
834{
835 // return TRUE if detector is handled by host or if fProcessAll is TRUE
836
837 if(fProcessAll) return kTRUE;
838 TIter iter(&fProcessedDetectors);
839 TObjString* detName;
840 while((detName = (TObjString*) iter.Next())){
841 if(detName->String() == detector) return kTRUE;
d477ad88 842 }
1d172743 843 return kFALSE;
844}
845
846//______________________________________________________________________________________________
847Bool_t AliShuttleConfig::StrictRunOrder(const char* detector) const
848{
849 // return TRUE if detector wants strict run ordering of stored data
850
851 AliShuttleDetConfigHolder* aHolder = (AliShuttleDetConfigHolder*) fDetectorMap.GetValue(detector);
852 if (!aHolder)
853 {
854 AliError(Form("There isn't configuration for detector: %s",
855 detector));
856 return kTRUE;
857 }
d477ad88 858
1d172743 859 return aHolder->StrictRunOrder();
860}
57f50b3c 861
1d172743 862//______________________________________________________________________________________________
863UInt_t AliShuttleConfig::SetGlobalConfig(TList* list)
864{
865 // Set the global configuration (DAQ Logbook + preprocessor monitoring settings)
866
867 TLDAPEntry* anEntry = 0;
868 TLDAPAttribute* anAttribute = 0;
869
870 if (list->GetEntries() == 0)
871 {
872 AliError("Global configuration not found!");
873 return 1;
874 }
875 else if (list->GetEntries() > 1)
876 {
877 AliError("More than one global configuration found!");
878 return 2;
879 }
880
881 anEntry = dynamic_cast<TLDAPEntry*> (list->At(0));
882
883 if (!anEntry)
884 {
885 AliError("Unexpected! Global list does not contain a TLDAPEntry");
886 return 3;
887 }
888
889
890 anAttribute = anEntry->GetAttribute("daqLbHost");
d477ad88 891 if (!anAttribute) {
1d172743 892 AliError("Can't find daqLbHost attribute!");
893 return 4;
d477ad88 894 }
57f50b3c 895 fDAQlbHost = anAttribute->GetValue();
d477ad88 896
1d172743 897 anAttribute = anEntry->GetAttribute("daqLbPort"); // MAY
fc5a4708 898 if (anAttribute)
899 {
900 fDAQlbPort = ((TString) anAttribute->GetValue()).Atoi();
901 } else {
902 fDAQlbPort = 3306; // mysql
903 }
904
1d172743 905 anAttribute = anEntry->GetAttribute("daqLbUser");
d477ad88 906 if (!anAttribute) {
1d172743 907 AliError("Can't find daqLbUser attribute!");
908 return 4;
d477ad88 909 }
57f50b3c 910 fDAQlbUser = anAttribute->GetValue();
911
1d172743 912 anAttribute = anEntry->GetAttribute("daqLbPasswd");
d477ad88 913 if (!anAttribute) {
1d172743 914 AliError("Can't find daqLbPasswd attribute!");
915 return 4;
d477ad88 916 }
57f50b3c 917 fDAQlbPass = anAttribute->GetValue();
d477ad88 918
1d172743 919 anAttribute = anEntry->GetAttribute("daqLbDB");
2c15234c 920 if (!anAttribute) {
1d172743 921 AliError("Can't find daqLbDB attribute!");
922 return 4;
2c15234c 923 }
924 fDAQlbDB = anAttribute->GetValue();
925
1d172743 926 anAttribute = anEntry->GetAttribute("daqLbTable");
2c15234c 927 if (!anAttribute) {
1d172743 928 AliError("Can't find daqLbTable attribute!");
929 return 4;
2c15234c 930 }
931 fDAQlbTable = anAttribute->GetValue();
932
1d172743 933 anAttribute = anEntry->GetAttribute("shuttleLbTable");
441b0e9c 934 if (!anAttribute) {
1d172743 935 AliError("Can't find shuttleLbTable attribute!");
936 return 4;
441b0e9c 937 }
938 fShuttlelbTable = anAttribute->GetValue();
939
1d172743 940 anAttribute = anEntry->GetAttribute("runTypeLbTable");
441b0e9c 941 if (!anAttribute) {
1d172743 942 AliError("Can't find runTypeLbTable attribute!");
943 return 4;
441b0e9c 944 }
945 fRunTypelbTable = anAttribute->GetValue();
2c15234c 946
1d172743 947 anAttribute = anEntry->GetAttribute("ppmaxRetries");
5164a766 948 if (!anAttribute) {
1d172743 949 AliError("Can't find ppmaxRetries attribute!");
950 return 4;
5164a766 951 }
952 TString tmpStr = anAttribute->GetValue();
cb343cfd 953 fMaxRetries = tmpStr.Atoi();
5164a766 954
1d172743 955 anAttribute = anEntry->GetAttribute("ppTimeOut");
5164a766 956 if (!anAttribute) {
1d172743 957 AliError("Can't find ppTimeOut attribute!");
958 return 4;
5164a766 959 }
960 tmpStr = anAttribute->GetValue();
cb343cfd 961 fPPTimeOut = tmpStr.Atoi();
5164a766 962
1d172743 963 anAttribute = anEntry->GetAttribute("ppMaxMem");
9827400b 964 if (!anAttribute) {
1d172743 965 AliError("Can't find ppMaxMem attribute!");
966 return 4;
9827400b 967 }
968 tmpStr = anAttribute->GetValue();
969 fPPMaxMem = tmpStr.Atoi();
970
b832ec02 971 anAttribute = anEntry->GetAttribute("monitorHost");
972 if (!anAttribute) {
973 AliError("Can't find monitorHost attribute!");
974 return 4;
975 }
976 fMonitorHost = anAttribute->GetValue();
977
978 anAttribute = anEntry->GetAttribute("monitorTable");
979 if (!anAttribute) {
980 AliError("Can't find monitorTable attribute!");
981 return 4;
982 }
983 fMonitorTable = anAttribute->GetValue();
7d4cf768 984
985 anAttribute = anEntry->GetAttribute("triggerWait"); // MAY
986 if (!anAttribute) {
987 AliWarning(Form("triggerWait not set! default = ", fTriggerWait));
988 }
989 tmpStr = anAttribute->GetValue();
990 fTriggerWait = tmpStr.Atoi();
b832ec02 991
7d4cf768 992 anAttribute = anEntry->GetAttribute("mode");
993 if (!anAttribute) {
994 AliWarning("Run mode not set! Running in test mode.");
7d4cf768 995 } else {
4508ab8b 996 tmpStr = anAttribute->GetValue();
997 if (tmpStr == "test")
998 {
999 fRunMode = kTest;
1000 } else if (tmpStr == "prod") {
1001 fRunMode = kProd;
1002 } else {
1003 AliWarning(Form("Not a valid run mode: %s", tmpStr.Data()));
1004 AliWarning("Valid run modes are \"test\" and \"prod\". Running in test mode.");
1005 }
7d4cf768 1006 }
1007
1d172743 1008 return 0;
1d172743 1009}
57f50b3c 1010
1d172743 1011//______________________________________________________________________________________________
1012UInt_t AliShuttleConfig::SetSysConfig(TList* list)
1013{
1014 // Set the online FXS configuration (DAQ + DCS + HLT)
1015
1016 TLDAPEntry* anEntry = 0;
1017 TLDAPAttribute* anAttribute = 0;
1018
1019 if (list->GetEntries() != 3)
1020 {
1021 AliError(Form("Wrong number of online systems found: %d !", list->GetEntries()));
1022 return 1;
1023 }
57f50b3c 1024
1d172743 1025 TIter iter(list);
1026 Int_t iSys=0, count = 0;
1027 while ((anEntry = dynamic_cast<TLDAPEntry*> (iter.Next())))
1028 {
1029 anAttribute = anEntry->GetAttribute("system");
1030 TString sysName = anAttribute->GetValue();
1031
1032 if (sysName == "DAQ")
1033 {
1034 iSys = 0;
1035 count += 1;
57f50b3c 1036 }
1d172743 1037 else if (sysName == "DCS")
1038 {
1039 iSys = 1;
1040 count += 10;
57f50b3c 1041 }
1d172743 1042 else if (sysName == "HLT")
1043 {
1044 iSys = 2;
1045 count += 100;
1046 }
1047
1048 anAttribute = anEntry->GetAttribute("dbHost");
57f50b3c 1049 if (!anAttribute) {
1d172743 1050 AliError(Form ("Can't find dbHost attribute for %s!!",
eba76848 1051 AliShuttleInterface::GetSystemName(iSys)));
1d172743 1052 return 5;
57f50b3c 1053 }
2c15234c 1054 fFXSdbHost[iSys] = anAttribute->GetValue();
57f50b3c 1055
1d172743 1056 anAttribute = anEntry->GetAttribute("dbPort"); // MAY
fc5a4708 1057 if (anAttribute)
1058 {
1059 fFXSdbPort[iSys] = ((TString) anAttribute->GetValue()).Atoi();
1060 } else {
1061 fFXSdbPort[iSys] = 3306; // mysql
1062 }
1063
1d172743 1064 anAttribute = anEntry->GetAttribute("dbUser");
57f50b3c 1065 if (!anAttribute) {
1d172743 1066 AliError(Form ("Can't find dbUser attribute for %s!!",
eba76848 1067 AliShuttleInterface::GetSystemName(iSys)));
1d172743 1068 return 5;
57f50b3c 1069 }
2c15234c 1070 fFXSdbUser[iSys] = anAttribute->GetValue();
57f50b3c 1071
1d172743 1072 anAttribute = anEntry->GetAttribute("dbPasswd");
57f50b3c 1073 if (!anAttribute) {
1d172743 1074 AliError(Form ("Can't find dbPasswd attribute for %s!!",
eba76848 1075 AliShuttleInterface::GetSystemName(iSys)));
1d172743 1076 return 5;
57f50b3c 1077 }
2c15234c 1078 fFXSdbPass[iSys] = anAttribute->GetValue();
1079
1d172743 1080 anAttribute = anEntry->GetAttribute("dbName");
2c15234c 1081 if (!anAttribute) {
1d172743 1082 AliError(Form ("Can't find dbName attribute for %s!!",
2c15234c 1083 AliShuttleInterface::GetSystemName(iSys)));
1d172743 1084 return 5;
2c15234c 1085 }
1086
1087 fFXSdbName[iSys] = anAttribute->GetValue();
1d172743 1088 anAttribute = anEntry->GetAttribute("dbTable");
2c15234c 1089 if (!anAttribute) {
1d172743 1090 AliError(Form ("Can't find dbTable attribute for %s!!",
2c15234c 1091 AliShuttleInterface::GetSystemName(iSys)));
1d172743 1092 return 5;
2c15234c 1093 }
1094 fFXSdbTable[iSys] = anAttribute->GetValue();
57f50b3c 1095
1d172743 1096 anAttribute = anEntry->GetAttribute("fxsHost");
57f50b3c 1097 if (!anAttribute) {
1d172743 1098 AliError(Form ("Can't find fxsHost attribute for %s!!",
eba76848 1099 AliShuttleInterface::GetSystemName(iSys)));
1d172743 1100 return 5;
57f50b3c 1101 }
2c15234c 1102 fFXSHost[iSys] = anAttribute->GetValue();
57f50b3c 1103
1d172743 1104 anAttribute = anEntry->GetAttribute("fxsPort"); // MAY
fc5a4708 1105 if (anAttribute)
1106 {
1107 fFXSPort[iSys] = ((TString) anAttribute->GetValue()).Atoi();
1108 } else {
1109 fFXSPort[iSys] = 22; // scp port number
1110 }
1111
1d172743 1112 anAttribute = anEntry->GetAttribute("fxsUser");
57f50b3c 1113 if (!anAttribute) {
1d172743 1114 AliError(Form ("Can't find fxsUser attribute for %s!!",
eba76848 1115 AliShuttleInterface::GetSystemName(iSys)));
1d172743 1116 return 5;
57f50b3c 1117 }
2c15234c 1118 fFXSUser[iSys] = anAttribute->GetValue();
57f50b3c 1119
1d172743 1120 anAttribute = anEntry->GetAttribute("fxsPasswd");
2c15234c 1121 if (anAttribute) fFXSPass[iSys] = anAttribute->GetValue();
57f50b3c 1122 }
73abe331 1123
1d172743 1124 if(count != 111) {
1125 AliError(Form("Wrong system configuration! (code = %d)", count));
1126 return 6;
73abe331 1127 }
1d172743 1128
1129 return 0;
2c15234c 1130}
1131
57c1a579 1132//______________________________________________________________________________________________
1d172743 1133UInt_t AliShuttleConfig::SetDetConfig(TList* detList, TList* dcsList)
57c1a579 1134{
1d172743 1135 // Set the detector configuration (general settings + DCS amanda server and alias/DP lists)
57c1a579 1136
1d172743 1137 TLDAPEntry* anEntry = 0;
1138
1139 TIter iter(detList);
1140 while ((anEntry = dynamic_cast<TLDAPEntry*> (iter.Next())))
1141 {
1142
1143 AliShuttleDetConfigHolder* detHolder = new AliShuttleDetConfigHolder(anEntry);
57c1a579 1144
1d172743 1145 if (!detHolder->IsValid()) {
1146 AliError("Detector configuration error!");
1147 delete detHolder;
1148 return 7;
1149 }
b948db8d 1150
1d172743 1151 TObjString* detStr = new TObjString(detHolder->GetDetector());
1152
1153 // Look for DCS Configuration
1154 TIter dcsIter(dcsList);
1155 TLDAPEntry *dcsEntry = 0;
1156 while ((dcsEntry = dynamic_cast<TLDAPEntry*> (dcsIter.Next())))
1157 {
1158 TString dn = dcsEntry->GetDn();
1159 if(dn.Contains(detStr->GetName())) {
1160 AliDebug(2, Form("Found DCS configuration: dn = %s",dn.Data()));
1161 AliShuttleDCSConfigHolder* dcsHolder = new AliShuttleDCSConfigHolder(dcsEntry);
1162 if (!dcsHolder->IsValid()) {
1163 AliError("DCS configuration error!");
1164 delete detHolder;
1165 delete dcsHolder;
1166 return 7;
1167 }
1168 detHolder->AddDCSConfig(dcsHolder);
1169 }
1170 }
1171
1172
1173 fDetectorMap.Add(detStr, detHolder);
1174 fDetectorList.AddLast(detStr);
b948db8d 1175 }
1d172743 1176
1177 return 0;
73abe331 1178}
1179
be48e3ea 1180//______________________________________________________________________________________________
1d172743 1181UInt_t AliShuttleConfig::SetHostConfig(TList* list)
be48e3ea 1182{
1d172743 1183 // Set the Shuttle machines configuration (which detectors processes each machine)
1184
1185 TLDAPEntry* anEntry = 0;
1186 TLDAPAttribute* anAttribute = 0;
1187
1188 fShuttleInstanceHost = gSystem->HostName();
1189
1190 TIter iter(list);
1191 while ((anEntry = dynamic_cast<TLDAPEntry*> (iter.Next())))
be48e3ea 1192 {
1d172743 1193
1194 TString dn(anEntry->GetDn());
1195 if (!dn.Contains(Form("shuttleHost=%s", fShuttleInstanceHost.Data()))) continue;
1196
1197 if (!fProcessAll)
1198 {
1199 anAttribute = anEntry->GetAttribute("detectors");
1200 const char *detName;
1201 while((detName = anAttribute->GetValue())){
1202 TObjString *objDet= new TObjString(detName);
1203 fProcessedDetectors.Add(objDet);
1204 }
1205 }
1206 }
1207
1208 return 0;
be48e3ea 1209}
1210
1d172743 1211
a7160fe9 1212//______________________________________________________________________________________________
36c99a6a 1213void AliShuttleConfig::Print(Option_t* option) const
58bc3020 1214{
1215// print configuration
36c99a6a 1216// options : "": print configuration for all detectors, aliases and DPs in compacted format
1217// "uncompact": print configuration for all detectors, aliases and DPs in uncompacted format
1218// "DET": print configuration for DET, aliases and DPs in compacted format
1219// "DET, uncompact": print configuration for DET, aliases and DPs in uncompacted format
1220
73abe331 1221 TString result;
1222 result += '\n';
7d4cf768 1223
1224 TString mode = "test";
1225 if (fRunMode == kProd) mode = "production";
d477ad88 1226
7d4cf768 1227 result += "########################################################################\n";
1228 result += Form(" Shuttle configuration from %s - Run Mode: <%s> \n",
1229 fConfigHost.Data(), mode.Data());
1230 result += "########################################################################\n";
57c1a579 1231 result += Form("\nShuttle running on %s \n", fShuttleInstanceHost.Data());
57f50b3c 1232
1233 if(fProcessAll) {
57c1a579 1234 result += Form("All detectors will be processed! \n");
57f50b3c 1235 } else {
1236 result += "Detectors processed by this host: ";
1237 TIter it(&fProcessedDetectors);
1238 TObjString* aDet;
1239 while ((aDet = (TObjString*) it.Next())) {
1240 result += Form("%s ", aDet->String().Data());
1241 }
57c1a579 1242 result += "\n";
b948db8d 1243 }
b948db8d 1244
7d4cf768 1245 result += Form("PP time out = %d - max PP mem size = %d KB - max retries = %d "
1246 "- DIM trigger waiting timeout = %d\n\n",
1247 fPPTimeOut, fPPMaxMem, fMaxRetries, fTriggerWait);
57c1a579 1248 result += "------------------------------------------------------\n";
2bb7b766 1249
57c1a579 1250 result += Form("Logbook Configuration \n\n \tHost: %s:%d; \tUser: %s; ",
fc5a4708 1251 fDAQlbHost.Data(), fDAQlbPort, fDAQlbUser.Data());
b948db8d 1252
2c15234c 1253// result += "Password: ";
1254// result.Append('*', fDAQlbPass.Length());
b832ec02 1255 result += Form("\tDB: %s; \tTables: %s, %s, %s\n",
441b0e9c 1256 fDAQlbDB.Data(), fDAQlbTable.Data(), fShuttlelbTable.Data(), fRunTypelbTable.Data());
2c15234c 1257
57f50b3c 1258 result += "\n\n";
1259
57c1a579 1260 result += "------------------------------------------------------\n";
1261 result += "FXS configuration\n\n";
1262
57f50b3c 1263 for(int iSys=0;iSys<3;iSys++){
57c1a579 1264 result += Form("*** %s ***\n", AliShuttleInterface::GetSystemName(iSys));
fc5a4708 1265 result += Form("\tDB host: %s:%d; \tUser: %s; \tName: %s; \tTable: %s\n",
1266 fFXSdbHost[iSys].Data(), fFXSdbPort[iSys], fFXSdbUser[iSys].Data(),
2c15234c 1267 fFXSdbName[iSys].Data(), fFXSdbTable[iSys].Data());
1268 // result += Form("DB Password:",fFXSdbPass[iSys].Data());
fc5a4708 1269 result += Form("\tFXS host: %s:%d; \tUser: %s\n\n", fFXSHost[iSys].Data(), fFXSPort[iSys],
1270 fFXSUser[iSys].Data());
2c15234c 1271 // result += Form("FXS Password:",fFXSPass[iSys].Data());
57f50b3c 1272 }
b948db8d 1273
b832ec02 1274 result += "------------------------------------------------------\n";
1275 result += "MonaLisa configuration\n\n";
1276
1277 result += Form("\tHost: %s; \tTable name: %s",
1278 fMonitorHost.Data(), fMonitorTable.Data());
1279
1280 result += "\n\n";
1281
36c99a6a 1282 TString optStr(option);
1283
57c1a579 1284 result += "------------------------------------------------------\n";
1285 result += "Detector-specific configuration\n\n";
1d172743 1286
73abe331 1287 TIter iter(fDetectorMap.GetTable());
1d172743 1288 TPair* aPair = 0;
1289
73abe331 1290 while ((aPair = (TPair*) iter.Next())) {
1d172743 1291 AliShuttleDetConfigHolder* aHolder = (AliShuttleDetConfigHolder*) aPair->Value();
1292 if (optStr != "" && !optStr.Contains(aHolder->GetDetector()) &&
1293 optStr.CompareTo("uncompact",TString::kIgnoreCase) != 0 )
36c99a6a 1294 continue;
1d172743 1295
57c1a579 1296 result += Form("*** %s *** \n", aHolder->GetDetector());
1297
1298 const TObjArray* responsibles = aHolder->GetResponsibles();
1299 if (responsibles->GetEntries() != 0)
1300 {
1301 result += "\tDetector responsible(s): ";
1302 TIter it(responsibles);
1303 TObjString* aResponsible;
1304 while ((aResponsible = (TObjString*) it.Next()))
1305 {
1306 result += Form("%s ", aResponsible->String().Data());
1307 }
1308 result += "\n";
1309 }
1310
1d172743 1311 result += Form("\tStrict run ordering: %s \n\n", aHolder->StrictRunOrder() ? "YES" : "NO");
1312
1313 const TObjArray* dcsConfig = aHolder->GetDCSConfig();
1314
1315 AliShuttleDCSConfigHolder* dcsHolder = 0;
1316 TIter dcsIter(dcsConfig);
1317 Int_t count=0;
1318 while ((dcsHolder = dynamic_cast<AliShuttleDCSConfigHolder*> (dcsIter.Next())))
be48e3ea 1319 {
542b6cc8 1320 result += Form("\tAmanda server [%d]: %s:%d - MultiSplit = %d\n", count,
1321 dcsHolder->GetDCSHost(), dcsHolder->GetDCSPort(), dcsHolder->GetMultiSplit());
57f50b3c 1322
1d172743 1323 const TObjArray* aliases = 0;
1324 if (optStr.Contains("uncompact",TString::kIgnoreCase))
1325 {
1326 aliases = dcsHolder->GetDCSAliases();
1327 } else {
1328 aliases = dcsHolder->GetCompactDCSAliases();
1329 }
36c99a6a 1330
1d172743 1331 if (aliases->GetEntries() != 0)
2c15234c 1332 {
1d172743 1333 result += Form("\tDCS Aliases [%d]: ", count);
1334 TIter it(aliases);
1335 TObjString* anAlias;
1336 while ((anAlias = (TObjString*) it.Next()))
1337 {
1338 result += Form("%s ", anAlias->String().Data());
1339 }
1340 result += "\n";
2c15234c 1341 }
57f50b3c 1342
1d172743 1343 const TObjArray* dataPoints = 0;
1344 if (optStr.Contains("uncompact",TString::kIgnoreCase))
1345 {
1346 dataPoints = dcsHolder->GetDCSDataPoints();
1347 } else {
1348 dataPoints = dcsHolder->GetCompactDCSDataPoints();
2c15234c 1349 }
1d172743 1350 if (dataPoints->GetEntries() != 0)
1351 {
1352 result += Form("\tDCS Data Points [%d]: ", count);
1353 TIter it(dataPoints);
1354 TObjString* aDataPoint;
1355 while ((aDataPoint = (TObjString*) it.Next())) {
1356 result += Form("%s ", aDataPoint->String().Data());
1357 }
2c15234c 1358 result += "\n";
1d172743 1359 }
1360 count++;
1361 result += "\n";
2c15234c 1362 }
73abe331 1363 }
57f50b3c 1364 if(!fIsValid) result += "\n\n********** !!!!! Configuration is INVALID !!!!! **********\n";
1365
73abe331 1366 AliInfo(result);
1367}