]>
Commit | Line | Data |
---|---|---|
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 | ||
19 | /** @file AliHLTPredictionProcessorInterface.cxx | |
20 | @author Sebastian Bablok | |
21 | @date | |
22 | @brief | |
23 | */ | |
24 | ||
25 | #include "AliHLTPredictionProcessorInterface.h" | |
26 | #include "AliHLTPendolino.h" | |
d1662f64 | 27 | #include "TObjArray.h" |
e58fb035 | 28 | |
29 | ||
30 | ClassImp(AliHLTPredictionProcessorInterface) | |
31 | ||
32 | AliHLTPredictionProcessorInterface::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 | ||
43 | AliHLTPredictionProcessorInterface::~AliHLTPredictionProcessorInterface() { | |
44 | ||
45 | } | |
46 | ||
47 | Int_t AliHLTPredictionProcessorInterface::GetRunNumber() { | |
bf560255 | 48 | return fpPend->GetRunNumber(); |
e58fb035 | 49 | } |
50 | ||
d1662f64 | 51 | void 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 | |
61 | Bool_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 | 68 | Bool_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()); | |
d1662f64 | 79 | Int_t nentriesDCS = valueSet->GetEntriesFast() - 1; |
8d569c91 | 80 | if(nentriesDCS>=0 && valueSet->At(nentriesDCS)){ |
81 | AliDCSValue *val = dynamic_cast<AliDCSValue *>(valueSet->At(nentriesDCS)); | |
82 | if (val) { | |
83 | *value=val->GetFloat(); | |
84 | return kTRUE; | |
85 | } | |
d1662f64 | 86 | } |
87 | } | |
88 | return kFALSE; | |
89 | } | |
febad492 | 90 | |
91 | Bool_t AliHLTPredictionProcessorInterface::GetSensorValue(TMap* dcsAliasMap, | |
92 | const char* stringId, Bool_t *value) const | |
93 | { | |
94 | // extracts the sensor value | |
95 | // return last value read from sensor specified by stringId | |
96 | ||
97 | TObject* object=dcsAliasMap->FindObject(stringId); | |
98 | if (!object) return kFALSE; | |
99 | TPair* pair = dynamic_cast<TPair*>(object); | |
100 | if (pair && pair->Value()) { | |
101 | TObjArray* valueSet = dynamic_cast<TObjArray*>(pair->Value()); | |
102 | Int_t nentriesDCS = valueSet->GetEntriesFast() - 1; | |
103 | if(nentriesDCS>=0 && valueSet->At(nentriesDCS)){ | |
104 | AliDCSValue *val = dynamic_cast<AliDCSValue *>(valueSet->At(nentriesDCS)); | |
105 | if (val) { | |
106 | *value=val->GetBool(); | |
107 | return kTRUE; | |
108 | } | |
109 | } | |
110 | } | |
111 | return kFALSE; | |
112 | } | |
113 | #endif // HAVE_NOT_ALIDCSVALUE_OPERATORS |