//* 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 "AliHLTShuttleInterface.h"
#include "TObjString.h"
#include "TString.h"
+#include "TMap.h"
+#include "TObject.h"
+#include "TObjArray.h"
ClassImp(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] =
}
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;
+}