Pad masking ok (0x3F)
[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);
57f50b3c 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
a7160fe9 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
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;
73abe331 331}
332
a7160fe9 333//______________________________________________________________________________________________
1d172743 334AliShuttleConfig::AliShuttleDetConfigHolder::AliShuttleDetConfigHolder(const TLDAPEntry* entry):
335fDetector(""),
336fDCSConfig(),
337fResponsibles(0),
338fIsValid(kFALSE),
339fSkipDCSQuery(kFALSE),
340fStrictRunOrder(kFALSE)
73abe331 341{
1d172743 342// constructor of the shuttle configuration holder
2bb7b766 343
1d172743 344 TLDAPAttribute* anAttribute;
345
346 fResponsibles = new TObjArray();
347 fResponsibles->SetOwner(1);
348 fDCSConfig = new TObjArray();
349 fDCSConfig->SetOwner(1);
b948db8d 350
1d172743 351 anAttribute = entry->GetAttribute("det"); // MUST
352 if (!anAttribute)
353 {
354 AliError(Form("No \"det\" attribute!"));
73abe331 355 return;
1d172743 356 }
357 fDetector = anAttribute->GetValue();
b948db8d 358
1d172743 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();
b948db8d 372 }
57f50b3c 373
1d172743 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));
b948db8d 385 }
386 }
387
1d172743 388 fIsValid = kTRUE;
389}
b948db8d 390
1d172743 391//______________________________________________________________________________________________
392AliShuttleConfig::AliShuttleDetConfigHolder::~AliShuttleDetConfigHolder()
393{
394// destructor of the shuttle configuration holder
57f50b3c 395
1d172743 396 delete fResponsibles;
397 delete fDCSConfig;
398}
73abe331 399
1d172743 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}
73abe331 414
1d172743 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}
57f50b3c 429
1d172743 430//______________________________________________________________________________________________
542b6cc8 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
445//______________________________________________________________________________________________
1d172743 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}
73abe331 460
1d172743 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 //
d477ad88 468
1d172743 469 if (iServ < 0 || iServ >= GetNServers()) return 0;
d477ad88 470
1d172743 471 AliShuttleDCSConfigHolder *aHolder = dynamic_cast<AliShuttleDCSConfigHolder *>
472 (fDCSConfig->At(iServ));
473
474 return aHolder->GetDCSDataPoints();
475}
d477ad88 476
1d172743 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 //
d477ad88 484
1d172743 485 if (iServ < 0 || iServ >= GetNServers()) return 0;
57f50b3c 486
1d172743 487 AliShuttleDCSConfigHolder *aHolder = dynamic_cast<AliShuttleDCSConfigHolder *>
488 (fDCSConfig->At(iServ));
489
490 return aHolder->GetCompactDCSAliases();
491}
d477ad88 492
1d172743 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 //
fc5a4708 500
1d172743 501 if (iServ < 0 || iServ >= GetNServers()) return 0;
57f50b3c 502
1d172743 503 AliShuttleDCSConfigHolder *aHolder = dynamic_cast<AliShuttleDCSConfigHolder *>
504 (fDCSConfig->At(iServ));
505
506 return aHolder->GetCompactDCSDataPoints();
507}
d477ad88 508
1d172743 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);
518}
2c15234c 519
1d172743 520ClassImp(AliShuttleConfig)
2c15234c 521
1d172743 522//______________________________________________________________________________________________
523AliShuttleConfig::AliShuttleConfig(const char* host, Int_t port,
524 const char* binddn, const char* password, const char* basedn):
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)
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
553 // basedn: this is basedn whose childeren entries which have
554 //
441b0e9c 555
1d172743 556 fDetectorMap.SetOwner(1);
557 fDetectorList.SetOwner(0); //fDetectorList and fDetectorMap share the same object!
558 fProcessedDetectors.SetOwner();
2c15234c 559
1d172743 560 TLDAPServer aServer(host, port, binddn, password, 3);
5164a766 561
1d172743 562 if (!aServer.IsConnected()) {
563 AliError(Form("Can't connect to ldap server %s:%d",
564 host, port));
5164a766 565 return;
566 }
5164a766 567
1d172743 568 // reads configuration for the shuttle running on this machine
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));
9827400b 589 return;
590 }
9827400b 591
1d172743 592 while ((anEntry = aResult->GetNext()))
593 {
594 TString dn = anEntry->GetDn();
595
596 if (dn.BeginsWith("dcsHost="))
fc5a4708 597 {
1d172743 598 dcsList.Add(anEntry);
599 }
600 else if (dn.BeginsWith("det="))
601 {
602 detList.Add(anEntry);
2c15234c 603 }
1d172743 604 else if (dn.BeginsWith("name=globalConfig"))
605 {
606 globalList.Add(anEntry);
2c15234c 607 }
1d172743 608 else if (dn.BeginsWith("system="))
609 {
610 sysList.Add(anEntry);
57f50b3c 611 }
1d172743 612 else if (dn.BeginsWith("shuttleHost="))
fc5a4708 613 {
1d172743 614 hostList.Add(anEntry);
fc5a4708 615 }
1d172743 616 else
617 {
618 delete anEntry;
57f50b3c 619 }
1d172743 620
621 }
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!");
634 }
635 else
636 {
637 fIsValid = kTRUE;
57f50b3c 638 }
73abe331 639}
640
a7160fe9 641//______________________________________________________________________________________________
642AliShuttleConfig::~AliShuttleConfig()
58bc3020 643{
644// destructor
645
73abe331 646 fDetectorMap.DeleteAll();
2bb7b766 647 fDetectorList.Clear();
648 fProcessedDetectors.Delete();
73abe331 649}
650
a7160fe9 651//______________________________________________________________________________________________
652const TObjArray* AliShuttleConfig::GetDetectors() const
58bc3020 653{
73abe331 654 //
655 // returns collection of TObjString which contains the name
656 // of every detector which is in the configuration.
657 //
658
659 return &fDetectorList;
660}
661
a7160fe9 662//______________________________________________________________________________________________
663Bool_t AliShuttleConfig::HasDetector(const char* detector) const
58bc3020 664{
73abe331 665 //
666 // checks for paricular detector in the configuration.
667 //
668 return fDetectorMap.GetValue(detector) != NULL;
669}
670
a7160fe9 671//______________________________________________________________________________________________
1d172743 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;
683 }
684
685 return aHolder->GetNServers();
686}
687
688
689//______________________________________________________________________________________________
690const char* AliShuttleConfig::GetDCSHost(const char* detector, Int_t iServ) const
58bc3020 691{
73abe331 692 //
1d172743 693 // returns i-th DCS server host used by particular detector
73abe331 694 //
695
1d172743 696 AliShuttleDetConfigHolder* aHolder = (AliShuttleDetConfigHolder*) fDetectorMap.GetValue(detector);
73abe331 697 if (!aHolder) {
698 AliError(Form("There isn't configuration for detector: %s",
699 detector));
700 return NULL;
701 }
702
1d172743 703 return aHolder->GetDCSHost(iServ);
73abe331 704}
705
a7160fe9 706//______________________________________________________________________________________________
1d172743 707Int_t AliShuttleConfig::GetDCSPort(const char* detector, Int_t iServ) const
58bc3020 708{
73abe331 709 //
1d172743 710 // returns i-th DCS server port used by particular detector
73abe331 711 //
712
713
1d172743 714 AliShuttleDetConfigHolder* aHolder = (AliShuttleDetConfigHolder*) fDetectorMap.GetValue(detector);
73abe331 715 if (!aHolder) {
716 AliError(Form("There isn't configuration for detector: %s",
717 detector));
718 return 0;
719 }
720
1d172743 721 return aHolder->GetDCSPort(iServ);
73abe331 722}
723
a7160fe9 724//______________________________________________________________________________________________
542b6cc8 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
742//______________________________________________________________________________________________
1d172743 743const TObjArray* AliShuttleConfig::GetDCSAliases(const char* detector, Int_t iServ) const
58bc3020 744{
73abe331 745 //
1d172743 746 // returns collection of TObjString which represents the i-th set of aliases
73abe331 747 // which used for data retrieval for particular detector
748 //
749
1d172743 750 AliShuttleDetConfigHolder* aHolder = (AliShuttleDetConfigHolder*) fDetectorMap.GetValue(detector);
73abe331 751 if (!aHolder) {
752 AliError(Form("There isn't configuration for detector: %s",
753 detector));
754 return NULL;
755 }
756
1d172743 757 return aHolder->GetDCSAliases(iServ);
b948db8d 758}
759
a7160fe9 760//______________________________________________________________________________________________
1d172743 761const TObjArray* AliShuttleConfig::GetDCSDataPoints(const char* detector, Int_t iServ) const
2c15234c 762{
763 //
764 // returns collection of TObjString which represents the set of aliases
765 // which used for data retrieval for particular detector
766 //
767
1d172743 768 AliShuttleDetConfigHolder* aHolder = (AliShuttleDetConfigHolder*) fDetectorMap.GetValue(detector);
2c15234c 769 if (!aHolder) {
770 AliError(Form("There isn't configuration for detector: %s",
771 detector));
772 return NULL;
773 }
774
1d172743 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);
2c15234c 812}
813
814//______________________________________________________________________________________________
57c1a579 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
1d172743 822 AliShuttleDetConfigHolder* aHolder = (AliShuttleDetConfigHolder*) fDetectorMap.GetValue(detector);
57c1a579 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//______________________________________________________________________________________________
a7160fe9 833Bool_t AliShuttleConfig::HostProcessDetector(const char* detector) const
58bc3020 834{
b948db8d 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;
842 }
843 return kFALSE;
73abe331 844}
845
a7160fe9 846//______________________________________________________________________________________________
be48e3ea 847Bool_t AliShuttleConfig::StrictRunOrder(const char* detector) const
848{
849 // return TRUE if detector wants strict run ordering of stored data
850
1d172743 851 AliShuttleDetConfigHolder* aHolder = (AliShuttleDetConfigHolder*) fDetectorMap.GetValue(detector);
be48e3ea 852 if (!aHolder)
853 {
854 AliError(Form("There isn't configuration for detector: %s",
855 detector));
856 return kTRUE;
857 }
858
859 return aHolder->StrictRunOrder();
860}
861
862//______________________________________________________________________________________________
1d172743 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");
891 if (!anAttribute) {
892 AliError("Can't find daqLbHost attribute!");
893 return 4;
894 }
895 fDAQlbHost = anAttribute->GetValue();
896
897 anAttribute = anEntry->GetAttribute("daqLbPort"); // MAY
898 if (anAttribute)
899 {
900 fDAQlbPort = ((TString) anAttribute->GetValue()).Atoi();
901 } else {
902 fDAQlbPort = 3306; // mysql
903 }
904
905 anAttribute = anEntry->GetAttribute("daqLbUser");
906 if (!anAttribute) {
907 AliError("Can't find daqLbUser attribute!");
908 return 4;
909 }
910 fDAQlbUser = anAttribute->GetValue();
911
912 anAttribute = anEntry->GetAttribute("daqLbPasswd");
913 if (!anAttribute) {
914 AliError("Can't find daqLbPasswd attribute!");
915 return 4;
916 }
917 fDAQlbPass = anAttribute->GetValue();
918
919 anAttribute = anEntry->GetAttribute("daqLbDB");
920 if (!anAttribute) {
921 AliError("Can't find daqLbDB attribute!");
922 return 4;
923 }
924 fDAQlbDB = anAttribute->GetValue();
925
926 anAttribute = anEntry->GetAttribute("daqLbTable");
927 if (!anAttribute) {
928 AliError("Can't find daqLbTable attribute!");
929 return 4;
930 }
931 fDAQlbTable = anAttribute->GetValue();
932
933 anAttribute = anEntry->GetAttribute("shuttleLbTable");
934 if (!anAttribute) {
935 AliError("Can't find shuttleLbTable attribute!");
936 return 4;
937 }
938 fShuttlelbTable = anAttribute->GetValue();
939
940 anAttribute = anEntry->GetAttribute("runTypeLbTable");
941 if (!anAttribute) {
942 AliError("Can't find runTypeLbTable attribute!");
943 return 4;
944 }
945 fRunTypelbTable = anAttribute->GetValue();
946
947 anAttribute = anEntry->GetAttribute("ppmaxRetries");
948 if (!anAttribute) {
949 AliError("Can't find ppmaxRetries attribute!");
950 return 4;
951 }
952 TString tmpStr = anAttribute->GetValue();
953 fMaxRetries = tmpStr.Atoi();
954
955 anAttribute = anEntry->GetAttribute("ppTimeOut");
956 if (!anAttribute) {
957 AliError("Can't find ppTimeOut attribute!");
958 return 4;
959 }
960 tmpStr = anAttribute->GetValue();
961 fPPTimeOut = tmpStr.Atoi();
962
963 anAttribute = anEntry->GetAttribute("ppMaxMem");
964 if (!anAttribute) {
965 AliError("Can't find ppMaxMem attribute!");
966 return 4;
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}
1010
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 }
1024
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;
1036 }
1037 else if (sysName == "DCS")
1038 {
1039 iSys = 1;
1040 count += 10;
1041 }
1042 else if (sysName == "HLT")
1043 {
1044 iSys = 2;
1045 count += 100;
1046 }
1047
1048 anAttribute = anEntry->GetAttribute("dbHost");
1049 if (!anAttribute) {
1050 AliError(Form ("Can't find dbHost attribute for %s!!",
1051 AliShuttleInterface::GetSystemName(iSys)));
1052 return 5;
1053 }
1054 fFXSdbHost[iSys] = anAttribute->GetValue();
1055
1056 anAttribute = anEntry->GetAttribute("dbPort"); // MAY
1057 if (anAttribute)
1058 {
1059 fFXSdbPort[iSys] = ((TString) anAttribute->GetValue()).Atoi();
1060 } else {
1061 fFXSdbPort[iSys] = 3306; // mysql
1062 }
1063
1064 anAttribute = anEntry->GetAttribute("dbUser");
1065 if (!anAttribute) {
1066 AliError(Form ("Can't find dbUser attribute for %s!!",
1067 AliShuttleInterface::GetSystemName(iSys)));
1068 return 5;
1069 }
1070 fFXSdbUser[iSys] = anAttribute->GetValue();
1071
1072 anAttribute = anEntry->GetAttribute("dbPasswd");
1073 if (!anAttribute) {
1074 AliError(Form ("Can't find dbPasswd attribute for %s!!",
1075 AliShuttleInterface::GetSystemName(iSys)));
1076 return 5;
1077 }
1078 fFXSdbPass[iSys] = anAttribute->GetValue();
1079
1080 anAttribute = anEntry->GetAttribute("dbName");
1081 if (!anAttribute) {
1082 AliError(Form ("Can't find dbName attribute for %s!!",
1083 AliShuttleInterface::GetSystemName(iSys)));
1084 return 5;
1085 }
1086
1087 fFXSdbName[iSys] = anAttribute->GetValue();
1088 anAttribute = anEntry->GetAttribute("dbTable");
1089 if (!anAttribute) {
1090 AliError(Form ("Can't find dbTable attribute for %s!!",
1091 AliShuttleInterface::GetSystemName(iSys)));
1092 return 5;
1093 }
1094 fFXSdbTable[iSys] = anAttribute->GetValue();
1095
1096 anAttribute = anEntry->GetAttribute("fxsHost");
1097 if (!anAttribute) {
1098 AliError(Form ("Can't find fxsHost attribute for %s!!",
1099 AliShuttleInterface::GetSystemName(iSys)));
1100 return 5;
1101 }
1102 fFXSHost[iSys] = anAttribute->GetValue();
1103
1104 anAttribute = anEntry->GetAttribute("fxsPort"); // MAY
1105 if (anAttribute)
1106 {
1107 fFXSPort[iSys] = ((TString) anAttribute->GetValue()).Atoi();
1108 } else {
1109 fFXSPort[iSys] = 22; // scp port number
1110 }
1111
1112 anAttribute = anEntry->GetAttribute("fxsUser");
1113 if (!anAttribute) {
1114 AliError(Form ("Can't find fxsUser attribute for %s!!",
1115 AliShuttleInterface::GetSystemName(iSys)));
1116 return 5;
1117 }
1118 fFXSUser[iSys] = anAttribute->GetValue();
1119
1120 anAttribute = anEntry->GetAttribute("fxsPasswd");
1121 if (anAttribute) fFXSPass[iSys] = anAttribute->GetValue();
1122 }
1123
1124 if(count != 111) {
1125 AliError(Form("Wrong system configuration! (code = %d)", count));
1126 return 6;
1127 }
1128
1129 return 0;
1130}
1131
1132//______________________________________________________________________________________________
1133UInt_t AliShuttleConfig::SetDetConfig(TList* detList, TList* dcsList)
1134{
1135 // Set the detector configuration (general settings + DCS amanda server and alias/DP lists)
1136
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);
1144
1145 if (!detHolder->IsValid()) {
1146 AliError("Detector configuration error!");
1147 delete detHolder;
1148 return 7;
1149 }
1150
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);
1175 }
1176
1177 return 0;
1178}
1179
1180//______________________________________________________________________________________________
1181UInt_t AliShuttleConfig::SetHostConfig(TList* list)
1182{
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())))
1192 {
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;
1209}
1210
1211
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}