+/// @file AliHLTMisc.h
+/// @author Matthias Richter
+/// @date
+/// @brief Definition of various glue functions implemented in dynamically
+/// loaded libraries
+
+#include "TObject.h"
+#include "AliHLTStdIncludes.h"
+#include "AliHLTDataTypes.h"
+#include "AliHLTLogging.h"
+#include "TClass.h"
+#include "TSystem.h"
+
+class AliCDBManager;
+class AliCDBEntry;
+class AliRawReader;
+class AliHLTComponentDataType;
+class AliHLTGlobalTriggerDecision;
+class TMap;
+
+class AliHLTMisc : public TObject {
+ public:
+ AliHLTMisc();
+ ~AliHLTMisc();
+
+ template<class T>
+ static T* LoadInstance(const T* dummy, const char* classname, const char* library=NULL);
+
+ static AliHLTMisc& Instance();
+
+ virtual int InitCDB(const char* cdbpath);
+
+ virtual int SetCDBRunNo(int runNo);
+ virtual int GetCDBRunNo() const;
+
+ /// Load an OCDB object
+ virtual AliCDBEntry* LoadOCDBEntry(const char* path, int runNo=-1) const;
+
+ // Extract the TObject instance from the CDB object
+ virtual TObject* ExtractObject(AliCDBEntry* entry) const;
+
+ /// check the availability of the OCDB entry descriptions in the TMap
+ /// key : complete OCDB path of the entry
+ /// value : auxiliary object - short description
+ virtual int CheckOCDBEntries(const TMap* const pMap) const;
+
+ virtual int InitMagneticField() const;
+
+ /// extract the triggermask from the rawreader
+ /// NOTE: not to be used in the online system
+ virtual AliHLTUInt64_t GetTriggerMask(AliRawReader* rawReader) const;
+
+ /// extract the timestamp from the rawreader
+ /// NOTE: not to be used in the online system, use AliHLTComponent::GetTimeStamp()
+ virtual AliHLTUInt32_t GetTimeStamp(AliRawReader* rawReader) const;
+
+ /// extract the event type from the rawreader
+ /// NOTE: not to be used in the online system
+ virtual AliHLTUInt32_t GetEventType(AliRawReader* rawReader) const;
+
+ virtual Double_t GetBz();
+ virtual Double_t GetBz(const Double_t *r);
+ virtual void GetBxByBz(const Double_t r[3], Double_t b[3]);
+
+ virtual const TClass* IsAliESDHLTDecision() const;
+
+ using TObject::Copy; // Needed since the declaration of AliHLTMisc::Copy below is ambiguous to the compiler.
+
+ virtual int Copy(const AliHLTGlobalTriggerDecision* pDecision, TObject* pESDHLTDecision) const;
+
+ /// Init streamer info from ocdb entry
+ virtual int InitStreamerInfos(const char* ocdbEntry) const;
+
+ /// Init streamer info for a collection of classes
+ virtual int InitStreamerInfos(TObjArray* pSchemas) const;
+
+ /// set the online mode flag of AliESDtrack
+ virtual void SetAliESDtrackOnlineModeFlag(bool mode) const;
+
+ /// get status of the online mode flag of AliESDtrack
+ virtual bool GetAliESDtrackOnlineModeFlag() const;
+
+ /// guard class for switching offline software to online mode
+ class AliOnlineGuard {
+ public:
+ AliOnlineGuard(bool mode=true);
+ ~AliOnlineGuard();
+
+ private:
+ bool fMode; //! old value to be restored
+ };
+
+ private:
+ static AliHLTMisc* fgInstance; //! global instance
+
+ ClassDef(AliHLTMisc, 0)
+};