]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/pendolino/PredictionProcessor/HLT/AliHLTPredictionProcessorHLT.h
b0adbcf7573c8ced4d44a473140277bfe45b5991
[u/mrichter/AliRoot.git] / HLT / pendolino / PredictionProcessor / HLT / AliHLTPredictionProcessorHLT.h
1 //-*- Mode: C++ -*-
2 // $Id$
3
4 #ifndef ALI_HLT_PREDICTION_PROCESSOR_HLT_H
5 #define ALI_HLT_PREDICTION_PROCESSOR_HLT_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   AliHLTPredictionProcessorHLT.h
11     @author Gaute Ovrebekk
12     @date   
13     @brief  
14 */
15
16 #include "AliHLTPredictionProcessorInterface.h"
17
18 //new
19 #include <TObjString.h>
20
21
22 /**
23  * Predition Processor for prepering b-field values for general HLT components. 
24  *
25  * @author Sebastian Bablok, Gaute Ovrebekk
26  *
27  * @date 2007-10-24
28  */
29 class AliHLTPredictionProcessorHLT : public AliHLTPredictionProcessorInterface {
30     public:
31         
32                 /**
33                  * Constructor for AliHLTPredictionProcessorHLT
34                  *
35                  * @param detector string defining the detector to which the 
36                  *                      PredictionProcessor belongs to
37                  * @param pendolino pointer to the hosting pendolino (derived from 
38                  *                      AliShuttleInterface)
39                  */
40                 AliHLTPredictionProcessorHLT(const char* detector, 
41                                                 AliHLTPendolino* pendolino);
42
43                 /**
44                  * Destructor for AliHLTPredictionProcessorHLT
45                  */
46                 virtual ~AliHLTPredictionProcessorHLT();
47                 
48                 /**
49                  * Virtual function to force the Prediction Processor to implement
50                  * a function to flag that prediction making is required.
51                  * This function is called by the Pendolino before the fetched DCS data
52                  * is handed in for (prediction) processing.
53                  *
54                  * @param doPrediction if true, prediction making shall be switched on,
55                  *                      if false, switched off.
56                  * 
57                  * @return 0 on success; a value greater than 0 refers to an error
58                  */
59                 virtual UInt_t makePrediction(Bool_t doPrediction = true);
60
61                 /**
62                  * Virtual function, implemented in the detector specific 
63                  * PredictionProcessors to initialize them.
64                  *
65                  * @param run run number
66                  * @param startTime start time of data
67                  * @param endTime end time of data
68                  */
69                 virtual void Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
70
71                 /**
72                  * Function called by the Pendolino for each participating subdetector
73                  * producing the required condition settings. This includes the 
74                  * encoding of a prediction to the values due to the fact, that only 
75                  * data up to now can be fetched from DCS (the latest data can also be 
76                  * up to 2 min old until it is received on HLT side). To write the data
77                  * to the HCDB, the detector specific implementation of this class has 
78                  * to call the appropriated storing function provided by the interface.
79                  *
80                  * @param dcsAliasMap the map containing aliases and corresponding DCS
81                  *                      values and timestamps
82                  *
83                  * @return 0 on success; a value greater than 0 refers to an error
84                  */
85                 virtual UInt_t Process(TMap* dcsAliasMap);
86
87                 /**
88                  * Indicates if DCS data shall be processed.
89                  * NOTE: should always return true, since it is used as prediction 
90                  * processor, which will only process DCS data
91                  *
92                  * @return true if DCS data can be processed, else false. Note: if false
93                  *                              the Pendolino would stop, so make sure that it is true.
94                  */
95                 virtual Bool_t ProcessDCS();
96
97         /**
98          * Function to let the PredictionProcessor produce dummy input data,
99          * that can be used in Pendolino tests, where no DCS Archieve DB is
100          * contacted. This function is called by the Pendolino, the result is
101          * given back to the PredictionProcessor via the Process(...) call.
102          * Since the DCSMaps requested from DCS are detector specific, the
103          * PredictionProcessor should know, how the maps look like, that it
104          * expects.
105          * NOTE: The clean - up (delete) of the TMap will be performed by the
106          * Pendolino after the usage. The PredictionProcessor has never to
107          * call delete on the returned TMap pointer.
108          *
109          * @param aliasName optional parameter, that can be given in order to
110          *          create a DCSMap for dedicated aliases. For a general test
111          *          this paramter should be empty. If more than one alias name
112          *          shall be specified, they are separated by blanks " ".
113          *
114          * @return DCSMap containing dummy data for testing the Pendolino.
115          */
116         virtual TMap* produceTestData(TString aliasName = "");
117
118
119         protected:
120
121         private:
122                 /**
123                  * Disabled Copy constructor 
124                  * (parent class is disabled so derived class does the same)
125                  */
126                 AliHLTPredictionProcessorHLT(
127                                                 const AliHLTPredictionProcessorHLT& predictPro);
128
129                 /**
130                  * Disabled Assignment operator
131                  * (parent class is disabled so derived class does the same)
132                  */
133                 AliHLTPredictionProcessorHLT& operator=(
134                                                 const AliHLTPredictionProcessorHLT& rhs);
135
136                 /**
137                  * Stores if prediction shall be made
138                  */
139                 Bool_t fPredict;  // flag for prediction making
140
141                 /**
142                  * Stores the run number
143                  */
144                 Int_t fRun;  // Stores the run number
145         
146                 /**
147                  * Stores the start time of the to process DCS data
148                  */     
149                 UInt_t fStartTime;  // Stores the start time of the to process DCS data
150         
151                 /**
152                  * Stores the end time of the to process DCS data
153                  */     
154                 UInt_t fEndTime;  // Stores the end time of the to process DCS data
155
156                 ClassDef(AliHLTPredictionProcessorHLT, 2);
157         
158 };
159
160
161 inline Bool_t AliHLTPredictionProcessorHLT::ProcessDCS() {
162         // indicates if DCS values are processed; always true
163         return true;
164 }
165
166 #endif
167
168