X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=HLT%2FBASE%2FAliHLTMisc.cxx;h=726738b13f5679bdbcc5272d9584d195b99b8c16;hb=ef833800cfa7cf6679885d7b69808e9d15bd6ee5;hp=9b7477fe7da314483d443c0ccb1993e77cb4fd22;hpb=2b545cdd954e2cd5330c66dc3c0ef545025fdb72;p=u%2Fmrichter%2FAliRoot.git diff --git a/HLT/BASE/AliHLTMisc.cxx b/HLT/BASE/AliHLTMisc.cxx index 9b7477fe7da..726738b13f5 100644 --- a/HLT/BASE/AliHLTMisc.cxx +++ b/HLT/BASE/AliHLTMisc.cxx @@ -1,7 +1,7 @@ // $Id$ //************************************************************************** -//* This file is property of and copyright by the ALICE HLT Project * +//* This file is property of and copyright by the * //* ALICE Experiment at CERN, All rights reserved. * //* * //* Primary Authors: Matthias Richter * @@ -23,60 +23,30 @@ /// loaded libraries #include "AliHLTMisc.h" -#include "AliHLTLogging.h" -#include "TClass.h" -#include "TSystem.h" /** ROOT macro for the implementation of ROOT specific class methods */ ClassImp(AliHLTMisc); AliHLTMisc::AliHLTMisc() { - // see header file for function documentation + // Abstract interface of various glue functions implemented in dynamically + // loaded libraries. + // + // The HLT base library is independent from AliRoot and binds AliRoot + // functionality via dynamic libraries. The provided methods can be used + // from any module library without introducing additional dependencies. } AliHLTMisc::~AliHLTMisc() { - // see header file for function documentation + // destructor } AliHLTMisc* AliHLTMisc::fgInstance=NULL; -template -T* AliHLTMisc::LoadInstance(const T* /*t*/, const char* classname, const char* library) -{ - // see header file for function documentation - int iLibResult=0; - T* pInstance=NULL; - AliHLTLogging log; - TClass* pCl=NULL; - ROOT::NewFunc_t pNewFunc=NULL; - do { - pCl=TClass::GetClass(classname); - } while (!pCl && (iLibResult=gSystem->Load(library))==0); - if (iLibResult>=0) { - if (pCl && (pNewFunc=pCl->GetNew())!=NULL) { - void* p=(*pNewFunc)(NULL); - if (p) { - pInstance=reinterpret_cast(p); - if (!pInstance) { - log.Logging(kHLTLogError, "AliHLTMisc::LoadInstance", "HLT Analysis", "type cast (%s) to instance failed", classname); - } - } else { - log.Logging(kHLTLogError, "AliHLTMisc::LoadInstance", "HLT Analysis", "can not create instance of type %s from class descriptor", classname); - } - } else { - log.Logging(kHLTLogError, "AliHLTMisc::LoadInstance", "HLT Analysis", "can not find class descriptor %s", classname); - } - } else { - log.Logging(kHLTLogError, "AliHLTMisc::LoadInstance", "HLT Analysis", "can not load %s library in order to find class descriptor %s", library, classname); - } - return pInstance; -} - AliHLTMisc& AliHLTMisc::Instance() { - // see header file for function documentation + // get global instance of the interface implementation if (!fgInstance) { fgInstance=LoadInstance((AliHLTMisc*)NULL, "AliHLTMiscImplementation", ALIHLTMISC_LIBRARY); } @@ -90,24 +60,147 @@ AliHLTMisc& AliHLTMisc::Instance() int AliHLTMisc::InitCDB(const char* /*cdbpath*/) { - // see header file for function documentation + // default method, functionality is implemented in the child class return -EFAULT; } int AliHLTMisc::SetCDBRunNo(int /*runNo*/) { - // see header file for function documentation + // default method, functionality is implemented in the child class return -EFAULT; } -AliCDBEntry* AliHLTMisc::LoadOCDBEntry(const char* /*path*/, int /*runNo*/, int /*version*/, int /*subVersion*/) +int AliHLTMisc::GetCDBRunNo() const { - // see header file for function documentation + // default method, functionality is implemented in the child class + return -1; +} + +AliCDBEntry* AliHLTMisc::LoadOCDBEntry(const char* /*path*/, int /*runNo*/) const +{ + // default method, functionality is implemented in the child class return NULL; } -TObject* AliHLTMisc::ExtractObject(AliCDBEntry* /*entry*/) +TObject* AliHLTMisc::ExtractObject(AliCDBEntry* /*entry*/) const { - // see header file for function documentation + // default method, functionality is implemented in the child class return NULL; } + +int AliHLTMisc::CheckOCDBEntries(const TMap* const /*pMap*/) const +{ + // default method, functionality is implemented in the child class + return -ENOENT; +} + +int AliHLTMisc::InitMagneticField() const +{ + // default method, functionality is implemented in the child class + return -EFAULT; +} + +AliHLTUInt64_t AliHLTMisc::GetTriggerMask(AliRawReader* /*rawReader*/) const +{ + // default method, functionality is implemented in the child class + return 0; +} + +AliHLTUInt32_t AliHLTMisc::GetTimeStamp(AliRawReader* /*rawReader*/) const +{ + // default method, functionality is implemented in the child class + return 0; +} + +AliHLTUInt32_t AliHLTMisc::GetEventType(AliRawReader* /*rawReader*/) const +{ + // default method, functionality is implemented in the child class + return 0; +} + +Double_t AliHLTMisc::GetBz() +{ + // default method, functionality is implemented in the child class + return 0.0; +} + +Double_t AliHLTMisc::GetBz(const Double_t */*r*/) +{ + // default method, functionality is implemented in the child class + return 0.0; +} + +void AliHLTMisc::GetBxByBz(const Double_t r[3], Double_t b[3]) +{ + // default method, functionality is implemented in the child class + if (!r || !b) return; + return; +} + +const TClass* AliHLTMisc::IsAliESDHLTDecision() const +{ + // default method, functionality is implemented in the child class + return NULL; +} + +int AliHLTMisc::Copy(const AliHLTGlobalTriggerDecision* /*pDecision*/, TObject* /*pESDHLTDecision*/) const +{ + // default method, functionality is implemented in the child class + return -EFAULT; +} + +int AliHLTMisc::InitStreamerInfos(const char* /*ocdbEntry*/) const +{ + // default method, functionality is implemented in the child class + return -EFAULT; +} + +int AliHLTMisc::InitStreamerInfos(TObjArray* /*pSchemas*/) const +{ + // default method, functionality is implemented in the child class + return -EFAULT; +} + +int AliHLTMisc::MergeStreamerInfo(TObjArray* /*tgt*/, const TObjArray* /*src*/, int /*iVerbosity*/) const +{ + // default method, functionality is implemented in the child class + return 0; +} + +void AliHLTMisc::SetAliESDtrackOnlineModeFlag(bool /*mode*/) const +{ + // default method, functionality is implemented in the child class +} + +bool AliHLTMisc::GetAliESDtrackOnlineModeFlag() const +{ + // default method, functionality is implemented in the child class + return false; +} + +AliHLTMisc::AliOnlineGuard::AliOnlineGuard(bool mode) + : fMode(false) +{ + // store the current value and set the flag + fMode=AliHLTMisc::Instance().GetAliESDtrackOnlineModeFlag(); + AliHLTMisc::Instance().SetAliESDtrackOnlineModeFlag(mode); +} + +AliHLTMisc::AliOnlineGuard::~AliOnlineGuard() +{ + // restore old value of the flag + AliHLTMisc::Instance().SetAliESDtrackOnlineModeFlag(fMode); +} + +ostream &operator<<(ostream &out, const AliHLTComponentDataType &dt) +{ + // printout of AliHLTComponentDataType struct + char id[kAliHLTComponentDataTypefIDsize+1]; + strncpy(id, dt.fID, kAliHLTComponentDataTypefIDsize); + id[kAliHLTComponentDataTypefIDsize]=0; + char origin[kAliHLTComponentDataTypefOriginSize+1]; + strncpy(origin, dt.fOrigin, kAliHLTComponentDataTypefOriginSize); + origin[kAliHLTComponentDataTypefOriginSize]=0; + out << "{" << id << ":" << origin << "}"; + return out; +}