Minor bugfixes and extensions for the onlineDiplay Interface
[u/mrichter/AliRoot.git] / EVE / EveHLT / AliEveHOMERManager.cxx
CommitLineData
a82a31af 1//-*- Mode: C++ -*-
2
d810d0de 3// $Id$
4// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
fd31e9de 5// Author: Jochen Thaeder <thaeder@kip.uni-heidelberg.de> *
6// for The ALICE HLT Project. *
059c30e4 7
a82a31af 8
7279ee15 9
d810d0de 10/** @file AliEveHOMERManager.cxx
059c30e4 11 @author Jochen Thaeder
51346b82 12 @date
059c30e4 13 @brief Manger for HOMER in offline
14*/
15
16#if __GNUC__>= 3
17 using namespace std;
18#endif
19
9e78371d 20#include "unistd.h"
21
d810d0de 22#include "AliEveHOMERManager.h"
059c30e4 23
a15e6d7d 24
d810d0de 25ClassImp(AliEveHOMERManager)
a82a31af 26
059c30e4 27/*
28 * ---------------------------------------------------------------------------------
51346b82 29 * Constructor / Destructor
30 * ---------------------------------------------------------------------------------
059c30e4 31 */
a82a31af 32
059c30e4 33//##################################################################################
a82a31af 34AliEveHOMERManager::AliEveHOMERManager() :
35 AliHLTHOMERManager(),
36 TEveElementList("Homer Manager"),
9e78371d 37 fSrcList(NULL),
38 fRetryCount(1),
39 fRetrySleeptime(10) {
a82a31af 40 // see header file for class documentation
41 // or
42 // refer to README to build package
43 // or
44 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
059c30e4 45}
46
059c30e4 47//##################################################################################
d810d0de 48AliEveHOMERManager::~AliEveHOMERManager() {
a82a31af 49 // see header file for class documentation
059c30e4 50
a82a31af 51 if (fSrcList)
46eadbb4 52 delete fSrcList;
53 fSrcList = NULL;
059c30e4 54}
55
56/*
57 * ---------------------------------------------------------------------------------
7279ee15 58 * Source Handling
51346b82 59 * ---------------------------------------------------------------------------------
059c30e4 60 */
61
62//##################################################################################
a82a31af 63Int_t AliEveHOMERManager::CreateEveSourcesList() {
64 // see header file for class documentation
059c30e4 65
059c30e4 66 DestroyElements();
059c30e4 67
a82a31af 68 Int_t iResult = CreateSourcesList();
46eadbb4 69
a82a31af 70 fStateHasChanged = kTRUE;
71
72 if ( iResult )
059c30e4 73 return iResult;
51346b82 74
a82a31af 75 if (fSrcList)
76 delete fSrcList;
77 fSrcList = NULL;
51346b82 78
a82a31af 79 // -- Create new AliEVE sources list
80 fSrcList = new AliEveHOMERSourceList("HLT Sources");
81 fSrcList->SetManager(this);
82
83 AddElement(fSrcList);
84 fSrcList->CreateByType();
85
059c30e4 86 return iResult;
87}
88
059c30e4 89//##################################################################################
9e78371d 90Int_t AliEveHOMERManager::CreateEveSourcesListLoop() {
a82a31af 91 // see header file for class documentation
059c30e4 92
93 Int_t iResult = 0;
9e78371d 94
95 for ( Int_t retry = 0; retry < fRetryCount ; retry++ ) {
a82a31af 96
9e78371d 97 iResult = CreateEveSourcesList();
98 if (!iResult)
99 break;
100
101 else if (iResult == 1) {
703482d8 102 HLTWarning( Form("Couldn't find active services, sleeping %d s", fRetryCount) ) ;
9e78371d 103 }
104 else if (iResult == 2) {
703482d8 105 HLTWarning( Form("Services List empty, sleeping %d s", fRetryCount) ) ;
9e78371d 106 }
107 else {
108 HLTError( Form("Other problem ... \n") );
109 return iResult;
110 }
111
112 sleep(fRetrySleeptime);
113 }
114
115 if ( iResult ) {
703482d8 116 HLTWarning( Form("Couldn't find active services.") );
9e78371d 117 return iResult;
118 }
a82a31af 119
9e78371d 120 return iResult;
121}
059c30e4 122
9e78371d 123//##################################################################################
703482d8 124Int_t AliEveHOMERManager::ConnectEVEtoHOMER( TString detector ) {
9e78371d 125 // see header file for class documentation
059c30e4 126
9e78371d 127 fStateHasChanged = fSrcList->GetSelectedSources();
46eadbb4 128
703482d8 129 return ConnectHOMER(detector);
059c30e4 130}