KaliVeda  1.12/06
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 
20 class KVDetectorSignal : public KVBase {
21 
24 
25 protected:
26  void set_value(double x)
27  {
28  fValue = x;
29  }
30 
31 public:
33  : KVBase(), fDetector(nullptr), fValue(0)
34  {}
35  KVDetectorSignal(const Char_t* type, const KVDetector* det = nullptr);
36 
38  {}
39 
40  virtual Double_t GetValue(const KVNameValueList& = "") const
41  {
42  return fValue;
43  }
44  virtual void SetValue(Double_t x)
45  {
47  if (IsRaw() && !IsExpression()) set_value(x);
48  }
49  virtual void Reset()
50  {
53  SetValue(0);
54  }
55  virtual Double_t GetInverseValue(Double_t out_val, const TString& in_sig, const KVNameValueList& = "") const
56  {
59 
60  if (in_sig == GetName()) return out_val;
61  return 0.;
62  }
63 
64  void SetDetector(const KVDetector* d)
65  {
66  fDetector = d;
67  }
68 
69  const KVDetector* GetDetector() const
70  {
71  return fDetector;
72  }
73 
74  virtual Bool_t IsValid() const
75  {
76  return kTRUE;
77  }
78 
79  virtual Bool_t IsRaw() const
80  {
83  return kTRUE;
84  }
85 
86  virtual Bool_t IsExpression() const
87  {
89  return kFALSE;
90  }
91 
92  void ls(Option_t* = "") const;
93 
94  virtual Int_t GetStatus(const TString&) const;
95  virtual Bool_t IsAvailableFor(const KVNameValueList&) const
96  {
103  return kTRUE;
104  }
105 
106  ClassDef(KVDetectorSignal, 1) //Data produced by a detector
107 };
108 
109 #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:135
Output signal data produced by a detector.
virtual Double_t GetValue(const KVNameValueList &="") const
virtual Bool_t IsExpression() const
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
const KVDetector * fDetector
associated detector
void ls(Option_t *="") const
virtual Double_t GetInverseValue(Double_t out_val, const TString &in_sig, const KVNameValueList &="") 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
Base class for detector geometry description, interface to energy-loss calculations.
Definition: KVDetector.h:121
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
Double_t x[n]