consistent naming
[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);
57f50b3c 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
a7160fe9 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
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;
73abe331 317}
318
a7160fe9 319//______________________________________________________________________________________________
1d172743 320AliShuttleConfig::AliShuttleDetConfigHolder::AliShuttleDetConfigHolder(const TLDAPEntry* entry):
321fDetector(""),
322fDCSConfig(),
323fResponsibles(0),
324fIsValid(kFALSE),
325fSkipDCSQuery(kFALSE),
326fStrictRunOrder(kFALSE)
73abe331 327{
1d172743 328// constructor of the shuttle configuration holder
2bb7b766 329
1d172743 330 TLDAPAttribute* anAttribute;
331
332 fResponsibles = new TObjArray();
333 fResponsibles->SetOwner(1);
334 fDCSConfig = new TObjArray();
335 fDCSConfig->SetOwner(1);
b948db8d 336
1d172743 337 anAttribute = entry->GetAttribute("det"); // MUST
338 if (!anAttribute)
339 {
340 AliError(Form("No \"det\" attribute!"));
73abe331 341 return;
1d172743 342 }
343 fDetector = anAttribute->GetValue();
b948db8d 344
1d172743 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();
b948db8d 358 }
57f50b3c 359
1d172743 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));
b948db8d 371 }
372 }
373
1d172743 374 fIsValid = kTRUE;
375}
b948db8d 376
1d172743 377//______________________________________________________________________________________________
378AliShuttleConfig::AliShuttleDetConfigHolder::~AliShuttleDetConfigHolder()
379{
380// destructor of the shuttle configuration holder
57f50b3c 381
1d172743 382 delete fResponsibles;
383 delete fDCSConfig;
384}
73abe331 385
1d172743 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}
73abe331 400
1d172743 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}
57f50b3c 415
1d172743 416//______________________________________________________________________________________________
542b6cc8 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
431//______________________________________________________________________________________________
1d172743 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}
73abe331 446
1d172743 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 //
d477ad88 454
1d172743 455 if (iServ < 0 || iServ >= GetNServers()) return 0;
d477ad88 456
1d172743 457 AliShuttleDCSConfigHolder *aHolder = dynamic_cast<AliShuttleDCSConfigHolder *>
458 (fDCSConfig->At(iServ));
459
460 return aHolder->GetDCSDataPoints();
461}
d477ad88 462
1d172743 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 //
d477ad88 470
1d172743 471 if (iServ < 0 || iServ >= GetNServers()) return 0;
57f50b3c 472
1d172743 473 AliShuttleDCSConfigHolder *aHolder = dynamic_cast<AliShuttleDCSConfigHolder *>
474 (fDCSConfig->At(iServ));
475
476 return aHolder->GetCompactDCSAliases();
477}
d477ad88 478
1d172743 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 //
fc5a4708 486
1d172743 487 if (iServ < 0 || iServ >= GetNServers()) return 0;
57f50b3c 488
1d172743 489 AliShuttleDCSConfigHolder *aHolder = dynamic_cast<AliShuttleDCSConfigHolder *>
490 (fDCSConfig->At(iServ));
491
492 return aHolder->GetCompactDCSDataPoints();
493}
d477ad88 494
1d172743 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);
504}
2c15234c 505
1d172743 506ClassImp(AliShuttleConfig)
2c15234c 507
1d172743 508//______________________________________________________________________________________________
509AliShuttleConfig::AliShuttleConfig(const char* host, Int_t port,
510 const char* binddn, const char* password, const char* basedn):
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)
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
539 // basedn: this is basedn whose childeren entries which have
540 //
441b0e9c 541
1d172743 542 fDetectorMap.SetOwner(1);
543 fDetectorList.SetOwner(0); //fDetectorList and fDetectorMap share the same object!
544 fProcessedDetectors.SetOwner();
2c15234c 545
1d172743 546 TLDAPServer aServer(host, port, binddn, password, 3);
5164a766 547
1d172743 548 if (!aServer.IsConnected()) {
549 AliError(Form("Can't connect to ldap server %s:%d",
550 host, port));
5164a766 551 return;
552 }
5164a766 553
1d172743 554 // reads configuration for the shuttle running on this machine
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));
9827400b 575 return;
576 }
9827400b 577
1d172743 578 while ((anEntry = aResult->GetNext()))
579 {
580 TString dn = anEntry->GetDn();
581
582 if (dn.BeginsWith("dcsHost="))
fc5a4708 583 {
1d172743 584 dcsList.Add(anEntry);
585 }
586 else if (dn.BeginsWith("det="))
587 {
588 detList.Add(anEntry);
2c15234c 589 }
1d172743 590 else if (dn.BeginsWith("name=globalConfig"))
591 {
592 globalList.Add(anEntry);
2c15234c 593 }
1d172743 594 else if (dn.BeginsWith("system="))
595 {
596 sysList.Add(anEntry);
57f50b3c 597 }
1d172743 598 else if (dn.BeginsWith("shuttleHost="))
fc5a4708 599 {
1d172743 600 hostList.Add(anEntry);
fc5a4708 601 }
1d172743 602 else
603 {
604 delete anEntry;
57f50b3c 605 }
1d172743 606
607 }
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!");
620 }
621 else
622 {
623 fIsValid = kTRUE;
57f50b3c 624 }
73abe331 625}
626
a7160fe9 627//______________________________________________________________________________________________
628AliShuttleConfig::~AliShuttleConfig()
58bc3020 629{
630// destructor
631
73abe331 632 fDetectorMap.DeleteAll();
2bb7b766 633 fDetectorList.Clear();
634 fProcessedDetectors.Delete();
73abe331 635}
636
a7160fe9 637//______________________________________________________________________________________________
638const TObjArray* AliShuttleConfig::GetDetectors() const
58bc3020 639{
73abe331 640 //
641 // returns collection of TObjString which contains the name
642 // of every detector which is in the configuration.
643 //
644
645 return &fDetectorList;
646}
647
a7160fe9 648//______________________________________________________________________________________________
649Bool_t AliShuttleConfig::HasDetector(const char* detector) const
58bc3020 650{
73abe331 651 //
652 // checks for paricular detector in the configuration.
653 //
654 return fDetectorMap.GetValue(detector) != NULL;
655}
656
a7160fe9 657//______________________________________________________________________________________________
1d172743 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;
669 }
670
671 return aHolder->GetNServers();
672}
673
674
675//______________________________________________________________________________________________
676const char* AliShuttleConfig::GetDCSHost(const char* detector, Int_t iServ) const
58bc3020 677{
73abe331 678 //
1d172743 679 // returns i-th DCS server host used by particular detector
73abe331 680 //
681
1d172743 682 AliShuttleDetConfigHolder* aHolder = (AliShuttleDetConfigHolder*) fDetectorMap.GetValue(detector);
73abe331 683 if (!aHolder) {
684 AliError(Form("There isn't configuration for detector: %s",
685 detector));
686 return NULL;
687 }
688
1d172743 689 return aHolder->GetDCSHost(iServ);
73abe331 690}
691
a7160fe9 692//______________________________________________________________________________________________
1d172743 693Int_t AliShuttleConfig::GetDCSPort(const char* detector, Int_t iServ) const
58bc3020 694{
73abe331 695 //
1d172743 696 // returns i-th DCS server port used by particular detector
73abe331 697 //
698
699
1d172743 700 AliShuttleDetConfigHolder* aHolder = (AliShuttleDetConfigHolder*) fDetectorMap.GetValue(detector);
73abe331 701 if (!aHolder) {
702 AliError(Form("There isn't configuration for detector: %s",
703 detector));
704 return 0;
705 }
706
1d172743 707 return aHolder->GetDCSPort(iServ);
73abe331 708}
709
a7160fe9 710//______________________________________________________________________________________________
542b6cc8 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
728//______________________________________________________________________________________________
1d172743 729const TObjArray* AliShuttleConfig::GetDCSAliases(const char* detector, Int_t iServ) const
58bc3020 730{
73abe331 731 //
1d172743 732 // returns collection of TObjString which represents the i-th set of aliases
73abe331 733 // which used for data retrieval for particular detector
734 //
735
1d172743 736 AliShuttleDetConfigHolder* aHolder = (AliShuttleDetConfigHolder*) fDetectorMap.GetValue(detector);
73abe331 737 if (!aHolder) {
738 AliError(Form("There isn't configuration for detector: %s",
739 detector));
740 return NULL;
741 }
742
1d172743 743 return aHolder->GetDCSAliases(iServ);
b948db8d 744}
745
a7160fe9 746//______________________________________________________________________________________________
1d172743 747const TObjArray* AliShuttleConfig::GetDCSDataPoints(const char* detector, Int_t iServ) const
2c15234c 748{
749 //
750 // returns collection of TObjString which represents the set of aliases
751 // which used for data retrieval for particular detector
752 //
753
1d172743 754 AliShuttleDetConfigHolder* aHolder = (AliShuttleDetConfigHolder*) fDetectorMap.GetValue(detector);
2c15234c 755 if (!aHolder) {
756 AliError(Form("There isn't configuration for detector: %s",
757 detector));
758 return NULL;
759 }
760
1d172743 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);
2c15234c 798}
799
800//______________________________________________________________________________________________
57c1a579 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
1d172743 808 AliShuttleDetConfigHolder* aHolder = (AliShuttleDetConfigHolder*) fDetectorMap.GetValue(detector);
57c1a579 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//______________________________________________________________________________________________
a7160fe9 819Bool_t AliShuttleConfig::HostProcessDetector(const char* detector) const
58bc3020 820{
b948db8d 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;
828 }
829 return kFALSE;
73abe331 830}
831
a7160fe9 832//______________________________________________________________________________________________
be48e3ea 833Bool_t AliShuttleConfig::StrictRunOrder(const char* detector) const
834{
835 // return TRUE if detector wants strict run ordering of stored data
836
1d172743 837 AliShuttleDetConfigHolder* aHolder = (AliShuttleDetConfigHolder*) fDetectorMap.GetValue(detector);
be48e3ea 838 if (!aHolder)
839 {
840 AliError(Form("There isn't configuration for detector: %s",
841 detector));
842 return kTRUE;
843 }
844
845 return aHolder->StrictRunOrder();
846}
847
848//______________________________________________________________________________________________
1d172743 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");
877 if (!anAttribute) {
878 AliError("Can't find daqLbHost attribute!");
879 return 4;
880 }
881 fDAQlbHost = anAttribute->GetValue();
882
883 anAttribute = anEntry->GetAttribute("daqLbPort"); // MAY
884 if (anAttribute)
885 {
886 fDAQlbPort = ((TString) anAttribute->GetValue()).Atoi();
887 } else {
888 fDAQlbPort = 3306; // mysql
889 }
890
891 anAttribute = anEntry->GetAttribute("daqLbUser");
892 if (!anAttribute) {
893 AliError("Can't find daqLbUser attribute!");
894 return 4;
895 }
896 fDAQlbUser = anAttribute->GetValue();
897
898 anAttribute = anEntry->GetAttribute("daqLbPasswd");
899 if (!anAttribute) {
900 AliError("Can't find daqLbPasswd attribute!");
901 return 4;
902 }
903 fDAQlbPass = anAttribute->GetValue();
904
905 anAttribute = anEntry->GetAttribute("daqLbDB");
906 if (!anAttribute) {
907 AliError("Can't find daqLbDB attribute!");
908 return 4;
909 }
910 fDAQlbDB = anAttribute->GetValue();
911
912 anAttribute = anEntry->GetAttribute("daqLbTable");
913 if (!anAttribute) {
914 AliError("Can't find daqLbTable attribute!");
915 return 4;
916 }
917 fDAQlbTable = anAttribute->GetValue();
918
919 anAttribute = anEntry->GetAttribute("shuttleLbTable");
920 if (!anAttribute) {
921 AliError("Can't find shuttleLbTable attribute!");
922 return 4;
923 }
924 fShuttlelbTable = anAttribute->GetValue();
925
926 anAttribute = anEntry->GetAttribute("runTypeLbTable");
927 if (!anAttribute) {
928 AliError("Can't find runTypeLbTable attribute!");
929 return 4;
930 }
931 fRunTypelbTable = anAttribute->GetValue();
932
933 anAttribute = anEntry->GetAttribute("ppmaxRetries");
934 if (!anAttribute) {
935 AliError("Can't find ppmaxRetries attribute!");
936 return 4;
937 }
938 TString tmpStr = anAttribute->GetValue();
939 fMaxRetries = tmpStr.Atoi();
940
941 anAttribute = anEntry->GetAttribute("ppTimeOut");
942 if (!anAttribute) {
943 AliError("Can't find ppTimeOut attribute!");
944 return 4;
945 }
946 tmpStr = anAttribute->GetValue();
947 fPPTimeOut = tmpStr.Atoi();
948
949 anAttribute = anEntry->GetAttribute("ppMaxMem");
950 if (!anAttribute) {
951 AliError("Can't find ppMaxMem attribute!");
952 return 4;
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}
997
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 }
1011
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;
1023 }
1024 else if (sysName == "DCS")
1025 {
1026 iSys = 1;
1027 count += 10;
1028 }
1029 else if (sysName == "HLT")
1030 {
1031 iSys = 2;
1032 count += 100;
1033 }
1034
1035 anAttribute = anEntry->GetAttribute("dbHost");
1036 if (!anAttribute) {
1037 AliError(Form ("Can't find dbHost attribute for %s!!",
1038 AliShuttleInterface::GetSystemName(iSys)));
1039 return 5;
1040 }
1041 fFXSdbHost[iSys] = anAttribute->GetValue();
1042
1043 anAttribute = anEntry->GetAttribute("dbPort"); // MAY
1044 if (anAttribute)
1045 {
1046 fFXSdbPort[iSys] = ((TString) anAttribute->GetValue()).Atoi();
1047 } else {
1048 fFXSdbPort[iSys] = 3306; // mysql
1049 }
1050
1051 anAttribute = anEntry->GetAttribute("dbUser");
1052 if (!anAttribute) {
1053 AliError(Form ("Can't find dbUser attribute for %s!!",
1054 AliShuttleInterface::GetSystemName(iSys)));
1055 return 5;
1056 }
1057 fFXSdbUser[iSys] = anAttribute->GetValue();
1058
1059 anAttribute = anEntry->GetAttribute("dbPasswd");
1060 if (!anAttribute) {
1061 AliError(Form ("Can't find dbPasswd attribute for %s!!",
1062 AliShuttleInterface::GetSystemName(iSys)));
1063 return 5;
1064 }
1065 fFXSdbPass[iSys] = anAttribute->GetValue();
1066
1067 anAttribute = anEntry->GetAttribute("dbName");
1068 if (!anAttribute) {
1069 AliError(Form ("Can't find dbName attribute for %s!!",
1070 AliShuttleInterface::GetSystemName(iSys)));
1071 return 5;
1072 }
1073
1074 fFXSdbName[iSys] = anAttribute->GetValue();
1075 anAttribute = anEntry->GetAttribute("dbTable");
1076 if (!anAttribute) {
1077 AliError(Form ("Can't find dbTable attribute for %s!!",
1078 AliShuttleInterface::GetSystemName(iSys)));
1079 return 5;
1080 }
1081 fFXSdbTable[iSys] = anAttribute->GetValue();
1082
1083 anAttribute = anEntry->GetAttribute("fxsHost");
1084 if (!anAttribute) {
1085 AliError(Form ("Can't find fxsHost attribute for %s!!",
1086 AliShuttleInterface::GetSystemName(iSys)));
1087 return 5;
1088 }
1089 fFXSHost[iSys] = anAttribute->GetValue();
1090
1091 anAttribute = anEntry->GetAttribute("fxsPort"); // MAY
1092 if (anAttribute)
1093 {
1094 fFXSPort[iSys] = ((TString) anAttribute->GetValue()).Atoi();
1095 } else {
1096 fFXSPort[iSys] = 22; // scp port number
1097 }
1098
1099 anAttribute = anEntry->GetAttribute("fxsUser");
1100 if (!anAttribute) {
1101 AliError(Form ("Can't find fxsUser attribute for %s!!",
1102 AliShuttleInterface::GetSystemName(iSys)));
1103 return 5;
1104 }
1105 fFXSUser[iSys] = anAttribute->GetValue();
1106
1107 anAttribute = anEntry->GetAttribute("fxsPasswd");
1108 if (anAttribute) fFXSPass[iSys] = anAttribute->GetValue();
1109 }
1110
1111 if(count != 111) {
1112 AliError(Form("Wrong system configuration! (code = %d)", count));
1113 return 6;
1114 }
1115
1116 return 0;
1117}
1118
1119//______________________________________________________________________________________________
1120UInt_t AliShuttleConfig::SetDetConfig(TList* detList, TList* dcsList)
1121{
1122 // Set the detector configuration (general settings + DCS amanda server and alias/DP lists)
1123
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);
1131
1132 if (!detHolder->IsValid()) {
1133 AliError("Detector configuration error!");
1134 delete detHolder;
1135 return 7;
1136 }
1137
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);
1162 }
1163
1164 return 0;
1165}
1166
1167//______________________________________________________________________________________________
1168UInt_t AliShuttleConfig::SetHostConfig(TList* list)
1169{
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())))
1179 {
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;
1196}
1197
1198
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}