KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVDetectorSignal.h
1
3
4
5#ifndef __KVDETECTORSIGNAL_H
6#define __KVDETECTORSIGNAL_H
7
8#include "KVBase.h"
9#include "KVNameValueList.h"
10
11class KVDetector;
12class KVNumberList;
13
46class KVDetectorSignal : public KVBase {
47
51
52protected:
53 void set_value(double x)
54 {
55 fValue = x;
56 }
57
58public:
60 : KVBase(), fDetector(nullptr), fValue(0), fFired(false)
61 {}
62 KVDetectorSignal(const Char_t* type, const KVDetector* det = nullptr);
63
65 {}
66
67 virtual Double_t GetValue(const KVNameValueList& params = "") const
68 {
71
72 IGNORE_UNUSED(params);
73 return fValue;
74 }
75 virtual void SetValue(Double_t x)
76 {
80 if (IsRaw() && !IsExpression()) fValue = x;
81 }
82 virtual void Reset()
83 {
88 SetValue(0);
89 SetFired(false);
90 }
91 void Clear(Option_t* = "")
92 {
96 Reset();
97 }
98 virtual Double_t GetInverseValue(Double_t out_val, const TString& in_sig, const KVNameValueList& params = "") const
99 {
104
105 IGNORE_UNUSED(params);
106 if (in_sig == GetName()) return out_val;
107 return 0.;
108 }
109
110 void SetDetector(const KVDetector* d)
111 {
113 fDetector = d;
114 }
115
116 const KVDetector* GetDetector() const
117 {
119 return fDetector;
120 }
121 void SetFired(Bool_t yes = true)
122 {
124 fFired = yes;
125 }
127 {
129 return fFired;
130 }
131
132 virtual Bool_t IsValid() const
133 {
135 return kTRUE;
136 }
137
138 virtual Bool_t IsRaw() const
139 {
141 return kTRUE;
142 }
143
144 virtual Bool_t IsExpression() const
145 {
147 return kFALSE;
148 }
149
151 {
153 return kFALSE;
154 }
155 void ls(Option_t* = "") const;
156
157 virtual Int_t GetStatus(const TString&) const;
159 {
166 return kTRUE;
167 }
168
169 TString GetFullName() const;
170
171 const Char_t* GetType() const
172 {
174 return GetName();
175 }
176 void SetType(const Char_t* typ)
177 {
179 SetName(typ);
180 }
181
182 ClassDef(KVDetectorSignal, 1) //Data produced by a detector
183};
184
185#endif
int Int_t
#define d(i)
bool Bool_t
char Char_t
constexpr Bool_t kFALSE
double Double_t
constexpr Bool_t kTRUE
const char Option_t
#define ClassDef(name, id)
Base class for KaliVeda framework.
Definition KVBase.h:142
Base class for output signal data produced by a detector.
Bool_t fFired
set for raw parameters when read from raw data
virtual Bool_t IsExpression() const
virtual Double_t GetInverseValue(Double_t out_val, const TString &in_sig, const KVNameValueList &params="") const
void Clear(Option_t *="")
virtual Int_t GetStatus(const TString &) const
Override in child classes to report on the 'status' of the signal.
virtual ~KVDetectorSignal()
virtual void SetValue(Double_t x)
virtual Bool_t IsRaw() const
virtual Bool_t IsValid() const
virtual Bool_t GetValueNeedsExtraParameters() const
const KVDetector * fDetector
associated detector
virtual Double_t GetValue(const KVNameValueList &params="") const
void ls(Option_t *="") const
Print compact listing of infos on signal: name/type, associated detector, value.
void SetType(const Char_t *typ)
TString GetFullName() const
Bool_t IsFired() const
virtual Bool_t IsAvailableFor(const KVNameValueList &) const
virtual void Reset()
Double_t fValue
signal value
void set_value(double x)
void SetDetector(const KVDetector *d)
const Char_t * GetType() const
void SetFired(Bool_t yes=true)
const KVDetector * GetDetector() const
Base class for detector geometry description.
Definition KVDetector.h:160
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Strings used to represent a set of ranges of values.
const char * GetName() const override
virtual void SetName(const char *name)
Double_t x[n]