KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVACQParam.h
Go to the documentation of this file.
1 #ifndef KVACQPARAM_H
2 #define KVACQPARAM_H
3 
4 #include "KVBase.h"
5 #include "TRef.h"
6 
13 class KVDetector;
14 
15 class KVACQParam: public KVBase {
16 
17 private:
25 
26 public:
27  void init();
28  KVACQParam();
29  KVACQParam(const TString& name, const TString& type = "");
30  KVACQParam(const KVACQParam&);
31  ROOT_COPY_ASSIGN_OP(KVACQParam)
32  virtual ~ KVACQParam() {}
33 
35  {
37  fDet = kd;
38  }
39 
41  {
42  return fDet;
43  }
44  void Clear(Option_t* = "")
45  {
47  SetData((UShort_t) - 1);
48  }
49 
50 
52  {
55  return &fChannel;
56  }
57 
58  void SetData(UShort_t val)
59  {
60  fData = val;
61  if (fChannel)
62  *fChannel = val;
63  }
65  {
68  if (fChannel)
69  return (Short_t)(*fChannel);
70  return (Short_t) fData;
71  }
72  Double_t GetData() const
73  {
79 
80  if (GetCoderData() >= 0)
81  return (Double_t)(GetCoderData()) + gRandom->Uniform(-0.5, 0.5);
82  return -1.;
83  }
84 
85  Bool_t Fired(Option_t* what = "") const
86  {
92 
93  return (what[0] ? ((Float_t)GetCoderData() > fPied) : (GetCoderData() != -1));
94  }
95 
96  void ls(Option_t* option = "") const;
97 
98  void SetPedestal(Float_t ped)
99  {
100  fPied = ped;
101  }
103  {
104  return fPied;
105  }
107  {
108  fDeltaPied = delta;
109  }
111  {
112  return fDeltaPied;
113  }
115  {
116  return &fData;
117  }
118 
119 #if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
120  virtual void Copy(TObject&) const;
121 #else
122  virtual void Copy(TObject&);
123 #endif
124  virtual void Print(Option_t* opt = "") const;
125 
127  {
128  return fWorks;
129  }
130  void SetWorking(Bool_t on = kTRUE)
131  {
133  fWorks = on;
134  }
135 
137  {
138  fNbBits = n;
139  }
141  {
142  return fNbBits;
143  }
145  {
147  fChannel = &fData;
148  }
149 
150  ClassDef(KVACQParam, 4) //Data acquisition parameters read from raw DLT's
151 };
152 
153 #endif
unsigned short UShort_t
unsigned char UChar_t
bool Bool_t
short Short_t
double Double_t
float Float_t
const char Option_t
#define ClassDef(name, id)
R__EXTERN TRandom * gRandom
GANIL VXI/VME acquisition parameter.
Definition: KVACQParam.h:15
void init()
Default initialisations.
Definition: KVACQParam.cpp:57
void ls(Option_t *option="") const
Dump name of parameter, raw coder value, and "randomised" value.
Definition: KVACQParam.cpp:156
void SetPedestal(Float_t ped)
Definition: KVACQParam.h:98
virtual void Print(Option_t *opt="") const
Definition: KVACQParam.cpp:141
UShort_t * GetDataAddress()
Definition: KVACQParam.h:114
Float_t GetDeltaPedestal() const
Definition: KVACQParam.h:110
UShort_t * fChannel
pointer to raw data i.e. value read from coder (channel number)
Definition: KVACQParam.h:18
void SetNbBits(UChar_t n)
Definition: KVACQParam.h:136
UShort_t ** ConnectData()
Definition: KVACQParam.h:51
Short_t GetCoderData() const
Definition: KVACQParam.h:64
Float_t fPied
Pedestal value for the current run.
Definition: KVACQParam.h:21
UChar_t fNbBits
number of bits (<=16) actually used by parameter
Definition: KVACQParam.h:24
void SetWorking(Bool_t on=kTRUE)
Definition: KVACQParam.h:130
void UseInternalDataMember()
Definition: KVACQParam.h:144
UChar_t GetNbBits() const
Definition: KVACQParam.h:140
Bool_t IsWorking() const
Definition: KVACQParam.h:126
UShort_t fData
Dummy used when reading back events from a TTree etc.
Definition: KVACQParam.h:20
Float_t GetPedestal() const
Definition: KVACQParam.h:102
Double_t GetData() const
Definition: KVACQParam.h:72
KVDetector * fDet
Detector associated with this acquisition parameter.
Definition: KVACQParam.h:19
KVDetector * GetDetector() const
Definition: KVACQParam.h:40
Bool_t Fired(Option_t *what="") const
Definition: KVACQParam.h:85
Float_t fDeltaPied
Pedestal correction value for the current run.
Definition: KVACQParam.h:22
void SetDetector(KVDetector *kd)
Definition: KVACQParam.h:34
virtual void Copy(TObject &) const
Definition: KVACQParam.cpp:119
Bool_t fWorks
kFALSE if acquisition parameter was not working
Definition: KVACQParam.h:23
KVACQParam()
default constructor
Definition: KVACQParam.cpp:74
void SetData(UShort_t val)
Definition: KVACQParam.h:58
void Clear(Option_t *="")
Clear object properties : name, type/title, number, label.
Definition: KVACQParam.h:44
void SetDeltaPedestal(Float_t delta)
Definition: KVACQParam.h:106
Base class for KaliVeda framework.
Definition: KVBase.h:135
Base class for detector geometry description, interface to energy-loss calculations.
Definition: KVDetector.h:121
virtual Double_t Uniform(Double_t x1, Double_t x2)
const Int_t n