4 #ifndef ALI_HLT_PREDICT_PROC_TEMP_MONITOR_H
5 #define ALI_HLT_PREDICT_PROC_TEMP_MONITOR_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 AliHLTPredicProcTempMonitor.h
11 @author Sebastian Bablok
16 #include "AliHLTPredictionProcessorInterface.h"
18 #include <TObjString.h>
22 * Implementation of an AliHLTPredictionProcessor for monitoring DCS
23 * Temperatur values inside the HLT.
25 * @author Sebastian Bablok
26 * @author Gaute Oevrebekk (extention for B-Field)
31 class AliHLTPredicProcTempMonitor : public AliHLTPredictionProcessorInterface {
34 /** Static const defining path part 2 */
35 static const TString kPath2; // defining path part 2
36 /** Static const defining path part 3 */
37 static const TString kPath3; //defining path part 3
38 /** Static const defining creator of HCDB object */
39 static const TString kCreator; // defining creator of HCDB object
40 /** Static const defining comment for HCDB object */
41 static const TString kComment; // defining comment for HCDB object
42 /** Static const defining aliroot version */
43 static const TString kAliRootVersion; // defining aliroot version
44 /** Static const defining error ret val for storage error */
45 static const UInt_t kUnableToStoreObject; // defining error ret val for storage error
46 // static const TString kAmandaTempSensor;
49 * Constructor for AliHLTPredictionProcessorDummy
51 * @param detector string defining the detector to which the
52 * PredictionProcessor belongs to
53 * @param pendolino pointer to the hosting pendolino (derived from
54 * AliShuttleInterface)
56 AliHLTPredicProcTempMonitor(const char* detector,
57 AliHLTPendolino* pendolino);
60 * Destructor for AliHLTPredictionProcessorDummy
62 virtual ~AliHLTPredicProcTempMonitor();
65 * Pure virtual function to force the Prediction Processor to implement
66 * a function to flag that prediction making is required.
67 * This function is called by the Pendolino before the fetched DCS data
68 * is handed in for (prediction) processing.
70 * @param doPrediction if true, prediction making shall be switched on,
71 * if false, switched off.
73 * @return 0 on success; a value greater than 0 refers to an error
75 virtual UInt_t makePrediction(Bool_t doPrediction = true);
78 * Pure Virtual function, implemented in the detector specific
79 * PredictionProcessors to initialize them.
81 * @param run run number
82 * @param startTime start time of data
83 * @param endTime end time of data
85 virtual void Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
88 * Function called by the Pendolino for each participating subdetector
89 * producing the required condition settings. This includes the
90 * encoding of a prediction to the values due to the fact, that only
91 * data up to now can be fetched from DCS (the latest data can also be
92 * up to 2 min old until it is received on HLT side). To write the data
93 * to the HCDB, the detector specific implementation of this class has
94 * to call the appropriated storing function provided by the interface.
96 * @param dcsAliasMap the map containing aliases and corresponding DCS
97 * values and timestamps
99 * @return 0 on success; a value greater than 0 refers to an error
101 virtual UInt_t Process(TMap* dcsAliasMap);
104 * Indicates if DCS data shall be processed.
105 * NOTE: should always return true, since it is used as prediction
106 * processor, which will only process DCS data
108 * @return true if DCS data can be processed, else false. Note: if false
109 * the Pendolino would stop, so make sure that it is true.
111 virtual Bool_t ProcessDCS();
114 * Function to let the PredictionProcessor produce dummy input data,
115 * that can be used in Pendolino tests, where no DCS Archieve DB is
116 * contacted. This function is called by the Pendolino, the result is
117 * given back to the PredictionProcessor via the Process(...) call.
118 * Since the DCSMaps requested from DCS are detector specific, the
119 * PredictionProcessor should know, how the maps look like, that it
121 * NOTE: The clean - up (delete) of the TMap will be performed by the
122 * Pendolino after the usage. The PredictionProcessor has never to
123 * call delete on the returned TMap pointer.
125 * @param aliasName optional parameter, that can be given in order to
126 * create a DCSMap for dedicated aliases. For a general test
127 * this paramter should be empty. If more than one alias name
128 * shall be specified, they are separated by blanks " ".
130 * @return DCSMap containing dummy data for testing the Pendolino.
132 virtual TMap* produceTestData(TString aliasName = "");
138 * Function to extract the B-Field from the DCS map.
140 * @param dcsAliasMap the DCS map, containing the AliDCSValues
142 * @return 0 in case of success, else an error code
144 UInt_t ExtractBField(TMap* dcsAliasMap);
147 * Function to extract a float AliDCSValue by its name from the DCS map
149 * @param dcsAliasMap the DCS value map
150 * @param stringId the name of the desired AliDCSValue - float
151 * @param value pointer to a float, where the extratced value shall be stored
154 * @return true in case of success, else false
156 Bool_t GetSensorValue(TMap* dcsAliasMap, const char* stringId,
161 * Disabled Copy constructor
162 * (parent class is disabled so derived class does the same)
164 AliHLTPredicProcTempMonitor(
165 const AliHLTPredicProcTempMonitor& predictPro);
168 * Disabled Assignment operator
169 * (parent class is disabled so derived class does the same)
171 AliHLTPredicProcTempMonitor& operator=(
172 const AliHLTPredicProcTempMonitor& rhs);
176 * Function to extract the actual values from the DCSMap
178 * @param inputMap pointer to the DCSMap as input
179 * @param outputMap pointer to the Map where to store the extracted
182 * @return true in case of success, else false
184 // Bool_t extractTempvalues(TMap* inputMap, TMap* outputMap);
187 * Stores if prediction shall be made
189 Bool_t fPredict; // flag for prediction making
192 * Stores the run number
194 Int_t fRun; // Stores the run number
197 * Stores the start time of the to process DCS data
199 UInt_t fStartTime; // Stores the start time of the to process DCS data
202 * Stores the end time of the to process DCS data
204 UInt_t fEndTime; // Stores the end time of the to process DCS data
207 * Stores the extracted B-Field in a TObjString
209 TObjString fBField; // Stores the extracted B-Field in a TObjString
211 /** ClassDef of AliHLTPredicProcTempMonitor for AliRoot */
212 ClassDef(AliHLTPredicProcTempMonitor, 4);
217 inline Bool_t AliHLTPredicProcTempMonitor::ProcessDCS() {
218 // indicates if DCS values are processed; always true