#include "AliEveHOMERManager.h"
-#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 "AliHLTHOMERLibManager.h"
#include "TObjArray.h"
// -- -- -- -- -- -- --
#include "AliLog.h"
-#include "AliTPCCalibPedestal.h"
-#include "AliTPCCalibPulser.h"
-#include "AliTPCCalibCE.h"
-#include "AliTPCPreprocessorOnline.h"
-#include "AliTPCCalROC.h"
//______________________________________________________________________________
//
fCurrentBlk(0),
fConnected(kFALSE),
fStateHasChanged(kTRUE),
- fSrcList(NULL),
- fTPCPre(NULL) {
+ 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
if ( fSrcList != NULL )
delete fSrcList;
fSrcList = NULL;
-
- if ( fTPCPre != NULL )
- delete fTPCPre;
- fTPCPre = NULL;
-
}
/*
Int_t AliEveHOMERManager::CreateBlockList() {
// Create a TList of blocks, which have been readout
- Int_t iResult = 0;
+ Int_t iResult = 0;
+#if 0
// -- Initialize block list
if ( fBlockList != NULL )
delete fBlockList;
iter = GetNextBlk();
} // while ( iter != NULL ){
-
+#endif
return iResult;
}
}
//##################################################################################
-Bool_t AliEveHOMERManager::CheckIfRequested( AliHLTHOMERBlockDesc * block ) {
+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
}
#endif
-
+#endif
return requested;
}
-/*
- * ---------------------------------------------------------------------------------
- * Test Realm ....
- * ---------------------------------------------------------------------------------
- */
-
-//##################################################################################
-void AliEveHOMERManager::DumpTPCCalib(TString objectName, Bool_t dumpToFile) {
- // Still under testing ...
-
- if ( fTPCPre != NULL )
- delete fTPCPre;
-
- fTPCPre = new AliTPCPreprocessorOnline();
-
- TList* blockList = GetBlockList();
-
- AliHLTHOMERBlockDesc *desc = 0;
-
- TIter next(blockList);
-
- while ( ( desc = (AliHLTHOMERBlockDesc*)next() ) ) {
- if ( ! desc->IsTObject() )
- continue;
-
- Int_t sectorTPC = 0;
-
- if ( desc->GetSubSubDetector().Atoi() <= 1 ) {
- sectorTPC = desc->GetSubDetector().Atoi();
- }
- else {
- sectorTPC = 36 + desc->GetSubDetector().Atoi();
- }
-
- if ( ! objectName.CompareTo( desc->GetClassName() ) ){
-
- //
- // AliTPCCalibPedestal
- //
-
- if ( ! objectName.CompareTo( "AliTPCCalibPedestal" ) ) {
- AliTPCCalROC* calROC = NULL;
-
- AliTPCCalibPedestal * cal = (AliTPCCalibPedestal*) desc->GetTObject();
- if ( cal == NULL ) {
- cout << "error 1" << endl;
- continue;
- }
-
- cal->Analyse();
-
- calROC = cal->GetCalRocRMS(sectorTPC);
- if ( calROC == NULL ) {
- cout << "error 2" << endl;
- continue;
- }
-
- calROC->SetName(Form("RMS_ROC%d", sectorTPC));
- fTPCPre->AddComponent((TObject*) calROC );
-
- calROC = cal->GetCalRocPedestal(sectorTPC);
- if ( calROC == NULL ) {
- cout << "error 3" << endl;
- continue;
- }
-
-
- calROC->SetName(Form("Pedestal_ROC%d", sectorTPC));
- cout << "added" << endl;
- fTPCPre->AddComponent((TObject*) calROC );
- }
-
- //
- // AliTPCCalibPulser
- //
- /*
- else if ( ! objectName.CompareTo( "AliTPCCalibPulser" ) ) {
- AliTPCCalROC* calROC = NULL;
-
- AliTPCCalibPulser * cal = (AliTPCCalibPulser*) desc->GetTObject();
-
- cal->Analyse();
-
- calROC = cal->GetCalRocT0(sectorTPC);
- calROC->SetName(Form("T0_ROC%d", sectorTPC));
- fTPCPre->AddComponent((TObject*) calROC );
-
- calROC = cal->GetCalRocQ(sectorTPC);
- calROC->SetName(Form("Q_ROC%d", sectorTPC));
- fTPCPre->AddComponent((TObject*) calROC );
-
- calROC = cal->GetCalRocRMS(sectorTPC);
- calROC->SetName(Form("RMS_ROC%d", sectorTPC));
- fTPCPre->AddComponent((TObject*) calROC );
-
- calROC = cal->GetCalRocOutliers(sectorTPC);
- calROC->SetName(Form("Outliers_ROC%d", sectorTPC));
- fTPCPre->AddComponent((TObject*) calROC );
- }
-
-*/
- //
- // AliTPCCalibCE
- //
- /*
- else if ( ! objectName.CompareTo( "AliTPCCalibCE" ) ) {
- AliTPCCalROC* calROC = NULL;
-
- AliTPCCalibPulser * cal = (AliTPCCalibPulser*) desc->GetTObject();
-
- cal->Analyse();
-
- calROC = cal->GetCalRocT0(sectorTPC);
- calROC->SetName(Form("T0_ROC%d", sectorTPC));
- fTPCPre->AddComponent((TObject*) calROC );
-
- calROC = cal->GetCalRocQ(sectorTPC);
- calROC->SetName(Form("Q_ROC%d", sectorTPC));
- fTPCPre->AddComponent((TObject*) calROC );
-
- calROC = cal->GetCalRocRMS(sectorTPC);
- calROC->SetName(Form("RMS_ROC%d", sectorTPC));
- fTPCPre->AddComponent((TObject*) calROC );
-
- calROC = cal->GetCalRocOutliers(sectorTPC);
- calROC->SetName(Form("Outliers_ROC%d", sectorTPC));
- fTPCPre->AddComponent((TObject*) calROC );
- }
- */
- } // if ( ! objectName.CompareTo( desc->GetClassName() ) ) {
-
- } // while ( ( desc = (AliHLTHOMERBlockDesc*)next() ) ) {
-
- if ( dumpToFile ) {
-
- fTPCPre->DumpToFile("pedestals.root");
- cout << "DUMP" << endl;
- }
-
-
-}
/** Get pointer to block List */
TList* GetBlockList() { return fBlockList; } // Get pointer to block List
- /*
- * ---------------------------------------------------------------------------------
- * Test Realm ....
- * ---------------------------------------------------------------------------------
- */
-
- /** Still under testing ... */
- void DumpTPCCalib(TString objectName, Bool_t dumpToFile);
-
///////////////////////////////////////////////////////////////////////////////////
protected:
// == sources ==
AliEveHOMERSourceList* fSrcList; // List of HOMER Sources
- //-----------------------------------------------------------------------------------------
- AliTPCPreprocessorOnline* fTPCPre; // Preprocessor for TPC calibration.
-
ClassDef(AliEveHOMERManager, 0); // Manage connections to HLT data-sources.
};
insert(srcid, srcst, def_state);
srcid.fDet = h->GetDetector();
- if (h->GetSubDetector().IsNull())
+ if (h->GetSubDetector() == 0)
{
srcst.fHandle = h;
insert(srcid, srcst, def_state);
insert(srcid, srcst, def_state);
srcid.fSDet = h->GetSubDetector();
- if (h->GetSubSubDetector().IsNull())
+ if (h->GetSubSubDetector() == 0)
{
srcst.fHandle = h;
insert(srcid, srcst, def_state);
TMap * objectMap = (TMap*) fObjectMap->GetValue( detector );
-
+#if 0
if ( ! objectMap->FindObject( name ) ) {
cout << "DET..." << detector.Data() << endl;
source->SetSourceName( name, srcObject->GetClassName() );
source->SetSourceType( srcObject->GetSpecification(), srcObject->GetDataType() );
}
+#endif
return iResult;
}
TString xmlParent = attrNode->GetText();
+#if 0
AliHLTHOMERSourceDesc * source = new AliHLTHOMERSourceDesc( hostname, port );
if ( FillSourceInformation( xmlParent, source ) ) {
AliInfo( Form("New Source added : %s", xmlParent.Data()) );
#endif
}
-
+#endif
} // while ( ( attrNode = prevNode->GetNextNode() ) ) {
return iResult;
subSubDetector.Remove( TString::kLeading, '0' );
// -- Set detector / subDetector / subSubDetector
- source->SetDetectors( detector, subDetector, subSubDetector );
+ // source->SetDetectors( detector, subDetector, subSubDetector );
// -- Fill dataType / specification / className
iResult = fSrcTranslator->FillSourceDesc( source, name );
-#if EVE_DEBUG
+#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 .",
#endif
#include "AliHLTHOMERBlockDesc.h"
+
#include "AliHLTMessage.h"
#include "TMath.h"
ClassImp(AliHLTHOMERBlockDesc)
+/*
+ * ---------------------------------------------------------------------------------
+ * Constructor / Destructor
+ * ---------------------------------------------------------------------------------
+ */
+
//##################################################################################
AliHLTHOMERBlockDesc::AliHLTHOMERBlockDesc() :
fData(NULL),
fSize(0),
+ fBlockName(),
fIsTObject(kFALSE),
fIsRawData(kFALSE),
fMessage(NULL),
fTObject(NULL),
fClassName(),
+ fDataType(),
fDetector(),
- fSubDetector(),
- fSubSubDetector(),
fSpecification(0),
- fDataType(),
+ fSubDetector(0),
+ fSubSubDetector(0),
fHasSubDetectorRange(kFALSE),
fHasSubSubDetectorRange(kFALSE) {
// see header file for class documentation
// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
}
-//##################################################################################
-AliHLTHOMERBlockDesc::AliHLTHOMERBlockDesc( void * data, ULong_t size, TString origin,
- TString dataType, ULong_t specification ) :
- fData(data),
- fSize(size),
- fIsTObject(kFALSE),
- fIsRawData(kFALSE),
- fMessage(NULL),
- fTObject(NULL),
- fClassName(),
- fDetector(origin),
- fSubDetector(),
- fSubSubDetector(),
- fSpecification(specification),
- fDataType(dataType),
- fHasSubDetectorRange(kFALSE),
- fHasSubSubDetectorRange(kFALSE) {
- // see header file for class documentation
-
- // -- Set block parameters
- SetBlockParameters();
-
-}
-
//##################################################################################
AliHLTHOMERBlockDesc::~AliHLTHOMERBlockDesc() {
// see header file for class documentation
}
+/*
+ * ---------------------------------------------------------------------------------
+ * Data Handling - Setter - public
+ * ---------------------------------------------------------------------------------
+ */
+
//##################################################################################
void AliHLTHOMERBlockDesc::SetBlock( void * data, ULong_t size, TString origin,
TString dataType, ULong_t specification ) {
fDataType = dataType;
fSpecification = specification;
+ fBlockName.Form("%s_%s%_%ul", fDetector.Data(), fDataType.Data(), fSpecification );
+
// -- Set block parameters
SetBlockParameters();
return;
}
+/*
+ * ---------------------------------------------------------------------------------
+ * Data Handling - private
+ * ---------------------------------------------------------------------------------
+ */
+
//##################################################################################
void AliHLTHOMERBlockDesc::SetBlockParameters() {
// see header file for class documentation
- Int_t iError = 0;
-
- // ---- SET CLASS NAME, DATA CONTENTS ----
-
- // -- Check if block contains raw data
- if ( ! CheckIfRawData() ) {
-
- // -- Check if block contains TObject
- if ( ! CheckIfTObject() ) {
-
- // -- Contains arbitrary data type
-
- // **** TPC ****
- if ( ! fDetector.CompareTo("TPC") ) {
-
- if ( ! fDataType.CompareTo("CLUSTERS") )
- fClassName = "AliHLTTPCSpacePoints";
- else
- iError = 1;
- }
-
- // **** TRD ****
-
- else if ( ! fDetector.CompareTo("TRD") ) {
- iError = 1;
- }
+ Int_t iResult = 0;
- // **** PHOS ****
-
- else if ( ! fDetector.CompareTo("PHOS") ) {
- iError = 1;
- }
-
- // **** MUON ****
-
- else if ( ! fDetector.CompareTo("MUON") ) {
- iError = 1;
- }
-
- // **** OTHER ****
-
- else {
- iError = 1;
- }
- }
- } // if ( ! CheckIfRawData() ) {
-
- // -- Check if Data Type has been defined
- if ( iError ) {
- //AliError( Form("The data type %s for the detector %s has not been defined yet.",
- // fDataType.Data(), fDetector.Data()) );
- }
-
// ---- SET SPECIFICATIONS ----
- // -- Convert Specification to "SubDetector/SubSubDetector"
+ // ----------------------------
// **** TPC **** ( has special treatment )
-
if ( ! fDetector.CompareTo("TPC") ) {
-
+
Int_t minPatch = (fSpecification & 0x000000FF);
Int_t maxPatch = (fSpecification & 0x0000FF00) >> 8;
Int_t minSector = (fSpecification & 0x00FF0000) >> 16 ;
Int_t maxSector = (fSpecification & 0xFF000000) >> 24;
- fSubDetector += minSector;
- fSubSubDetector += minPatch;
-
+ fSubDetector = minSector;
+ fSubSubDetector = minPatch;
+
// -- check for ranges
if ( minSector != maxSector )
fHasSubDetectorRange = kTRUE;
if ( minPatch != maxPatch )
fHasSubSubDetectorRange = kTRUE;
+
}
-
// **** OTHER DETECTORS ****
-
else {
-
+
if ( fSpecification ) {
- // find the max bin which is set to 1
- fSubDetector += TMath::FloorNint( TMath::Log2(fSpecification) );
-
+ // find the max bin which is set to 1
+ fSubDetector = TMath::FloorNint( TMath::Log2(fSpecification) );
+
// -- check for ranges
- if ( TMath::Log2(fSpecification) != ( (Double_t) TMath::FloorNint( TMath::Log2(fSpecification) ) ) )
+ if ( TMath::Log2(fSpecification) !=
+ static_cast<Double_t>(TMath::FloorNint(TMath::Log2(fSpecification))) )
fHasSubDetectorRange = kTRUE;
-
}
}
+ // ---- SET CLASS NAME, DATA CONTENTS ----
+ // ---------------------------------------
+
+ // -- Check if block contains raw data
+ if ( CheckIfRawData() )
+ return;
+
+ // -- Check if block contains TObject
+ if ( CheckIfTObject() )
+ return;
+
+ // -- Contains arbitrary data type
+
+ // **** TPC ****
+ if ( ! fDetector.CompareTo("TPC") ) {
+
+ if ( ! fDataType.CompareTo("CLUSTERS") )
+ fClassName = "AliHLTTPCSpacePoints";
+ else
+ iResult = -1;
+ }
+
+ // **** TRD ****
+ else if ( ! fDetector.CompareTo("TRD") ) {
+ iResult = -1;
+ }
+
+ // **** PHOS ****
+ else if ( ! fDetector.CompareTo("PHOS") ) {
+ iResult = -1;
+ }
+
+ // **** MUON ****
+ else if ( ! fDetector.CompareTo("MUON") ) {
+ iResult = -1;
+ }
+
+ // **** OTHER ****
+ else {
+ iResult = -1;
+ }
+
+ // -- Check if classname has been defined
+ /*
+ if ( iResult < 0 ) {
+ HLTWarning( "The classname for data type %s for the detector %s has not been defined yet.",
+ fDataType.Data(), fDetector.Data());
+ }
+ */
return;
}
#include "TString.h"
#include "TObject.h"
+//#include "AliHLTLogging.h"
+
/**
* @class AliHLTHOMERBlockDesc
* This class contains the data which comes from 1 block, delivered via the
*
* @ingroup alihlt_homer
*/
-class AliHLTHOMERBlockDesc : public TObject {
+class AliHLTHOMERBlockDesc : public TObject/*, public AliHLTLogging*/ {
public:
/** standard constructor */
AliHLTHOMERBlockDesc();
- /** Constructor, set block data
- * @param data Pointer to data
- * @param size Size of data
- * @param origin Detector
- * @param dataType HLT data type
- * @param specification HLT specification
- */
- AliHLTHOMERBlockDesc( void * data, ULong_t size, TString origin, TString dataType, ULong_t specification );
-
/** destructor */
virtual ~AliHLTHOMERBlockDesc();
/** Returns Pointer to TObject */
TObject* GetTObject() { return fTObject; }
+ /** Get class name of this block
+ * @return class name
+ */
+ TString GetClassName() { return fClassName; }
+
/*
* ---------------------------------------------------------------------------------
* Data Handling - Getter - public
*/
ULong_t GetSize() { return fSize; }
+ /** Get name of this block
+ * @return name
+ */
+ TString GetBlockName() { return fBlockName; }
+
/** Get detector of this block
* @return Detector name
*/
*/
ULong_t GetSpecification() { return fSpecification; }
- /** Get class name of this block
- * @return class name
- */
- TString GetClassName() { return fClassName; }
-
/** Get sub detector of this block
* @return subdetector
*/
- TString GetSubDetector() { return fSubDetector; }
+ Int_t GetSubDetector() { return fSubDetector; }
/** Get sub sub detector of this block
* @return subsubdetector
*/
- TString GetSubSubDetector() { return fSubSubDetector; }
+ Int_t GetSubSubDetector() { return fSubSubDetector; }
/** Returns kTRUE if HLT specification indicates a subdetector range
* @return kTRUE if subdetector range
*/
- Bool_t HasSubDetectorRange() { return fHasSubDetectorRange; }
+ Bool_t HasSubDetectorRange() { return fHasSubDetectorRange; }
/** Returns kTRUE if HLT specification indicates a subsubdetector range
* @return kTRUE if subsubdetector range
*/
- Bool_t HasSubSubDetectorRange() { return fHasSubSubDetectorRange; }
+ Bool_t HasSubSubDetectorRange(){ return fHasSubSubDetectorRange; }
+
+ ///////////////////////////////////////////////////////////////////////////////////
private:
/** assignment operator prohibited */
AliHLTHOMERBlockDesc& operator=(const AliHLTHOMERBlockDesc&);
+ /*
+ * ---------------------------------------------------------------------------------
+ * Data Handling - private
+ * ---------------------------------------------------------------------------------
+ */
+
/** Set all additional members*/
void SetBlockParameters();
* ---------------------------------------------------------------------------------
*/
+ // -- Block properties --
+ // ----------------------
+
/** Pointer to data of the block */
- void* fData; //! transient
+ void* fData; //! transient
/** Size of data */
ULong_t fSize; // see above
+ /** Block Name */
+ TString fBlockName; // see above
+
+ // -- Data flags --
+ // ----------------
+
/** States if block contains a TObject */
Bool_t fIsTObject; // see above
/** States if block contains a raw data */
Bool_t fIsRawData; // see above
+ // -- TObject properties --
+ // ------------------------
+
/** AliHTMessage object containg a TObject */
AliHLTMessage* fMessage; //! transient
/** TObject extracted out of @see AliHLTMessage */
- TObject* fTObject; //! transient
+ TObject* fTObject; //! transient
/** Class Name of the block */
- TString fClassName; // see above
+ TString fClassName; // see above
+
+ // -- Data Specifications --
+ // -------------------------
+
+ /** HLT DataType */
+ TString fDataType; // see above
/** Detector Name, e.g. PHOS */
TString fDetector; // see above
- /** SubDetector Name e.g. MODULE */
- TString fSubDetector; // see above
-
- /** SubSubDetector Name e.g. PARTITION */
- TString fSubSubDetector; // see above
-
/** HLT Specification */
ULong_t fSpecification; // see above
- /** HLT DataType */
- TString fDataType; // see above
+ // XXXXXXXXXXXXXXXXXXXXXXXX REMOVE IF NOT NEEDED XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+
+ // -- Sub Detector Specifications --
+ // ---------------------------------
+
+ /** SubDetector Name e.g. MODULE */
+ Int_t fSubDetector; // see above
+
+ /** SubSubDetector Name e.g. PARTITION */
+ Int_t fSubSubDetector; // see above
/** States id block has a subdetector range */
- Bool_t fHasSubDetectorRange; // see above
+ Bool_t fHasSubDetectorRange; // see above
/** States id block has a subsubdetector range */
- Bool_t fHasSubSubDetectorRange; // see above
+ Bool_t fHasSubSubDetectorRange; // see above
+
+ // XXXXXXXXXXXXXXXXXXXXXXXX REMOVE IF NOT NEEDED XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ClassDef( AliHLTHOMERBlockDesc, 0 )
};
--- /dev/null
+//-*- Mode: C++ -*-
+// $Id: AliHLTHOMERManager.cxx $
+//**************************************************************************
+//* This file is property of and copyright by the ALICE HLT Project *
+//* ALICE Experiment at CERN, All rights reserved. *
+//* *
+//* Primary Authors: Jochen Thaeder <thaeder@kip.uni-heidelberg.de> *
+//* for The ALICE HLT Project. *
+//* *
+//* Permission to use, copy, modify and distribute this software and its *
+//* documentation strictly for non-commercial purposes is hereby granted *
+//* without fee, provided that the above copyright notice appears in all *
+//* copies and that both the copyright notice and this permission notice *
+//* appear in the supporting documentation. The authors make no claims *
+//* about the suitability of this software for any purpose. It is *
+//* provided "as is" without express or implied warranty. *
+//**************************************************************************
+
+/** @file AliHLTHOMERManager.cxx
+ @author Jochen Thaeder
+ @date
+ @brief Manger for HOMER in aliroot
+*/
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+#if __GNUC__>= 3
+ using namespace std;
+#endif
+
+#define EVE_DEBUG 1
+
+#include "AliHLTHOMERManager.h"
+// -- -- -- -- -- -- --
+#include "AliHLTHOMERLibManager.h"
+#include "AliHLTHOMERSourceDesc.h"
+#include "AliHLTHOMERBlockDesc.h"
+
+ClassImp(AliHLTHOMERManager)
+
+/*
+ * ---------------------------------------------------------------------------------
+ * Constructor / Destructor
+ * ---------------------------------------------------------------------------------
+ */
+
+//##################################################################################
+ AliHLTHOMERManager::AliHLTHOMERManager() :
+ fLibManager(new AliHLTHOMERLibManager),
+ fProxyHandler(NULL),
+ fReader(NULL),
+ fSourceList(NULL),
+ fBlockList(NULL),
+ fNBlks(0),
+ fEventID(0),
+ fCurrentBlk(0),
+ fConnected(kFALSE),
+ fStateHasChanged(kTRUE) {
+ // see header file for class documentation
+ // or
+ // refer to README to build package
+ // or
+ // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+}
+
+//##################################################################################
+AliHLTHOMERManager::~AliHLTHOMERManager() {
+ // see header file for class documentation
+
+ if ( fLibManager ) {
+ if ( fReader )
+ fLibManager->DeleteReader(fReader);
+ delete fLibManager;
+ fLibManager = NULL;
+ fReader = NULL;
+ }
+
+ if ( fProxyHandler != NULL )
+ delete fProxyHandler;
+ fProxyHandler = NULL;
+
+ if ( fSourceList != NULL )
+ delete fSourceList;
+ fSourceList = NULL;
+
+ if ( fBlockList != NULL )
+ delete fBlockList;
+ fBlockList = NULL;
+}
+
+//##################################################################################
+Int_t AliHLTHOMERManager::Initialize() {
+ // see header file for class documentation
+
+ Int_t iResult = 0;
+
+ if ( !fProxyHandler )
+ fProxyHandler = new AliHLTHOMERProxyHandler();
+
+ if ( fProxyHandler ) {
+ iResult = fProxyHandler->Initialize();
+ if (iResult)
+ HLTError("Initialize of ProxyHandler failed.");
+ }
+ else {
+ iResult = -1;
+ HLTError("Creating of ProxyHandler failed.");
+ }
+
+ return iResult;
+}
+
+/*
+ * ---------------------------------------------------------------------------------
+ * Source Handling
+ * ---------------------------------------------------------------------------------
+ */
+
+//##################################################################################
+Int_t AliHLTHOMERManager::CreateSourcesList() {
+ // see header file for class documentation
+
+ Int_t iResult = 0;
+
+ if ( fSourceList != NULL )
+ delete fSourceList;
+ fSourceList = NULL;
+
+ fSourceList = new TList();
+ fSourceList->SetOwner( kTRUE );
+
+ iResult = fProxyHandler->FillSourceList( fSourceList );
+ if ( iResult ) {
+ HLTWarning("There have been errors, while creating the sources list.");
+ }
+ else {
+ HLTInfo("New sources list created.");
+
+ // -- New SourceList has been created
+ // --> All Sources are new --> State has changed
+ fStateHasChanged = kTRUE;
+ }
+
+ return iResult;
+}
+
+//##################################################################################
+void AliHLTHOMERManager::SetSourceState( AliHLTHOMERSourceDesc * source, Bool_t state ) {
+ // see header file for class documentation
+
+ if ( source->IsSelected() != state ) {
+ source->SetState( state );
+ fStateHasChanged = kTRUE;
+ }
+
+ return;
+}
+
+/*
+ * ---------------------------------------------------------------------------------
+ * Connection Handling -oublic
+ * ---------------------------------------------------------------------------------
+ */
+
+//##################################################################################
+Int_t AliHLTHOMERManager::ConnectHOMER(){
+ // see header file for class documentation
+
+ Int_t iResult = 0;
+
+ // -- Check if already connected and state has not changed
+ if ( fStateHasChanged == kFALSE && IsConnected() ) {
+ HLTInfo("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 ) {
+ HLTError("No sources selected, aborting.");
+ return -1;
+ }
+
+ // *** Connect to data sources
+ if ( !fReader && fLibManager )
+ fReader = fLibManager->OpenReader( sourceCount, sourceHostnames, sourcePorts );
+ else {
+ HLTError("No LibManager present.");
+ return -2;
+ }
+
+ iResult = fReader->GetConnectionStatus();
+ if ( iResult ) {
+ // -- Connection failed
+
+ UInt_t ndx = fReader->GetErrorConnectionNdx();
+
+ if ( ndx < sourceCount ) {
+ HLTError("Error establishing connection to TCP source %s:%hu: %s (%d)",
+ sourceHostnames[ndx], sourcePorts[ndx], strerror(iResult), iResult);
+ }
+ else {
+ HLTError("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;
+
+ HLTInfo("Connection established.");
+ }
+
+ delete[] sourceHostnames;
+ delete[] sourcePorts;
+
+ return iResult;
+}
+
+//##################################################################################
+void AliHLTHOMERManager::DisconnectHOMER(){
+ // see header file for class documentation
+
+ if ( ! IsConnected() )
+ return;
+
+ if ( fReader )
+ fLibManager->DeleteReader( fReader );
+ fReader = NULL;
+
+ fStateHasChanged = kTRUE;
+ fConnected = kFALSE;
+
+ HLTInfo("Connection closed.");
+
+ return;
+}
+
+//##################################################################################
+Int_t AliHLTHOMERManager::ReconnectHOMER(){
+ // see header file for class documentation
+
+ Int_t iResult = 0;
+
+ if ( IsConnected() )
+ DisconnectHOMER();
+
+ iResult = ConnectHOMER();
+ if ( iResult ) {
+ HLTError("Error reconnecting.");
+ }
+
+ return iResult;
+}
+
+/*
+ * ---------------------------------------------------------------------------------
+ * Event Handling - public
+ * ---------------------------------------------------------------------------------
+ */
+
+
+//##################################################################################
+Int_t AliHLTHOMERManager::NextEvent(){
+ // see header file for class documentation
+
+ Int_t iResult = 0;
+ Int_t iRetryCount = 0;
+
+ if ( !fReader || ! IsConnected() ) {
+ HLTWarning( "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 ) {
+ HLTError("No Connection to source %d: %s (%d)",
+ fReader->GetErrorConnectionNdx(), strerror(iResult), iResult);
+ return -iResult;
+ }
+ else if ( iResult == 110 ) {
+ HLTError("Timout occured, reading event from source %d: %s (%d)",
+ fReader->GetErrorConnectionNdx(), strerror(iResult), iResult);
+ return -iResult;
+ }
+ else if ( iResult == 56) {
+ ++iRetryCount;
+
+ if ( iRetryCount >= 20 ) {
+ HLTError("Retry Failed: Error reading event from source %d: %s (%d)",
+ fReader->GetErrorConnectionNdx(), strerror(iResult), iResult);
+ return -iResult;
+ }
+ else {
+ HLTError("Retry: Error reading event from source %d: %s (%d)",
+ fReader->GetErrorConnectionNdx(), strerror(iResult), iResult);
+ continue;
+ }
+ }
+ else if ( iResult ) {
+ HLTError("General Error reading event from source %d: %s (%d)",
+ fReader->GetErrorConnectionNdx(), strerror(iResult), iResult);
+ fConnected = kFALSE;
+ return -iResult;
+ }
+ else {
+ break;
+ }
+ } // while( 1 ) {
+
+ // -- Get blockCnt and eventID
+ fNBlks = static_cast<ULong_t>(fReader->GetBlockCnt());
+ fEventID = static_cast<ULong64_t>(fReader->GetEventID());
+ fCurrentBlk = 0;
+
+ HLTInfo("Event 0x%016LX (%Lu) with %lu blocks", fEventID, fEventID, fNBlks);
+
+#if EVE_DEBUG
+ // Loop for Debug only
+ for ( ULong_t ii = 0; ii < fNBlks; ii++ ) {
+ Char_t tmp1[9], tmp2[5];
+ memset( tmp1, 0, 9 );
+ memset( tmp2, 0, 5 );
+ void *tmp11 = tmp1;
+ ULong64_t* tmp12 = static_cast<ULong64_t*>(tmp11);
+ *tmp12 = fReader->GetBlockDataType( ii );
+ void *tmp21 = tmp2;
+ ULong_t* tmp22 = static_cast<ULong_t*>(tmp21);
+ *tmp22 = fReader->GetBlockDataOrigin( ii );
+ HLTInfo("Block %lu length: %lu - type: %s - origin: %s",
+ ii, fReader->GetBlockDataLength( ii ), tmp1, tmp2);
+ } // end for ( ULong_t ii = 0; ii < fNBlks; ii++ ) {
+#endif
+
+ // -- Create BlockList
+ HLTInfo("Create Block List");
+ CreateBlockList();
+
+ return iResult;
+}
+
+/*
+ * ---------------------------------------------------------------------------------
+ * Connection Handling - private
+ * ---------------------------------------------------------------------------------
+ */
+
+//##################################################################################
+void AliHLTHOMERManager::CreateReadoutList( const char** sourceHostnames,
+ UShort_t *sourcePorts, UInt_t &sourceCount ){
+ // see header file for class documentation
+
+ AliHLTHOMERSourceDesc * source= NULL;
+
+ // -- Read all sources and check if they should be read out
+ TIter next( fSourceList );
+ while ( ( source = dynamic_cast<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
+ * ---------------------------------------------------------------------------------
+ */
+
+
+//##################################################################################
+void AliHLTHOMERManager::CreateBlockList() {
+ // see header file for class documentation
+
+ // -- Initialize block list
+ if ( fBlockList != NULL )
+ delete fBlockList;
+ fBlockList = NULL;
+
+ fBlockList = new TList();
+ fBlockList->SetOwner(kTRUE);
+
+ GetFirstBlk();
+
+ // -- Fill block list
+ do {
+
+ // -- Create new block
+ AliHLTHOMERBlockDesc * block = new AliHLTHOMERBlockDesc();
+ block->SetBlock( GetBlk(), GetBlkSize(), GetBlkOrigin(),
+ GetBlkType(), GetBlkSpecification() );
+
+ // -- Check sources list if block is requested
+ if ( CheckIfRequested( block ) )
+ fBlockList->Add( block );
+ else {
+ delete block;
+ block = NULL;
+ }
+
+ } while( GetNextBlk() );
+
+ return;
+}
+
+/*
+ * ---------------------------------------------------------------------------------
+ * BlockHandling
+ * ---------------------------------------------------------------------------------
+ */
+
+//##################################################################################
+void* AliHLTHOMERManager::GetBlk( Int_t ndx ) {
+ // see header file for class documentation
+ // Get pointer to current block in current event
+
+ if ( !fReader || !IsConnected() ) {
+ HLTError("Not connected yet.");
+ return NULL;
+ }
+ if ( ndx < static_cast<Int_t>(fNBlks) )
+ return const_cast<void*> (fReader->GetBlockData(ndx));
+ else
+ return NULL;
+}
+
+//##################################################################################
+ULong_t AliHLTHOMERManager::GetBlkSize( Int_t ndx ) {
+ // see header file for class documentation
+
+ if ( !fReader || !IsConnected() ) {
+ HLTError("Not connected yet.");
+ return 0;
+ }
+
+ if ( ndx < static_cast<Int_t>(fNBlks) )
+ return static_cast<ULong_t> (fReader->GetBlockDataLength(ndx));
+ else
+ return 0;
+}
+
+//##################################################################################
+TString AliHLTHOMERManager::GetBlkOrigin( Int_t ndx ) {
+ // see header file for class documentation
+
+ TString origin = "";
+
+ // -- Check for Connection
+ if ( !fReader || ! IsConnected() ) {
+ HLTError("Not connected yet.");
+ return origin;
+ }
+
+ // -- Check block index
+ if ( ndx >= static_cast<Int_t>(fNBlks) ) {
+ HLTError("Block index %d out of range.", ndx );
+ return origin;
+ }
+
+ // -- Get origin
+ union{
+ UInt_t data;
+ Char_t array[4];
+ } reverseOrigin;
+
+ reverseOrigin.data = static_cast<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] );
+
+ origin.Remove( TString::kTrailing, ' ' );
+
+ return origin;
+}
+
+//##################################################################################
+TString AliHLTHOMERManager::GetBlkType( Int_t ndx ) {
+ // see header file for class documentation
+
+ TString type = "";
+
+ // -- Check for Connection
+ if ( !fReader || ! IsConnected() ) {
+ HLTError("Not connected yet.");
+ return type;
+ }
+
+ // -- Check block index
+ if ( ndx >= static_cast<Int_t>(fNBlks) ) {
+ HLTError("Block index %d out of range.", ndx );
+ return type;
+ }
+
+ // -- Get type
+ union{
+ ULong64_t data;
+ Char_t array[8];
+ } reverseType;
+
+ reverseType.data = static_cast<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] );
+
+ type.Remove( TString::kTrailing, ' ' );
+
+ return type;
+}
+
+//##################################################################################
+ULong_t AliHLTHOMERManager::GetBlkSpecification( Int_t ndx ) {
+ // see header file for class documentation
+
+ // -- Check for Connection
+ if ( !fReader || ! IsConnected() ) {
+ HLTError("Not connected yet.");
+ return 0;
+ }
+
+ // -- Check block index
+ if ( ndx >= static_cast<Int_t>(fNBlks) ) {
+ HLTError("Block index %d out of range.", ndx );
+ return 0;
+ }
+
+ return static_cast<ULong_t>(fReader->GetBlockDataSpec(ndx));
+}
+
+//##################################################################################
+Bool_t AliHLTHOMERManager::CheckIfRequested( AliHLTHOMERBlockDesc * block ) {
+ // see header file for class documentation
+
+ Bool_t requested = kFALSE;
+
+ AliHLTHOMERSourceDesc * source= NULL;
+
+ // -- Read all sources and check if they should be read out
+ TIter next( fSourceList );
+ while ( ( source = dynamic_cast<AliHLTHOMERSourceDesc*>(next()) ) ) {
+
+ // -- Check if source is selected
+ if ( ! source->IsSelected() )
+ continue;
+
+ // -- Check if detector matches
+ if ( source->GetSourceName().CompareTo( block->GetBlockName() ) )
+ continue;
+
+ requested = kTRUE;
+ break;
+
+ } // while ( ( source = dynamic_cast<AliHLTHOMERSourceDesc*>(next()) ) ) {
+
+#if EVE_DEBUG
+ if ( requested ) {
+ HLTInfo ("Block requested : %s", block->GetBlockName().Data());
+ }
+ else {
+ HLTInfo("Block NOT requested : %s", block->GetBlockName().Data());
+ }
+#endif
+
+ return requested;
+}
+
--- /dev/null
+//-*- Mode: C++ -*-
+
+// $Id: AliHLTHOMERManager.h $
+
+#ifndef ALIEVEHOMERMANGER_H
+#define ALIEVEHOMERMANGER_H
+
+/* This file is property of and copyright by the ALICE HLT Project *
+ * ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice
+ */
+
+/** @file AliHLTHOMERManager.h
+ @author Jochen Thaeder
+ @date
+ @brief Manager for HOMER in aliroot
+*/
+
+
+#include "TString.h"
+#include "TList.h"
+
+#include "AliHLTHOMERSourceDesc.h"
+#include "AliHLTHOMERBlockDesc.h"
+#include "AliHLTHOMERReader.h"
+#include "AliHLTHOMERProxyHandler.h"
+
+#include "AliHLTLogging.h"
+
+class AliHLTHOMERLibManager;
+
+/**
+ * @class AliHLTHOMERManager
+ * This Class should handle the communication
+ * from the HLT to aliroot. 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.
+ *
+ * @ingroup alihlt_homer
+ */
+
+class AliHLTHOMERManager : public TObject, public AliHLTLogging {
+public:
+
+ /*
+ * ---------------------------------------------------------------------------------
+ * Constructor / Destructor
+ * ---------------------------------------------------------------------------------
+ */
+
+ /** default constructor */
+ AliHLTHOMERManager();
+
+ /** destructor */
+ virtual ~AliHLTHOMERManager();
+
+ /** Initialize
+ * @return 0 on success, <0 for failure
+ */
+ Int_t Initialize();
+
+ /*
+ * ---------------------------------------------------------------------------------
+ * Source Handling - public
+ * ---------------------------------------------------------------------------------
+ */
+
+ /** Create Sources List from HOMER-Proxy
+ * @return 0 on success, <0 for failure
+ */
+ virtual Int_t CreateSourcesList();
+
+ /** Set state of a source
+ * @param source Pointer to AliHLTHOMERSourceDesc object.
+ * @param state New (selected/not selected) state.
+ */
+ void SetSourceState( AliHLTHOMERSourceDesc* source, Bool_t state);
+
+ /** Get pointer to source List */
+ TList* GetSourceList() { return fSourceList; }
+
+ /*
+ * ---------------------------------------------------------------------------------
+ * Connection Handling - public
+ * ---------------------------------------------------------------------------------
+ */
+
+ /** Connect to HOMER sources, out of Readout List,
+ * which gets created when state has changed
+ * @return 0 on success, <0 for failure
+ */
+ Int_t ConnectHOMER();
+
+ /** Disconnect from HOMER sources */
+ void DisconnectHOMER();
+
+ /** Reconnect from HOMER sources
+ * @return 0 on success, <0 for failure
+ */
+ Int_t ReconnectHOMER();
+
+ /*
+ * ---------------------------------------------------------------------------------
+ * Event Handling - public
+ * ---------------------------------------------------------------------------------
+ */
+
+ /** Loads the next Event, after being connected
+ * @return 0 on success, <0 for failure
+ */
+ virtual 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
+
+ ///////////////////////////////////////////////////////////////////////////////////
+
+protected:
+
+ /** Dynamic loader manager for the HOMER library */
+ AliHLTHOMERLibManager* fLibManager; //! transient
+
+ ///////////////////////////////////////////////////////////////////////////////////
+
+private:
+
+ /** copy constructor prohibited */
+ AliHLTHOMERManager(const AliHLTHOMERManager&);
+
+ /** assignment operator prohibited */
+ AliHLTHOMERManager& operator=(const AliHLTHOMERManager&);
+
+ /*
+ * ---------------------------------------------------------------------------------
+ * Connection Handling - private
+ * ---------------------------------------------------------------------------------
+ */
+
+ /** 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
+ */
+ void CreateReadoutList( const char** sourceHostnames, UShort_t* sourcePorts,
+ UInt_t &sourceCount);
+
+ /** Checks if already connected to HOMER sources */
+ Bool_t IsConnected() { return fConnected; }
+
+ /* ---------------------------------------------------------------------------------
+ * Event Handling - private
+ * ---------------------------------------------------------------------------------
+ */
+
+ /** Create a TList of blocks, which have been readout */
+ void CreateBlockList();
+
+ /*
+ * ---------------------------------------------------------------------------------
+ * Block Handling - private
+ * ---------------------------------------------------------------------------------
+ */
+
+ /** Get Number of blocks in current event */
+ ULong_t GetNBlks() { return fNBlks; }
+
+ // ----------------------------------------------------
+
+ /** Get pointer to block ndx in current event
+ * @param ndx Block index
+ * @return returns pointer to blk, NULL if no block present
+ */
+ void* GetBlk( Int_t ndx );
+
+ /** Get pointer to current block in current event */
+ void* GetBlk() { return GetBlk(fCurrentBlk); }
+
+ /** Get first block in current event */
+ void* GetFirstBlk() { fCurrentBlk=0; return GetBlk(0); }
+
+ /** Get next block in current event */
+ void* GetNextBlk() { return GetBlk(++fCurrentBlk); }
+
+ // ----------------------------------------------------
+
+ /** Get size of block ndx
+ * @param ndx Block index
+ * @return returns size blk, 0 otherwise
+ */
+ ULong_t GetBlkSize( Int_t ndx );
+
+ /** Get size of current block */
+ ULong_t GetBlkSize() { return GetBlkSize( fCurrentBlk ); }
+
+ // ----------------------------------------------------
+
+ /** Get origin of block ndx
+ * @param ndx Block index
+ * @return origin of block
+ */
+ TString GetBlkOrigin( Int_t ndx );
+
+ /** Get origin of current block */
+ TString GetBlkOrigin(){ return GetBlkOrigin( fCurrentBlk ); }
+
+ // ----------------------------------------------------
+
+ /** Get type of block ndx
+ * @param ndx Block index
+ * @return type of block
+ */
+ TString GetBlkType( Int_t ndx );
+
+ /** Get type of current block */
+ TString GetBlkType() { return GetBlkType( fCurrentBlk ); }
+
+ // ----------------------------------------------------
+
+ /** Get specification of block ndx
+ * @param ndx Block index
+ * @return specification of block
+ */
+ ULong_t GetBlkSpecification( Int_t ndx );
+
+ /** Get specification of current block */
+ ULong_t GetBlkSpecification() { return GetBlkSpecification( fCurrentBlk ); }
+
+ // ----------------------------------------------------
+
+ /** Checks if current Block should was requested
+ * @return returns kTRUE, if block should was requested
+ */
+ Bool_t CheckIfRequested( AliHLTHOMERBlockDesc* block );
+
+ /*
+ * ---------------------------------------------------------------------------------
+ * Members - private
+ * ---------------------------------------------------------------------------------
+ */
+
+ /** Proxy Handler to get the list of sources */
+ AliHLTHOMERProxyHandler *fProxyHandler; //! transient
+
+ // == connection ==
+
+ /** Pointer to HOMER reader */
+ AliHLTHOMERReader* fReader; //! transient
+
+ // == sources ==
+
+ /** List to HOMER sources */
+ TList *fSourceList; //! transient
+
+ // == blocks ==
+
+ /** List to HOMER blocks */
+ TList *fBlockList; //! transient
+
+ // == events ==
+
+ /** Number of blockes in current event */
+ ULong_t fNBlks; // see above
+
+ /** EventID of current event */
+ ULong64_t fEventID; // see above
+
+ /** Current block in current event */
+ ULong_t fCurrentBlk; // see above
+
+ // == states ==
+
+ /** 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.
+};
+
+#endif
--- /dev/null
+//-*- Mode: C++ -*-
+// $Id: AliHLTHOMERProxyHandler.cxx $
+//**************************************************************************
+//* This file is property of and copyright by the ALICE HLT Project *
+//* ALICE Experiment at CERN, All rights reserved. *
+//* *
+//* Primary Authors: Jochen Thaeder <thaeder@kip.uni-heidelberg.de> *
+//* for The ALICE HLT Project. *
+//* *
+//* Permission to use, copy, modify and distribute this software and its *
+//* documentation strictly for non-commercial purposes is hereby granted *
+//* without fee, provided that the above copyright notice appears in all *
+//* copies and that both the copyright notice and this permission notice *
+//* appear in the supporting documentation. The authors make no claims *
+//* about the suitability of this software for any purpose. It is *
+//* provided "as is" without express or implied warranty. *
+//**************************************************************************
+
+/** @file AliHLTHOMERProxyHandler.cxx
+ @author Jochen Thaeder
+ @date
+ @brief HOMER proxy handler for HomerManger
+*/
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+#if __GNUC__>= 3
+ using namespace std;
+#endif
+
+#include "TDOMParser.h"
+#include "TSocket.h"
+#include "TSystem.h"
+// -- -- -- -- -- -- --
+#include "AliHLTHOMERProxyHandler.h"
+
+ClassImp(AliHLTHOMERProxyHandler)
+
+/*
+ * ---------------------------------------------------------------------------------
+ * Constructor / Destructor
+ * ---------------------------------------------------------------------------------
+ */
+
+//##################################################################################
+AliHLTHOMERProxyHandler::AliHLTHOMERProxyHandler() :
+ fRealm(kHLT),
+ fXmlRpcResponse(""),
+ fSourceList(NULL) {
+ // see header file for class documentation
+ // or
+ // refer to README to build package
+ // or
+ // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+}
+
+//##################################################################################
+AliHLTHOMERProxyHandler::~AliHLTHOMERProxyHandler() {
+ // see header file for class documentation
+
+}
+
+//##################################################################################
+Int_t AliHLTHOMERProxyHandler::Initialize() {
+ // see header file for class documentation
+
+ Int_t iResult = 0 ;
+
+ IdentifyRealm();
+
+ return iResult;
+}
+
+/*
+ * ---------------------------------------------------------------------------------
+ * Source List - public
+ * ---------------------------------------------------------------------------------
+ */
+
+//##################################################################################
+Int_t AliHLTHOMERProxyHandler::FillSourceList(TList *srcList) {
+ // see header file for class documentation
+
+ Int_t iResult = 0;
+
+ fSourceList = srcList;
+
+ iResult = RequestXmlRpcResponse();
+
+ if (!iResult)
+ iResult = ProcessXmlRpcResponse();
+
+ if (iResult)
+ HLTError("Filling SourceList failed.");
+
+ return iResult;
+}
+
+/*
+ * ---------------------------------------------------------------------------------
+ * Realms - private
+ * ---------------------------------------------------------------------------------
+ */
+
+//##################################################################################
+const Char_t *AliHLTHOMERProxyHandler::fgkHOMERProxyNode[] = {
+ "portal-dcs0.internal",
+ "alihlt-dcs0.cern.ch",
+ "alihlt-vobox0.cern.ch",
+ "alihlt-gw0.kip.uni-heidelberg.de",
+ "portal-dcs1.internal",
+ "alihlt-dcs1.cern.ch",
+ "alihlt-vobox1.cern.ch",
+ "alihlt-gw1.kip.uni-heidelberg.de"
+};
+
+//##################################################################################
+void AliHLTHOMERProxyHandler::IdentifyRealm() {
+ // see header file for class documentation
+
+ TString hostIP(gSystem->GetHostByName(gSystem->HostName()).GetHostAddress());
+
+ if ( hostIP.Contains("10.162.") )
+ fRealm = kHLT;
+ else if ( hostIP.Contains("10.160.") || hostIP.Contains("10.161.") )
+ fRealm = kACR;
+ else if ( hostIP.Contains("129.206.") )
+ fRealm = kKIP;
+ else
+ fRealm = kGPN;
+
+ return;
+}
+
+/*
+ * ---------------------------------------------------------------------------------
+ * Proxy Communication - private
+ * ---------------------------------------------------------------------------------
+ */
+
+//##################################################################################
+Int_t AliHLTHOMERProxyHandler::RequestXmlRpcResponse() {
+ // see header file for class documentation
+
+ Int_t iResult = 0;
+
+ // -- open socket
+ // ----------------
+
+ Int_t proxyPort = 19999;
+
+ TSocket *socket = new TSocket(fgkHOMERProxyNode[fRealm], proxyPort);
+ if ( ! socket->IsValid() ) {
+ HLTWarning("Failed to create socket to %s:%d,",fgkHOMERProxyNode[fRealm], proxyPort);
+ HLTWarning("trying %s:%d now.", fgkHOMERProxyNode[fRealm+kHOMERRealmsMax],proxyPort);
+
+ socket = new TSocket(fgkHOMERProxyNode[fRealm+kHOMERRealmsMax], proxyPort);
+ if ( ! socket->IsValid() ) {
+ HLTError("Failed to create socket to %s:%d and %s:%d.",
+ fgkHOMERProxyNode[fRealm], proxyPort,
+ fgkHOMERProxyNode[fRealm+kHOMERRealmsMax],proxyPort);
+ fRealm = -1;
+ return -1;
+ }
+ else
+ fRealm = fRealm+kHOMERRealmsMax;
+ }
+
+ // -- send request
+ // -----------------
+
+ Char_t reqMsg[] = "PUT / HTTP/1.1\r\n\
+User-Agent: curl/7.18.0 (x86_64-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.1\r\n\
+Host: localhost:10000\r\n\
+Accept: */*\r\n\
+Content-type: text/xml\r\n\
+Content-Length: 68\r\n\
+\r\n<methodCall><methodName>getTcpDumpServices</methodName></methodCall>\r\n";
+
+ iResult = socket->SendRaw( reqMsg, strlen(reqMsg) );
+ if ( iResult < 1 ||
+ iResult != static_cast<Int_t>(strlen(reqMsg))) {
+ HLTError("Error sending! -- send length %d -- msg length %d.", iResult, strlen(reqMsg) );
+ socket->Close();
+ return iResult;
+ }
+
+ // -- receive answer
+ // -------------------
+
+ const Int_t bufferSize = 1024;
+ Char_t buffer[bufferSize];
+
+ Bool_t isXmlRpc = kFALSE;
+
+ fXmlRpcResponse = "";
+
+ // -- loop for getting full xmlRPC response
+ while(1) {
+
+ Int_t bufferLength = 0;
+
+ // -- loop for reading until end of line
+ while (1) {
+
+ iResult = socket->RecvRaw(&buffer[bufferLength], 1);
+ if ( iResult < 0) {
+ HLTError("Error reading form socket.");
+ socket->Close();
+ return iResult;
+ }
+
+ // -- Checking for end of line
+ if ( buffer[bufferLength] == 10 ) {
+ buffer[bufferLength] = 0;
+ break;
+ }
+
+ ++bufferLength;
+ }
+
+ TString bufferString(buffer);
+
+ // -- Checking for start of XML response
+ if ( bufferString.BeginsWith("<?xml") )
+ isXmlRpc = kTRUE;
+
+ // -- Append the xml response
+ if (isXmlRpc) {
+ fXmlRpcResponse.Append(bufferString);
+ }
+
+ // -- Checking for end of XML response
+ if( ! bufferString.CompareTo("</methodResponse>") )
+ break;
+ }
+
+ // -- close socket
+ socket->Close();
+
+ return 0;
+}
+
+//##################################################################################
+Int_t AliHLTHOMERProxyHandler::ProcessXmlRpcResponse() {
+ // see header file for class documentation
+
+ Int_t iResult = 0;
+
+ // -- Parse XML RPC Response
+ // ---------------------------
+
+ TDOMParser xmlParser;
+ xmlParser.SetValidate(kFALSE);
+
+ HLTInfo("XMLResponse:\n %s",fXmlRpcResponse.Data());
+
+ iResult = xmlParser.ParseBuffer(fXmlRpcResponse.Data(), fXmlRpcResponse.Length());
+ if ( iResult < 0 ) {
+ HLTError("Parsing buffer with error: %s",
+ xmlParser.GetParseCodeMessage(xmlParser.GetParseCode()) );
+ return iResult;
+ }
+
+ TXMLNode * node = xmlParser.GetXMLDocument()->GetRootNode()->
+ GetChildren()->GetChildren()->GetChildren()->GetChildren();
+
+ if ( strcmp( node->GetNodeName(), "string" ) ) {
+ HLTError("No node 'string' in XmlRpcResponse.");
+ return -1;
+ }
+
+ // -- Parse Content
+ // ------------------
+
+ // -- Get Content
+ TString xmlContent(node->GetText() );
+
+ HLTInfo("XMLContent:\n %s",xmlContent.Data());
+
+ iResult = xmlParser.ParseBuffer(xmlContent.Data(), xmlContent.Length());
+ if ( iResult < 0 ) {
+ HLTError("Parsing buffer with error: %s",
+ xmlParser.GetParseCodeMessage(xmlParser.GetParseCode()) );
+ return iResult;
+ }
+
+
+ if ( !xmlParser.GetXMLDocument()->GetRootNode()->HasChildren() ) {
+ HLTInfo("No Services active.");
+ return 0;
+ }
+
+ // -- Loop over all service nodes
+ TXMLNode* serviceNode = xmlParser.GetXMLDocument()->GetRootNode()->GetChildren();
+ TXMLNode* prevServiceNode = NULL;
+
+ do {
+ prevServiceNode = serviceNode;
+
+ // -- Add service to list
+ iResult = AddService( serviceNode->GetChildren() );
+
+ } while ( ( serviceNode = prevServiceNode->GetNextNode() ) && !iResult );
+
+ return iResult;
+}
+
+/*
+ * ---------------------------------------------------------------------------------
+ * Source Resolving - private
+ * ---------------------------------------------------------------------------------
+ */
+
+//##################################################################################
+Int_t AliHLTHOMERProxyHandler::AddService(TXMLNode *innerNode) {
+ // see header file for class documentation
+
+ Int_t iResult = 0;
+
+ HLTInfo(">> New service");
+
+ // -- Loop over all service properties and
+ // read them from the service tag
+ // -----------------------------------------
+
+ TString hostname = "";
+ Int_t port = 0;
+ TString dataType = "";
+ TString dataOrigin = "";
+ TString dataSpecification = "";
+
+ TXMLNode* prevInnerNode = NULL;
+
+ do {
+ prevInnerNode = innerNode;
+
+ if ( ! strcmp(innerNode->GetNodeName(), "text" ) )
+ continue;
+
+ HLTInfo(" %s ++ %s", innerNode->GetNodeName(), innerNode->GetText() );
+
+ // -- hostname
+ if ( ! strcmp( innerNode->GetNodeName(), "address") )
+ hostname = innerNode->GetText();
+ else if ( ! strcmp( innerNode->GetNodeName(), "port") ) {
+ TString portS(innerNode->GetText());
+ if ( portS.IsDigit() )
+ port = portS.Atoi();
+ else {
+ HLTError("Port %s is not a digit.", portS.Data());
+ iResult = -1;
+ }
+ }
+ else if ( ! strcmp( innerNode->GetNodeName(), "dataorigin") )
+ dataOrigin = innerNode->GetText();
+ else if ( ! strcmp( innerNode->GetNodeName(), "datatype") )
+ dataType = innerNode->GetText();
+ else if ( ! strcmp( innerNode->GetNodeName(), "dataspecification") )
+ dataSpecification = innerNode->GetText();
+
+ } while ( ( innerNode = prevInnerNode->GetNextNode() ) && !iResult );
+
+ // -- Check the service properties
+ // ---------------------------------
+
+ // -- Change hostame from service with proxy, if outside HLT
+ if ( fRealm != kHLT || fRealm != kHLT+kHOMERRealmsMax )
+ hostname = fgkHOMERProxyNode[fRealm];
+
+ // -- Check for completeness of the source properties
+ if ( hostname.IsNull() || !port || dataOrigin.IsNull() ||
+ dataType.IsNull() /*|| dataSpecification.IsNull()*/ ) {
+ HLTError("Service provides not all values:\n\thostname\t\t %s\n\tport\t\t\t %d\n\tdataorigin\t\t %s\n\tdatatype\t\t %s\n\tdataspecification\t %s", hostname.Data(),
+ port, dataOrigin.Data(), dataType.Data(), dataSpecification.Data());
+ return -2;
+ }
+
+ // -- Create new source
+ // ----------------------
+
+ AliHLTHOMERSourceDesc * source = new AliHLTHOMERSourceDesc();
+ source->SetService( hostname, port, dataType, dataOrigin, dataSpecification );
+
+ fSourceList->Add( source );
+
+ HLTInfo( "New Source added : %s", source->GetSourceName().Data());
+
+ return iResult;
+}
+
+
--- /dev/null
+//-*- Mode: C++ -*-
+
+// $Id: AliHLTHOMERProxyHandler.h $
+
+#ifndef ALIHLTHOMERPROXYHANDLER_H
+#define ALIHLTHOMERPROXYHANDLER_H
+
+/* This file is property of and copyright by the ALICE HLT Project *
+ * ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice
+ */
+
+/** @file AliHLTHOMERProxyHandler.h
+ @author Jochen Thaeder
+ @date
+ @brief HOMER proxy handler for HomerManger
+*/
+
+#include "TString.h"
+#include "TList.h"
+#include "TXMLNode.h"
+// -- -- -- -- -- -- --
+#include "AliHLTHOMERSourceDesc.h"
+// -- -- -- -- -- -- --
+#include "AliHLTLogging.h"
+
+/**
+ * @class AliHLTHOMERProxyHandler
+ * This Class should handle the communication with the proxy
+ * and fill the source list.
+ *
+ * @ingroup alihlt_homer
+ */
+
+class AliHLTHOMERProxyHandler : public TObject, public AliHLTLogging
+{
+public:
+
+ /*
+ * ---------------------------------------------------------------------------------
+ * Constructor / Destructor
+ * ---------------------------------------------------------------------------------
+ */
+
+ /** constructor */
+ AliHLTHOMERProxyHandler();
+
+ /** destructor */
+ virtual ~AliHLTHOMERProxyHandler();
+
+ /** Initialize
+ * @return 0 on success, <0 for failure
+ */
+ Int_t Initialize();
+
+ /*
+ * ---------------------------------------------------------------------------------
+ * Source List - public
+ * ---------------------------------------------------------------------------------
+ */
+
+ /** Fill's source list, with entries */
+ Int_t FillSourceList(TList *srcList);
+
+ ///////////////////////////////////////////////////////////////////////////////////
+
+private:
+
+ /** copy constructor prohibited */
+ AliHLTHOMERProxyHandler(const AliHLTHOMERProxyHandler&); // Not implemented.
+
+ /** assignment operator prohibited */
+ AliHLTHOMERProxyHandler& operator=(const AliHLTHOMERProxyHandler&); // Not implemented.
+
+ /*
+ * ---------------------------------------------------------------------------------
+ * Realms - private
+ * ---------------------------------------------------------------------------------
+ */
+
+ /** Realms */
+ enum HOMERRealms_t {
+ kHLT, /**< HLT realm */
+ kACR, /**< ACR realm */
+ kGPN, /**< GPN realm */
+ kKIP, /**< KIP realm */
+ kHOMERRealmsMax /**< Number of enum entries */
+ };
+
+ /** Array of proxy nodes per realm */
+ static const Char_t *fgkHOMERProxyNode[];
+
+ /** Indentifies the realm and sets it
+ * @return 0 on success, <0 for failure
+ */
+ void IdentifyRealm();
+
+ /*
+ * ---------------------------------------------------------------------------------
+ * Proxy Communication - private
+ * ---------------------------------------------------------------------------------
+ */
+
+ /** Get xmlrpc response from the proxy
+ * @return 0 on success, <0 for failure
+ */
+ Int_t RequestXmlRpcResponse();
+
+ /** process xmlrpc response and fill the source list
+ * @return 0 on success, <0 for failure
+ */
+ Int_t ProcessXmlRpcResponse();
+
+ /*
+ * ---------------------------------------------------------------------------------
+ * Source Resolving - private
+ * ---------------------------------------------------------------------------------
+ */
+
+ /** Add a new Service to list
+ * @param xmlNode Ptr to service node
+ * @return 0 on sucess, <0 for failure
+ */
+ Int_t AddService(TXMLNode *innerNode);
+
+ /*
+ * ---------------------------------------------------------------------------------
+ * Members - private
+ * ---------------------------------------------------------------------------------
+ */
+
+ /** Realm, which can be ACR, GPN, HLT, KIP */
+ Int_t fRealm; // see above
+
+ /** xmlRPC response */
+ TString fXmlRpcResponse; // see above
+
+ /** List to HOMER sources */
+ TList* fSourceList; //! transient
+
+ ClassDef(AliHLTHOMERProxyHandler, 0); // Handles HLT xml sources.
+};
+
+#endif
//##################################################################################
AliHLTHOMERSourceDesc::AliHLTHOMERSourceDesc() :
fSelected( kFALSE ),
+ fSourceName(),
fHostname(),
fPort(),
- fSourceName(),
- fClassName(),
+ fDataType(),
fDetector(),
- fSubDetector(),
- fSubSubDetector(),
fSpecification(),
- fDataType() {
+ fSubDetector(),
+ fSubSubDetector() {
// see header file for class documentation
// or
// refer to README to build package
// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
}
-
//##################################################################################
-AliHLTHOMERSourceDesc::AliHLTHOMERSourceDesc( TString hostname, Int_t port ) :
- fSelected( kFALSE ),
- fHostname( hostname ),
- fPort( port ),
- fSourceName(),
- fClassName(),
- fDetector(),
- fSubDetector(),
- fSubSubDetector(),
- fSpecification(),
- fDataType() {
+AliHLTHOMERSourceDesc::~AliHLTHOMERSourceDesc() {
// see header file for class documentation
-
}
+/*
+ * ---------------------------------------------------------------------------------
+ * Setter - public
+ * ---------------------------------------------------------------------------------
+ */
-//##################################################################################
-AliHLTHOMERSourceDesc::~AliHLTHOMERSourceDesc() {
+//#################################################################################
+void AliHLTHOMERSourceDesc::SetService( TString hostname, Int_t port, TString origin,
+ TString type, TString /*spec*/ ) {
// see header file for class documentation
-}
+ fSourceName.Form("%s_%s%_%ul", fDetector.Data(), fDataType.Data(), fSpecification);
+
+ fHostname = hostname;
+ fPort = port;
+
+ fDataType = type;
+ fDataType.Remove( TString::kTrailing, ' ' );
+
+ fDetector = origin;
+ fDetector.Remove( TString::kTrailing, ' ' );
+
+ // -- Temporary until Specification is set in service
+ fSpecification = 0;
+ fSubDetector = 0;
+ fSubSubDetector = 0;
+
+ return;
+}
public:
- /** standard constructor */
+ /** constructor */
AliHLTHOMERSourceDesc();
- /** constructor
- * @param hostname hostname of the source
- * @param port port of the source
- */
- AliHLTHOMERSourceDesc( TString hostname, Int_t port );
-
/** destructor */
virtual ~AliHLTHOMERSourceDesc();
+ /*
+ * ---------------------------------------------------------------------------------
+ * Selection - public
+ * ---------------------------------------------------------------------------------
+ */
+
// -- SELECTION --
/** Set selection state
/** Checks if Source is selected to readout
* @return returns state, either kTRUE or kFALSE
- */
+ */
Bool_t IsSelected() { return fSelected; }
/** Select this source */
void Select() { fSelected = kTRUE; }
-
+
/** Deselect this source */
void Deselect() { fSelected = kFALSE; }
- // -- SETTER --
-
- /** Set node name of this source
- * @param hostname hostname of the source
- * @param port port of the source
+ /*
+ * ---------------------------------------------------------------------------------
+ * Setter - public
+ * ---------------------------------------------------------------------------------
*/
- void SetHostnamePort( TString hostname, Int_t port ) { fHostname = hostname; fPort = port; }
- /** Set name/obj name of this source
- * @param s1 source name
- * @param s2 source class name, default is ""
+ /** Set Service of this source
+ * @param hostname hostname of the source
+ * @param port port of the source
+ * @param origin HLT data origin
+ * @param type HLT data type
+ * @param spec HLT data specification
*/
- void SetSourceName( TString s1, TString s2="" ) { fSourceName = s1; fClassName = s2; }
+ void SetService( TString hostname, Int_t port, TString origin,
+ TString type, TString spec );
- /** Set detector, sub detector and sub sub detector of this source
- * @param s1 detector name
- * @param s2 subdetector name
- * @param s3 subsubdetector name
+ /*
+ * ---------------------------------------------------------------------------------
+ * Getter - public
+ * ---------------------------------------------------------------------------------
*/
- void SetDetectors( TString s1, TString s2, TString s3 ) { fDetector = s1; fSubDetector = s2; fSubSubDetector = s3; }
-
- /** Set HLT specification anf HLT data type of this source
- * @param ul HLT specification
- * @param s HLT data type
- */
- void SetSourceType( ULong_t ul, TString s ) { fSpecification = ul, fDataType = s; }
-
- // -- GETTER --
/** Get node name of this source
* @return hostname
/** Get node name of this source
* @return port
*/
- Int_t GetPort() { return fPort; }
+ Int_t GetPort() { return fPort; }
/** Get name of this source
* @return name
*/
TString GetSourceName() { return fSourceName; }
- /** Get object name of this source
- * @return class name
- */
- TString GetClassName() { return fClassName; }
-
/** Get detector of this source
* @return detector
*/
/** Get sub detector of this source
* @return subdetector
*/
- TString GetSubDetector() { return fSubDetector; }
+ Int_t GetSubDetector() { return fSubDetector; }
/** Get sub sub detector of this source
* @return subsubdetector
*/
- TString GetSubSubDetector() { return fSubSubDetector; }
+ Int_t GetSubSubDetector() { return fSubSubDetector; }
/** Get HLT data type of this source
* @return HLT data type
*/
ULong_t GetSpecification() { return fSpecification; }
+ ///////////////////////////////////////////////////////////////////////////////////
private:
+
/** copy constructor prohibited */
AliHLTHOMERSourceDesc(const AliHLTHOMERSourceDesc&);
/** assignment operator prohibited */
AliHLTHOMERSourceDesc& operator=(const AliHLTHOMERSourceDesc&);
+ /*
+ * ---------------------------------------------------------------------------------
+ * Members - private
+ * ---------------------------------------------------------------------------------
+ */
+
/** is selected to read out */
Bool_t fSelected; // see above
+ /** Name of Source */
+ TString fSourceName; // see above
+
+ // -- Service Specifications --
+ // ----------------------------
+
/** Name of HOMER Node */
TString fHostname; // see above
/** Name of HOMER port */
Int_t fPort; // see above
- /** Name of Source */
- TString fSourceName; // see above
+ // -- Data Specifications --
+ // -------------------------
- /** Object Name of Source */
- TString fClassName; // see above
+ /** HLT DataType */
+ TString fDataType; // see above
/** Detector Name, e.g. PHOS
* corresponds to HLT origin
*/
TString fDetector; // see above
- /** SubDetector Name e.g. MODULE */
- TString fSubDetector; // see above
-
- /** SubSubDetector Name e.g. PARTITION */
- TString fSubSubDetector; // see above
-
/** HLT Specification */
ULong_t fSpecification; // see above
- /** HLT DataType */
- TString fDataType; // see above
+ /** SubDetector Name e.g. MODULE */
+ Int_t fSubDetector; // see above
+
+ /** SubSubDetector Name e.g. PARTITION */
+ Int_t fSubSubDetector; // see above
ClassDef( AliHLTHOMERSourceDesc, 0 )
};
#pragma link C++ class AliHLTModulePreprocessor+;
#pragma link C++ class AliHLTShuttleInterface+;
#pragma link C++ class AliHLTHOMERLibManager+;
+#pragma link C++ class AliHLTHOMERManager+;
+#pragma link C++ class AliHLTHOMERProxyHandler+;
#pragma link C++ class AliHLTHOMERBlockDesc+;
#pragma link C++ class AliHLTHOMERSourceDesc+;
#pragma link C++ class AliHLTEsdManager+;
BASE/AliHLTModulePreprocessor.cxx
BASE/AliHLTShuttleInterface.cxx
BASE/AliHLTHOMERLibManager.cxx
+BASE/AliHLTHOMERManager.cxx
+BASE/AliHLTHOMERProxyHandler.cxx
BASE/AliHLTHOMERBlockDesc.cxx
BASE/AliHLTHOMERSourceDesc.cxx
BASE/AliHLTEsdManager.cxx
--- /dev/null
+//-*- Mode: C++ -*-
+// $Id: HOMERManager.C $
+/**
+ * @file HOMERManager.C
+ * @brief Sample macro for the use of the HOMERManager
+ *
+ * Usage:
+ * <pre>
+ * aliroot -l HOMERManager.C
+ * </pre>
+ *
+ * This macro illustrates the usage of the AliHLTHOMERManager in order
+ * to on-line read events outside the HLT.
+ *
+ * This macro can be run inside the
+ * <ul>
+ * <li>DAQ/DCS(ACR) network</li>
+ * <li>HLT network</li>
+ * <li>CERN GPN network</li>
+ * </ul>
+ *
+ * See AliHLTHOMERManager for detailed description.
+ *
+ * @author Jochen Thaeder
+ * @ingroup alihlt_tutorial
+ * @ingroup alihlt_homer
+ */
+
+Int_t HOMERManager() {
+
+ Int_t iResult = 0;
+
+ // -- Create new hM object
+ AliHLTHOMERManager *hM = new AliHLTHOMERManager();
+
+ printf( "== INITIALIZE ==\n" );
+
+ iResult = hM->Initialize();
+ if (iResult) return iResult;
+
+ printf( "== CREATE SOURCE LIST ==\n" );
+
+ iResult = hM->CreateSourcesList();
+ if (iResult) return iResult;
+
+ printf( "== CONNECT HOMER ==\n" );
+
+ iResult = hM->ConnectHOMER();
+ if (iResult) return iResult;
+
+ // printf( "== NEXT EVENT ==\n" );
+
+ iResult = hM->NextEvent();
+ if (iResult) return iResult;
+
+
+ // -- Destroy hM object
+ if (hM)
+ delete hM;
+ hM = NULL;
+
+ return iResult;;
+}
AliHLTModulePreprocessor.h \
AliHLTShuttleInterface.h \
AliHLTHOMERLibManager.h \
+ AliHLTHOMERManager.h \
+ AliHLTHOMERProxyHandler.h \
AliHLTHOMERBlockDesc.h \
AliHLTHOMERSourceDesc.h \
AliHLTEsdManager.h \