- Changes in the calibration framework to write the filtered friends in a
[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
cfa641b1 11 @author Jochen Thaeder and Svein Lindal
51346b82 12 @date
cfa641b1 13 @brief Manager for HOMER online
059c30e4 14*/
15
16#if __GNUC__>= 3
17 using namespace std;
18#endif
19
9e78371d 20#include "unistd.h"
cfa641b1 21//#include "TIter.h"
d810d0de 22#include "AliEveHOMERManager.h"
cfa641b1 23#include "AliHLTHOMERBlockDesc.h"
24//#include <TEveElementList.h>
25#include "AliHLTHOMERManager.h"
26#include "AliHLTTriggerDecision.h"
a15e6d7d 27
d810d0de 28ClassImp(AliEveHOMERManager)
a82a31af 29
059c30e4 30/*
31 * ---------------------------------------------------------------------------------
51346b82 32 * Constructor / Destructor
33 * ---------------------------------------------------------------------------------
059c30e4 34 */
a82a31af 35
059c30e4 36//##################################################################################
a82a31af 37AliEveHOMERManager::AliEveHOMERManager() :
cfa641b1 38 TEveElementList("Homer Manager"),
d52fea52 39 AliHLTHOMERManager(),
cfa641b1 40 fSrcList(NULL),
41 fRetryCount(1),
42 fRetrySleeptime(10000)
43{
44
45
46// see header file for class documentation
a82a31af 47 // or
48 // refer to README to build package
49 // or
50 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
059c30e4 51}
52
059c30e4 53//##################################################################################
d810d0de 54AliEveHOMERManager::~AliEveHOMERManager() {
a82a31af 55 // see header file for class documentation
059c30e4 56
a82a31af 57 if (fSrcList)
46eadbb4 58 delete fSrcList;
59 fSrcList = NULL;
059c30e4 60}
61
62/*
63 * ---------------------------------------------------------------------------------
7279ee15 64 * Source Handling
51346b82 65 * ---------------------------------------------------------------------------------
059c30e4 66 */
67
68//##################################################################################
a82a31af 69Int_t AliEveHOMERManager::CreateEveSourcesList() {
70 // see header file for class documentation
059c30e4 71
059c30e4 72 DestroyElements();
059c30e4 73
a82a31af 74 Int_t iResult = CreateSourcesList();
46eadbb4 75
a82a31af 76 fStateHasChanged = kTRUE;
77
78 if ( iResult )
059c30e4 79 return iResult;
51346b82 80
a82a31af 81 if (fSrcList)
82 delete fSrcList;
83 fSrcList = NULL;
51346b82 84
a82a31af 85 // -- Create new AliEVE sources list
86 fSrcList = new AliEveHOMERSourceList("HLT Sources");
87 fSrcList->SetManager(this);
88
89 AddElement(fSrcList);
90 fSrcList->CreateByType();
91
059c30e4 92 return iResult;
93}
94
059c30e4 95//##################################################################################
9e78371d 96Int_t AliEveHOMERManager::CreateEveSourcesListLoop() {
a82a31af 97 // see header file for class documentation
059c30e4 98
99 Int_t iResult = 0;
9e78371d 100
101 for ( Int_t retry = 0; retry < fRetryCount ; retry++ ) {
a82a31af 102
9e78371d 103 iResult = CreateEveSourcesList();
104 if (!iResult)
105 break;
106
107 else if (iResult == 1) {
cfa641b1 108 HLTWarning( Form("Couldn't find active services, sleeping %d s before making attempt %d out of %d", fRetrySleeptime, retry, fRetryCount) ) ;
9e78371d 109 }
110 else if (iResult == 2) {
cfa641b1 111 HLTWarning( Form("Services List empty, sleeping %d s", fRetrySleeptime) ) ;
9e78371d 112 }
113 else {
114 HLTError( Form("Other problem ... \n") );
115 return iResult;
116 }
117
118 sleep(fRetrySleeptime);
119 }
120
121 if ( iResult ) {
703482d8 122 HLTWarning( Form("Couldn't find active services.") );
9e78371d 123 return iResult;
124 }
a82a31af 125
9e78371d 126 return iResult;
127}
059c30e4 128
9e78371d 129//##################################################################################
703482d8 130Int_t AliEveHOMERManager::ConnectEVEtoHOMER( TString detector ) {
9e78371d 131 // see header file for class documentation
059c30e4 132
9e78371d 133 fStateHasChanged = fSrcList->GetSelectedSources();
46eadbb4 134
703482d8 135 return ConnectHOMER(detector);
059c30e4 136}
cfa641b1 137