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"
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 kLOCAL_STORAGE_DEFINE; // defines the local storage
51 * Static string defining the name of this inteface module.
53 static const char* kHLTInterfaceModule; // defines the name of inteface module
56 * Static value defining error value for a Pendolino exception.
58 static const Int_t kHLTPendolinoException; // error value for a Pendolino exception
61 * Static value defining error value for a bad cast
63 static const Int_t kHLTPendolinoBadCast; // 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 kHLTPendolinoNotPredictProc; // error value for "not implementing the PredictionProcessor interface"
72 * Static value defining error value for module not existing.
74 static const Int_t kHLTPendolinoModuleNotExisting; // error value for module not existing
77 * Static value defining error value for PredictionProc does not
80 static const Int_t kHLTPendolinoNoDCS; // 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 kTaxiListBaseFolder; // defines the base folder for the Taxi list files
88 * Static string that defines list folder name for taxi list
90 static const TString kTaxiListFolderName; // defines list folder name for taxi list
93 * Static string that defines the filename for the Taxi list required
96 static const TString kTaxiListPendolino; // 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 kMAX_LINE_LENGTH; // 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
271 * Registers a preprocessor; actually it has to be a PredictionProcessor
272 * since the Pendolino requires a PredictionProcessor. If the registered
273 * preprocessor is not implementing a PredictionProcessor, a log entry
274 * is made and the registration discarded.
276 * @param preprocessor the PredictionProcessor that shall be registered.
277 * For more details please see above !!
279 virtual void RegisterPreprocessor(AliPreprocessor* preprocessor);
280 // AliHLTPredictionProcessorInterface* preprocessor);
283 * Function to get the current run number
285 * @return current run number
287 virtual Int_t GetRunNumber();
290 * Function to enable prediction making in all registered
291 * PredictionProcessors, if they implement the required interface
293 * @return number of PredictionProcessor, which has been switched to
294 * prediction making (NOTE: the internal list may conatin
295 * more PredictionProcessors, but if switching on failed
296 * for one, this one is not counted.)
298 virtual UInt_t setToPredictMaking();
301 * Function to get the number of registered PredictionProcessors
303 * @return number of registered PredictionProcessors
305 Int_t getNumberOfPredictProc();
308 * Function to check if given PredtionProc allows for processing DCS
309 * and enable prediction making
311 * @param detector the detector in whose PredictionProcessor the
312 * prediction making shall be enabled.
314 * @return 0 on success, else an error code is returned
316 virtual Int_t setToPredictMaking(TString detector);
319 * Function to initlaize a dedicated Prediction Processor
321 * @param detector the detector, whose PredictProc shall be initialized
322 * @param run the current run number
323 * @param startTime the start time of the fetched data
324 * @param endTime the end time of the fetched data
326 * @return 0 on success, else an error code is returned
328 virtual Int_t initPredictProc(TString detector, Int_t run,
329 UInt_t startTime, UInt_t endTime);
332 * Function to hand in retrieved DCS values. These values are handed to
333 * the corresponding PredictionProcessor of the according detector.
334 * The PredictionProcessor should prepare the data inside and store
337 * @param detector the according detector, to whose PredictionProcessor
338 * shall prepare the handed-in data
339 * @param DCSValues pointer to the map containing the fetched DCS values
341 * @return 0 on success, else an error code is returned.
343 virtual Int_t prepareDCSValues(TString detector, TMap* DCSValues);
346 * Function to retrieve dummy data for testing the Pendolino from a
347 * given PredictionProcessor. The function called is handed further to
348 * the corresponding PredictionProcessor.
349 * NOTE: The returned TMap can be NULL, if no corresponding
350 * PredictionProcessor is registered.
352 * @param detector the according detector, from whom the
353 * PredictionProcessor shall produce the dummy data.
354 * @param aliasName optional parameter to hand in a alias name for
355 * producing a DCSMap for the given alias.
357 * @return the DCSMap with the dummy data to test (given by the
358 * PredictionProcessor). NOTE: can be NULL, if no corresponding
359 * PredictionProcessor is registered.
361 virtual TMap* emulateDCSMap(TString detector, TString aliasName = "");
364 * Function to add a entry request to the Taxi lists.
366 * @param entryPath the path entry, that shall be included in the
369 * @return true, when successful included or entry already existing in
372 virtual Bool_t includeAliCDBEntryInList(const TString& entryPath);
375 * Function to get the start time of the DCS Archive DB request; in HLT
376 * this is the same like the start time given in the Initialize() call
377 * to the PredictionProcessors (NOTE: thsi is differnet to the
378 * implementation in the Offline Shuttle - there the initial start time
379 * is set to the start-of-data for the complete run.)
381 #ifdef SHUTTLE_PRE_REV29388_INTERFACE
382 virtual const UInt_t GetStartTimeDCSQuery();
384 virtual UInt_t GetStartTimeDCSQuery();
388 * Function to get the end time of the DCS Archive DB request; in HLT
389 * this is the same like the end time given in the Initialize() call
390 * to the PredictionProcessors (NOTE: thsi is differnet to the
391 * implementation in the Offline Shuttle - there the initial end time
392 * is set to the end-of-data for the complete run.)
394 #ifdef SHUTTLE_PRE_REV29388_INTERFACE
395 virtual const UInt_t GetEndTimeDCSQuery();
397 virtual UInt_t GetEndTimeDCSQuery();
406 * Function is required from interface, but is disbled in its
407 * implementation since additional refernce data will not be used by
408 * the DAs inside the HLT. Therefore always returns NULL.
409 * If this feature is lateron required by HLT, inherit from this class
410 * and overwrite this function with the required functionality.
412 * @return always NULL, since not used.
414 virtual TList* GetFileIDs(Int_t system, const char* detector,
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* GetFileSources(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 const char* GetFile(Int_t system, const char* detector,
439 const char* id, const char* source);
442 * Function is required from interface, but is disbled in the Pendolino
443 * because at the moment there is no Trigger configuration available
444 * for Pendolino. At the moment it just return a NULL pointer and makes
447 * @return NULL pointer, since it should not be used.
449 virtual const char* GetTriggerConfiguration();
452 * Disable the default constructor.
456 /** copy constructor prohibited */
457 AliHLTPendolino(const AliHLTPendolino&);
458 /** assignment operator prohibited */
459 AliHLTPendolino& operator=(const AliHLTPendolino&);
462 * Stores the current run type
464 TString fRunType; // Stores the current run type
467 * Stores the current run number
469 Int_t fRunNumber; // Stores the current run number
472 * Stores the HCDBpath
474 TString fHCDBPath; // Stores the HCDBpath
477 * Map that stores the all PredictionProcessors with their name
480 TMap fPredictionProcessorMap; // stores the all PredictionProcessors
483 * Pointer to the used Pendolino logger
485 AliHLTPendolinoLogger* fpLogger; // Pointer to the used Pendolino logger
488 * Indicates, if Logger is owned by Pendolino
490 Bool_t fOwnLogger; // Indicates, if Logger is owned by Pendolino
493 * Stores the start time of the DCS Archive DB request
498 * Stores the end time of the DCS Archive DB request
502 ClassDef(AliHLTPendolino, 6);
507 inline const char* AliHLTPendolino::GetRunType() {
508 // getter for run type
509 return fRunType.Data();
512 inline Int_t AliHLTPendolino::GetRunNumber() {
513 // getter for run number
517 inline Int_t AliHLTPendolino::getNumberOfPredictProc() {
518 // getter for number of registered PredictionProcessors
519 return fPredictionProcessorMap.GetSize();