KaliVeda
Toolkit for HIC analysis
KVDetectorSignal.h
1 
4 
5 #ifndef __KVDETECTORSIGNAL_H
6 #define __KVDETECTORSIGNAL_H
7 
8 #include "KVBase.h"
9 #include "KVNameValueList.h"
10 
11 class KVDetector;
12 class KVNumberList;
13 
46 class KVDetectorSignal : public KVBase {
47 
48  const KVDetector* fDetector;
51 
52 protected:
53  void set_value(double x)
54  {
55  fValue = x;
56  }
57 
58 public:
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* = "") override
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  }
126  virtual Bool_t IsFired() const
127  {
132  return fFired;
133  }
134 
135  virtual Bool_t IsValid() const
136  {
138  return kTRUE;
139  }
140 
141  virtual Bool_t IsRaw() const
142  {
144  return kTRUE;
145  }
146 
147  virtual Bool_t IsExpression() const
148  {
150  return kFALSE;
151  }
152 
154  {
156  return kFALSE;
157  }
158  void ls(Option_t* = "") const override;
159 
160  virtual Int_t GetStatus(const TString&) const;
161  virtual Bool_t IsAvailableFor(const KVNameValueList&) const
162  {
169  return kTRUE;
170  }
171 
172  TString GetFullName() const;
173 
174  const Char_t* GetType() const override
175  {
177  return GetName();
178  }
179  void SetType(const Char_t* typ) override
180  {
182  SetName(typ);
183  }
184 
185  ClassDefOverride(KVDetectorSignal, 1) //Data produced by a detector
186 };
187 
188 #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 ClassDefOverride(name, id)
Base class for KaliVeda framework.
Definition: KVBase.h:139
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
virtual Int_t GetStatus(const TString &) const
Override in child classes to report on the 'status' of the signal.
virtual Bool_t IsFired() const
const Char_t * GetType() const override
void ls(Option_t *="") const override
Print compact listing of infos on signal: name/type, associated detector, value.
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
TString GetFullName() const
virtual Bool_t IsAvailableFor(const KVNameValueList &) const
virtual void Reset()
Double_t fValue
signal value
void Clear(Option_t *="") override
void set_value(double x)
void SetType(const Char_t *typ) override
void SetDetector(const KVDetector *d)
const KVDetector * GetDetector() const
void SetFired(Bool_t yes=true)
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Strings used to represent a set of ranges of values.
Definition: KVNumberList.h:85
const char * GetName() const override
virtual void SetName(const char *name)
Double_t x[n]