4 #ifndef ALI_HLT_PENDOLINO_H
5 #define ALI_HLT_PENDOLINO_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 *
10 /** @file AliHLTPendolino.h
11 @author Sebastian Bablok
16 //#include <TObject.h>
21 #include <AliShuttleInterface.h>
23 //#include "AliHLTPredictionProcessorInterface.h"
26 class AliHLTPendolinoLogger;
29 * Class that implements the AliShuttleInterface and provides the required
30 * features for the contacting the PredictionProcessor and storing the result
33 * @author Sebastian Bablok
37 class AliHLTPendolino : public AliShuttleInterface {
41 * Static string that defines the local storage indicator in path
43 static const TString kLOCAL_STORAGE_DEFINE; // defines the local storage
46 * Static string defining the name of this inteface module.
48 static const char* kHLTInterfaceModule; // defines the name of inteface module
51 * Static value defining error value for a Pendolino exception.
53 static const Int_t kHLTPendolinoException; // error value for a Pendolino exception
56 * Static value defining error value for a bad cast
58 static const Int_t kHLTPendolinoBadCast; // error value for a bad cast
61 * Static value defining error value for handed in module is not
62 * implementing the PredictionProcessor interface.
64 static const Int_t kHLTPendolinoNotPredictProc; // error value for "not implementing the PredictionProcessor interface"
67 * Static value defining error value for module not existing.
69 static const Int_t kHLTPendolinoModuleNotExisting; // error value for module not existing
72 * Static value defining error value for PredictionProc does not
75 static const Int_t kHLTPendolinoNoDCS; // error value for PredictionProc does not process DCS
78 * Static string that defines the base folder for the Taxi list files.
80 static const TString kTaxiListBaseFolder; // defines the base folder for the Taxi list files
83 * Static string that defines list folder name for taxi list
85 static const TString kTaxiListFolderName; // defines list folder name for taxi list
88 * Static string that defines the filename for the Taxi list required
91 static const TString kTaxiListPendolino; // defines the filename for the Taxi list
94 * Static value that defines the max length of a line that can be read
95 * when browsing through the list file
97 static const Int_t kMAX_LINE_LENGTH; // defines the max length of a line
101 * Constructor for AliHLTPendolino.
103 * @param run the current run number
104 * @param HCDBbase path to the HCDB base folder
105 * @param runType the current run type
106 * @param logger pointer to the desired logger; default is the command
109 AliHLTPendolino(Int_t run, TString HCDBbase, TString runType = "TEST",
110 AliHLTPendolinoLogger* logger = 0);
115 virtual ~AliHLTPendolino();
118 * Function to store processed data in the HCDB
120 * @param path the storage path consisting of "detector/type/objectname"
121 * where detector should be the detector name used by offline,
122 * type is something like "CALIB" or "ALIGN", while
123 * objectname the name represents, by which it can be requested
125 * @param object the object to store
126 * @param metaData metaData to store
127 * @param validityStart object is valid from current run number minus
129 * @param validityInfinite if true, validity is set to infinity
131 * @return true on success, else false
133 virtual Bool_t Store(const AliCDBPath& path, TObject* object,
134 AliCDBMetaData* metaData, Int_t validityStart = 0,
135 Bool_t validityInfinite = kFALSE);
137 * Function is required from interface, but is disbled in its
138 * implementation since additional refernce data will not be used by
139 * the DAs inside the HLT. Therefore always returns false
141 * @return always false, since function is disabled.
143 virtual Bool_t StoreReferenceData(const AliCDBPath& path,
144 TObject* object, AliCDBMetaData* metaData);
146 * Function is required from interface, but is disbled in its
147 * implementation since additional reference data will not be used by
148 * the DAs inside the HLT. Therefore always returns false
150 * @return always false, since function is disabled.
152 virtual Bool_t StoreReferenceFile(const char* detector,
153 const char* localFile, const char* gridFileName);
156 * Function is required from interface, but is disbled in its
157 * implementation since additional run meta data will only be stored
158 * by the the GPR - Preprocessor of the Offline Shuttle.
160 * @return always false, since function is disabled.
162 virtual Bool_t StoreRunMetadataFile(const char* localFile,
163 const char* gridFileName);
166 * Function is required from interface, but is disbled in its
167 * implementation since additional refernce data will not be used by
168 * the DAs inside the HLT. Therefore always returns NULL.
169 * If this feature is lateron required by HLT, inherit from this class
170 * and overwrite this function with the required functionality.
172 * @return always NULL, since not used.
174 // virtual const char* GetFile(Int_t system, const char* detector,
175 // const char* id, const char* source); --> is private now
178 * Function is required from interface, but is disbled in its
179 * implementation since additional refernce data will not be used by
180 * the DAs inside the HLT. Therefore always returns NULL.
181 * If this feature is lateron required by HLT, inherit from this class
182 * and overwrite this function with the required functionality.
184 * @return always NULL, since not used.
186 // virtual TList* GetFileSources(Int_t system, const char* detector,
187 // const char* id = 0); -> is priavte now
190 * Function is required from interface, but is disbled in its
191 * implementation since additional refernce data will not be used by
192 * the DAs inside the HLT. Therefore always returns NULL.
193 * If this feature is lateron required by HLT, inherit from this class
194 * and overwrite this function with the required functionality.
196 * @return always NULL, since not used.
198 // virtual TList* GetFileIDs(Int_t system, const char* detector,
199 // const char* source); -> is private now
202 * Retrieves current run parameter.
204 * @param lbEntry name of the run parameter
206 * @return value of the run parameter
208 virtual const char* GetRunParameter(const char* lbEntry);
211 * Retrieves the current run type.
213 * @return the current run type
215 virtual const char* GetRunType();
218 * Returns the HLT status.
219 * Since the Pendolino is part of the HLT, the function will always
222 * @return always true - see above
224 virtual Bool_t GetHLTStatus();
227 * Retrieves a file from the OCDB, but does not uses the OCDB but the
228 * HCDB (local copy of the OCDB). - Since the HCDB only contains OCDB
229 * objects, that are included in the list the Taxi uses for fetching
230 * the data from the OCDB, it can happen, that the corresponding
231 * AliCDBEntry is missing.
232 * TODO: Think of mechanism to automatically include the object in the
235 * @param detector the detectorname, to which the object belongs
236 * @param path the path of the object
238 * @return pointer to the fetched HCDB entry
240 virtual AliCDBEntry* GetFromOCDB(const char* detector,
241 const AliCDBPath& path);
244 * Function to allow Pendolino and PredictionProcessor to make log
247 * @param detector the detector, that wants to issue this message
248 * @param message the log message
250 virtual void Log(const char* detector, const char* message);
253 * Function is required from interface, but is disbled in the Pendolino
254 * because at the moment there is no Trigger configuration available
255 * for Pendolino. At the moment it just return a NULL pointer and makes
258 * @return NULL pointer, since it should not be used.
260 // virtual const char* GetTriggerConfiguration(); --> is private now
263 * Registers a preprocessor; actually it has to be a PredictionProcessor
264 * since the Pendolino requires a PredictionProcessor. If the registered
265 * preprocessor is not implementing a PredictionProcessor, a log entry
266 * is made and the registration discarded.
268 * @param preprocessor the PredictionProcessor that shall be registered.
269 * For more details please see above !!
271 virtual void RegisterPreprocessor(AliPreprocessor* preprocessor);
272 // AliHLTPredictionProcessorInterface* preprocessor);
275 * Function to get the current run number
277 * @return current run number
279 virtual Int_t GetRunNumber();
282 * Function to enable prediction making in all registered
283 * PredictionProcessors, if they implement the required interface
285 * @return number of PredictionProcessor, which has been switched to
286 * prediction making (NOTE: the internal list may conatin
287 * more PredictionProcessors, but if switching on failed
288 * for one, this one is not counted.)
290 virtual UInt_t setToPredictMaking();
293 * Function to get the number of registered PredictionProcessors
295 * @return number of registered PredictionProcessors
297 Int_t getNumberOfPredictProc();
300 * Function to check if given PredtionProc allows for processing DCS
301 * and enable prediction making
303 * @param detector the detector in whose PredictionProcessor the
304 * prediction making shall be enabled.
306 * @return 0 on success, else an error code is returned
308 virtual Int_t setToPredictMaking(TString detector);
311 * Function to initlaize a dedicated Prediction Processor
313 * @param detector the detector, whose PredictProc shall be initialized
314 * @param run the current run number
315 * @param startTime the start time of the fetched data
316 * @param endTime the end time of the fetched data
318 * @return 0 on success, else an error code is returned
320 virtual Int_t initPredictProc(TString detector, Int_t run,
321 UInt_t startTime, UInt_t endTime);
324 * Function to hand in retrieved DCS values. These values are handed to
325 * the corresponding PredictionProcessor of the according detector.
326 * The PredictionProcessor should prepare the data inside and store
329 * @param detector the according detector, to whose PredictionProcessor
330 * shall prepare the handed-in data
331 * @param DCSValues pointer to the map containing the fetched DCS values
333 * @return 0 on success, else an error code is returned.
335 virtual Int_t prepareDCSValues(TString detector, TMap* DCSValues);
338 * Function to retrieve dummy data for testing the Pendolino from a
339 * given PredictionProcessor. The function called is handed further to
340 * the corresponding PredictionProcessor.
341 * NOTE: The returned TMap can be NULL, if no corresponding
342 * PredictionProcessor is registered.
344 * @param detector the according detector, from whom the
345 * PredictionProcessor shall produce the dummy data.
346 * @param aliasName optional parameter to hand in a alias name for
347 * producing a DCSMap for the given alias.
349 * @return the DCSMap with the dummy data to test (given by the
350 * PredictionProcessor). NOTE: can be NULL, if no corresponding
351 * PredictionProcessor is registered.
353 virtual TMap* emulateDCSMap(TString detector, TString aliasName = "");
356 * Function to add a entry request to the Taxi lists.
358 * @param entryPath the path entry, that shall be included in the
361 * @return true, when successful included or entry already existing in
364 virtual Bool_t includeAliCDBEntryInList(const TString& entryPath);
371 * Function is required from interface, but is disbled in its
372 * implementation since additional refernce data will not be used by
373 * the DAs inside the HLT. Therefore always returns NULL.
374 * If this feature is lateron required by HLT, inherit from this class
375 * and overwrite this function with the required functionality.
377 * @return always NULL, since not used.
379 virtual TList* GetFileIDs(Int_t system, const char* detector,
383 * Function is required from interface, but is disbled in its
384 * implementation since additional refernce data will not be used by
385 * the DAs inside the HLT. Therefore always returns NULL.
386 * If this feature is lateron required by HLT, inherit from this class
387 * and overwrite this function with the required functionality.
389 * @return always NULL, since not used.
391 virtual TList* GetFileSources(Int_t system, const char* detector,
395 * Function is required from interface, but is disbled in its
396 * implementation since additional refernce data will not be used by
397 * the DAs inside the HLT. Therefore always returns NULL.
398 * If this feature is lateron required by HLT, inherit from this class
399 * and overwrite this function with the required functionality.
401 * @return always NULL, since not used.
403 virtual const char* GetFile(Int_t system, const char* detector,
404 const char* id, const char* source);
407 * Function is required from interface, but is disbled in the Pendolino
408 * because at the moment there is no Trigger configuration available
409 * for Pendolino. At the moment it just return a NULL pointer and makes
412 * @return NULL pointer, since it should not be used.
414 virtual const char* GetTriggerConfiguration();
417 * Disable the default constructor.
421 /** copy constructor prohibited */
422 AliHLTPendolino(const AliHLTPendolino&);
423 /** assignment operator prohibited */
424 AliHLTPendolino& operator=(const AliHLTPendolino&);
427 * Stores the current run type
429 TString fRunType; // Stores the current run type
432 * Stores the current run number
434 Int_t fRunNumber; // Stores the current run number
437 * Stores the HCDBpath
439 TString fHCDBPath; // Stores the HCDBpath
442 * Map that stores the all PredictionProcessors with their name
445 TMap fPredictionProcessorMap; // stores the all PredictionProcessors
448 * Pointer to the used Pendolino logger
450 AliHLTPendolinoLogger* fpLogger; // Pointer to the used Pendolino logger
453 * Indicates, if Logger is owned by Pendolino
455 Bool_t fOwnLogger; // Indicates, if Logger is owned by Pendolino
457 ClassDef(AliHLTPendolino, 5);
462 inline const char* AliHLTPendolino::GetRunType() {
463 // getter for run type
464 return fRunType.Data();
467 inline Int_t AliHLTPendolino::GetRunNumber() {
468 // getter for run number
472 inline Int_t AliHLTPendolino::getNumberOfPredictProc() {
473 // getter for number of registered PredictionProcessors
474 return fPredictionProcessorMap.GetSize();