]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/pendolino/PredictionProcessor/AliHLTPredictionProcessorInterface.cxx
member array initialization added (Theo)
[u/mrichter/AliRoot.git] / HLT / pendolino / PredictionProcessor / AliHLTPredictionProcessorInterface.cxx
CommitLineData
e58fb035 1// $Id$
2
3//**************************************************************************
4//* This file is property of and copyright by the ALICE HLT Project *
5//* ALICE Experiment at CERN, All rights reserved. *
6//* *
7//* Primary Authors: Sebastian Bablok <Sebastian.Bablok@ift.uib.no> *
8//* for The ALICE HLT Project. *
9//* *
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//**************************************************************************
18
8d3510ac 19/// @file AliHLTPredictionProcessorInterface.cxx
20/// @author Sebastian Bablok
21/// @date
22/// @brief
23///
e58fb035 24
25#include "AliHLTPredictionProcessorInterface.h"
26#include "AliHLTPendolino.h"
d1662f64 27#include "TObjArray.h"
e58fb035 28
29
30ClassImp(AliHLTPredictionProcessorInterface)
31
32AliHLTPredictionProcessorInterface::AliHLTPredictionProcessorInterface(
d1662f64 33 const char* detector, AliHLTPendolino* pendolino)
34 : AliPreprocessor(detector, reinterpret_cast<AliShuttleInterface*>(pendolino))
35 , fpPend(pendolino)
36 , fPredict(kFALSE)
37 , fStartTime(0)
38 , fEndTime(0)
39{
e58fb035 40}
41
42
43AliHLTPredictionProcessorInterface::~AliHLTPredictionProcessorInterface() {
44
45}
46
47Int_t AliHLTPredictionProcessorInterface::GetRunNumber() {
bf560255 48 return fpPend->GetRunNumber();
e58fb035 49}
50
d1662f64 51void AliHLTPredictionProcessorInterface::Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
52{
53 // initializes AliHLTPredictionProcessorHLT
54 if (GetRunNumber()!=run) {
55 Log(Form("run number argument %d differs from pendolino run number %d", run, GetRunNumber()));
56 }
57 fStartTime = startTime;
58 fEndTime = endTime;
59}
e58fb035 60
61Bool_t AliHLTPredictionProcessorInterface::includeAliCDBEntryInList(
62 const TString& entryPath) {
63
425695db 64 return fpPend->IncludeAliCDBEntryInList(entryPath);
e58fb035 65}
66
febad492 67#ifdef HAVE_NOT_ALIDCSVALUE_OPERATORS
d1662f64 68Bool_t AliHLTPredictionProcessorInterface::GetSensorValue(TMap* dcsAliasMap,
69 const char* stringId, Float_t *value) const
70{
71 // extracts the sensor value
72 // return last value read from sensor specified by stringId
73
8d569c91 74 TObject* object=dcsAliasMap->FindObject(stringId);
75 if (!object) return kFALSE;
76 TPair* pair = dynamic_cast<TPair*>(object);
77 if (pair && pair->Value()) {
78 TObjArray* valueSet = dynamic_cast<TObjArray*>(pair->Value());
8d3510ac 79 if (valueSet) {
d1662f64 80 Int_t nentriesDCS = valueSet->GetEntriesFast() - 1;
8d569c91 81 if(nentriesDCS>=0 && valueSet->At(nentriesDCS)){
82 AliDCSValue *val = dynamic_cast<AliDCSValue *>(valueSet->At(nentriesDCS));
83 if (val) {
84 *value=val->GetFloat();
85 return kTRUE;
86 }
d1662f64 87 }
8d3510ac 88 }
d1662f64 89 }
90 return kFALSE;
91}
febad492 92
93Bool_t AliHLTPredictionProcessorInterface::GetSensorValue(TMap* dcsAliasMap,
94 const char* stringId, Bool_t *value) const
95{
96 // extracts the sensor value
97 // return last value read from sensor specified by stringId
98
99 TObject* object=dcsAliasMap->FindObject(stringId);
100 if (!object) return kFALSE;
101 TPair* pair = dynamic_cast<TPair*>(object);
102 if (pair && pair->Value()) {
103 TObjArray* valueSet = dynamic_cast<TObjArray*>(pair->Value());
8d3510ac 104 if (valueSet) {
febad492 105 Int_t nentriesDCS = valueSet->GetEntriesFast() - 1;
106 if(nentriesDCS>=0 && valueSet->At(nentriesDCS)){
107 AliDCSValue *val = dynamic_cast<AliDCSValue *>(valueSet->At(nentriesDCS));
108 if (val) {
109 *value=val->GetBool();
110 return kTRUE;
111 }
112 }
8d3510ac 113 }
febad492 114 }
115 return kFALSE;
116}
117#endif // HAVE_NOT_ALIDCSVALUE_OPERATORS