adding prediction processor for the GRP, moving some functions to the PredictionProce...
[u/mrichter/AliRoot.git] / HLT / pendolino / PredictionProcessor / AliHLTPredictionProcessorInterface.h
CommitLineData
e58fb035 1//-*- Mode: C++ -*-
2// $Id$
3
4#ifndef ALI_HLT_PREDICTION_PROCESSOR_INTERFACE_H
5#define ALI_HLT_PREDICTION_PROCESSOR_INTERFACE_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 *
9
10/** @file AliHLTPredictionProcessorInterface.h
11 @author Sebastian Bablok
12 @date
13 @brief
14*/
15
16#include <AliPreprocessor.h>
17
18class AliHLTPendolino;
19
20
21/**
22 * The Class defines the interface HLT Preprocessor.
23 * It inherits from the AliPreprocessorInterface and adds the features for
24 * the prediction procession required by the HLT Pendolino.
25 *
26 * @author Sebastian Bablok
27 *
28 * @date 2007-10-22
29 */
30class AliHLTPredictionProcessorInterface : public AliPreprocessor {
31 public:
32
33 /**
34 * Constructor for AliHLTPredictionProcessorInterface
35 *
36 * @param detector string defining the detector to which the
37 * PredictionProcessor belongs to
38 * @param pendolino pointer to the hosting pendolino (derived from
39 * AliShuttleInterface)
40 */
41 AliHLTPredictionProcessorInterface(const char* detector,
42 AliHLTPendolino* pendolino);
43
44 /**
45 * Destructor for AliHLTPredictionProcessorInterface
46 */
47 virtual ~AliHLTPredictionProcessorInterface();
48
49 /**
50 * Pure virtual function to force the Prediction Processor to implement
51 * a function to flag that prediction making is required.
52 * This function is called by the Pendolino before the fetched DCS data
53 * is handed in for (prediction) processing.
54 *
55 * @param doPrediction if true, prediction making shall be switched on,
56 * if false, switched off.
57 *
58 * @return 0 on success; a value greater than 0 refers to an error
59 */
60 virtual UInt_t makePrediction(Bool_t doPrediction = true) = 0;
61
62 /**
63 * Function to let the PredictionProcessor produce dummy input data,
64 * that can be used in Pendolino tests, where no DCS Archieve DB is
65 * contacted. This function is called by the Pendolino, the result is
66 * given back to the PredictionProcessor via the Process(...) call.
67 * Since the DCSMaps requested from DCS are detector specific, the
68 * PredictionProcessor should know, how the maps look like, that it
69 * expects. This function is pure virtual, because it has to be
70 * implemented by the real PredictionProcessors.
71 * NOTE: the clean - up (delete) of the TMap will be performed by the
72 * Pendolino after the usage. The PredictionProcessor has never to
73 * call delete on the returned TMap pointer.
74 *
75 * @param aliasName optional parameter, that can be given in order to
76 * create a DCSMap for dedicated aliases. For a general test
77 * this parameter should be empty. If more than one alias name
78 * shall be specified, they are separated by blanks " ".
79 *
80 * @return DCSMap containing dummy data for testing the Pendolino.
81 */
82 virtual TMap* produceTestData(TString aliasName = "") = 0;
83
84 /**
85 * Virtual function, implemented in the detector specific
86 * PredictionProcessors to initialize them.
87 *
88 * @param run run number
89 * @param startTime start time of data
90 * @param endTime end time of data
91 */
d1662f64 92 virtual void Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
e58fb035 93
94 /**
95 * Function called by the Pendolino for each participating subdetector
96 * producing the required condition settings. This includes the
97 * encoding of a prediction to the values due to the fact, that only
98 * data up to now can be fetched from DCS (the latest data can also be
99 * up to 2 min old until it is received on HLT side). To write the data
100 * to the HCDB, the detector specific implementation of this class has
101 * to call the appropriated storing function provided by the interface.
102 *
103 * @param dcsAliasMap the map containing aliases and corresponding DCS
104 * values and timestamps
105 *
106 * @return 0 on success; a value greater than 0 refers to an error
107 */
108// virtual UInt_t Process(TMap* dcsAliasMap) = 0;
109
110 /**
111 * Indicates if DCS data shall be processed.
112 * NOTE: should always return true, since it is used as prediction
113 * processor, which will only process DCS data
114 *
115 * @return true if DCS data can be processed, else false. Note: if false
116 * the Pendolino would stop, so make sure that it is true.
117 */
118// virtual Bool_t ProcessDCS();
119
120 protected:
121 /**
122 * Helper function to receive the current run number
123 *
124 * @return the current run number
125 */
126 virtual Int_t GetRunNumber();
d1662f64 127
128 Bool_t IsPredicting() const {return fPredict;}
129 UInt_t StartTime() const {return fStartTime;}
130 UInt_t EndTime() const {return fEndTime;}
e58fb035 131
132 /**
133 * Function to let the Penolino add an request for an AliCDBEntry to the
134 * according Taxi list. This corresponding object will be request then
135 * with the next run of the Taxi. The entry is added to the Pendolino
136 * specific list for the Taxi configuration. Note: the name has to
137 * include the detector name as well; e.g.: "TPC/Calib/LocalVdrift" .
138 *
139 * @param entryPath the full path name of the entry, that shall be
140 * included
141 *
142 * @return true, when successful included or entry already existing in
143 * list; else false.
144 */
145 virtual Bool_t includeAliCDBEntryInList(const TString& entryPath);
146
d1662f64 147 /**
148 * Function to rertieve a sensor value from the DCS value map
149 *
150 * @param dcsAliasMap the retrieved DCS value map
151 * @param stringId the alias name of the desired sensor value
152 * @param value [return parameter] - the extracted sensor value
153 *
154 * @return true if sucessful, else false
155 */
156 Bool_t GetSensorValue(TMap* dcsAliasMap,const char* stringId, Float_t * value) const;
e58fb035 157
158 private:
159 /**
160 * Disabled Standart Constructor
161 */
162 AliHLTPredictionProcessorInterface();
163
164 /**
165 * Disabled Copy constructor
166 * (parent class is disabled so derived class does the same)
167 */
168 AliHLTPredictionProcessorInterface(
169 const AliHLTPredictionProcessorInterface& predictPro);
170
171 /**
172 * Disabled Assignment operator
173 * (parent class is disabled so derived class does the same)
174 */
175 AliHLTPredictionProcessorInterface& operator=(
176 const AliHLTPredictionProcessorInterface& rhs);
177
178 /**
179 * Stores pointer to Pendolino
180 */
bf560255 181 AliHLTPendolino* fpPend; // Stores pointer to Pendolino
e58fb035 182
d1662f64 183 /**
184 * Stores if prediction shall be made
185 */
186 Bool_t fPredict; // flag for prediction making
187
188 /**
189 * Stores the start time of the to process DCS data
190 */
191 UInt_t fStartTime; // Stores the start time of the to process DCS data
192
193 /**
194 * Stores the end time of the to process DCS data
195 */
196 UInt_t fEndTime; // Stores the end time of the to process DCS data
e58fb035 197
d1662f64 198 ClassDef(AliHLTPredictionProcessorInterface, 7);
e58fb035 199
200};
201
202
203
204#endif
205
206