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 AliHLTDAQ.cxx
20 @author Matthias Richter
22 @brief Virtual Interface to the AliDAQ class.
25 #include "AliHLTDAQ.h"
26 #include "AliHLTLogging.h"
30 /** ROOT macro for the implementation of ROOT specific class methods */
33 AliHLTDAQ::AliHLTDAQ()
35 // see header file for class documentation
37 // refer to README to build package
39 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
42 AliHLTDAQ* AliHLTDAQ::fgpInstance=NULL;
43 const char* AliHLTDAQ::fgkImplName="AliHLTDAQInterfaceImplementation";
44 const char* AliHLTDAQ::fgkImplLibrary="libHLTrec.so";
46 AliHLTDAQ::~AliHLTDAQ()
48 // see header file for class documentation
51 Int_t AliHLTDAQ::NumberOfDetectors()
53 // see header file for class documentation
54 if (!fgpInstance) GetInstance();
55 if (fgpInstance) return fgpInstance->VirtNumberOfDetectors();
59 Int_t AliHLTDAQ::DetectorID(const char *detectorName)
61 // see header file for class documentation
62 if (!fgpInstance) GetInstance();
63 if (fgpInstance) return fgpInstance->VirtDetectorID(detectorName);
67 const char *AliHLTDAQ::DetectorName(Int_t detectorID)
69 // see header file for class documentation
70 if (!fgpInstance) GetInstance();
71 if (fgpInstance) return fgpInstance->VirtDetectorName(detectorID);
75 Int_t AliHLTDAQ::DdlIDOffset(const char *detectorName)
77 // see header file for class documentation
78 if (!fgpInstance) GetInstance();
79 if (fgpInstance) return fgpInstance->VirtDdlIDOffset(detectorName);
83 Int_t AliHLTDAQ::DdlIDOffset(Int_t detectorID)
85 // see header file for class documentation
86 if (!fgpInstance) GetInstance();
87 if (fgpInstance) return fgpInstance->VirtDdlIDOffset(detectorID);
91 const char *AliHLTDAQ::DetectorNameFromDdlID(Int_t ddlID, Int_t &ddlIndex)
93 // see header file for class documentation
94 if (!fgpInstance) GetInstance();
95 if (fgpInstance) return fgpInstance->VirtDetectorNameFromDdlID(ddlID, ddlIndex);
99 Int_t AliHLTDAQ::DetectorIDFromDdlID(Int_t ddlID, Int_t &ddlIndex)
101 // see header file for class documentation
102 if (!fgpInstance) GetInstance();
103 if (fgpInstance) return fgpInstance->VirtDetectorIDFromDdlID(ddlID, ddlIndex);
107 Int_t AliHLTDAQ::DdlID(const char *detectorName, Int_t ddlIndex)
109 // see header file for class documentation
110 if (!fgpInstance) GetInstance();
111 if (fgpInstance) return fgpInstance->VirtDdlID(detectorName, ddlIndex);
115 Int_t AliHLTDAQ::DdlID(Int_t detectorID, Int_t ddlIndex)
117 // see header file for class documentation
118 if (!fgpInstance) GetInstance();
119 if (fgpInstance) return fgpInstance->VirtDdlID(detectorID, ddlIndex);
123 const char *AliHLTDAQ::DdlFileName(const char *detectorName, Int_t ddlIndex)
125 // see header file for class documentation
126 if (!fgpInstance) GetInstance();
127 if (fgpInstance) return fgpInstance->VirtDdlFileName(detectorName, ddlIndex);
131 const char *AliHLTDAQ::DdlFileName(Int_t detectorID, Int_t ddlIndex)
133 // see header file for class documentation
134 if (!fgpInstance) GetInstance();
135 if (fgpInstance) return fgpInstance->VirtDdlFileName(detectorID, ddlIndex);
139 Int_t AliHLTDAQ::NumberOfDdls(const char *detectorName)
141 // see header file for class documentation
142 if (!fgpInstance) GetInstance();
143 if (fgpInstance) return fgpInstance->VirtNumberOfDdls(detectorName);
147 Int_t AliHLTDAQ::NumberOfDdls(Int_t detectorID)
149 // see header file for class documentation
150 if (!fgpInstance) GetInstance();
151 if (fgpInstance) return fgpInstance->VirtNumberOfDdls(detectorID);
155 const char *AliHLTDAQ::ListOfTriggeredDetectors(UInt_t detectorPattern)
157 // see header file for class documentation
158 if (!fgpInstance) GetInstance();
159 if (fgpInstance) return fgpInstance->VirtListOfTriggeredDetectors(detectorPattern);
163 UInt_t AliHLTDAQ::DetectorPattern(const char *detectorList)
165 // see header file for class documentation
166 if (!fgpInstance) GetInstance();
167 if (fgpInstance) return fgpInstance->VirtDetectorPattern(detectorList);
171 const char *AliHLTDAQ::OfflineModuleName(const char *detectorName)
173 // see header file for class documentation
174 if (!fgpInstance) GetInstance();
175 if (fgpInstance) return fgpInstance->VirtOfflineModuleName(detectorName);
178 const char *AliHLTDAQ::OfflineModuleName(Int_t detectorID)
180 // see header file for class documentation
181 if (!fgpInstance) GetInstance();
182 if (fgpInstance) return fgpInstance->VirtOfflineModuleName(detectorID);
186 const char *AliHLTDAQ::OnlineName(const char *detectorName)
188 // see header file for class documentation
189 if (!fgpInstance) GetInstance();
190 if (fgpInstance) return fgpInstance->VirtOnlineName(detectorName);
193 const char *AliHLTDAQ::OnlineName(Int_t detectorID)
195 // see header file for class documentation
196 if (!fgpInstance) GetInstance();
197 if (fgpInstance) return fgpInstance->VirtOnlineName(detectorID);
201 AliHLTDAQ* AliHLTDAQ::GetInstance()
203 // see header file for class documentation
208 ROOT::NewFunc_t pNewFunc=NULL;
210 pCl=TClass::GetClass(fgkImplName);
211 } while (!pCl && (iLibResult=gSystem->Load(fgkImplLibrary))==0);
213 if (pCl && (pNewFunc=pCl->GetNew())!=NULL) {
214 void* p=(*pNewFunc)(NULL);
216 fgpInstance=reinterpret_cast<AliHLTDAQ*>(p);
218 log.Logging(kHLTLogError, "AliHLTDAQ::Instance", "HLT Analysis", "type cast to AliHLTDAQ instance failed");
221 log.Logging(kHLTLogError, "AliHLTDAQ::Instance", "HLT Analysis", "can not create AliHLTDAQ instance from class descriptor");
224 log.Logging(kHLTLogError, "AliHLTDAQ::Instance", "HLT Analysis", "can not find AliHLTDAQ class descriptor");
227 log.Logging(kHLTLogError, "AliHLTDAQ::Instance", "HLT Analysis", "can not load libHLTrec library");