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