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 class AliHLTPendolinoLogger;
28 * Class that implements the AliShuttleInterface and provides the required
29 * features for the contacting the PredictionProcessor and storing the result
32 * @author Sebastian Bablok
36 class AliHLTPendolino : public AliShuttleInterface {
40 * Static string that defines the local storage indicator in path
42 static const TString fgkLocalStorageDefine; // defines the local storage
45 * Static string defining the name of this inteface module.
47 static const char* fgkHLTInterfaceModule; // defines the name of inteface module
50 * Static value defining error value for a Pendolino exception.
52 static const Int_t fgkHLTPendolinoException; // error value for a Pendolino exception
55 * Static value defining error value for a bad cast
57 static const Int_t fgkHLTPendolinoBadCast; // error value for a bad cast
60 * Static value defining error value for handed in module is not
61 * implementing the PredictionProcessor interface.
63 static const Int_t fgkHLTPendolinoNotPredictProc; // error value for "not implementing the PredictionProcessor interface"
66 * Static value defining error value for module not existing.
68 static const Int_t fgkHLTPendolinoModuleNotExisting; // error value for module not existing
71 * Static value defining error value for PredictionProc does not
74 static const Int_t fgkHLTPendolinoNoDCS; // error value for PredictionProc does not process DCS
77 * Static string that defines the base folder for the Taxi list files.
79 static const TString fgkTaxiListBaseFolder; // defines the base folder for the Taxi list files
82 * Static string that defines list folder name for taxi list
84 static const TString fgkTaxiListFolderName; // defines list folder name for taxi list
87 * Static string that defines the filename for the Taxi list required
90 static const TString fgkTaxiListPendolino; // defines the filename for the Taxi list
93 * Static value that defines the max length of a line that can be read
94 * when browsing through the list file
96 static const Int_t fgkMaxLineLength; // defines the max length of a line
100 * Constructor for AliHLTPendolino.
102 * @param run the current run number
103 * @param HCDBbase path to the HCDB base folder
104 * @param runType the current run type
105 * @param logger pointer to the desired logger; default is the command
107 * @param startTime start time of the DCS Archive DB request
108 * @param endTime end time of the DCS Archive DB request
110 AliHLTPendolino(Int_t run, TString HCDBbase, TString runType = "TEST",
111 AliHLTPendolinoLogger* logger = 0, UInt_t startTime = 0,
117 virtual ~AliHLTPendolino();
120 * Function to store processed data in the HCDB
122 * @param path the storage path consisting of "detector/type/objectname"
123 * where detector should be the detector name used by offline,
124 * type is something like "CALIB" or "ALIGN", while
125 * objectname the name represents, by which it can be requested
127 * @param object the object to store
128 * @param metaData metaData to store
129 * @param validityStart object is valid from current run number minus
131 * @param validityInfinite if true, validity is set to infinity
133 * @return true on success, else false
135 virtual Bool_t Store(const AliCDBPath& path, TObject* object,
136 AliCDBMetaData* metaData, Int_t validityStart = 0,
137 Bool_t validityInfinite = kFALSE);
139 * Function is required from interface, but is disbled in its
140 * implementation since additional refernce data will not be used by
141 * the DAs inside the HLT. Therefore always returns false
143 * @return always false, since function is disabled.
145 virtual Bool_t StoreReferenceData(const AliCDBPath& path,
146 TObject* object, AliCDBMetaData* metaData);
148 * Function is required from interface, but is disbled in its
149 * implementation since additional reference data will not be used by
150 * the DAs inside the HLT. Therefore always returns false
152 * @return always false, since function is disabled.
154 virtual Bool_t StoreReferenceFile(const char* detector,
155 const char* localFile, const char* gridFileName);
158 * Function is required from interface, but is disbled in its
159 * implementation since additional run meta data will only be stored
160 * by the the GPR - Preprocessor of the Offline Shuttle.
162 * @return always false, since function is disabled.
164 virtual Bool_t StoreRunMetadataFile(const char* localFile,
165 const char* gridFileName);
168 * Function is required from interface, but is disbled in its
169 * implementation since additional refernce data will not be used by
170 * the DAs inside the HLT. Therefore always returns NULL.
171 * If this feature is lateron required by HLT, inherit from this class
172 * and overwrite this function with the required functionality.
174 * @return always NULL, since not used.
176 // virtual const char* GetFile(Int_t system, const char* detector,
177 // const char* id, const char* source); --> is private now
180 * Function is required from interface, but is disbled in its
181 * implementation since additional refernce data will not be used by
182 * the DAs inside the HLT. Therefore always returns NULL.
183 * If this feature is lateron required by HLT, inherit from this class
184 * and overwrite this function with the required functionality.
186 * @return always NULL, since not used.
188 // virtual TList* GetFileSources(Int_t system, const char* detector,
189 // const char* id = 0); -> is priavte now
192 * Function is required from interface, but is disbled in its
193 * implementation since additional refernce data will not be used by
194 * the DAs inside the HLT. Therefore always returns NULL.
195 * If this feature is lateron required by HLT, inherit from this class
196 * and overwrite this function with the required functionality.
198 * @return always NULL, since not used.
200 // virtual TList* GetFileIDs(Int_t system, const char* detector,
201 // const char* source); -> is private now
204 * Retrieves current run parameter.
206 * @param lbEntry name of the run parameter
208 * @return value of the run parameter
210 virtual const char* GetRunParameter(const char* lbEntry);
213 * Retrieves the current run type.
215 * @return the current run type
217 virtual const char* GetRunType();
220 * Returns the HLT status.
221 * Since the Pendolino is part of the HLT, the function will always
224 * @return always true - see above
226 virtual Bool_t GetHLTStatus();
229 * Retrieves a file from the OCDB, but does not uses the OCDB but the
230 * HCDB (local copy of the OCDB). - Since the HCDB only contains OCDB
231 * objects, that are included in the list the Taxi uses for fetching
232 * the data from the OCDB, it can happen, that the corresponding
233 * AliCDBEntry is missing.
234 * TODO: Think of mechanism to automatically include the object in the
237 * @param detector the detectorname, to which the object belongs
238 * @param path the path of the object
240 * @return pointer to the fetched HCDB entry
242 virtual AliCDBEntry* GetFromOCDB(const char* detector,
243 const AliCDBPath& path);
246 * Function to allow Pendolino and PredictionProcessor to make log
249 * @param detector the detector, that wants to issue this message
250 * @param message the log message
252 virtual void Log(const char* detector, const char* message);
255 * Function is required from interface, but is disbled in the Pendolino
256 * because at the moment there is no Trigger configuration available
257 * for Pendolino. At the moment it just return a NULL pointer and makes
260 * @return NULL pointer, since it should not be used.
262 // virtual const char* GetTriggerConfiguration(); --> is private now
264 virtual const char* GetCTPTimeParams() {return "";}
265 virtual void Log(const char* name, const char* message, UInt_t level);
268 * Registers a preprocessor; actually it has to be a PredictionProcessor
269 * since the Pendolino requires a PredictionProcessor. If the registered
270 * preprocessor is not implementing a PredictionProcessor, a log entry
271 * is made and the registration discarded.
273 * @param preprocessor the PredictionProcessor that shall be registered.
274 * For more details please see above !!
276 virtual void RegisterPreprocessor(AliPreprocessor* preprocessor);
277 // AliHLTPredictionProcessorInterface* preprocessor);
280 * Function to get the current run number
282 * @return current run number
284 virtual Int_t GetRunNumber();
287 * Function to enable prediction making in all registered
288 * PredictionProcessors, if they implement the required interface
290 * @return number of PredictionProcessor, which has been switched to
291 * prediction making (NOTE: the internal list may conatin
292 * more PredictionProcessors, but if switching on failed
293 * for one, this one is not counted.)
295 virtual UInt_t SetToPredictMaking();
298 * Function to get the number of registered PredictionProcessors
300 * @return number of registered PredictionProcessors
302 Int_t GetNumberOfPredictProc();
305 * Function to check if given PredtionProc allows for processing DCS
306 * and enable prediction making
308 * @param detector the detector in whose PredictionProcessor the
309 * prediction making shall be enabled.
311 * @return 0 on success, else an error code is returned
313 virtual Int_t setToPredictMaking(TString detector);
316 * Function to initlaize a dedicated Prediction Processor
318 * @param detector the detector, whose PredictProc shall be initialized
319 * @param run the current run number
320 * @param startTime the start time of the fetched data
321 * @param endTime the end time of the fetched data
323 * @return 0 on success, else an error code is returned
325 virtual Int_t initPredictProc(TString detector, Int_t run,
326 UInt_t startTime, UInt_t endTime);
329 * Function to hand in retrieved DCS values. These values are handed to
330 * the corresponding PredictionProcessor of the according detector.
331 * The PredictionProcessor should prepare the data inside and store
334 * @param detector the according detector, to whose PredictionProcessor
335 * shall prepare the handed-in data
336 * @param DCSValues pointer to the map containing the fetched DCS values
338 * @return 0 on success, else an error code is returned.
340 virtual Int_t PrepareDCSValues(TString detector, TMap* DCSValues);
343 * Function to retrieve dummy data for testing the Pendolino from a
344 * given PredictionProcessor. The function called is handed further to
345 * the corresponding PredictionProcessor.
346 * NOTE: The returned TMap can be NULL, if no corresponding
347 * PredictionProcessor is registered.
349 * @param detector the according detector, from whom the
350 * PredictionProcessor shall produce the dummy data.
351 * @param aliasName optional parameter to hand in a alias name for
352 * producing a DCSMap for the given alias.
354 * @return the DCSMap with the dummy data to test (given by the
355 * PredictionProcessor). NOTE: can be NULL, if no corresponding
356 * PredictionProcessor is registered.
358 virtual TMap* EmulateDCSMap(TString detector, TString aliasName = "");
361 * Function to add a entry request to the Taxi lists.
363 * @param entryPath the path entry, that shall be included in the
366 * @return true, when successful included or entry already existing in
369 virtual Bool_t IncludeAliCDBEntryInList(const TString& entryPath);
372 * Function to get the start time of the DCS Archive DB request; in HLT
373 * this is the same like the start time given in the Initialize() call
374 * to the PredictionProcessors (NOTE: thsi is differnet to the
375 * implementation in the Offline Shuttle - there the initial start time
376 * is set to the start-of-data for the complete run.)
378 virtual UInt_t GetStartTimeDCSQuery();
381 * Function to get the end time of the DCS Archive DB request; in HLT
382 * this is the same like the end time given in the Initialize() call
383 * to the PredictionProcessors (NOTE: thsi is differnet to the
384 * implementation in the Offline Shuttle - there the initial end time
385 * is set to the end-of-data for the complete run.)
387 virtual UInt_t GetEndTimeDCSQuery();
390 * method introduced as pure virtual in r43691
391 * needs to be implemented to create pendolino instances
393 virtual void SendMLFromDet(const char* /*value*/) {}
395 * method introduced as pure virtual in r45587
396 * needs to be implemented to create pendolino instances
398 virtual TString* GetLTUConfig(const char* /*det*/) {return NULL;}
404 * Function is required from interface, but is disbled in its
405 * implementation since additional refernce data will not be used by
406 * the DAs inside the HLT. Therefore always returns NULL.
407 * If this feature is lateron required by HLT, inherit from this class
408 * and overwrite this function with the required functionality.
410 * @return always NULL, since not used.
412 virtual TList* GetFileIDs(Int_t system, const char* detector,
416 * Function is required from interface, but is disbled in its
417 * implementation since additional refernce data will not be used by
418 * the DAs inside the HLT. Therefore always returns NULL.
419 * If this feature is lateron required by HLT, inherit from this class
420 * and overwrite this function with the required functionality.
422 * @return always NULL, since not used.
424 virtual TList* GetFileSources(Int_t system, const char* detector,
428 * Function is required from interface, but is disbled in its
429 * implementation since additional refernce data will not be used by
430 * the DAs inside the HLT. Therefore always returns NULL.
431 * If this feature is lateron required by HLT, inherit from this class
432 * and overwrite this function with the required functionality.
434 * @return always NULL, since not used.
436 virtual const char* GetFile(Int_t system, const char* detector,
437 const char* id, const char* source);
440 * Function is required from interface, but is disbled in the Pendolino
441 * because at the moment there is no Trigger configuration available
442 * for Pendolino. At the moment it just return a NULL pointer and makes
445 * @return NULL pointer, since it should not be used.
447 virtual const char* GetTriggerConfiguration();
448 virtual const char* GetTriggerDetectorMask();
451 * Disable the default constructor.
455 /** copy constructor prohibited */
456 AliHLTPendolino(const AliHLTPendolino&);
457 /** assignment operator prohibited */
458 AliHLTPendolino& operator=(const AliHLTPendolino&);
461 * Stores the current run type
463 TString fRunType; // Stores the current run type
466 * Stores the current run number
468 Int_t fRunNumber; // Stores the current run number
471 * Stores the HCDBpath
473 TString fHCDBPath; // Stores the HCDBpath
476 * Map that stores the all PredictionProcessors with their name
479 TMap fPredictionProcessorMap; // stores the all PredictionProcessors
482 * Pointer to the used Pendolino logger
484 AliHLTPendolinoLogger* fpLogger; // Pointer to the used Pendolino logger
487 * Indicates, if Logger is owned by Pendolino
489 Bool_t fOwnLogger; // Indicates, if Logger is owned by Pendolino
492 * Stores the start time of the DCS Archive DB request
494 UInt_t fStartTime; //!
497 * Stores the end time of the DCS Archive DB request
501 ClassDef(AliHLTPendolino, 6);
506 inline const char* AliHLTPendolino::GetRunType() {
507 // getter for run type
508 return fRunType.Data();
511 inline Int_t AliHLTPendolino::GetRunNumber() {
512 // getter for run number
516 inline Int_t AliHLTPendolino::GetNumberOfPredictProc() {
517 // getter for number of registered PredictionProcessors
518 return fPredictionProcessorMap.GetSize();