+//-*- Mode: C++ -*-
+
// $Id$
// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
// Author: Jochen Thaeder <thaeder@kip.uni-heidelberg.de> *
// for The ALICE HLT Project. *
-//-*- Mode: C++ -*-
+
/** @file AliEveHOMERManager.cxx
@author Jochen Thaeder
#include "AliEveHOMERManager.h"
-#define EVE_DEBUG 1
-// -- -- -- -- -- -- --
-#include "AliHLTHOMERLibManager.h"
-#include "AliHLTHOMERSourceDesc.h"
-#include "AliHLTHOMERBlockDesc.h"
-// -- -- -- -- -- -- --
-#include "AliEveHOMERSource.h"
-// -- -- -- -- -- -- --
-#include "TString.h"
-#include <TApplication.h>
-#include "Riostream.h"
-#include "TXMLAttr.h"
-#include "TCollection.h"
-#include "TList.h"
-#include "TObjString.h"
-#include "TObjArray.h"
-// -- -- -- -- -- -- --
-#include "AliLog.h"
-
-//______________________________________________________________________________
-//
-// Manage connections to HLT data-sources.
ClassImp(AliEveHOMERManager)
-
+
/*
* ---------------------------------------------------------------------------------
* Constructor / Destructor
* ---------------------------------------------------------------------------------
*/
-
+
//##################################################################################
-AliEveHOMERManager::AliEveHOMERManager( TString xmlFile ) :
- TEveElementList("AliEveHOMERManager"),
- fLibManager(new AliHLTHOMERLibManager),
- fXMLHandler( new AliEveHOMERXMLHandler( xmlFile ) ),
- fSourceList(NULL),
- fReader(NULL),
- fBlockList(NULL),
- fNBlks(0),
- fEventID(0),
- fCurrentBlk(0),
- fConnected(kFALSE),
- fStateHasChanged(kTRUE),
+AliEveHOMERManager::AliEveHOMERManager() :
+ AliHLTHOMERManager(),
+ TEveElementList("Homer Manager"),
fSrcList(NULL) {
- // This Class should handle the communication
- // from the HLT to AliEVE. The HLT sends data via
- // the HOMER interface on several TCP ports of nodes
- // in the CERN GPN and DCS network.
- // All this communication is hidden from the user.
- //
- // Right now, a xml file ( SCC1 ) is used to get the
- // configuration, this will/ has to change to a proxy
- // running on dedicated nodes.
-
+ // see header file for class documentation
+ // or
+ // refer to README to build package
+ // or
+ // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
}
//##################################################################################
AliEveHOMERManager::~AliEveHOMERManager() {
- // The destructor
-
- if ( fLibManager ) {
- if ( fReader )
- fLibManager->DeleteReader(fReader);
- delete fLibManager;
- fLibManager = NULL;
- fReader = NULL;
- }
-
- if ( fXMLHandler != NULL )
- delete fXMLHandler;
- fXMLHandler = NULL;
+ // see header file for class documentation
- if ( fSourceList != NULL )
- delete fSourceList;
- fSourceList = NULL;
-
- if ( fBlockList != NULL )
- delete fBlockList;
- fBlockList = NULL;
-
- if ( fSrcList != NULL )
+ if (fSrcList)
delete fSrcList;
fSrcList = NULL;
}
*/
//##################################################################################
-Int_t AliEveHOMERManager::CreateHOMERSourcesList() {
- // Create Sources List from HOMER-Proxy
-
- Int_t iResult = 0;
+Int_t AliEveHOMERManager::CreateEveSourcesList() {
+ // see header file for class documentation
- // -- Initialize sources list
DestroyElements();
- if ( fSourceList != NULL )
- delete fSourceList;
- fSourceList = NULL;
-
- fSourceList = new TList();
- fSourceList->SetOwner( kTRUE );
-
- iResult = fXMLHandler->FillSourceList( fSourceList );
-
- if ( iResult ) {
- AliWarning( Form("There have been errors, while creating the sources list.") );
- }
- else {
- AliInfo( Form("New sources list created.") );
-
- // -- New SourceList has been created --> All Sources are new --> State has changed
- fStateHasChanged = kTRUE;
-
- if ( fSrcList )
- delete fSrcList;
-
- // -- Create new AliEVE sources list
- fSrcList = new AliEveHOMERSourceList("HLT Sources");
- fSrcList->SetManager(this);
-
- AddElement(fSrcList);
- fSrcList->CreateByType();
- }
-
- return iResult;
-}
-//##################################################################################
-void AliEveHOMERManager::SetSourceState( AliHLTHOMERSourceDesc * source, Bool_t state ) {
- // Set state of a source
- // * param source Pointer to AliHLTHOMERSourceDesc object.
- // * param state New (selected/not selected) state.
+ Int_t iResult = CreateSourcesList();
- if ( source->IsSelected() != state ) {
- source->SetState( state );
- fStateHasChanged = kTRUE;
- }
-
- return;
-}
-
-/*
- * ---------------------------------------------------------------------------------
- * Connection Handling
- * ---------------------------------------------------------------------------------
- */
-
-//##################################################################################
-Int_t AliEveHOMERManager::ConnectHOMER(){
- // Connect to HOMER sources, out of Readout List, which gets created when state has changed
- // * return 0 on sucess, "HOMER" errors on error
-
- Int_t iResult = 0;
-
- fStateHasChanged = fSrcList->GetSelectedSources();
-
- // -- Check if already connected and state has not changed
- if ( fStateHasChanged == kFALSE && IsConnected() ) {
- AliInfo( Form("No need for reconnection.") );
- return iResult;
- }
-
- // -- If already connected, disconnect before connect
- if ( IsConnected() )
- DisconnectHOMER();
-
- // *** Create the Readoutlist
-
- UShort_t* sourcePorts = new UShort_t [fSourceList->GetEntries()];
- const char ** sourceHostnames = new const char* [fSourceList->GetEntries()];
- UInt_t sourceCount = 0;
-
- CreateReadoutList( sourceHostnames, sourcePorts, sourceCount );
-
- if ( sourceCount == 0 ) {
- AliError(Form("No sources selected, aborting.") );
+ fStateHasChanged = kTRUE;
+
+ if ( iResult )
return iResult;
- }
-
- // *** Connect to data sources
-
- if ( !fReader ) {
- if ( fLibManager )
- fReader = fLibManager->OpenReader( sourceCount, sourceHostnames, sourcePorts );
- }
-
- iResult = fReader->GetConnectionStatus();
-
- if ( iResult ) {
- // -- Connection failed
- UInt_t ndx = fReader->GetErrorConnectionNdx();
-
- if ( ndx < sourceCount ) {
- AliError( Form("Error : Error establishing connection to TCP source %s:%hu: %s (%d)",
- sourceHostnames[ndx], sourcePorts[ndx], strerror(iResult), iResult) );
- }
- else {
- AliError( Form("Error : Error establishing connection to unknown source with index %d: %s (%d)",
- ndx, strerror(iResult), iResult) );
- }
-
- if ( fReader )
- fLibManager->DeleteReader( fReader );
- fReader = NULL;
-
- }
- else {
- // -- Connection ok - set reader
- fConnected = kTRUE;
-
- AliInfo( Form("Connection established") );
- }
-
- delete[] sourceHostnames;
- delete[] sourcePorts;
+ if (fSrcList)
+ delete fSrcList;
+ fSrcList = NULL;
+ // -- Create new AliEVE sources list
+ fSrcList = new AliEveHOMERSourceList("HLT Sources");
+ fSrcList->SetManager(this);
+
+ AddElement(fSrcList);
+ fSrcList->CreateByType();
+
return iResult;
+
}
-//##################################################################################
-void AliEveHOMERManager::DisconnectHOMER(){
- // Disconnect from HOMER sources
-
- if ( ! IsConnected() )
- return;
-
- if ( fReader )
- fLibManager->DeleteReader( fReader );
- fReader = NULL;
-
- fStateHasChanged = kTRUE;
- fConnected = kFALSE;
-
- AliInfo( Form("Connection closed") );
-
- return;
-}
//##################################################################################
-Int_t AliEveHOMERManager::ReconnectHOMER(){
- // Reconnect from HOMER sources
- // * return 0 on sucess, "ConnectHOMER()" errors on error
+Int_t AliEveHOMERManager::ConnectEVEtoHOMER() {
+ // see header file for class documentation
Int_t iResult = 0;
-
- if ( IsConnected() )
- DisconnectHOMER();
+
+ fStateHasChanged = fSrcList->GetSelectedSources();
+
+ cout<<"In ConnectEVEtoHOMER"<<endl;
iResult = ConnectHOMER();
- if ( iResult ) {
- AliError( Form("Error connecting.") );
- }
-
- return iResult;
-}
-
-//##################################################################################
-void AliEveHOMERManager::CreateReadoutList( const char** sourceHostnames, UShort_t *sourcePorts, UInt_t &sourceCount ){
- // Create a readout list for Hostname and ports
- // * param socurceHostnames Array of selected hostnames
- // * param socurcePorts Array of selected ports
- // * param socurceCount Number of selected hostname:port
-
- AliHLTHOMERSourceDesc * source= NULL;
-
- // -- Read all sources and check if they should be read out
- TIter next( fSourceList );
- while ( ( source = (AliHLTHOMERSourceDesc*)next() ) ) {
-
- if ( ! source->IsSelected() )
- continue;
-
- Bool_t exists = kFALSE;
-
- // -- Loop over existing entries and check if entry is already in readout list
- for ( UInt_t ii = 0; ii < sourceCount; ii++ ){
- if ( !strcmp( sourceHostnames[ii], source->GetHostname().Data() ) && sourcePorts[ii] == source->GetPort() ) {
- exists = kTRUE;
- break;
- }
- }
-
- // -- Add new entires to readout list
- if ( ! exists ) {
- sourcePorts[sourceCount] = source->GetPort();
- sourceHostnames[sourceCount] = source->GetHostname().Data();
- sourceCount++;
- }
-
- } // while ( ( source = (AliHLTHOMERSourceDesc*)next() ) ) {
-
- fStateHasChanged = kFALSE;
-
- return;
-}
-
-/*
- * ---------------------------------------------------------------------------------
- * Event Handling
- * ---------------------------------------------------------------------------------
- */
-//##################################################################################
-Int_t AliEveHOMERManager::NextEvent(){
- // Loads the next Event, after being connected
- // * return 0 on sucess, "HOMER" errors on error
-
- Int_t iResult = 0;
- Int_t iRetryCount = 0;
-
- if ( !fReader || ! IsConnected() ) {
- AliWarning( Form( "Not connected yet." ) );
- return 1;
- }
-
- // fReader->SetEventRequestAdvanceTime( 20000000 /*timeout in us*/ );
-
- // -- Read next event data and error handling for HOMER (error codes and empty blocks)
- while( 1 ) {
-
- iResult = fReader->ReadNextEvent( 40000000 /*timeout in us*/);
-
- if ( iResult == 111 || iResult == 32 || iResult == 6 ) {
- Int_t ndx = fReader->GetErrorConnectionNdx();
- AliError( Form("Error, No Connection to source %d: %s (%d)",
- ndx, strerror(iResult), iResult) );
- return 2;
- }
- else if ( iResult == 110 ) {
- Int_t ndx = fReader->GetErrorConnectionNdx();
- AliError( Form("Timout occured, reading event from source %d: %s (%d)",
- ndx, strerror(iResult), iResult) );
- return 3;
- }
- else if ( iResult == 56) {
- Int_t ndx = fReader->GetErrorConnectionNdx();
-
- ++iRetryCount;
-
- if ( iRetryCount >= 20 ) {
- AliError( Form("Retry Failed: Error reading event from source %d: %s (%d)",
- ndx, strerror(iResult), iResult) );
- return 4;
- }
- else {
- AliError( Form("Retry: Error reading event from source %d: %s (%d)",
- ndx, strerror(iResult), iResult) );
- continue;
- }
- }
- else if ( iResult ) {
- Int_t ndx = fReader->GetErrorConnectionNdx();
- AliError( Form("General Error reading event from source %d: %s (%d)",
- ndx, strerror(iResult), iResult) );
- fConnected = kFALSE;
- return 2;
- }
- else {
- break;
- }
- } // while( 1 ) {
-
- if ( iResult )
- return iResult;
- // -- Get blockCnt and eventID
- fNBlks = (ULong_t) fReader->GetBlockCnt();
- fEventID = (ULong64_t) fReader->GetEventID();
- fCurrentBlk = 0;
-
- AliInfo( Form("Event 0x%016LX (%Lu) with %lu blocks", fEventID, fEventID, fNBlks) );
-
-#if EVE_DEBUG
- // Loop for Debug only
- for ( ULong_t i = 0; i < fNBlks; i++ ) {
- Char_t tmp1[9], tmp2[5];
- memset( tmp1, 0, 9 );
- memset( tmp2, 0, 5 );
- void *tmp11 = tmp1;
- ULong64_t* tmp12 = (ULong64_t*)tmp11;
- *tmp12 = fReader->GetBlockDataType( i );
- void *tmp21 = tmp2;
- ULong_t* tmp22 = (ULong_t*)tmp21;
- *tmp22 = fReader->GetBlockDataOrigin( i );
- AliInfo( Form("Block %lu length: %lu - type: %s - origin: %s",
- i, fReader->GetBlockDataLength( i ), tmp1, tmp2) );
- } // end for ( ULong_t i = 0; i < fNBlks; i++ ) {
-#endif
-
- // -- Create BlockList
- AliInfo( Form("Create Block List") );
- iResult = CreateBlockList();
-
- return iResult;
-}
-
-//##################################################################################
-Int_t AliEveHOMERManager::CreateBlockList() {
- // Create a TList of blocks, which have been readout
-
-
- Int_t iResult = 0;
-#if 0
- // -- Initialize block list
- if ( fBlockList != NULL )
- delete fBlockList;
- fBlockList = NULL;
-
- fBlockList = new TList();
- fBlockList->SetOwner( kTRUE );
-
- void* iter = GetFirstBlk();
-
- // -- Fill block list
- while ( iter != NULL ){
-
- // -- Create new block
- AliHLTHOMERBlockDesc * block = new AliHLTHOMERBlockDesc( GetBlk(), GetBlkSize(), GetBlkOrigin(),
- GetBlkType(), GetBlkSpecification() );
-
- // -- Check sources list if block is requested
- if ( CheckIfRequested( block ) )
- fBlockList->Add( block );
- else {
- //The Following 2 line commented out and the previous is added.
- // delete block;
- // block = NULL;
- fBlockList->Add( block );
- }
- iter = GetNextBlk();
-
- } // while ( iter != NULL ){
-#endif
return iResult;
+
}
-
-/*
- * ---------------------------------------------------------------------------------
- * BlockHandling
- * ---------------------------------------------------------------------------------
- */
-
-//##################################################################################
-void* AliEveHOMERManager::GetBlk( Int_t ndx ) {
- // Get pointer to current block in current event
- // * param ndx Block index
- // * return returns pointer to blk, NULL if no block present
-
- void* data = NULL;
-
- if ( !fReader || ! IsConnected() ) {
- AliError( Form("Not connected yet.") );
- }
- else {
- if ( ( ndx ) < (Int_t) fNBlks )
- data = (void*) fReader->GetBlockData( ndx );
- }
-
- return data;
-}
-
-//##################################################################################
-ULong_t AliEveHOMERManager::GetBlkSize( Int_t ndx ) {
- // Get size of block ndx
- // * param ndx Block index
- // * return returns pointer to blk, 0 if no block present
-
- ULong_t length = 0;
-
- if ( !fReader || ! IsConnected() ) {
- AliError( Form("Not connected yet.") );
- }
- else {
- if ( ( ndx ) < (Int_t) fNBlks )
- length = (ULong_t) fReader->GetBlockDataLength( ndx );
- }
-
- return length;
-}
-
-//##################################################################################
-TString AliEveHOMERManager::GetBlkOrigin( Int_t ndx ) {
- // Get origin of block ndx
- // * param ndx Block index
- // * return origin of block
-
- TString origin = "";
-
- // -- Check for Connection
- if ( !fReader || ! IsConnected() ) {
- AliError( Form("Not connected yet.") );
- return origin;
- }
-
- // -- Check block index
- if ( ( ndx ) >= (Int_t) fNBlks ) {
- AliError( Form("Block index %d out of range.", ndx ) );
- return origin;
- }
-
- // -- Get origin
- union{
- UInt_t data;
- Char_t array[4];
- } reverseOrigin;
-
- reverseOrigin.data = (UInt_t) fReader->GetBlockDataOrigin( ndx );
-
- // -- Reverse the order
- for (Int_t ii = 3; ii >= 0; ii-- )
- if ( reverseOrigin.array[ii] != ' ')
- origin.Append( reverseOrigin.array[ii] );
-
- return origin;
-}
-
-//##################################################################################
-TString AliEveHOMERManager::GetBlkType( Int_t ndx ) {
- // Get type of block ndx
- // * param ndx Block index
- // * return type of block
-
- TString type = "";
-
- // -- Check for Connection
- if ( !fReader || ! IsConnected() ) {
- AliError( Form("Not connected yet.") );
- return type;
- }
-
- // -- Check blockk index
- if ( ( ndx ) >= (Int_t) fNBlks ) {
- AliError( Form("Block index %d out of range.", ndx ) );
- return type;
- }
-
- // -- Get type
- union{
- ULong64_t data;
- Char_t array[8];
- } reverseType;
-
- reverseType.data = (ULong64_t) fReader->GetBlockDataType( ndx );
-
- // -- Reverse the order
- for (Int_t ii = 7; ii >= 0; ii-- )
- if ( reverseType.array[ii] != ' ')
- type.Append( reverseType.array[ii] );
-
- return type;
-}
-
-//##################################################################################
-ULong_t AliEveHOMERManager::GetBlkSpecification( Int_t ndx ) {
- // Get specification of block ndx
- // * param ndx Block index
- // * return specification of block
-
- ULong_t spec = 0;
-
- // -- Check for Connection
- if ( !fReader || ! IsConnected() ) {
- AliError( Form("Not connected yet.") );
- return spec;
- }
-
- // -- Check blockk index
- if ( ( ndx ) >= (Int_t) fNBlks ) {
- AliError( Form("Block index %d out of range.", ndx ) );
- return spec;
- }
-
- spec = (ULong_t) fReader->GetBlockDataSpec( ndx );
-
- return spec;
-}
-
-//##################################################################################
-Bool_t AliEveHOMERManager::CheckIfRequested( AliHLTHOMERBlockDesc */* block*/ ) {
- // Checks if current Block should was requested
- // * return returns kTRUE, if block should was requested
-
- Bool_t requested = kFALSE;
-#if 0
- AliHLTHOMERSourceDesc * source= NULL;
-
- // -- Read all sources and check if they should be read out
- TIter next( fSourceList );
- while ( ( source = (AliHLTHOMERSourceDesc*)next() ) ) {
-
- if ( ! source->IsSelected() )
- continue;
-
- if ( !( block->GetDetector().CompareTo( "*** " ) && block->GetDetector().CompareTo( "***" ) ) ) {
- // if not any detector
- if ( source->GetDetector().CompareTo( block->GetDetector() ) )
- continue;
- }
-
- if ( ! ( block->GetDataType().CompareTo( "******* " ) && block->GetDataType().CompareTo( "******* " ) ) ) {
- if ( source->GetDataType().CompareTo( block->GetDataType() ) )
- continue;
- }
-
- if ( ! block->HasSubDetectorRange() ) {
- if ( source->GetSubDetector().Atoi() != block->GetSubDetector().Atoi() )
- continue;
-
- if ( ! block->HasSubSubDetectorRange() ) {
-
- if ( source->GetSubSubDetector().Atoi() != block->GetSubSubDetector().Atoi() )
- continue;
-
- } // if ( ! block->HasSubSubDetectorRange ) {
- } // if ( ! block->HasSubDetectorRange ) {
-
- requested = kTRUE;
- break;
-
- } // while ( ( source = (AliHLTHOMERSourceDesc*)next() ) ) {
-
-#if EVE_DEBUG
-
- if ( block->GetDataType().CompareTo("CLUSTERS") ) {
- if ( requested ) {
- AliError( Form("Block requested : %s - %s : %s/%s -> %s ", block->GetDetector().Data(), block->GetDataType().Data(),
- block->GetSubDetector().Data(), block->GetSubSubDetector().Data(), block->GetClassName().Data() ) );
- }
- else {
- AliError( Form("Block NOT requested : %s - %s : %s/%s -> %s ", block->GetDetector().Data(), block->GetDataType().Data(),
- block->GetSubDetector().Data(), block->GetSubSubDetector().Data(), block->GetClassName().Data() ) );
- }
-
- }
-#endif
-#endif
- return requested;
-}
-
+//-*- Mode: C++ -*-
+
// $Id$
// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
* full copyright notice. *
**************************************************************************/
-//-*- Mode: C++ -*-
-#ifndef ALIEVEHOMERMANGER_H
-#define ALIEVEHOMERMANGER_H
+#ifndef ALIEVEHOMERMANAGER_H
+#define ALIEVEHOMERMANAGER_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/** @file AliEveHOMERManager.h
@author Jochen Thaeder
@date
- @brief Manager for HOMER in offline
+ @brief Manager for HOMER in offline. Inherits most functionalitye
+ from AliHLTHOMERManager, with small additions for alieve interface
*/
-
-#include <TEveElement.h>
-
-#include "TString.h"
-#include "TDOMParser.h"
-#include "TXMLNode.h"
-#include "TList.h"
-
+#include <AliHLTHOMERManager.h>
+#include <TEveEventManager.h>
#include "AliEveHOMERSourceList.h"
-#include "AliHLTHOMERSourceDesc.h"
-#include "AliHLTHOMERBlockDesc.h"
-#include "AliHLTHOMERReader.h"
-#include "AliEveHOMERXMLHandler.h"
-
-#include "AliTPCPreprocessorOnline.h"
-
-class AliHLTHOMERLibManager;
-class AliEveHOMERManager : public TEveElementList
+class AliEveHOMERManager : public AliHLTHOMERManager, public TEveElementList
{
public:
*/
/** constructor */
- AliEveHOMERManager(TString xmlFile="" );
+ AliEveHOMERManager();
/** destructor */
virtual ~AliEveHOMERManager();
- /*
- * ---------------------------------------------------------------------------------
- * Source Handling - public
- * ---------------------------------------------------------------------------------
- */
-
- /** Create Sources List from HOMER-Proxy */
- Int_t CreateHOMERSourcesList();
- /** Set state of a source */
- void SetSourceState( AliHLTHOMERSourceDesc* source, Bool_t state);
- /** Get pointer to source List */
- TList* GetSourceList() { return fSourceList; } // Get pointer to source List
/*
* ---------------------------------------------------------------------------------
- * Connection Handling - public
+ * Source Handling - public
* ---------------------------------------------------------------------------------
*/
- /** Connect to HOMER sources, out of Readout List, which gets created when state has changed */
- Int_t ConnectHOMER();
-
- /** Disconnect from HOMER sources */
- void DisconnectHOMER();
-
- /** Reconnect from HOMER sources */
- Int_t ReconnectHOMER();
-
- /*
- * ---------------------------------------------------------------------------------
- * Event Handling - public
- * ---------------------------------------------------------------------------------
+ /** Create Sources List from HOMER-Proxy
+ * @return 0 on success, <0 for failure, 1 for no active service
*/
-
- /** Loads the next Event, after being connected */
- Int_t NextEvent();
-
- /** Get event ID */
- ULong_t GetEventID() { return fEventID; } // Get event ID
-
- /** Get pointer to block List */
- TList* GetBlockList() { return fBlockList; } // Get pointer to block List
+ Int_t CreateEveSourcesList();
- ///////////////////////////////////////////////////////////////////////////////////
-
-protected:
-
- AliHLTHOMERLibManager* fLibManager; //! Dynamic loader manager for the HOMER library
+ Int_t ConnectEVEtoHOMER();
///////////////////////////////////////////////////////////////////////////////////
private:
- AliEveHOMERManager(const AliEveHOMERManager&); // Not implemented.
- AliEveHOMERManager& operator=(const AliEveHOMERManager&); // Not implemented.
-
- /*
- * ---------------------------------------------------------------------------------
- * Connection Handling - private
- * ---------------------------------------------------------------------------------
- */
-
- /** Create a readout list for Hostname and ports */
- void CreateReadoutList( const char** sourceHostnames, UShort_t* sourcePorts, UInt_t &sourceCount);
-
- /** Checks if already connected to HOMER sources */
- Bool_t IsConnected() { return fConnected; } // Checks if already connected to HOMER sources
-
- /** Sets realm ( which can be ACR, GPN, HLT, KIP ) */
- void SetRealm( TString s ) { fXMLHandler->SetRealm(s); } // Sets realm ( which can be ACR, GPN, HLT, KIP )
-
- /* ---------------------------------------------------------------------------------
- * Event Handling - private
- * ---------------------------------------------------------------------------------
- */
-
- /** Create a TList of blocks, which have been readout */
- Int_t CreateBlockList();
-
- /*
- * ---------------------------------------------------------------------------------
- * Block Handling - private
- * ---------------------------------------------------------------------------------
- */
-
- /** Get Number of blocks in current event */
- ULong_t GetNBlks() { return fNBlks; } // Get Number of blocks in current event
-
- /** Get pointer to block ndx in current event */
- void* GetBlk( Int_t ndx );
-
- /** Get pointer to current block in current event */
- void* GetBlk() { return GetBlk( fCurrentBlk ); } // Get pointer to current block in current event
-
- /** Get first block in current event */
- void* GetFirstBlk() { return GetBlk( 0 ); } // Get first block in current event
+ /** copy constructor prohibited */
+ AliEveHOMERManager(const AliEveHOMERManager&);
- /** Get next block in current event */
- void* GetNextBlk() { return GetBlk( ++fCurrentBlk ); } // Get next block in current event
-
- /** Get size of block ndx */
- ULong_t GetBlkSize( Int_t ndx );
-
- /** Get size of current block */
- ULong_t GetBlkSize() { return GetBlkSize( fCurrentBlk ); } // Get size of current block
-
- /** Get origin of block ndx */
- TString GetBlkOrigin( Int_t ndx );
-
- /** Get origin of current block */
- TString GetBlkOrigin(){ return GetBlkOrigin( fCurrentBlk ); } // Get origin of current block
-
- /** Get type of block ndx */
- TString GetBlkType( Int_t ndx );
-
- /** Get type of current block */
- TString GetBlkType() { return GetBlkType( fCurrentBlk ); } // Get type of current block
-
- /** Get specification of block ndx */
- ULong_t GetBlkSpecification( Int_t ndx );
-
- /** Get specification of current block */
- ULong_t GetBlkSpecification() { return GetBlkSpecification( fCurrentBlk ); } // Get specification of current block
-
- /** Checks if current Block should was requested */
- Bool_t CheckIfRequested( AliHLTHOMERBlockDesc* block );
+ /** assignment operator prohibited */
+ AliEveHOMERManager& operator=(const AliEveHOMERManager&);
/*
* ---------------------------------------------------------------------------------
* ---------------------------------------------------------------------------------
*/
- // == XML handler ==
- AliEveHOMERXMLHandler* fXMLHandler; //! Handles HLT XML Config Files
-
// == sources ==
- TList * fSourceList; //! List to HOMER sources
-
- // == connection ==
- AliHLTHOMERReader* fReader; //! Pointer to HOMER reader
+ AliEveHOMERSourceList* fSrcList; // List of Connected HOMER Sources
- // == blocks ==
- TList * fBlockList; //! List to HOMER blocks
-
- // == events ==
- ULong_t fNBlks; // Number of blockes in current event
- ULong64_t fEventID; // EventID of current event
- ULong_t fCurrentBlk; // Current block in current event
+ ClassDef(AliEveHOMERManager, 0); // Manage connections to HLT data-sources.
- // == states ==
- Bool_t fConnected; // Shows connection status
- Bool_t fStateHasChanged; // Indicates, if a sources have changes, so that one has to reconnect.
+};
- // == sources ==
- AliEveHOMERSourceList* fSrcList; // List of HOMER Sources
- ClassDef(AliEveHOMERManager, 0); // Manage connections to HLT data-sources.
-};
#endif
AddFrame(fButtonNextEvent); //, new TGLayoutHints(...));
fButtonNextEvent->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "NextEvent()");
- fButtonEventLoop = new TGTextButton(this, " not yet used ");
+
+ fButtonEventLoop = new TGPictureButton(this, gClient->GetPicture("$ALICE_ROOT/EVE/hlt-macros/HLT-logo.png"));
AddFrame(fButtonEventLoop); //, new TGLayoutHints(...));
fButtonEventLoop->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "EventLoop()");
{
// Connects to HOMER sources -> to HLT.
- fM->ConnectHOMER();
+ fM->ConnectEVEtoHOMER();
}
void AliEveHOMERManagerEditor::NextEvent()
void AliEveHOMERManagerEditor::EventLoop()
{
- // Start/stop event loop
- fM->ConnectHOMER();
+ // Start/stop event loop
+ if ( !fEventLoopStarted ) {
+ gROOT->ProcessLineFast("loopEvent();");
+ fEventLoopStarted = kTRUE;
+ }
+ else {
+ gROOT->ProcessLineFast("stopLoopEvent();");
+ fEventLoopStarted = kFALSE;
+ }
}
class TGTextButton;
class TGNumberEntry;
class TGColorSelect;
+class TGPictureButton;
class AliEveHOMERManager;
TGTextButton *fButtonConnect; // Button to connect to HOMER.
TGTextButton *fButtonNextEvent; // Button to call next Event
- TGTextButton *fButtonEventLoop; // Button to start/stop event loop
-
+ TGPictureButton *fButtonEventLoop; // Button to start/stop event loop, HLT LOGO.
private:
AliEveHOMERManagerEditor(const AliEveHOMERManagerEditor&); // Not implemented
AliEveHOMERManagerEditor& operator=(const AliEveHOMERManagerEditor&); // Not implemented
+//-*- Mode: C++ -*-
+
// $Id$
// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
void AliEveHOMERSourceList::RebuildSourceReps()
{
DestroyElements();
- // !!!! if fManager ?
- // ???? fManager->CreateHOMERSourcesList();
TList* srcList = fManager->GetSourceList();
fSrcMap->FillMap(srcList, 1);
parentStack.back()->AddElement(src);
parentStack.push_back(src); ++parentLvl;
- /*
+
printf("%*s%s [state=%d, handle=0x%lx] {ssdet='%s'}\n", 4*i.level(), "",
i.description().Data(), i.state().fState,
(ULong_t) i.state().fHandle,
i.id().fSSDet.Data());
- */
+
}
}
fManager->SetSourceState( (AliHLTHOMERSourceDesc*) iter.state().fHandle,iter.state().fState );
bResult = kTRUE;
- /*
+#if 0 // EVE_DEBUG
printf("%*s%s [state=%d, handle=0x%lx] {ssdet='%s'}\n", 4*iter.level(), "",
iter.description().Data(), iter.state().fState,
(ULong_t) iter.state().fHandle,
iter.id().fSSDet.Data());
- */
-
+
+#endif
+//-*- Mode: C++ -*-
+
// $Id$
// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
+++ /dev/null
-// $Id$
-// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
-// Author: Jochen Thaeder <thaeder@kip.uni-heidelberg.de> *
-// for The ALICE HLT Project. *
-
-//-*- Mode: C++ -*-
-
-/** @file AliEveHOMERSrcObject.cxx
- @author Jochen Thaeder
- @date
- @brief Src Object for Src Mapping
-*/
-
-#if __GNUC__>= 3
- using namespace std;
-#endif
-
-#define use_aliroot
-#define use_root
-#define ROWHOUGHPARAMS
-#define use_reconstruction
-#define use_newio
-#define ROOTVERSION "unchecked"
-#define ALIROOTVERSION "unchecked"
-#define __ROOT__
-#define USE_ALILOG
-#define LINUX
-
-#include "AliEveHOMERSrcObject.h"
-
-//______________________________________________________________________________
-//
-// Translate HLT data-sources.
-
-ClassImp(AliEveHOMERSrcObject)
-
-/*
- * ---------------------------------------------------------------------------------
- * Constructor / Destructor
- * ---------------------------------------------------------------------------------
- */
-
-//##################################################################################
-AliEveHOMERSrcObject::AliEveHOMERSrcObject( TString dataType, TString className, ULong_t specification ) :
- fDataType(dataType),
- fClassName(className),
- fSpecification(specification) {
- // This Class is a mapping object, which should allow, to
- // add new sources out of the HLT.
- // This should be only needed by AliEveHOMERSrcTranslator
-
- printf ("%s - %s - %lu\n", fDataType.Data(),fClassName.Data(), fSpecification);
-
-}
-
-//##################################################################################
-AliEveHOMERSrcObject::~AliEveHOMERSrcObject() {
- // The destructor
-
-}
-
+++ /dev/null
-// $Id$
-// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
-
-/**************************************************************************
- * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
- * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
- * full copyright notice. *
- **************************************************************************/
-
-//-*- Mode: C++ -*-
-#ifndef ALIEVEHOMERSRCOBJECT_H
-#define ALIEVEHOMERSRCOBJECT_H
-
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/** @file AliEveHOMERSrcObject.h
- @author Jochen Thaeder
- @date
- @brief Src Object for Src Mapping
-*/
-
-#include "TString.h"
-#include "TObject.h"
-
-class AliEveHOMERSrcObject : public TObject
-{
- public:
-
- /*
- * ---------------------------------------------------------------------------------
- * Constructor / Destructor
- * ---------------------------------------------------------------------------------
- */
-
- /** constructor */
- AliEveHOMERSrcObject( TString dataType, TString className, ULong_t specification );
-
- /** destructor */
- virtual ~AliEveHOMERSrcObject();
-
- /*
- * ---------------------------------------------------------------------------------
- * Getter - public
- * ---------------------------------------------------------------------------------
- */
-
- /** Returns the HLT dataType */
- TString GetDataType() { return fDataType; } // Returns the HLT dataType
-
- /** Returns the HLT className */
- TString GetClassName() { return fClassName; } // Returns the HLT className
-
- /** Returns the HLT specification in HLT */
- ULong_t GetSpecification() { return fSpecification; } // Returns the HLT specification in HLT
-
- ///////////////////////////////////////////////////////////////////////////////////
-
-private:
-
- AliEveHOMERSrcObject(const AliEveHOMERSrcObject&); // Not implemented.
- AliEveHOMERSrcObject& operator=(const AliEveHOMERSrcObject&); // Not implemented.
-
- /*
- * ---------------------------------------------------------------------------------
- * Members - private
- * ---------------------------------------------------------------------------------
- */
-
- TString fDataType; // Contains the HLT DataType
- TString fClassName; // Contains the Classname in HLT
- ULong_t fSpecification; // Contains the HLT Specification
-
- ClassDef(AliEveHOMERSrcObject, 0); // Object for mapping of HLT data-sources.
-};
-
-#endif
-
-
+++ /dev/null
-// $Id$
-// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
-// Author: Jochen Thaeder <thaeder@kip.uni-heidelberg.de> *
-// for The ALICE HLT Project. *
-
-//-*- Mode: C++ -*-
-
-/** @file AliEveHOMERSrcTranslator.cxx
- @author Jochen Thaeder
- @date
- @brief Src Translator of HomerManger
-*/
-
-#if __GNUC__>= 3
- using namespace std;
-#endif
-
-#define use_aliroot
-#define use_root
-#define ROWHOUGHPARAMS
-#define use_reconstruction
-#define use_newio
-#define ROOTVERSION "unchecked"
-#define ALIROOTVERSION "unchecked"
-#define __ROOT__
-#define USE_ALILOG
-#define LINUX
-
-#define EVE_DEBUG 1
-// -- -- -- -- -- -- --
-#include "AliEveHOMERSource.h"
-#include "AliEveHOMERSrcTranslator.h"
-#include "AliEveHOMERSrcObject.h"
-// -- -- -- -- -- -- --
-#include "TString.h"
-#include <TApplication.h>
-#include "Riostream.h"
-#include "TXMLAttr.h"
-#include "TCollection.h"
-#include "TList.h"
-#include "TObjString.h"
-#include "TObjArray.h"
-// -- -- -- -- -- -- --
-#include "AliLog.h"
-
-//______________________________________________________________________________
-//
-// Translate HLT data-sources.
-
-ClassImp(AliEveHOMERSrcTranslator)
-
-/*
- * ---------------------------------------------------------------------------------
- * Constructor / Destructor
- * ---------------------------------------------------------------------------------
- */
-
-//##################################################################################
- AliEveHOMERSrcTranslator::AliEveHOMERSrcTranslator( TString realm ) :
- fBasePortMap(NULL),
- fObjectMap(NULL),
- fRealm(realm)
-{
- // This Class should handle the translation of
- // internal hostnames and ports to the ones used by
- // HOMER according to realm, where AliEVE is running in.
-
- SetupPortMap();
- SetupObjectMap();
-}
-
-//##################################################################################
-AliEveHOMERSrcTranslator::~AliEveHOMERSrcTranslator() {
- // The destructor
-
- if ( fBasePortMap )
- delete fBasePortMap;
- fBasePortMap = NULL;
-}
-
-/*
- * ---------------------------------------------------------------------------------
- * Translation - public
- * ---------------------------------------------------------------------------------
- */
-
-//##################################################################################
-Int_t AliEveHOMERSrcTranslator::Translate( TString xmlNodename, TString xmlPort,
- TString &hostname, Int_t &port ) {
- // Translate hostname and port for source which has to be used by HOMER
- // ( due to port mapping inside the HLT )
- // * param xmlNodename Nodename out of the XML
- // * param xmlPort Port out of the XML
- // * param hostname Return of the hostname
- // * param port Return of the port
- // * return 0 on sucess, 1 if port couldn't be resolved,
-
- Int_t iResult = 0;
-
- // *** Resolve hostname
- hostname = ResolveHostname( xmlNodename );
-
- // *** Resolve port
- port = ResolvePort( xmlPort, xmlNodename );
-
- if ( port == -1 ) {
- AliError( Form("Error resolving port : %s", xmlPort.Data()) );
- iResult = 1;
- }
-
- // *** Summary
-#if EVE_DEBUG
- if ( !iResult ) {
- AliInfo( Form("%s:%i resolved out of %s:%s", hostname.Data(), port, xmlNodename.Data(), xmlPort.Data()) );
- }
-#endif
-
- return iResult;
-}
-
-//##################################################################################
-void AliEveHOMERSrcTranslator::ApplyDetectorCorrections( TString &detector, TString &subDetector) {
- // Apply corrections for differnt detectors and subdetectors */
-
- // -- Correct TPC subdetector, because in we have somtimes "A","C"
- if ( ! detector.CompareTo("TPC") ) {
- if ( subDetector.BeginsWith('A') ) {
- subDetector.Remove( TString::kLeading, 'A' );
- }
- else if ( subDetector.BeginsWith('C') ) {
- subDetector.Remove( TString::kLeading, 'C' );
- Int_t tmp = subDetector.Atoi() + 18;
- subDetector = "";
- subDetector += tmp;
- }
- }
-
- // -- Correct for MUON
- if ( ! detector.CompareTo("DIMU") ) {
- detector = "MUON";
-
- if ( ! subDetector.CompareTo("TRG") )
- subDetector = "1";
- else if ( ! subDetector.CompareTo("TRK") )
- subDetector = "2";
- }
-}
-
-//##################################################################################
-Int_t AliEveHOMERSrcTranslator::FillSourceDesc( AliHLTHOMERSourceDesc* source, TString name ) {
- // Fill SourceDesc with object Information
-
- Int_t iResult = 0;
-
- TString detector = source->GetDetector();
-
- if ( ! fObjectMap->FindObject( detector ) ) {
- AliError( Form("Error mapping for detector not known : %s", detector.Data()) );
- AliError( Form("Error mapping for NAME : %s", name.Data()) );
- iResult = 1;
-
- return iResult;
- }
-
-
- TMap * objectMap = (TMap*) fObjectMap->GetValue( detector );
-
-#if 0
-
- if ( ! objectMap->FindObject( name ) ) {
- cout << "DET..." << detector.Data() << endl;
-
- source->SetSourceName( name, "" );
- source->SetSourceType( 0, "*******" );
- }
- else {
- AliEveHOMERSrcObject* srcObject = (AliEveHOMERSrcObject*) objectMap->FindObject( name );
- source->SetSourceName( name, srcObject->GetClassName() );
- source->SetSourceType( srcObject->GetSpecification(), srcObject->GetDataType() );
- }
-#endif
-
- return iResult;
-}
-
-/*
- * ---------------------------------------------------------------------------------
- * Source Resolving - private
- * ---------------------------------------------------------------------------------
- */
-
-//##################################################################################
-TString AliEveHOMERSrcTranslator::ResolveHostname( TString nodename ){
- // resolves the hostname, out of the XML nodename, and the realm set
-
- TString hostname;
-
- // -- Set hostname according to realm
- if ( ! fRealm.CompareTo( "ACR" ) )
- hostname = "alihlt-dcs0.cern.ch";
- else if ( ! fRealm.CompareTo( "GPN" ) )
- hostname = "alihlt-vobox0.cern.ch";
- else if ( ! fRealm.CompareTo( "KIP" ) )
- hostname = "alihlt-gw0.kip.uni-heidelberg.de";
- else
- hostname = nodename;
-
- return hostname;
-}
-
-//##################################################################################
-Int_t AliEveHOMERSrcTranslator::ResolvePort( TString srcPort, TString nodename ) {
- // resolves the port, out of the XML port, and the realm set
- Int_t port = -1;
-
- if ( ! srcPort.IsDigit() )
- return port;
-
- if ( srcPort.Atoi() < kNodeBasePort )
- return port;
-
- if ( ! fBasePortMap->FindObject( nodename ) )
- return port;
-
- port = srcPort.Atoi();
-
- if ( ! fRealm.CompareTo( "HLT" ) )
- return port;
-
- Int_t offset = port - kNodeBasePort;
-
- port = ( ( (TObjString*) fBasePortMap->GetValue(nodename) )->GetString() ).Atoi();
- port += offset;
-
- return port;
-}
-
-/*
- * ---------------------------------------------------------------------------------
- * Setup - private
- * ---------------------------------------------------------------------------------
- */
-
-//##################################################################################
-void AliEveHOMERSrcTranslator::SetupPortMap () {
- // Setup hostname to port mapping
-
- fBasePortMap = new TMap();
- //fBasePortMap->SetOwnerKeyValue();
-
- fBasePortMap->Add( new TObjString("cntpca000"), new TObjString("49408"));
- fBasePortMap->Add( new TObjString("feptpcao00"), new TObjString("49436"));
- fBasePortMap->Add( new TObjString("feptpcai00"), new TObjString("49440"));
- fBasePortMap->Add( new TObjString("feptpcao01"), new TObjString("49444"));
- fBasePortMap->Add( new TObjString("feptpcao02"), new TObjString("49564"));
- fBasePortMap->Add( new TObjString("feptpcai02"), new TObjString("49568"));
- fBasePortMap->Add( new TObjString("feptpcao03"), new TObjString("49572"));
- fBasePortMap->Add( new TObjString("cntpca040"), new TObjString("49664"));
- fBasePortMap->Add( new TObjString("feptpcao04"), new TObjString("49692"));
- fBasePortMap->Add( new TObjString("feptpcai04"), new TObjString("49696"));
- fBasePortMap->Add( new TObjString("feptpcao05"), new TObjString("49700"));
- fBasePortMap->Add( new TObjString("feptpcao06"), new TObjString("49820"));
- fBasePortMap->Add( new TObjString("feptpcai06"), new TObjString("49824"));
- fBasePortMap->Add( new TObjString("feptpcao07"), new TObjString("49828"));
- fBasePortMap->Add( new TObjString("cntpca080"), new TObjString("49920"));
- fBasePortMap->Add( new TObjString("feptpcao08"), new TObjString("49948"));
- fBasePortMap->Add( new TObjString("feptpcai08"), new TObjString("49952"));
- fBasePortMap->Add( new TObjString("feptpcao09"), new TObjString("49956"));
- fBasePortMap->Add( new TObjString("feptpcao10"), new TObjString("50076"));
- fBasePortMap->Add( new TObjString("feptpcai10"), new TObjString("50080"));
- fBasePortMap->Add( new TObjString("feptpcao11"), new TObjString("50084"));
- fBasePortMap->Add( new TObjString("cntpca120"), new TObjString("50176"));
- fBasePortMap->Add( new TObjString("feptpcao12"), new TObjString("50204"));
- fBasePortMap->Add( new TObjString("feptpcai12"), new TObjString("50208"));
- fBasePortMap->Add( new TObjString("feptpcao13"), new TObjString("50212"));
- fBasePortMap->Add( new TObjString("feptpcao14"), new TObjString("50332"));
- fBasePortMap->Add( new TObjString("feptpcai14"), new TObjString("50336"));
- fBasePortMap->Add( new TObjString("feptpcao15"), new TObjString("50340"));
- fBasePortMap->Add( new TObjString("cntpca160"), new TObjString("50432"));
- fBasePortMap->Add( new TObjString("feptpcao16"), new TObjString("50460"));
- fBasePortMap->Add( new TObjString("feptpcai16"), new TObjString("50464"));
- fBasePortMap->Add( new TObjString("feptpcao17"), new TObjString("50468"));
- fBasePortMap->Add( new TObjString("cntrd0"), new TObjString("54144"));
- fBasePortMap->Add( new TObjString("feptrd00"), new TObjString("54168"));
- fBasePortMap->Add( new TObjString("feptrd04"), new TObjString("54172"));
- fBasePortMap->Add( new TObjString("feptrd08"), new TObjString("54176"));
- fBasePortMap->Add( new TObjString("feptrd10"), new TObjString("54180"));
- fBasePortMap->Add( new TObjString("feptrd14"), new TObjString("54184"));
- fBasePortMap->Add( new TObjString("feptpcco16"), new TObjString("54428"));
- fBasePortMap->Add( new TObjString("feptpcci16"), new TObjString("54432"));
- fBasePortMap->Add( new TObjString("feptpcco17"), new TObjString("54436"));
- fBasePortMap->Add( new TObjString("feptpcco14"), new TObjString("54556"));
- fBasePortMap->Add( new TObjString("feptpcci14"), new TObjString("54560"));
- fBasePortMap->Add( new TObjString("feptpcco15"), new TObjString("54564"));
- fBasePortMap->Add( new TObjString("cntpcc120"), new TObjString("54656"));
- fBasePortMap->Add( new TObjString("feptpcco12"), new TObjString("54684"));
- fBasePortMap->Add( new TObjString("feptpcci12"), new TObjString("54688"));
- fBasePortMap->Add( new TObjString("feptpcco13"), new TObjString("54692"));
- fBasePortMap->Add( new TObjString("feptpcco10"), new TObjString("54812"));
- fBasePortMap->Add( new TObjString("feptpcci10"), new TObjString("54816"));
- fBasePortMap->Add( new TObjString("feptpcco11"), new TObjString("54820"));
- fBasePortMap->Add( new TObjString("cntpcc080"), new TObjString("54912"));
- fBasePortMap->Add( new TObjString("feptpcco08"), new TObjString("54940"));
- fBasePortMap->Add( new TObjString("feptpcci08"), new TObjString("54944"));
- fBasePortMap->Add( new TObjString("feptpcco09"), new TObjString("54948"));
- fBasePortMap->Add( new TObjString("feptpcco06"), new TObjString("55068"));
- fBasePortMap->Add( new TObjString("feptpcci06"), new TObjString("55072"));
- fBasePortMap->Add( new TObjString("feptpcco07"), new TObjString("55076"));
- fBasePortMap->Add( new TObjString("cntpcc040"), new TObjString("55168"));
- fBasePortMap->Add( new TObjString("feptpcco04"), new TObjString("55196"));
- fBasePortMap->Add( new TObjString("feptpcci04"), new TObjString("55200"));
- fBasePortMap->Add( new TObjString("feptpcco05"), new TObjString("55204"));
- fBasePortMap->Add( new TObjString("feptpcco02"), new TObjString("55324"));
- fBasePortMap->Add( new TObjString("feptpcci02"), new TObjString("55328"));
- fBasePortMap->Add( new TObjString("feptpcco03"), new TObjString("55332"));
- fBasePortMap->Add( new TObjString("cntpcc000"), new TObjString("55424"));
- fBasePortMap->Add( new TObjString("feptpcco00"), new TObjString("55452"));
- fBasePortMap->Add( new TObjString("feptpcci00"), new TObjString("55456"));
- fBasePortMap->Add( new TObjString("feptpcco01"), new TObjString("55460"));
- fBasePortMap->Add( new TObjString("cnspd0"), new TObjString("57728"));
- fBasePortMap->Add( new TObjString("fepspd0"), new TObjString("57752"));
- fBasePortMap->Add( new TObjString("fepspd1"), new TObjString("57756"));
- fBasePortMap->Add( new TObjString("fepspd2"), new TObjString("57760"));
- fBasePortMap->Add( new TObjString("fepspd3"), new TObjString("57764"));
- fBasePortMap->Add( new TObjString("fepspd4"), new TObjString("57768"));
- fBasePortMap->Add( new TObjString("cnssd0"), new TObjString("57856"));
- fBasePortMap->Add( new TObjString("fepssd0"), new TObjString("57880"));
- fBasePortMap->Add( new TObjString("fepssd1"), new TObjString("57884"));
- fBasePortMap->Add( new TObjString("fepssd2"), new TObjString("57888"));
- fBasePortMap->Add( new TObjString("fepssd3"), new TObjString("57892"));
- fBasePortMap->Add( new TObjString("fepphos4"), new TObjString("57896"));
- fBasePortMap->Add( new TObjString("fepsdd5"), new TObjString("57896"));
- fBasePortMap->Add( new TObjString("fephmpid0"), new TObjString("58008"));
- fBasePortMap->Add( new TObjString("fepsdd0"), new TObjString("58008"));
- fBasePortMap->Add( new TObjString("fephmpid1"), new TObjString("58012"));
- fBasePortMap->Add( new TObjString("fepsdd1"), new TObjString("58012"));
- fBasePortMap->Add( new TObjString("fephmpid2"), new TObjString("58016"));
- fBasePortMap->Add( new TObjString("fepsdd2"), new TObjString("58016"));
- fBasePortMap->Add( new TObjString("fephmpid3"), new TObjString("58020"));
- fBasePortMap->Add( new TObjString("fepsdd3"), new TObjString("58020"));
- fBasePortMap->Add( new TObjString("fepphos1"), new TObjString("58024"));
- fBasePortMap->Add( new TObjString("fepsdd4"), new TObjString("58024"));
- fBasePortMap->Add( new TObjString("feptriggerdet"), new TObjString("58140"));
- fBasePortMap->Add( new TObjString("fepfmdaccorde"), new TObjString("58144"));
- fBasePortMap->Add( new TObjString("fephltout0"), new TObjString("58400"));
- fBasePortMap->Add( new TObjString("fephltout1"), new TObjString("58404"));
- fBasePortMap->Add( new TObjString("cnphos0"), new TObjString("58624"));
- fBasePortMap->Add( new TObjString("fepphos2"), new TObjString("58656"));
- fBasePortMap->Add( new TObjString("fepphos3"), new TObjString("58660"));
- fBasePortMap->Add( new TObjString("cndimutrg0"), new TObjString("58752"));
- fBasePortMap->Add( new TObjString("fepdimutrg"), new TObjString("58784"));
- fBasePortMap->Add( new TObjString("cndimutrk0"), new TObjString("58880"));
- fBasePortMap->Add( new TObjString("fepdimutrk1"), new TObjString("58904"));
- fBasePortMap->Add( new TObjString("fepdimutrk2"), new TObjString("58908"));
- fBasePortMap->Add( new TObjString("fepdimutrk3"), new TObjString("58912"));
- fBasePortMap->Add( new TObjString("fepdimutrk4"), new TObjString("58916"));
- fBasePortMap->Add( new TObjString("fepdimutrk5"), new TObjString("58920"));
-
-
-// fBasePortMap->Add( new TObjString("feptpcao00"), new TObjString("49436"));
-// fBasePortMap->Add( new TObjString("feptpcai00"), new TObjString("49440"));
-// fBasePortMap->Add( new TObjString("feptpcao01"), new TObjString("49444"));
-// fBasePortMap->Add( new TObjString("feptpcao02"), new TObjString("49564"));
-// fBasePortMap->Add( new TObjString("feptpcai02"), new TObjString("49568"));
-// fBasePortMap->Add( new TObjString("feptpcao03"), new TObjString("49572"));
-// fBasePortMap->Add( new TObjString("feptpcao04"), new TObjString("49692"));
-// fBasePortMap->Add( new TObjString("feptpcai04"), new TObjString("49696"));
-// fBasePortMap->Add( new TObjString("feptpcao05"), new TObjString("49700"));
-// fBasePortMap->Add( new TObjString("feptpcao06"), new TObjString("49820"));
-// fBasePortMap->Add( new TObjString("feptpcai06"), new TObjString("49824"));
-// fBasePortMap->Add( new TObjString("feptpcao07"), new TObjString("49828"));
-// fBasePortMap->Add( new TObjString("feptpcao08"), new TObjString("49948"));
-// fBasePortMap->Add( new TObjString("feptpcai08"), new TObjString("49952"));
-// fBasePortMap->Add( new TObjString("feptpcao09"), new TObjString("49956"));
-// fBasePortMap->Add( new TObjString("feptpcao10"), new TObjString("50076"));
-// fBasePortMap->Add( new TObjString("feptpcai10"), new TObjString("50080"));
-// fBasePortMap->Add( new TObjString("feptpcao11"), new TObjString("50084"));
-// fBasePortMap->Add( new TObjString("feptpcao12"), new TObjString("50204"));
-// fBasePortMap->Add( new TObjString("feptpcai12"), new TObjString("50208"));
-// fBasePortMap->Add( new TObjString("feptpcao13"), new TObjString("50212"));
-// fBasePortMap->Add( new TObjString("feptpcao14"), new TObjString("50332"));
-// fBasePortMap->Add( new TObjString("feptpcai14"), new TObjString("50336"));
-// fBasePortMap->Add( new TObjString("feptpcao15"), new TObjString("50340"));
-// fBasePortMap->Add( new TObjString("feptpcao16"), new TObjString("50460"));
-// fBasePortMap->Add( new TObjString("feptpcai16"), new TObjString("50464"));
-// fBasePortMap->Add( new TObjString("feptpcao17"), new TObjString("50468"));
-// fBasePortMap->Add( new TObjString("feptrd00"), new TObjString("54168"));
-// fBasePortMap->Add( new TObjString("feptrd04"), new TObjString("54172"));
-// fBasePortMap->Add( new TObjString("feptrd08"), new TObjString("54176"));
-// fBasePortMap->Add( new TObjString("feptrd10"), new TObjString("54180"));
-// fBasePortMap->Add( new TObjString("feptrd14"), new TObjString("54184"));
-// fBasePortMap->Add( new TObjString("feptpcco16"), new TObjString("54428"));
-// fBasePortMap->Add( new TObjString("feptpcci16"), new TObjString("54432"));
-// fBasePortMap->Add( new TObjString("feptpcco17"), new TObjString("54436"));
-// fBasePortMap->Add( new TObjString("feptpcco14"), new TObjString("54556"));
-// fBasePortMap->Add( new TObjString("feptpcci14"), new TObjString("54560"));
-// fBasePortMap->Add( new TObjString("feptpcco15"), new TObjString("54564"));
-// fBasePortMap->Add( new TObjString("feptpcco12"), new TObjString("54684"));
-// fBasePortMap->Add( new TObjString("feptpcci12"), new TObjString("54688"));
-// fBasePortMap->Add( new TObjString("feptpcco13"), new TObjString("54692"));
-// fBasePortMap->Add( new TObjString("feptpcco10"), new TObjString("54812"));
-// fBasePortMap->Add( new TObjString("feptpcci10"), new TObjString("54816"));
-// fBasePortMap->Add( new TObjString("feptpcco11"), new TObjString("54820"));
-// fBasePortMap->Add( new TObjString("feptpcco08"), new TObjString("54940"));
-// fBasePortMap->Add( new TObjString("feptpcci08"), new TObjString("54944"));
-// fBasePortMap->Add( new TObjString("feptpcco09"), new TObjString("54948"));
-// fBasePortMap->Add( new TObjString("feptpcco06"), new TObjString("55068"));
-// fBasePortMap->Add( new TObjString("feptpcci06"), new TObjString("55072"));
-// fBasePortMap->Add( new TObjString("feptpcco07"), new TObjString("55076"));
-// fBasePortMap->Add( new TObjString("feptpcco04"), new TObjString("55196"));
-// fBasePortMap->Add( new TObjString("feptpcci04"), new TObjString("55200"));
-// fBasePortMap->Add( new TObjString("feptpcco05"), new TObjString("55204"));
-// fBasePortMap->Add( new TObjString("feptpcco02"), new TObjString("55324"));
-// fBasePortMap->Add( new TObjString("feptpcci02"), new TObjString("55328"));
-// fBasePortMap->Add( new TObjString("feptpcco03"), new TObjString("55332"));
-// fBasePortMap->Add( new TObjString("feptpcco00"), new TObjString("55452"));
-// fBasePortMap->Add( new TObjString("feptpcci00"), new TObjString("55456"));
-// fBasePortMap->Add( new TObjString("feptpcco01"), new TObjString("55460"));
-// fBasePortMap->Add( new TObjString("fepspd0"), new TObjString("57752"));
-// fBasePortMap->Add( new TObjString("fepspd1"), new TObjString("57756"));
-// fBasePortMap->Add( new TObjString("fepspd2"), new TObjString("57760"));
-// fBasePortMap->Add( new TObjString("fepspd3"), new TObjString("57764"));
-// fBasePortMap->Add( new TObjString("fepspd4"), new TObjString("57768"));
-// fBasePortMap->Add( new TObjString("fepssd0"), new TObjString("57880"));
-// fBasePortMap->Add( new TObjString("fepssd1"), new TObjString("57884"));
-// fBasePortMap->Add( new TObjString("fepssd2"), new TObjString("57888"));
-// fBasePortMap->Add( new TObjString("fepssd3"), new TObjString("57892"));
-// fBasePortMap->Add( new TObjString("feptriggerdet"), new TObjString("58140"));
-// fBasePortMap->Add( new TObjString("fepfmdaccorde"), new TObjString("58144"));
-// fBasePortMap->Add( new TObjString("fephmpid0"), new TObjString("58264"));
-// fBasePortMap->Add( new TObjString("fephmpid1"), new TObjString("58268"));
-// fBasePortMap->Add( new TObjString("fephmpid2"), new TObjString("58272"));
-// fBasePortMap->Add( new TObjString("fephmpid3"), new TObjString("58276"));
-// fBasePortMap->Add( new TObjString("fephltout0"), new TObjString("58400"));
-// fBasePortMap->Add( new TObjString("fephltout1"), new TObjString("58404"));
-// fBasePortMap->Add( new TObjString("fepphos2"), new TObjString("58656"));
-// fBasePortMap->Add( new TObjString("fepphos3"), new TObjString("58660"));
-// fBasePortMap->Add( new TObjString("fepphos4"), new TObjString("58664"));
-// fBasePortMap->Add( new TObjString("fepdimutrg"), new TObjString("58784"));
-// fBasePortMap->Add( new TObjString("fepdimutrk1"), new TObjString("58904"));
-// fBasePortMap->Add( new TObjString("fepdimutrk2"), new TObjString("58908"));
-// fBasePortMap->Add( new TObjString("fepdimutrk3"), new TObjString("58912"));
-// fBasePortMap->Add( new TObjString("fepdimutrk4"), new TObjString("58916"));
-// fBasePortMap->Add( new TObjString("fepdimutrk5"), new TObjString("58920"));
-
-}
-
-//##################################################################################
-void AliEveHOMERSrcTranslator::SetupObjectMap () {
- // Setup hostname to port mapping
-
- fObjectMap = new TMap();
- // fObjectMap->SetOwnerKeyValue();
-
- SetupObjectMapTPC();
- SetupObjectMapTRD();
- SetupObjectMapPHOS();
- SetupObjectMapDIMUON();
-}
-
-//##################################################################################
-void AliEveHOMERSrcTranslator::SetupObjectMapTPC() {
- //Setup the Object mapping for TPC
-
- TMap* objectMap = new TMap();
- fObjectMap->Add( new TObjString("TPC"), objectMap );
-
- SetupObjectMapCommon( objectMap );
-
- objectMap->Add( new TObjString("CF"), new AliEveHOMERSrcObject( "AliHLTTPCClusterDataFormat", "CLUSTERS", 0 ) );
- objectMap->Add( new TObjString("RelayCF"), new AliEveHOMERSrcObject( "AliHLTTPCClusterDataFormat", "CLUSTERS", 0 ) );
- objectMap->Add( new TObjString("CalibPedestal"), new AliEveHOMERSrcObject( "AliTPCCalibPedestal", "HIS_CAL", 0 ) );
- objectMap->Add( new TObjString("CalibPulser"), new AliEveHOMERSrcObject( "AliTPCCalibPulser", "HIS_CAL", 0 ) );
- objectMap->Add( new TObjString("ESDConv"), new AliEveHOMERSrcObject( "TTree", "ESD_TREE", 0 ) );
- objectMap->Add( new TObjString("ESDCM"), new AliEveHOMERSrcObject( "TTree", "ESD_TREE", 0 ) );
- objectMap->Add( new TObjString("ESDCA"), new AliEveHOMERSrcObject( "TTree", "ESD_TREE", 0 ) );
- objectMap->Add( new TObjString("RelayESD"), new AliEveHOMERSrcObject( "TTree", "ESD_TREE", 0 ) );
- objectMap->Add( new TObjString("KRCF"), new AliEveHOMERSrcObject( "TH1F", "ROOTHIST", 0 ) );
- objectMap->Add( new TObjString("RelayKR"), new AliEveHOMERSrcObject( "TH1F", "ROOTHIST", 0 ) );
- objectMap->Add( new TObjString("CLHI"), new AliEveHOMERSrcObject( "TH1F", "ROOTHIST", 0 ) );
- objectMap->Add( new TObjString("RelayCLHI"), new AliEveHOMERSrcObject( "TH1F", "ROOTHIST", 0 ) );
- objectMap->Add( new TObjString("NM"), new AliEveHOMERSrcObject( "TH1F", "ROOTHIST", 0 ) );
- objectMap->Add( new TObjString("HH"), new AliEveHOMERSrcObject( "TH1F", "ROOTHIST", 0 ) );
-
-}
-
-//##################################################################################
-void AliEveHOMERSrcTranslator::SetupObjectMapTRD(){
- //Setup the Object mapping for TRD
-
- TMap* objectMap = new TMap();
- fObjectMap->Add( new TObjString("TRD"), objectMap );
-
- SetupObjectMapCommon( objectMap );
-
-}
-
-//##################################################################################
-void AliEveHOMERSrcTranslator::SetupObjectMapPHOS(){
- //Setup the Object mapping for PHOS
-
- TMap* objectMap = new TMap();
- fObjectMap->Add( new TObjString("PHOS"), objectMap );
-
- SetupObjectMapCommon( objectMap );
-
-
-}
-
-//##################################################################################
-void AliEveHOMERSrcTranslator::SetupObjectMapDIMUON(){
- //Setup the Object mapping for DIMUON
-
- TMap* objectMap = new TMap();
- fObjectMap->Add( new TObjString("MUON"), objectMap );
-
- objectMap->Add( new TObjString("RECHITS"), new AliEveHOMERSrcObject( "", "RECHITS", 0 ) );
- objectMap->Add( new TObjString("TRIGRECS"), new AliEveHOMERSrcObject( "", "TRIGRECS", 0 ) );
- objectMap->Add( new TObjString("DECIDSIN"), new AliEveHOMERSrcObject( "", "DECIDSIN", 0 ) );
- objectMap->Add( new TObjString("DECIDPAR"), new AliEveHOMERSrcObject( "", "DECIDPAR", 0 ) );
- objectMap->Add( new TObjString("MANTRACK"), new AliEveHOMERSrcObject( "", "MANTRACK", 0 ) );
-
-
- SetupObjectMapCommon( objectMap );
-
-
-}
-
-//##################################################################################
-void AliEveHOMERSrcTranslator::SetupObjectMapCommon( TMap* objectMap) {
- // Setup the common Object mappings
-
- objectMap->Add( new TObjString("RP"), new AliEveHOMERSrcObject( "", "DDL_RAW", 0 ) );
- objectMap->Add( new TObjString("FP"), new AliEveHOMERSrcObject( "", "DDL_RAW", 0 ) );
- objectMap->Add( new TObjString("Relay"), new AliEveHOMERSrcObject( "", "DDL_RAW", 0 ) );
-}
-
-
-
+++ /dev/null
-//-*- Mode: C++ -*-
-// $Id$
-// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
-
-/**************************************************************************
- * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
- * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
- * full copyright notice. *
- **************************************************************************/
-
-#ifndef ALIEVEHOMERSRCTRANSLATOR_H
-#define ALIEVEHOMERSRCTRANSLATOR_H
-
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/** @file AliEveHOMERSrcTranslator.h
- @author Jochen Thaeder
- @date
- @brief Src Translator of HomerManger
-*/
-
-#include "TString.h"
-#include "TDOMParser.h"
-#include "TXMLNode.h"
-#include "TList.h"
-
-#include "AliEveHOMERSourceList.h"
-#include "AliHLTHOMERSourceDesc.h"
-
-#include "TMap.h"
-
-class AliEveHOMERSrcTranslator : public TObject
-{
-public:
-
- /*
- * ---------------------------------------------------------------------------------
- * Constructor / Destructor
- * ---------------------------------------------------------------------------------
- */
-
- /** constructor */
- AliEveHOMERSrcTranslator( TString realm );
-
- /** destructor */
- virtual ~AliEveHOMERSrcTranslator();
-
- /*
- * ---------------------------------------------------------------------------------
- * Setter - public
- * ---------------------------------------------------------------------------------
- */
-
- /** Sets realm ( which can be ACR, GPN, HLT, KIP ) */
- void SetRealm( TString s ) { fRealm = s; } // Sets realm ( which can be ACR, GPN, HLT, KIP )
-
- /*
- * ---------------------------------------------------------------------------------
- * Translation - public
- * ---------------------------------------------------------------------------------
- */
-
- /** Resolve Information of nodename and port for source which has to be used by HOMER */
- Int_t Translate( TString Nodename, TString xmlPort, TString &hostname, Int_t &port );
-
- /** Apply corrections for differnt detectors and subdetectors */
- void ApplyDetectorCorrections( TString &detector, TString &subDetector);
-
- /** Fill SourceDesc with object Information */
- Int_t FillSourceDesc( AliHLTHOMERSourceDesc* source, TString name );
-
- ///////////////////////////////////////////////////////////////////////////////////
-
-private:
-
- AliEveHOMERSrcTranslator(const AliEveHOMERSrcTranslator&); // Not implemented.
- AliEveHOMERSrcTranslator& operator=(const AliEveHOMERSrcTranslator&); // Not implemented.
-
- /*
- * ---------------------------------------------------------------------------------
- * Source Resolving - private
- * ---------------------------------------------------------------------------------
- */
-
- /** Resolve hostname out of XML and realm */
- TString ResolveHostname( TString nodename );
-
- /** Resolve port out of XML and realm */
- Int_t ResolvePort( TString srcPort, TString srcHostname );
-
- /*
- * ---------------------------------------------------------------------------------
- * Setup - private
- * ---------------------------------------------------------------------------------
- */
-
- /** Setup the BasePort mapping */
- void SetupPortMap();
-
- /** Setup the Object mapping */
- void SetupObjectMap();
-
- /** Setup the Object mapping for TPC */
- void SetupObjectMapTPC();
-
- /** Setup the Object mapping for TRD */
- void SetupObjectMapTRD();
-
- /** Setup the Object mapping for PHOS */
- void SetupObjectMapPHOS();
-
- /** Setup the Object mapping for DIMUON */
- void SetupObjectMapDIMUON();
-
- /** Setup the common Object mappings */
- void SetupObjectMapCommon( TMap* objectMap );
-
- /*
- * ---------------------------------------------------------------------------------
- * Members - private
- * ---------------------------------------------------------------------------------
- */
-
- TMap* fBasePortMap; //! Map of BasePorts on the gateways
-
- TMap* fObjectMap; //! Map of Objects and DataTypes
-
- TString fRealm; // Indicates the realm where AliEve can connect to ( HLT, GPN, ACR, KIP );
-
- /*
- * ---------------------------------------------------------------------------------
- * Constants - private
- * ---------------------------------------------------------------------------------
- */
-
- static const Int_t kNodeBasePort = 49152; // BasePort of TCP ports on the nodes
-
- ClassDef(AliEveHOMERSrcTranslator, 0); // Translate HLT data-sources.
-};
-
-#endif
+++ /dev/null
-// $Id:
-// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
-// Author: Jochen Thaeder <thaeder@kip.uni-heidelberg.de> *
-// for The ALICE HLT Project. *
-
-//-*- Mode: C++ -*-
-
-/** @file AliEveHOMERXMLHandler.cxx
- @author Jochen Thaeder
- @date
- @brief Src Translator of HomerManger
-*/
-
-#if __GNUC__>= 3
- using namespace std;
-#endif
-
-#define use_aliroot
-#define use_root
-#define ROWHOUGHPARAMS
-#define use_reconstruction
-#define use_newio
-#define ROOTVERSION "unchecked"
-#define ALIROOTVERSION "unchecked"
-#define __ROOT__
-#define USE_ALILOG
-#define LINUX
-
-#define EVE_DEBUG 1
-// -- -- -- -- -- -- --
-#include "AliEveHOMERSource.h"
-#include "AliEveHOMERXMLHandler.h"
-// -- -- -- -- -- -- --
-#include "TString.h"
-#include <TApplication.h>
-#include "Riostream.h"
-#include "TXMLAttr.h"
-#include "TCollection.h"
-#include "TList.h"
-#include "TObjString.h"
-#include "TObjArray.h"
-// -- -- -- -- -- -- --
-#include "AliLog.h"
-
-
-
-//______________________________________________________________________________
-//
-// Manage connections to HLT data-sources.
-
-ClassImp(AliEveHOMERXMLHandler)
-
-/*
- * ---------------------------------------------------------------------------------
- * Constructor / Destructor
- * ---------------------------------------------------------------------------------
- */
-
-//##################################################################################
- AliEveHOMERXMLHandler::AliEveHOMERXMLHandler( TString xmlFile ) :
- fXMLFile(xmlFile),
- fXMLParser(NULL),
- fRootNode(NULL),
- fSrcTranslator(NULL),
- fSourceList(NULL)
-{
- // This Class should handle the HLT XML config file.
- // host the XML parser, and do all searching in the
- // XML File
-
- Initialize();
-}
-
-//##################################################################################
-AliEveHOMERXMLHandler::~AliEveHOMERXMLHandler() {
- // The destructor
-
- if ( fXMLParser )
- delete fXMLParser;
- fXMLParser = NULL;
-
- if ( fSrcTranslator != NULL )
- delete fSrcTranslator;
- fSrcTranslator = NULL;
-
-}
-
-//##################################################################################
-Int_t AliEveHOMERXMLHandler::Initialize() {
- // Initialize the XML Parser, set the root node
-
- Int_t iResult = 0 ;
-
- // -- Initialize XML parser
- if ( fXMLParser != NULL )
- delete fXMLParser;
- fXMLParser = NULL;
-
- fXMLParser = new TDOMParser();
- fXMLParser->SetValidate( kFALSE );
-
- iResult = fXMLParser->ParseFile( fXMLFile );
- if ( iResult < 0 ) {
- iResult = 1;
- AliError( Form("Parsing file with error: %s", fXMLParser->GetParseCodeMessage( fXMLParser->GetParseCode() )) );
- return iResult;
- }
-
- // -- Set root node
- fRootNode = fXMLParser->GetXMLDocument()->GetRootNode();
-
- // -- Initialize Src Translator
- fSrcTranslator = new AliEveHOMERSrcTranslator( "GPN" );
-
- return iResult;
-}
-
-//##################################################################################
-Int_t AliEveHOMERXMLHandler::FillSourceList(TList *srcList) {
- // Files the source list of HOMER sources
-
- fSourceList = srcList;
-
- Int_t iResult = 0;
-
- TXMLNode * node = NULL;
- TXMLNode * prevNode = fRootNode->GetChildren();
-
- // -- Loop over all nodes
- while ( ( node = prevNode->GetNextNode() ) ) {
- prevNode = node;
-
- // -- Find only "Process" nodes, otherwise continue to next node
- if ( strcmp( node->GetNodeName(), "Proc" ) != 0 )
- continue;
-
- // -- Get Attributes of current node
- TList *attrList = node->GetAttributes();
- TXMLAttr *attr = 0;
- TIter next(attrList);
-
- while ( ( attr = (TXMLAttr*)next() ) ) {
-
- // -- Find "ID" attribute, otherwise continue to next attribute
- if ( strcmp( attr->GetName(), "ID" ) != 0 )
- continue;
-
- TString nodeId( attr->GetValue() );
-
- // -- Find only TDS processes
- TObjArray * nodeIdTok = nodeId.Tokenize("_");
-
- for ( Int_t ii=0 ; ii < nodeIdTok->GetEntries() ; ii++ ) {
-
- if ( ! ( (TObjString*) nodeIdTok->At(ii) )->GetString().CompareTo("TDS") ) {
-
- iResult = AddSourceTDS( node->GetChildren() );
- if ( iResult ) {
- AliError( Form("Error processing TDS process : %s", nodeId.Data()) );
- }
-
- }
-
- } // for ( Int_t ii=0 ; ii < nodeIdTok->GetEntries() ; ii++ ) {
-
- } // while ( ( attr = (TXMLAttr*)next() ) ) {
-
- } // while ( ( node = prevNode->GetNextNode() ) ) {
-
- return iResult;
-}
-
-//##################################################################################
-Int_t AliEveHOMERXMLHandler::AddSourceTDS( TXMLNode * xmlNode ) {
- // Get Information out of a TDS process in XML file
- // * param xmlNode Pointer to childs of TDS node
- // * return 0 on sucess, > 0 on errorsee header file for class documentation
-
- Int_t iResult = 0;
-
- TXMLNode * attrNode = NULL;
- TXMLNode * prevNode = xmlNode;
-
- TString xmlHostname;
- TString xmlPort;
-
- TString hostname;
- Int_t port = 0;
-
- // -- Get hostname and port from TDS node out of XML
- while ( ( attrNode = prevNode->GetNextNode() ) ) {
- prevNode = attrNode;
-
- // -- Get port out of the commandline
- if ( strcmp( attrNode->GetNodeName(), "Cmd" ) == 0 ) {
- TString cmd( attrNode->GetText() );
-
- TObjArray * cmdTok = cmd.Tokenize(" ");
- xmlPort = ((TObjString*) cmdTok->At(2))->GetString();
- }
- // -- Get hostname
- else if ( strcmp( attrNode->GetNodeName(), "Node" ) == 0 )
- xmlHostname = attrNode->GetText();
-
- } // while ( ( attrNode = prevNode->GetNextNode() ) ) {
-
- TString xmlNodename = GetNodename( xmlHostname );
-
- // -- Resolve hostname and port information --
- iResult = fSrcTranslator->Translate( xmlNodename, xmlPort, hostname, port );
- if ( iResult ) {
- if ( iResult == 1 )
- { AliError( Form("Error resolving hostname : %s", xmlHostname.Data()) ); }
- else if ( iResult == 2 )
- { AliError( Form("Error resolving port : %s", xmlPort.Data()) ); }
- return iResult;
- }
-
- // -- Reset loop to TDS node
- prevNode = xmlNode;
-
- // -- Get Sources out of XML, resolve sources, add to sources List
- while ( ( attrNode = prevNode->GetNextNode() ) ) {
- prevNode = attrNode;
-
- // Find only "Parent" tags, otherwise continue to next tag
- if ( strcmp( attrNode->GetNodeName(), "Parent" ) != 0 )
- continue;
-
- TString xmlParent = attrNode->GetText();
-
-#if 0
- AliHLTHOMERSourceDesc * source = new AliHLTHOMERSourceDesc( hostname, port );
-
- if ( FillSourceInformation( xmlParent, source ) ) {
- AliError( Form("Error resolving source : %s", xmlParent.Data()) );
- iResult = 3;
- delete source;
- }
- else {
- fSourceList->Add( source );
-#if EVE_DEBUG
- AliInfo( Form("New Source added : %s", xmlParent.Data()) );
-#endif
- }
-#endif
- } // while ( ( attrNode = prevNode->GetNextNode() ) ) {
-
- return iResult;
-}
-
-//##################################################################################
-Int_t AliEveHOMERXMLHandler::FillSourceInformation( TString xmlParent, AliHLTHOMERSourceDesc *source ) {
- // Resolve information of source
- // * param xmlParent ParentString out of the XML
- // * param source Return the filled AliHLTHOMERSourceDesc object
- // * return 0 on sucess, 1 on errorsee header file for class documentation
-
- Int_t iResult = 0;
-
- if ( ! xmlParent.Contains( "_" ) ) {
- AliError( Form("Source %s could not be resolved", xmlParent.Data() ) );
- iResult = 1;
-
- return iResult;
- }
-
- // -- Get detector / subDetector / subSubDetector
- TObjArray * parentTokens = xmlParent.Tokenize("_");
- Int_t nParentTokens = parentTokens->GetEntries();
-
- TString detector = ((TObjString*) parentTokens->At(0) )->GetString();
- TString subDetector = "";
- TString subSubDetector = "";
- TString name = ((TObjString*) parentTokens->At(1) )->GetString();
-
- if ( nParentTokens == 3 )
- subDetector = ((TObjString*) parentTokens->At(2) )->GetString();
- else if ( nParentTokens == 4 ) {
- subDetector = ((TObjString*) parentTokens->At(2) )->GetString();
- subSubDetector = ((TObjString*) parentTokens->At(3) )->GetString();
- }
-
- // -- Apply detector corrections
- fSrcTranslator->ApplyDetectorCorrections( detector, subDetector );
-
- // -- Remove Leading '0' in sub detector and subsubdetector
- subDetector.Remove( TString::kLeading, '0' );
- subSubDetector.Remove( TString::kLeading, '0' );
-
- // -- Set detector / subDetector / subSubDetector
- // source->SetDetectors( detector, subDetector, subSubDetector );
-
- // -- Fill dataType / specification / className
- iResult = fSrcTranslator->FillSourceDesc( source, name );
-
-#if 0
- AliInfo( Form("Set Source %s , Type %s, ClassName %s .", name.Data(),
- source->GetDataType().Data(), source->GetClassName().Data()) );
- AliInfo( Form(" Detector %s , SubDetector : %s, SubSubDetector %s .",
- detector.Data(), subDetector.Data(), subSubDetector.Data()) );
-#endif
-
- return iResult;
-}
-
-//##################################################################################
-TString AliEveHOMERXMLHandler::GetNodename( TString xmlHostname ) {
- // Get xml nodename out of xml hostname
-
- TString nodename;
-
- TXMLNode * node = NULL;
- TXMLNode * prevNode = fRootNode->GetChildren();
-
- while ((node = prevNode->GetNextNode()) != 0)
- {
- prevNode = node;
-
- // -- Find only "Node" nodes, otherwise continue
- if ( strcmp( node->GetNodeName(), "Node" ) != 0 )
- continue;
-
- // -- Get Attributes of current node
- TList *attrList = node->GetAttributes();
- TXMLAttr *attr = 0;
- TIter next(attrList);
-
- TString nodeId;
-
- // Get "nodeID" and "nodeName" of this "Node" node
- while ( ( attr = (TXMLAttr*)next() ) ) {
- if ( strcmp( attr->GetName(), "ID" ) == 0 )
- nodeId = attr->GetValue();
- else if ( strcmp( attr->GetName(), "hostname" ) == 0 )
- nodename = attr->GetValue();
- }
-
- // -- if this is not the correct "nodeID" continue
- if ( nodeId != xmlHostname )
- continue;
-
- break;
-
- } // while ( node = prevNode->GetNextNode() ) {
-
- return nodename;
-}
+++ /dev/null
-// $Id:
-// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
-
-/**************************************************************************
- * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
- * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
- * full copyright notice. *
- **************************************************************************/
-
-//-*- Mode: C++ -*-
-#ifndef ALIEVEHOMERXMLHANDLER_H
-#define ALIEVEHOMERXMLHANDLER_H
-
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/** @file AliEveHOMERXMLHandler.h
- @author Jochen Thaeder
- @date
- @brief XML Handler for HomerManger
-*/
-
-#include "TString.h"
-#include "TDOMParser.h"
-#include "TXMLNode.h"
-#include "TList.h"
-
-#include "AliEveHOMERSrcTranslator.h"
-#include "AliHLTHOMERSourceDesc.h"
-
-
-class AliEveHOMERXMLHandler : public TObject
-{
-public:
-
- /*
- * ---------------------------------------------------------------------------------
- * Constructor / Destructor
- * ---------------------------------------------------------------------------------
- */
-
- /** constructor */
- AliEveHOMERXMLHandler( TString xmlFile );
-
- /** destructor */
- virtual ~AliEveHOMERXMLHandler();
-
- /*
- * ---------------------------------------------------------------------------------
- * Source List - public
- * ---------------------------------------------------------------------------------
- */
-
- /** Fill's source list, with entries */
- Int_t FillSourceList(TList *srcList);
-
- /** Sets realm ( which can be ACR, GPN, HLT, KIP ) */
- void SetRealm( TString s ) { fSrcTranslator->SetRealm(s); } // Sets realm ( which can be ACR, GPN, HLT, KIP )
-
-
- ///////////////////////////////////////////////////////////////////////////////////
-
-private:
-
- AliEveHOMERXMLHandler(const AliEveHOMERXMLHandler&); // Not implemented.
- AliEveHOMERXMLHandler& operator=(const AliEveHOMERXMLHandler&); // Not implemented.
-
- /*
- * ---------------------------------------------------------------------------------
- * Source Resolving - private
- * ---------------------------------------------------------------------------------
- */
-
- /** Initialize the XML Handler, create the SrcTranslator */
- Int_t Initialize();
-
- /** Get Information out of a TDS process in XML file */
- Int_t AddSourceTDS( TXMLNode * xmlNode );
-
- /** Get xml nodename out of xml hostname */
- TString GetNodename( TString xmlHostname );
-
- /** Resolve information of source */
- Int_t FillSourceInformation( TString xmlParent, AliHLTHOMERSourceDesc * source );
-
- /*
- * ---------------------------------------------------------------------------------
- * Members - private
- * ---------------------------------------------------------------------------------
- */
-
- // == XML parser ==
- TString fXMLFile; // XML input file
- TDOMParser* fXMLParser; //! XML parser into DOM model
- TXMLNode* fRootNode; //! Root node of parsed config file
-
- // == Source Translator ==
- AliEveHOMERSrcTranslator* fSrcTranslator; //! Translates HOMER sources to real hostname,port
-
- // == Sources List ==
- TList* fSourceList; //! List to HOMER sources
-
- ClassDef(AliEveHOMERXMLHandler, 0); // Handles HLT xml sources.
-};
-
-#endif
#pragma link C++ class AliEveHOMERSource+;
#pragma link C++ class AliEveHOMERSourceList+;
#pragma link C++ class AliEveHOMERSourceMap+;
-
-#pragma link C++ class AliEveHOMERSrcTranslator+;
-#pragma link C++ class AliEveHOMERSrcObject+;
-
-#pragma link C++ class AliEveHOMERXMLHandler+;
fDataType = dataType;
fSpecification = specification;
- fBlockName.Form("%s_%s_0x%08LX", fDetector.Data(), fDataType.Data(), fSpecification );
+ // fBlockName.Form("%s_%s_0x%08LX", fDetector.Data(), fDataType.Data(), fSpecification );
+ fBlockName.Form("%s_%s_0", fDetector.Data(), fDataType.Data() );
// -- Set block parameters
SetBlockParameters();
//##################################################################################
AliHLTHOMERManager::AliHLTHOMERManager() :
fLibManager(new AliHLTHOMERLibManager),
+ fStateHasChanged(kTRUE),
fProxyHandler(NULL),
fReader(NULL),
fSourceList(NULL),
fNBlks(0),
fEventID(0),
fCurrentBlk(0),
- fConnected(kFALSE),
- fStateHasChanged(kTRUE) {
+ fConnected(kFALSE) {
// see header file for class documentation
// or
// refer to README to build package
* @ingroup alihlt_homer
*/
-class AliHLTHOMERManager : public TObject, public AliHLTLogging
+class AliHLTHOMERManager : public AliHLTLogging
{
public:
/** Dynamic loader manager for the HOMER library */
AliHLTHOMERLibManager* fLibManager; //! transient
+ /** Indicates, if a sources have changes,
+ * so that one has to reconnect. */
+ Bool_t fStateHasChanged; // see above
+
///////////////////////////////////////////////////////////////////////////////////
private:
/** Shows connection status */
Bool_t fConnected; // see above
- /** Indicates, if a sources have changes,
- * so that one has to reconnect. */
- Bool_t fStateHasChanged; // see above
ClassDef(AliHLTHOMERManager, 0); // Manage connections to HLT data-sources.
};
TDOMParser xmlParser;
xmlParser.SetValidate(kFALSE);
- HLTInfo(Form("XMLResponse: %s",fXmlRpcResponse.Data()));
-
+ HLTDebug(Form("XMLResponse: %s",fXmlRpcResponse.Data()));
+
iResult = xmlParser.ParseBuffer(fXmlRpcResponse.Data(), fXmlRpcResponse.Length());
if ( iResult < 0 ) {
HLTError(Form("Parsing buffer with error: %s",
// -- Get Content
TString xmlContent(node->GetText() );
- HLTInfo(Form("XMLContent: %s",xmlContent.Data()));
+ HLTDebug(Form("XMLContent: %s",xmlContent.Data()));
iResult = xmlParser.ParseBuffer(xmlContent.Data(), xmlContent.Length());
if ( iResult < 0 ) {
fSubDetector = 0;
fSubSubDetector = 0;
- fSourceName.Form("%s_%s_0x%08LX", fDetector.Data(), fDataType.Data(), fSpecification );
+ // fSourceName.Form("%s_%s_0x%08LX", fDetector.Data(), fDataType.Data(), fSpecification );
+ fSourceName.Form("%s_%s_0", fDetector.Data(), fDataType.Data() );
return;
}