]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/BASE/AliHLTMisc.cxx
Compatibility with ROOT trunk
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTMisc.cxx
CommitLineData
2b545cdd 1// $Id$
2
3//**************************************************************************
4//* This file is property of and copyright by the ALICE HLT Project *
5//* ALICE Experiment at CERN, All rights reserved. *
6//* *
7//* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8//* for The ALICE HLT Project. *
9//* *
10//* Permission to use, copy, modify and distribute this software and its *
11//* documentation strictly for non-commercial purposes is hereby granted *
12//* without fee, provided that the above copyright notice appears in all *
13//* copies and that both the copyright notice and this permission notice *
14//* appear in the supporting documentation. The authors make no claims *
15//* about the suitability of this software for any purpose. It is *
16//* provided "as is" without express or implied warranty. *
17//**************************************************************************
18
19/// @file AliHLTMisc.h
20/// @author Matthias Richter
21/// @date 2009-07-07
22/// @brief Definition of various glue functions implemented in dynamically
23/// loaded libraries
24
25#include "AliHLTMisc.h"
2b545cdd 26
27/** ROOT macro for the implementation of ROOT specific class methods */
28ClassImp(AliHLTMisc);
29
30AliHLTMisc::AliHLTMisc()
31{
32 // see header file for function documentation
33}
34
35AliHLTMisc::~AliHLTMisc()
36{
37 // see header file for function documentation
38}
39
40AliHLTMisc* AliHLTMisc::fgInstance=NULL;
41
2b545cdd 42AliHLTMisc& AliHLTMisc::Instance()
43{
44 // see header file for function documentation
45 if (!fgInstance) {
46 fgInstance=LoadInstance((AliHLTMisc*)NULL, "AliHLTMiscImplementation", ALIHLTMISC_LIBRARY);
47 }
48 if (!fgInstance) {
49 AliHLTLogging log;
50 fgInstance=new AliHLTMisc;
51 log.Logging(kHLTLogError, "AliHLTMisc::Instance", "HLT Analysis", "falling back to default AliHLTMisc instance");
52 }
53 return *fgInstance;
54}
55
56int AliHLTMisc::InitCDB(const char* /*cdbpath*/)
57{
cc484ed9 58 // default method, functionality is implemented in the child class
2b545cdd 59 return -EFAULT;
60}
61
62int AliHLTMisc::SetCDBRunNo(int /*runNo*/)
63{
cc484ed9 64 // default method, functionality is implemented in the child class
2b545cdd 65 return -EFAULT;
66}
67
74c1905c 68int AliHLTMisc::GetCDBRunNo() const
df5d2b78 69{
70 // default method, functionality is implemented in the child class
71 return -1;
72}
73
5df320bf 74AliCDBEntry* AliHLTMisc::LoadOCDBEntry(const char* /*path*/, int /*runNo*/) const
2b545cdd 75{
cc484ed9 76 // default method, functionality is implemented in the child class
2b545cdd 77 return NULL;
78}
79
74c1905c 80TObject* AliHLTMisc::ExtractObject(AliCDBEntry* /*entry*/) const
2b545cdd 81{
cc484ed9 82 // default method, functionality is implemented in the child class
2b545cdd 83 return NULL;
84}
5bc495ef 85
74c1905c 86int AliHLTMisc::CheckOCDBEntries(const TMap* const /*pMap*/) const
87{
88 // default method, functionality is implemented in the child class
89 return -ENOENT;
90}
91
cc484ed9 92int AliHLTMisc::InitMagneticField() const
93{
94 // default method, functionality is implemented in the child class
95 return -EFAULT;
96}
97
73305a93 98AliHLTUInt64_t AliHLTMisc::GetTriggerMask(AliRawReader* /*rawReader*/) const
99{
100 // default method, functionality is implemented in the child class
101 return 0;
102}
103
21c25cf3 104AliHLTUInt32_t AliHLTMisc::GetTimeStamp(AliRawReader* /*rawReader*/) const
105{
106 // default method, functionality is implemented in the child class
107 return 0;
108}
109
110AliHLTUInt32_t AliHLTMisc::GetEventType(AliRawReader* /*rawReader*/) const
111{
112 // default method, functionality is implemented in the child class
113 return 0;
114}
115
a5e775ec 116Double_t AliHLTMisc::GetBz()
117{
118 // default method, functionality is implemented in the child class
119 return 0.0;
120}
121
70bd63a2 122Double_t AliHLTMisc::GetBz(const Double_t */*r*/)
a5e775ec 123{
124 // default method, functionality is implemented in the child class
125 return 0.0;
126}
127
128void AliHLTMisc::GetBxByBz(const Double_t r[3], Double_t b[3])
129{
130 // default method, functionality is implemented in the child class
70bd63a2 131 if (!r || !b) return;
a5e775ec 132 return;
133}
134
95ea76b5 135const TClass* AliHLTMisc::IsAliESDHLTDecision() const
136{
137 // default method, functionality is implemented in the child class
138 return NULL;
139}
140
141int AliHLTMisc::Copy(const AliHLTGlobalTriggerDecision* /*pDecision*/, TObject* /*pESDHLTDecision*/) const
142{
143 // default method, functionality is implemented in the child class
144 return -EFAULT;
145}
146
79c426cf 147int AliHLTMisc::InitStreamerInfos(const char* /*ocdbEntry*/) const
148{
149 // default method, functionality is implemented in the child class
150 return -EFAULT;
151}
152
153int AliHLTMisc::InitStreamerInfos(TObjArray* /*pSchemas*/) const
154{
155 // default method, functionality is implemented in the child class
156 return -EFAULT;
157}
158
ee15809c 159void AliHLTMisc::SetAliESDtrackOnlineModeFlag(bool /*mode*/) const
160{
161 // default method, functionality is implemented in the child class
162}
163
164bool AliHLTMisc::GetAliESDtrackOnlineModeFlag() const
165{
166 // default method, functionality is implemented in the child class
167 return false;
168}
169
170AliHLTMisc::AliOnlineGuard::AliOnlineGuard(bool mode)
171 : fMode(false)
172{
173 // store the current value and set the flag
174 fMode=AliHLTMisc::Instance().GetAliESDtrackOnlineModeFlag();
175 AliHLTMisc::Instance().SetAliESDtrackOnlineModeFlag(mode);
176}
177
178AliHLTMisc::AliOnlineGuard::~AliOnlineGuard()
179{
180 // restore old value of the flag
181 AliHLTMisc::Instance().SetAliESDtrackOnlineModeFlag(fMode);
182}
183
5bc495ef 184ostream &operator<<(ostream &out, const AliHLTComponentDataType &dt)
185{
186 // printout of AliHLTComponentDataType struct
187 char id[kAliHLTComponentDataTypefIDsize+1];
188 strncpy(id, dt.fID, kAliHLTComponentDataTypefIDsize);
189 id[kAliHLTComponentDataTypefIDsize]=0;
190 char origin[kAliHLTComponentDataTypefOriginSize+1];
191 strncpy(origin, dt.fOrigin, kAliHLTComponentDataTypefOriginSize);
192 origin[kAliHLTComponentDataTypefOriginSize]=0;
193 out << "{" << id << ":" << origin << "}";
194 return out;
195}