//-*- Mode: C++ -*- // $Id$ #ifndef ALI_HLT_PREDICTION_PROCESSOR_DUMMY_H #define ALI_HLT_PREDICTION_PROCESSOR_DUMMY_H //* This file is property of and copyright by the ALICE HLT Project * //* ALICE Experiment at CERN, All rights reserved. * //* See cxx source for full Copyright notice * /** @file AliHLTPredictionProcessorDummy.h @author Sebastian Bablok @date @brief */ #include "AliHLTPredictionProcessorInterface.h" /** * Dummy implementation of the AliHLTPredictionProcessorInterface. * This class is just for testing purpose of the PredictionProcessor interface. * * @author Sebastian Bablok * * @date 2007-10-24 */ class AliHLTPredictionProcessorDummy : public AliHLTPredictionProcessorInterface { public: /** * Constructor for AliHLTPredictionProcessorDummy * * @param detector string defining the detector to which the * PredictionProcessor belongs to * @param pendolino pointer to the hosting pendolino (derived from * AliShuttleInterface) */ AliHLTPredictionProcessorDummy(const char* detector, AliHLTPendolino* pendolino); /** * Destructor for AliHLTPredictionProcessorDummy */ virtual ~AliHLTPredictionProcessorDummy(); /** * Pure virtual function to force the Prediction Processor to implement * a function to flag that prediction making is required. * This function is called by the Pendolino before the fetched DCS data * is handed in for (prediction) processing. * * @param doPrediction if true, prediction making shall be switched on, * if false, switched off. * * @return 0 on success; a value greater than 0 refers to an error */ virtual UInt_t makePrediction(Bool_t doPrediction = true); /** * Pure Virtual function, implemented in the detector specific * PredictionProcessors to initialize them. * * @param run run number * @param startTime start time of data * @param endTime end time of data */ virtual void Initialize(Int_t run, UInt_t startTime, UInt_t endTime); /** * Function called by the Pendolino for each participating subdetector * producing the required condition settings. This includes the * encoding of a prediction to the values due to the fact, that only * data up to now can be fetched from DCS (the latest data can also be * up to 2 min old until it is received on HLT side). To write the data * to the HCDB, the detector specific implementation of this class has * to call the appropriated storing function provided by the interface. * * @param dcsAliasMap the map containing aliases and corresponding DCS * values and timestamps * * @return 0 on success; a value greater than 0 refers to an error */ virtual UInt_t Process(TMap* dcsAliasMap); /** * Indicates if DCS data shall be processed. * NOTE: should always return true, since it is used as prediction * processor, which will only process DCS data * * @return true if DCS data can be processed, else false. Note: if false * the Pendolino would stop, so make sure that it is true. */ virtual Bool_t ProcessDCS(); /** * Function to let the PredictionProcessor produce dummy input data, * that can be used in Pendolino tests, where no DCS Archieve DB is * contacted. This function is called by the Pendolino, the result is * given back to the PredictionProcessor via the Process(...) call. * Since the DCSMaps requested from DCS are detector specific, the * PredictionProcessor should know, how the maps look like, that it * expects. * NOTE: The clean - up (delete) of the TMap will be performed by the * Pendolino after the usage. The PredictionProcessor has never to * call delete on the returned TMap pointer. * * @param aliasName optional parameter, that can be given in order to * create a DCSMap for dedicated aliases. For a general test * this paramter should be empty. If more than one alias name * shall be specified, they are separated by blanks " ". * * @return DCSMap containing dummy data for testing the Pendolino. */ virtual TMap* produceTestData(TString aliasName = ""); protected: private: /** * Disabled Copy constructor * (parent class is disabled so derived class does the same) */ AliHLTPredictionProcessorDummy( const AliHLTPredictionProcessorDummy& predictPro); /** * Disabled Assignment operator * (parent class is disabled so derived class does the same) */ AliHLTPredictionProcessorDummy& operator=( const AliHLTPredictionProcessorDummy& rhs); /** * Stores if prediction shall be made */ Bool_t fPredict; // Stores if prediction shall be made /** * Stores the run number */ Int_t fRun; // Stores the run number /** * Stores the start time of the to process DCS data */ UInt_t fStartTime; // Stores the start time of the to process DCS data /** * Stores the end time of the to process DCS data */ UInt_t fEndTime; // Stores the end time of the to process DCS data ClassDef(AliHLTPredictionProcessorDummy, 1); }; inline Bool_t AliHLTPredictionProcessorDummy::ProcessDCS() { // getter for flag indicating if DCS values are processed; always true return true; } #endif