3 //**************************************************************************
4 //* This file is property of and copyright by the ALICE HLT Project *
5 //* ALICE Experiment at CERN, All rights reserved. *
7 //* Primary Authors: Sebastian Bablok <Sebastian.Bablok@ift.uib.no> *
8 //* for The ALICE HLT Project. *
10 //* Permission to use, copy, modify and distribute this software and its *
11 //* documentation strictly for non-commercial purposes is hereby granted *
12 //* without fee, provided that the above copyright notice appears in all *
13 //* copies and that both the copyright notice and this permission notice *
14 //* appear in the supporting documentation. The authors make no claims *
15 //* about the suitability of this software for any purpose. It is *
16 //* provided "as is" without express or implied warranty. *
17 //**************************************************************************
19 /** @file AliHLTPredictionProcessorDummy.cxx
20 @author Sebastian Bablok
25 #include "AliHLTPredictionProcessorDummy.h"
27 #include <AliCDBMetaData.h>
28 #include <AliCDBEntry.h>
30 #include <TTimeStamp.h>
31 #include <TObjString.h>
32 #include <TObjArray.h>
33 #include <AliDCSValue.h>
35 ClassImp(AliHLTPredictionProcessorDummy)
37 AliHLTPredictionProcessorDummy::AliHLTPredictionProcessorDummy(
38 const char* detector, AliHLTPendolino* pendolino) :
39 AliHLTPredictionProcessorInterface(detector, pendolino),
40 fPredict(false), fRun(0), fStartTime(0), fEndTime(0) {
41 // C-tor of AliHLTPredictionProcessorDummy
45 AliHLTPredictionProcessorDummy::~AliHLTPredictionProcessorDummy() {
46 // D-tor of AliHLTPredictionProcessorDummy
51 UInt_t AliHLTPredictionProcessorDummy::makePrediction(Bool_t doPrediction) {
52 // switches prediction making on or off
53 Log("Prediction switched on");
54 fPredict = doPrediction;
59 void AliHLTPredictionProcessorDummy::Initialize(Int_t run, UInt_t startTime,
61 // initializes AliHLTPredictionProcessorDummy
63 fStartTime = startTime;
66 TString msg("Initialized Dummy PredictProc. Run: ");
68 msg += ", start time: ";
70 msg += ", end time: ";
76 Log("Dummy PredictProc has prediction switched ON.");
78 Log("Prediction is switched OFF.");
83 UInt_t AliHLTPredictionProcessorDummy::Process(TMap* dcsAliasMap) {
84 // processes the handed in DCS value map
87 TString path2("Dummy");
88 TString path3("DCSValley");
90 //test GetFromOCDB() calls
91 AliCDBEntry* entry = GetFromOCDB("Calib", "LocalVdrift");
93 TString msg("AliCDBEntry -> last storage: ");
94 msg += entry->GetLastStorage();
96 entry->PrintMetaData();
98 Log("Error. Cannot retrieve HCDB entry.");
101 entry = GetFromOCDB("Dummy", "DCSValley");
103 TString msg("AliCDBEntry -> last storage: ");
104 msg += entry->GetLastStorage();
106 entry->PrintMetaData();
108 Log("Error. Cannot retrieve HCDB entry.");
111 // test call for non existing object
112 entry = GetFromOCDB("Nix", "Nada");
114 Log("Error: call should failed, but it does NOT!");
116 Log("Tested call for missing CDB entry -> succeeded!");
117 if (!includeAliCDBEntryInList("TPC/Nix/Nada")) {
118 Log("Adding of AliCDBEntry request for 'TPC/Nix/Nada' failed!");
120 Log("Successfully added an AliCDBEntry request (TPC/Nix/Nada).");
126 //TODO test GetRunParameter() calls
128 if (GetHLTStatus()) {
129 Log("HLT status is: ON");
131 Log("ERROR. HLT is OFF.");
135 TString runType("RunType is set to: ");
136 runType += GetRunType();
139 //transform dcsAliasMap to ROOT object
140 TString comment("Beam it up");
142 comment += " with PREDICTION!";
147 AliCDBMetaData meta(this->GetName(), 666, "unknownAliRoot",
150 if (Store(path2.Data(), path3.Data(), (TObject*) dcsAliasMap, &meta, start,
152 Log(" +++ Successfully stored object ;-)");
154 Log(" *** Storing of OBJECT failed!!");
161 TMap* AliHLTPredictionProcessorDummy::produceTestData(TString /*aliasName*/) {
162 // generates test dummy data for AliHLTPredictionProcessorDummy
165 // here has to come real dummy data :-)
166 resultMap = new TMap();
169 TObjString* name = new TObjString("DummyData");
170 AliDCSValue* val = new AliDCSValue(fval, tt.GetTime());
171 TObjArray* arr = new TObjArray();
173 resultMap->Add(name, arr);