1 /**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * All rights reserved. *
6 * Artur Szostak <artursz@iafrica.com> *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
20 /// @file AliHLTPredictionProcessorMCH.cxx
21 /// @author Artur Szostak <artursz@iafrica.com>
23 /// @brief Implementation of the AliHLTPredictionProcessorMCH class.
26 #include "AliHLTPredictionProcessorMCH.h"
27 #include "AliCDBMetaData.h"
28 #include "AliCDBEntry.h"
31 #include <TTimeStamp.h>
32 #include <TObjString.h>
33 #include <TObjArray.h>
34 #include <AliDCSValue.h>
36 ClassImp(AliHLTPredictionProcessorMCH);
39 AliHLTPredictionProcessorMCH::AliHLTPredictionProcessorMCH(
40 const char* detector, AliHLTPendolino* pendolino
42 AliHLTPredictionProcessorInterface(detector, pendolino),
45 /// The class constructor for the preprocessor.
46 /// @param detector The detector name, which must be "MCH".
47 /// @param pendolino A valid pointer to the pendolino instance.
49 if (strcmp(detector, "MCH") != 0)
51 Log(Form("Warning: Setting the detector name to an incorrect value = '%s'."
52 " It must be set to 'MCH'.", detector)
58 AliHLTPredictionProcessorMCH::~AliHLTPredictionProcessorMCH()
60 /// Default destructor.
64 UInt_t AliHLTPredictionProcessorMCH::makePrediction(Bool_t doPrediction)
66 /// This function is called by the Pendolino before the fetched DCS data
67 /// is handed in for (prediction) processing.
69 /// @param doPrediction If true then preprocessed data will be extrapolated
70 /// to the current time. Otherwise no extrapolation will be
71 /// performed if false. The default is to perform extrapolations.
73 /// @return Currently always returns 0 for success.
75 fPredict = doPrediction;
80 void AliHLTPredictionProcessorMCH::Initialize(
81 Int_t run, UInt_t startTime, UInt_t endTime
84 /// Performs initialisation of the preprocessor.
85 /// At the moment just basic sanity checks are performed.
87 /// @param run The current run number.
88 /// @param startTime The start time (earliest timestamp) of the data.
89 /// @param endTime The end time (latest timestamp) of the data.
91 if (startTime > endTime)
92 Log("Error: start time is greater than end time.");
94 AliPreprocessor::Initialize(run, startTime, endTime);
97 Log("Prediction is switched ON.");
99 Log("Prediction is switched OFF.");
103 UInt_t AliHLTPredictionProcessorMCH::Process(TMap* /*dcsAliasMap*/)
105 /// Process the DCS values.
106 /// At the moment nothing is done here.
108 /// @param dcsAliasMap The map containing aliases and corresponding DCS
109 /// values and timestamps
111 /// @return At the moment 0 is always returned for success.
113 Log("Processing MCH");
117 TMap* AliHLTPredictionProcessorMCH::produceTestData(TString /*aliasName*/) {
120 // here has to come real dummy data :-)
121 resultMap = new TMap();
124 TObjString* name = new TObjString("DummyData");
125 AliDCSValue* val = new AliDCSValue(fval, tt.GetTime());
126 TObjArray* arr = new TObjArray();
128 resultMap->Add(name, arr);