3 //**************************************************************************
4 //* This file is property of and copyright by the ALICE HLT Project *
5 //* ALICE Experiment at CERN, All rights reserved. *
7 //* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 //* for The ALICE HLT Project. *
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 //**************************************************************************
19 /// @file AliHLTMisc.h
20 /// @author Matthias Richter
22 /// @brief Definition of various glue functions implemented in dynamically
25 #include "AliHLTMisc.h"
27 /** ROOT macro for the implementation of ROOT specific class methods */
30 AliHLTMisc::AliHLTMisc()
32 // see header file for function documentation
35 AliHLTMisc::~AliHLTMisc()
37 // see header file for function documentation
40 AliHLTMisc* AliHLTMisc::fgInstance=NULL;
42 AliHLTMisc& AliHLTMisc::Instance()
44 // see header file for function documentation
46 fgInstance=LoadInstance((AliHLTMisc*)NULL, "AliHLTMiscImplementation", ALIHLTMISC_LIBRARY);
50 fgInstance=new AliHLTMisc;
51 log.Logging(kHLTLogError, "AliHLTMisc::Instance", "HLT Analysis", "falling back to default AliHLTMisc instance");
56 int AliHLTMisc::InitCDB(const char* /*cdbpath*/)
58 // default method, functionality is implemented in the child class
62 int AliHLTMisc::SetCDBRunNo(int /*runNo*/)
64 // default method, functionality is implemented in the child class
68 int AliHLTMisc::GetCDBRunNo() const
70 // default method, functionality is implemented in the child class
74 AliCDBEntry* AliHLTMisc::LoadOCDBEntry(const char* /*path*/, int /*runNo*/, int /*version*/, int /*subVersion*/) const
76 // default method, functionality is implemented in the child class
80 TObject* AliHLTMisc::ExtractObject(AliCDBEntry* /*entry*/) const
82 // default method, functionality is implemented in the child class
86 int AliHLTMisc::CheckOCDBEntries(const TMap* const /*pMap*/) const
88 // default method, functionality is implemented in the child class
92 int AliHLTMisc::InitMagneticField() const
94 // default method, functionality is implemented in the child class
98 AliHLTUInt64_t AliHLTMisc::GetTriggerMask(AliRawReader* /*rawReader*/) const
100 // default method, functionality is implemented in the child class
104 AliHLTUInt32_t AliHLTMisc::GetTimeStamp(AliRawReader* /*rawReader*/) const
106 // default method, functionality is implemented in the child class
110 AliHLTUInt32_t AliHLTMisc::GetEventType(AliRawReader* /*rawReader*/) const
112 // default method, functionality is implemented in the child class
116 Double_t AliHLTMisc::GetBz()
118 // default method, functionality is implemented in the child class
122 Double_t AliHLTMisc::GetBz(const Double_t */*r*/)
124 // default method, functionality is implemented in the child class
128 void AliHLTMisc::GetBxByBz(const Double_t r[3], Double_t b[3])
130 // default method, functionality is implemented in the child class
131 if (!r || !b) return;
135 const TClass* AliHLTMisc::IsAliESDHLTDecision() const
137 // default method, functionality is implemented in the child class
141 int AliHLTMisc::Copy(const AliHLTGlobalTriggerDecision* /*pDecision*/, TObject* /*pESDHLTDecision*/) const
143 // default method, functionality is implemented in the child class
147 int AliHLTMisc::InitStreamerInfos(const char* /*ocdbEntry*/) const
149 // default method, functionality is implemented in the child class
153 int AliHLTMisc::InitStreamerInfos(TObjArray* /*pSchemas*/) const
155 // default method, functionality is implemented in the child class
159 void AliHLTMisc::SetAliESDtrackOnlineModeFlag(bool /*mode*/) const
161 // default method, functionality is implemented in the child class
164 bool AliHLTMisc::GetAliESDtrackOnlineModeFlag() const
166 // default method, functionality is implemented in the child class
170 AliHLTMisc::AliOnlineGuard::AliOnlineGuard(bool mode)
173 // store the current value and set the flag
174 fMode=AliHLTMisc::Instance().GetAliESDtrackOnlineModeFlag();
175 AliHLTMisc::Instance().SetAliESDtrackOnlineModeFlag(mode);
178 AliHLTMisc::AliOnlineGuard::~AliOnlineGuard()
180 // restore old value of the flag
181 AliHLTMisc::Instance().SetAliESDtrackOnlineModeFlag(fMode);
184 ostream &operator<<(ostream &out, const AliHLTComponentDataType &dt)
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 << "}";