Fixing deletion of array.
[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
d810d0de 20#include "AliEveHOMERManager.h"
059c30e4 21
a15e6d7d 22
d810d0de 23ClassImp(AliEveHOMERManager)
a82a31af 24
059c30e4 25/*
26 * ---------------------------------------------------------------------------------
51346b82 27 * Constructor / Destructor
28 * ---------------------------------------------------------------------------------
059c30e4 29 */
a82a31af 30
059c30e4 31//##################################################################################
a82a31af 32AliEveHOMERManager::AliEveHOMERManager() :
33 AliHLTHOMERManager(),
34 TEveElementList("Homer Manager"),
06272c83 35 fSrcList(NULL) {
a82a31af 36 // see header file for class documentation
37 // or
38 // refer to README to build package
39 // or
40 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
059c30e4 41}
42
059c30e4 43//##################################################################################
d810d0de 44AliEveHOMERManager::~AliEveHOMERManager() {
a82a31af 45 // see header file for class documentation
059c30e4 46
a82a31af 47 if (fSrcList)
46eadbb4 48 delete fSrcList;
49 fSrcList = NULL;
059c30e4 50}
51
52/*
53 * ---------------------------------------------------------------------------------
7279ee15 54 * Source Handling
51346b82 55 * ---------------------------------------------------------------------------------
059c30e4 56 */
57
58//##################################################################################
a82a31af 59Int_t AliEveHOMERManager::CreateEveSourcesList() {
60 // see header file for class documentation
059c30e4 61
059c30e4 62 DestroyElements();
059c30e4 63
a82a31af 64 Int_t iResult = CreateSourcesList();
46eadbb4 65
a82a31af 66 fStateHasChanged = kTRUE;
67
68 if ( iResult )
059c30e4 69 return iResult;
51346b82 70
a82a31af 71 if (fSrcList)
72 delete fSrcList;
73 fSrcList = NULL;
51346b82 74
a82a31af 75 // -- Create new AliEVE sources list
76 fSrcList = new AliEveHOMERSourceList("HLT Sources");
77 fSrcList->SetManager(this);
78
79 AddElement(fSrcList);
80 fSrcList->CreateByType();
81
059c30e4 82 return iResult;
a82a31af 83
059c30e4 84}
85
059c30e4 86
87//##################################################################################
a82a31af 88Int_t AliEveHOMERManager::ConnectEVEtoHOMER() {
89 // see header file for class documentation
059c30e4 90
91 Int_t iResult = 0;
a82a31af 92
93 fStateHasChanged = fSrcList->GetSelectedSources();
94
95 cout<<"In ConnectEVEtoHOMER"<<endl;
059c30e4 96
97 iResult = ConnectHOMER();
059c30e4 98
46eadbb4 99
059c30e4 100 return iResult;
a82a31af 101
059c30e4 102}