KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVDetectorSignal.h
Go to the documentation of this file.
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 
45 class KVDetectorSignal : public KVBase {
46 
50 
51 protected:
52  void set_value(double x)
53  {
54  fValue = x;
55  }
56 
57 public:
59  : KVBase(), fDetector(nullptr), fValue(0), fFired(false)
60  {}
61  KVDetectorSignal(const Char_t* type, const KVDetector* det = nullptr);
62 
64  {}
65 
66  virtual Double_t GetValue(const KVNameValueList& params = "") const
67  {
70 
71  IGNORE_UNUSED(params);
72  return fValue;
73  }
74  virtual void SetValue(Double_t x)
75  {
79  if (IsRaw() && !IsExpression()) fValue = x;
80  }
81  virtual void Reset()
82  {
87  SetValue(0);
88  SetFired(false);
89  }
90  void Clear(Option_t* = "")
91  {
95  Reset();
96  }
97  virtual Double_t GetInverseValue(Double_t out_val, const TString& in_sig, const KVNameValueList& params = "") const
98  {
103 
104  IGNORE_UNUSED(params);
105  if (in_sig == GetName()) return out_val;
106  return 0.;
107  }
108 
109  void SetDetector(const KVDetector* d)
110  {
112  fDetector = d;
113  }
114 
115  const KVDetector* GetDetector() const
116  {
118  return fDetector;
119  }
120  void SetFired(Bool_t yes = true)
121  {
123  fFired = yes;
124  }
125  Bool_t IsFired() const
126  {
128  return fFired;
129  }
130 
131  virtual Bool_t IsValid() const
132  {
134  return kTRUE;
135  }
136 
137  virtual Bool_t IsRaw() const
138  {
140  return kTRUE;
141  }
142 
143  virtual Bool_t IsExpression() const
144  {
146  return kFALSE;
147  }
148 
150  {
152  return kFALSE;
153  }
154  void ls(Option_t* = "") const;
155 
156  virtual Int_t GetStatus(const TString&) const;
157  virtual Bool_t IsAvailableFor(const KVNameValueList&) const
158  {
165  return kTRUE;
166  }
167 
168  TString GetFullName() const;
169 
170  const Char_t* GetType() const
171  {
173  return GetName();
174  }
175  void SetType(const Char_t* typ)
176  {
178  SetName(typ);
179  }
180 
181  ClassDef(KVDetectorSignal, 1) //Data produced by a detector
182 };
183 
184 #endif
int Int_t
#define d(i)
char Char_t
const Bool_t kFALSE
bool Bool_t
double Double_t
const Bool_t kTRUE
const char Option_t
#define ClassDef(name, id)
Base class for KaliVeda framework.
Definition: KVBase.h:141
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 *="")
Clear object properties : name, type/title, number, label.
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
const Char_t * GetType() 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 KVDetector * GetDetector() const
void SetFired(Bool_t yes=true)
Base class for detector geometry description.
Definition: KVDetector.h:159
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:83
virtual const char * GetName() const
virtual void SetName(const char *name)
Double_t x[n]