Reimplemented the AliHLTCaloConstants class
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTMisc.h
CommitLineData
2b545cdd 1//-*- Mode: C++ -*-
2// $Id$
6634349e 3
4#ifndef ALIHLTMISC_H
5#define ALIHLTMISC_H
6//* This file is property of and copyright by the ALICE HLT Project *
7//* ALICE Experiment at CERN, All rights reserved. *
8//* See cxx source for full Copyright notice */
9
2b545cdd 10/// @file AliHLTMisc.h
11/// @author Matthias Richter
12/// @date
13/// @brief Definition of various glue functions implemented in dynamically
14/// loaded libraries
15
16#include "TObject.h"
5bc495ef 17#include "AliHLTStdIncludes.h"
73305a93 18#include "AliHLTDataTypes.h"
2b545cdd 19
20class AliCDBManager;
21class AliCDBEntry;
73305a93 22class AliRawReader;
5bc495ef 23class AliHLTComponentDataType;
95ea76b5 24class AliHLTGlobalTriggerDecision;
2b545cdd 25
26class AliHLTMisc : public TObject {
27 public:
28 AliHLTMisc();
29 ~AliHLTMisc();
30
31 template<class T>
32 static T* LoadInstance(const T* dummy, const char* classname, const char* library);
33
34 static AliHLTMisc& Instance();
35
36 virtual int InitCDB(const char* cdbpath);
37
38 virtual int SetCDBRunNo(int runNo);
39
40 virtual AliCDBEntry* LoadOCDBEntry(const char* path, int runNo=-1, int version = -1, int subVersion = -1);
41
42 virtual TObject* ExtractObject(AliCDBEntry* entry);
43
cc484ed9 44 virtual int InitMagneticField() const;
45
73305a93 46 virtual AliHLTUInt64_t GetTriggerMask(AliRawReader* rawReader) const;
47
a5e775ec 48 virtual Double_t GetBz();
49 virtual Double_t GetBz(const Double_t *r);
50 virtual void GetBxByBz(const Double_t r[3], Double_t b[3]);
51
95ea76b5 52 virtual const TClass* IsAliESDHLTDecision() const;
53 virtual int Copy(const AliHLTGlobalTriggerDecision* pDecision, TObject* pESDHLTDecision) const;
54
2b545cdd 55 private:
56 static AliHLTMisc* fgInstance;
57
58 ClassDef(AliHLTMisc, 0)
59};
6634349e 60
61#define ALIHLTMISC_LIBRARY "libHLTrec.so"
62#define ALIHLTMISC_INIT_CDB "AliHLTMiscInitCDB"
63#define ALIHLTMISC_SET_CDB_RUNNO "AliHLTMiscSetCDBRunNo"
64
65#ifdef __cplusplus
66extern "C" {
67#endif
68
69 /**
70 * Init the CDB access for the running instance.
71 * The method is used from the C wrapper interface utilized by the on-line
72 * framework. The path of the (H)CDB is set to the specified path.<br>
73 * When running from AliRoot, the CDB path is set in the startup of the
703bcca6 74 * reconstruction.<br>
75 * If cdbpath is nil or empty and the CDB is not already initialized, the
162637e4 76 * CDB storage is set to local://$ALICE_ROOT/OCDB and the run no to 0.
6634349e 77 * @param cdbpath path to the CDB
78 * @return neg. error code if failed
79 * @note function implemented in libHLTrec
80 */
81 int AliHLTMiscInitCDB(const char* cdbpath);
82 typedef int (*AliHLTMiscInitCDB_t)(const char* cdbpath);
83
6634349e 84 /**
85 * Init the Run no for the CDB access.
7e914051 86 * @param runNo the run no
6634349e 87 * @return neg. error code if failed
88 * @note function implemented in libHLTrec
89 */
90 int AliHLTMiscSetCDBRunNo(int runNo);
91 typedef int (*AliHLTMiscSetCDBRunNo_t)(int runNo);
92
93#ifdef __cplusplus
94}
95#endif
5bc495ef 96
97// direct printout of data type struct
98ostream &operator<<(ostream &str, const AliHLTComponentDataType&);
99
6634349e 100#endif //ALIHLTMISC_H