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
14 // @note maintained by Matthias.Richter@ift.uib.no
16 //#include <TObject.h>
21 #include <AliShuttleInterface.h>
23 //#include "AliHLTPredictionProcessorInterface.h"
25 #ifdef SHUTTLE_PRE_REV29388_INTERFACE
26 #define CONST_PROPERTY const
28 #define CONST_PROPERTY
31 class AliHLTPendolinoLogger;
34 * Class that implements the AliShuttleInterface and provides the required
35 * features for the contacting the PredictionProcessor and storing the result
38 * @author Sebastian Bablok
42 class AliHLTPendolino : public AliShuttleInterface {
46 * Static string that defines the local storage indicator in path
48 static const TString fgkLocalStorageDefine; // defines the local storage
51 * Static string defining the name of this inteface module.
53 static const char* fgkHLTInterfaceModule; // defines the name of inteface module
56 * Static value defining error value for a Pendolino exception.
58 static const Int_t fgkHLTPendolinoException; // error value for a Pendolino exception
61 * Static value defining error value for a bad cast
63 static const Int_t fgkHLTPendolinoBadCast; // error value for a bad cast
66 * Static value defining error value for handed in module is not
67 * implementing the PredictionProcessor interface.
69 static const Int_t fgkHLTPendolinoNotPredictProc; // error value for "not implementing the PredictionProcessor interface"
72 * Static value defining error value for module not existing.
74 static const Int_t fgkHLTPendolinoModuleNotExisting; // error value for module not existing
77 * Static value defining error value for PredictionProc does not
80 static const Int_t fgkHLTPendolinoNoDCS; // error value for PredictionProc does not process DCS
83 * Static string that defines the base folder for the Taxi list files.
85 static const TString fgkTaxiListBaseFolder; // defines the base folder for the Taxi list files
88 * Static string that defines list folder name for taxi list
90 static const TString fgkTaxiListFolderName; // defines list folder name for taxi list
93 * Static string that defines the filename for the Taxi list required
96 static const TString fgkTaxiListPendolino; // defines the filename for the Taxi list
99 * Static value that defines the max length of a line that can be read
100 * when browsing through the list file
102 static const Int_t fgkMaxLineLength; // defines the max length of a line
106 * Constructor for AliHLTPendolino.
108 * @param run the current run number
109 * @param HCDBbase path to the HCDB base folder
110 * @param runType the current run type
111 * @param logger pointer to the desired logger; default is the command
113 * @param startTime start time of the DCS Archive DB request
114 * @param endTime end time of the DCS Archive DB request
116 AliHLTPendolino(Int_t run, TString HCDBbase, TString runType = "TEST",
117 AliHLTPendolinoLogger* logger = 0, UInt_t startTime = 0,
123 virtual ~AliHLTPendolino();
126 * Function to store processed data in the HCDB
128 * @param path the storage path consisting of "detector/type/objectname"
129 * where detector should be the detector name used by offline,
130 * type is something like "CALIB" or "ALIGN", while
131 * objectname the name represents, by which it can be requested
133 * @param object the object to store
134 * @param metaData metaData to store
135 * @param validityStart object is valid from current run number minus
137 * @param validityInfinite if true, validity is set to infinity
139 * @return true on success, else false
141 virtual Bool_t Store(const AliCDBPath& path, TObject* object,
142 AliCDBMetaData* metaData, Int_t validityStart = 0,
143 Bool_t validityInfinite = kFALSE);
145 * Function is required from interface, but is disbled in its
146 * implementation since additional refernce data will not be used by
147 * the DAs inside the HLT. Therefore always returns false
149 * @return always false, since function is disabled.
151 virtual Bool_t StoreReferenceData(const AliCDBPath& path,
152 TObject* object, AliCDBMetaData* metaData);
154 * Function is required from interface, but is disbled in its
155 * implementation since additional reference data will not be used by
156 * the DAs inside the HLT. Therefore always returns false
158 * @return always false, since function is disabled.
160 virtual Bool_t StoreReferenceFile(const char* detector,
161 const char* localFile, const char* gridFileName);
164 * Function is required from interface, but is disbled in its
165 * implementation since additional run meta data will only be stored
166 * by the the GPR - Preprocessor of the Offline Shuttle.
168 * @return always false, since function is disabled.
170 virtual Bool_t StoreRunMetadataFile(const char* localFile,
171 const char* gridFileName);
174 * Function is required from interface, but is disbled in its
175 * implementation since additional refernce data will not be used by
176 * the DAs inside the HLT. Therefore always returns NULL.
177 * If this feature is lateron required by HLT, inherit from this class
178 * and overwrite this function with the required functionality.
180 * @return always NULL, since not used.
182 // virtual const char* GetFile(Int_t system, const char* detector,
183 // const char* id, const char* source); --> is private now
186 * Function is required from interface, but is disbled in its
187 * implementation since additional refernce data will not be used by
188 * the DAs inside the HLT. Therefore always returns NULL.
189 * If this feature is lateron required by HLT, inherit from this class
190 * and overwrite this function with the required functionality.
192 * @return always NULL, since not used.
194 // virtual TList* GetFileSources(Int_t system, const char* detector,
195 // const char* id = 0); -> is priavte now
198 * Function is required from interface, but is disbled in its
199 * implementation since additional refernce data will not be used by
200 * the DAs inside the HLT. Therefore always returns NULL.
201 * If this feature is lateron required by HLT, inherit from this class
202 * and overwrite this function with the required functionality.
204 * @return always NULL, since not used.
206 // virtual TList* GetFileIDs(Int_t system, const char* detector,
207 // const char* source); -> is private now
210 * Retrieves current run parameter.
212 * @param lbEntry name of the run parameter
214 * @return value of the run parameter
216 virtual const char* GetRunParameter(const char* lbEntry);
219 * Retrieves the current run type.
221 * @return the current run type
223 virtual const char* GetRunType();
226 * Returns the HLT status.
227 * Since the Pendolino is part of the HLT, the function will always
230 * @return always true - see above
232 virtual Bool_t GetHLTStatus();
235 * Retrieves a file from the OCDB, but does not uses the OCDB but the
236 * HCDB (local copy of the OCDB). - Since the HCDB only contains OCDB
237 * objects, that are included in the list the Taxi uses for fetching
238 * the data from the OCDB, it can happen, that the corresponding
239 * AliCDBEntry is missing.
240 * TODO: Think of mechanism to automatically include the object in the
243 * @param detector the detectorname, to which the object belongs
244 * @param path the path of the object
246 * @return pointer to the fetched HCDB entry
248 virtual AliCDBEntry* GetFromOCDB(const char* detector,
249 const AliCDBPath& path);
252 * Function to allow Pendolino and PredictionProcessor to make log
255 * @param detector the detector, that wants to issue this message
256 * @param message the log message
258 virtual void Log(const char* detector, const char* message);
261 * Function is required from interface, but is disbled in the Pendolino
262 * because at the moment there is no Trigger configuration available
263 * for Pendolino. At the moment it just return a NULL pointer and makes
266 * @return NULL pointer, since it should not be used.
268 // virtual const char* GetTriggerConfiguration(); --> is private now
270 virtual const char* GetCTPTimeParams() {return "";}
271 virtual void Log(const char* name, const char* message, UInt_t level);
274 * Registers a preprocessor; actually it has to be a PredictionProcessor
275 * since the Pendolino requires a PredictionProcessor. If the registered
276 * preprocessor is not implementing a PredictionProcessor, a log entry
277 * is made and the registration discarded.
279 * @param preprocessor the PredictionProcessor that shall be registered.
280 * For more details please see above !!
282 virtual void RegisterPreprocessor(AliPreprocessor* preprocessor);
283 // AliHLTPredictionProcessorInterface* preprocessor);
286 * Function to get the current run number
288 * @return current run number
290 virtual Int_t GetRunNumber();
293 * Function to enable prediction making in all registered
294 * PredictionProcessors, if they implement the required interface
296 * @return number of PredictionProcessor, which has been switched to
297 * prediction making (NOTE: the internal list may conatin
298 * more PredictionProcessors, but if switching on failed
299 * for one, this one is not counted.)
301 virtual UInt_t SetToPredictMaking();
304 * Function to get the number of registered PredictionProcessors
306 * @return number of registered PredictionProcessors
308 Int_t GetNumberOfPredictProc();
311 * Function to check if given PredtionProc allows for processing DCS
312 * and enable prediction making
314 * @param detector the detector in whose PredictionProcessor the
315 * prediction making shall be enabled.
317 * @return 0 on success, else an error code is returned
319 virtual Int_t setToPredictMaking(TString detector);
322 * Function to initlaize a dedicated Prediction Processor
324 * @param detector the detector, whose PredictProc shall be initialized
325 * @param run the current run number
326 * @param startTime the start time of the fetched data
327 * @param endTime the end time of the fetched data
329 * @return 0 on success, else an error code is returned
331 virtual Int_t initPredictProc(TString detector, Int_t run,
332 UInt_t startTime, UInt_t endTime);
335 * Function to hand in retrieved DCS values. These values are handed to
336 * the corresponding PredictionProcessor of the according detector.
337 * The PredictionProcessor should prepare the data inside and store
340 * @param detector the according detector, to whose PredictionProcessor
341 * shall prepare the handed-in data
342 * @param DCSValues pointer to the map containing the fetched DCS values
344 * @return 0 on success, else an error code is returned.
346 virtual Int_t PrepareDCSValues(TString detector, TMap* DCSValues);
349 * Function to retrieve dummy data for testing the Pendolino from a
350 * given PredictionProcessor. The function called is handed further to
351 * the corresponding PredictionProcessor.
352 * NOTE: The returned TMap can be NULL, if no corresponding
353 * PredictionProcessor is registered.
355 * @param detector the according detector, from whom the
356 * PredictionProcessor shall produce the dummy data.
357 * @param aliasName optional parameter to hand in a alias name for
358 * producing a DCSMap for the given alias.
360 * @return the DCSMap with the dummy data to test (given by the
361 * PredictionProcessor). NOTE: can be NULL, if no corresponding
362 * PredictionProcessor is registered.
364 virtual TMap* EmulateDCSMap(TString detector, TString aliasName = "");
367 * Function to add a entry request to the Taxi lists.
369 * @param entryPath the path entry, that shall be included in the
372 * @return true, when successful included or entry already existing in
375 virtual Bool_t IncludeAliCDBEntryInList(const TString& entryPath);
378 * Function to get the start time of the DCS Archive DB request; in HLT
379 * this is the same like the start time given in the Initialize() call
380 * to the PredictionProcessors (NOTE: thsi is differnet to the
381 * implementation in the Offline Shuttle - there the initial start time
382 * is set to the start-of-data for the complete run.)
384 #ifdef SHUTTLE_PRE_REV29388_INTERFACE
385 virtual const UInt_t GetStartTimeDCSQuery();
387 virtual UInt_t GetStartTimeDCSQuery();
391 * Function to get the end time of the DCS Archive DB request; in HLT
392 * this is the same like the end time given in the Initialize() call
393 * to the PredictionProcessors (NOTE: thsi is differnet to the
394 * implementation in the Offline Shuttle - there the initial end time
395 * is set to the end-of-data for the complete run.)
397 #ifdef SHUTTLE_PRE_REV29388_INTERFACE
398 virtual const UInt_t GetEndTimeDCSQuery();
400 virtual UInt_t GetEndTimeDCSQuery();
404 * method introduced as pure virtual in r43691
405 * needs to be implemented to create pendolino instances
407 virtual void SendMLFromDet(const char* /*value*/) {}
409 * method introduced as pure virtual in r45587
410 * needs to be implemented to create pendolino instances
412 virtual TString* GetLTUConfig(const char* /*det*/) {return NULL;}
418 * Function is required from interface, but is disbled in its
419 * implementation since additional refernce data will not be used by
420 * the DAs inside the HLT. Therefore always returns NULL.
421 * If this feature is lateron required by HLT, inherit from this class
422 * and overwrite this function with the required functionality.
424 * @return always NULL, since not used.
426 virtual TList* GetFileIDs(Int_t system, const char* detector,
430 * Function is required from interface, but is disbled in its
431 * implementation since additional refernce data will not be used by
432 * the DAs inside the HLT. Therefore always returns NULL.
433 * If this feature is lateron required by HLT, inherit from this class
434 * and overwrite this function with the required functionality.
436 * @return always NULL, since not used.
438 virtual TList* GetFileSources(Int_t system, const char* detector,
442 * Function is required from interface, but is disbled in its
443 * implementation since additional refernce data will not be used by
444 * the DAs inside the HLT. Therefore always returns NULL.
445 * If this feature is lateron required by HLT, inherit from this class
446 * and overwrite this function with the required functionality.
448 * @return always NULL, since not used.
450 virtual const char* GetFile(Int_t system, const char* detector,
451 const char* id, const char* source);
454 * Function is required from interface, but is disbled in the Pendolino
455 * because at the moment there is no Trigger configuration available
456 * for Pendolino. At the moment it just return a NULL pointer and makes
459 * @return NULL pointer, since it should not be used.
461 virtual const char* GetTriggerConfiguration();
462 virtual const char* GetTriggerDetectorMask();
465 * Disable the default constructor.
469 /** copy constructor prohibited */
470 AliHLTPendolino(const AliHLTPendolino&);
471 /** assignment operator prohibited */
472 AliHLTPendolino& operator=(const AliHLTPendolino&);
475 * Stores the current run type
477 TString fRunType; // Stores the current run type
480 * Stores the current run number
482 Int_t fRunNumber; // Stores the current run number
485 * Stores the HCDBpath
487 TString fHCDBPath; // Stores the HCDBpath
490 * Map that stores the all PredictionProcessors with their name
493 TMap fPredictionProcessorMap; // stores the all PredictionProcessors
496 * Pointer to the used Pendolino logger
498 AliHLTPendolinoLogger* fpLogger; // Pointer to the used Pendolino logger
501 * Indicates, if Logger is owned by Pendolino
503 Bool_t fOwnLogger; // Indicates, if Logger is owned by Pendolino
506 * Stores the start time of the DCS Archive DB request
508 UInt_t fStartTime; //!
511 * Stores the end time of the DCS Archive DB request
515 ClassDef(AliHLTPendolino, 6);
520 inline const char* AliHLTPendolino::GetRunType() {
521 // getter for run type
522 return fRunType.Data();
525 inline Int_t AliHLTPendolino::GetRunNumber() {
526 // getter for run number
530 inline Int_t AliHLTPendolino::GetNumberOfPredictProc() {
531 // getter for number of registered PredictionProcessors
532 return fPredictionProcessorMap.GetSize();