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 
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 
64  virtual Double_t GetValue(const KVNameValueList& params = "") const
65  {
68 
69  IGNORE_UNUSED(params);
70  return fValue;
71  }
72  virtual void SetValue(Double_t x)
73  {
77  if (IsRaw() && !IsExpression()) fValue = x;
78  }
79  virtual void Reset()
80  {
85  SetValue(0);
86  SetFired(false);
87  }
88  void Clear(Option_t* = "") override
89  {
93  Reset();
94  }
95  virtual Double_t GetInverseValue(Double_t out_val, const TString& in_sig, const KVNameValueList& params = "") const
96  {
101 
102  IGNORE_UNUSED(params);
103  if (in_sig == GetName()) return out_val;
104  return 0.;
105  }
106 
107  void SetDetector(const KVDetector* d)
108  {
110  fDetector = d;
111  }
112 
113  const KVDetector* GetDetector() const
114  {
116  return fDetector;
117  }
118  void SetFired(Bool_t yes = true)
119  {
121  fFired = yes;
122  }
123  virtual Bool_t IsFired() const
124  {
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 override;
156 
157  virtual Int_t GetStatus(const TString&) const;
158  virtual Bool_t IsAvailableFor(const KVNameValueList&) const
159  {
166  return kTRUE;
167  }
168 
169  TString GetFullName() const;
170 
171  const Char_t* GetType() const override
172  {
174  return GetName();
175  }
176  void SetType(const Char_t* typ) override
177  {
179  SetName(typ);
180  }
181 
182  ClassDefOverride(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 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 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)
Base class for detector geometry description, interface to energy-loss calculations.
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.
Definition: KVNumberList.h:85
const char * GetName() const override
virtual void SetName(const char *name)
Double_t x[n]