//* provided "as is" without express or implied warranty. *
//**************************************************************************
-/**
- * @file AliHLTModulePreprocessor.cxx
- * @author Matthias Richter
- * @date 2008-01-22
- * @brief Base class for HLT module preprocessors
- */
+// @file AliHLTModulePreprocessor.cxx
+// @author Matthias Richter
+// @date 2008-01-22
+// @brief Base class for HLT module preprocessors
+//
+#include <cstdlib>
#include <cassert>
#include "AliHLTModulePreprocessor.h"
#include "AliHLTShuttleInterface.h"
#include "TObjString.h"
#include "TString.h"
+#include "TMap.h"
+#include "TObject.h"
+#include "TObjArray.h"
ClassImp(AliHLTModulePreprocessor)
+AliHLTModulePreprocessor::AliHLTModulePreprocessor()
+ :
+ fpInterface(NULL),
+ fActiveDetectors(0)
+{
+ // see header file for class documentation
+ // or
+ // refer to README to build package
+ // or
+ // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+}
+
+AliHLTModulePreprocessor::~AliHLTModulePreprocessor()
+{
+ // see header file for function documentation
+}
+
+// TODO: map this constants to AliHLTDAQ class
const Int_t AliHLTModulePreprocessor::kNDetectors = 21;
const char* AliHLTModulePreprocessor::fgkDetectorName[kNDetectors] =
"HLT"
};
-AliHLTModulePreprocessor::AliHLTModulePreprocessor()
- :
- fpInterface(NULL),
- fActiveDetectors(0)
-{
- // see header file for class documentation
- // or
- // refer to README to build package
- // or
- // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
-}
-
-AliHLTModulePreprocessor::~AliHLTModulePreprocessor()
-{
- // see header file for function documentation
-}
-
void AliHLTModulePreprocessor::SetShuttleInterface(AliHLTShuttleInterface* pInterface)
{
assert(fpInterface==NULL || fpInterface==pInterface || pInterface==NULL);
fpInterface=pInterface;
}
-Int_t AliHLTModulePreprocessor::GetRun()
+Int_t AliHLTModulePreprocessor::GetRun() const
{
// see header file for function documentation
return fpInterface->PreprocessorGetRun();
}
-UInt_t AliHLTModulePreprocessor::GetStartTime()
+UInt_t AliHLTModulePreprocessor::GetStartTime() const
{
// see header file for function documentation
return fpInterface->PreprocessorGetStartTime();
}
-UInt_t AliHLTModulePreprocessor::GetEndTime()
+UInt_t AliHLTModulePreprocessor::GetEndTime() const
{
// see header file for function documentation
}
return fgkDetectorName[detectorID];
}
+
+TObject* AliHLTModulePreprocessor::GetFromMap(TMap* dcsAliasMap, const char* stringId) const
+{
+ /// extract object from the alias map
+ /// return the last object from the value set
+ TObject* object=dcsAliasMap->FindObject(stringId);
+ if (!object) return NULL;
+ TPair* pair = dynamic_cast<TPair*>(object);
+ if (pair && pair->Value()) {
+ TObjArray* valueSet = dynamic_cast<TObjArray*>(pair->Value());
+ if (!valueSet) return NULL;
+ Int_t nentriesDCS = valueSet->GetEntriesFast() - 1;
+ if(nentriesDCS>=0 && valueSet->At(nentriesDCS)){
+ return valueSet->At(nentriesDCS);
+ }
+ }
+ return NULL;
+}