]>
Commit | Line | Data |
---|---|---|
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 | 25 | ClassImp(AliEveHOMERManager) |
a82a31af | 26 | |
059c30e4 | 27 | /* |
28 | * --------------------------------------------------------------------------------- | |
51346b82 | 29 | * Constructor / Destructor |
30 | * --------------------------------------------------------------------------------- | |
059c30e4 | 31 | */ |
a82a31af | 32 | |
059c30e4 | 33 | //################################################################################## |
a82a31af | 34 | AliEveHOMERManager::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 | 48 | AliEveHOMERManager::~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 | 63 | Int_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 | 90 | Int_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) { | |
102 | HLTWarning( Form("Couldn't find active services, sleeping %d s\n", fRetryCount) ) ; | |
103 | } | |
104 | else if (iResult == 2) { | |
105 | HLTWarning( Form("Services List empty, sleeping %d s\n", fRetryCount) ) ; | |
106 | } | |
107 | else { | |
108 | HLTError( Form("Other problem ... \n") ); | |
109 | return iResult; | |
110 | } | |
111 | ||
112 | sleep(fRetrySleeptime); | |
113 | } | |
114 | ||
115 | if ( iResult ) { | |
116 | HLTError( Form("Couldn't find active services.\n") ); | |
117 | return iResult; | |
118 | } | |
a82a31af | 119 | |
9e78371d | 120 | return iResult; |
121 | } | |
059c30e4 | 122 | |
9e78371d | 123 | //################################################################################## |
124 | Int_t AliEveHOMERManager::ConnectEVEtoHOMER() { | |
125 | // see header file for class documentation | |
059c30e4 | 126 | |
9e78371d | 127 | fStateHasChanged = fSrcList->GetSelectedSources(); |
46eadbb4 | 128 | |
9e78371d | 129 | return ConnectHOMER(); |
059c30e4 | 130 | } |