HYDRA_development_version
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
hmdccalparraw.h
Go to the documentation of this file.
1 #ifndef HMDCCALPARRAW_H
2 #define HMDCCALPARRAW_H
3 
4 #include "TObject.h"
5 #include "TObjArray.h"
6 #include "TString.h"
7 #include "hparset.h"
8 
9 class HMdcCalParTdc : public TObject {
10 protected:
11  Float_t slope; // gain
12  Float_t offset; // offset
13  Float_t slopeErr; // error of gain
14  Float_t offsetErr; // error of offset
15  Int_t slopeMethod; // number of method used to determine the slope
16  Int_t offsetMethod; // number of method used to determine the offset
17 public:
18  HMdcCalParTdc() : slope(1.F), offset(0.F), slopeErr(0.F), offsetErr(0.F),
19  slopeMethod(0), offsetMethod(0) {;}
21  Float_t getSlope() {return slope;}
22  Float_t getOffset() {return offset;}
23  Float_t getSlopeErr() {return slopeErr;}
24  Float_t getOffsetErr() {return offsetErr;}
25  Int_t getSlopeMethod() {return slopeMethod;}
26  Int_t getOffsetMethod() {return offsetMethod;}
27  void fill(Float_t s,Float_t o, Float_t sE,Float_t oE,Int_t sM,Int_t oM)
28  {
29  slope=s;
30  offset=o;
31  slopeErr=sE;
32  offsetErr=oE;
33  slopeMethod=sM;
34  offsetMethod=oM;
35  }
36  void fill(HMdcCalParTdc&);
37  void setSlope(Float_t s) {slope=s;}
38  void setOffset(Float_t o) {offset=o;}
39  void setSlopeErr(Float_t sE){slopeErr=sE;}
40  void setOffsetErr(Float_t oE){offsetErr=oE;}
41  void setSlopeMethod(Int_t sM) {slopeMethod=sM;}
42  void setOffsetMethod(Int_t oM) {offsetMethod=oM;}
43  void clear() {
44  slope =1.F;
45  offset =0.F;
46  slopeErr =0.F;
47  offsetErr =0.F;
48  slopeMethod =0;
49  offsetMethod=0;
50  }
51  ClassDef(HMdcCalParTdc,1) // Tdc level of the MDC calibration parameters
52 };
53 
54 
55 class HMdcCalParMbo : public TNamed {
56 protected:
57  TObjArray *array; // array of pointers of type HMdcCalParTdc
58 public:
59  HMdcCalParMbo(Int_t tdc = 96, const Text_t* name="");
62  return *static_cast<HMdcCalParTdc*>((*array)[i]);
63  }
64  Int_t getSize() {return array->GetEntries();}
65  ClassDef(HMdcCalParMbo,1) // Mbo level of the MDC calibration parameters
66 };
67 
68 
69 class HMdcCalParRawMod : public TObject {
70 protected:
71  TObjArray *array; // array of pointers of type HMdcCalParMbo
72 public:
73  HMdcCalParRawMod(Int_t mbo = 16);
76  return *static_cast<HMdcCalParMbo*>((*array)[i]);
77  }
78  Int_t getSize() {return array->GetEntries();}
79  void createMbo(Int_t, Int_t, const Char_t*);
80  ClassDef(HMdcCalParRawMod,1) // Module level of the MDC calibration parameters
81 };
82 
83 
84 class HMdcCalParRawSec : public TObject {
85 protected:
86  TObjArray* array; // array of pointers of type HMdcCalParRawMod
87 
88 public:
89  HMdcCalParRawSec(Int_t mod = 4);
92  return *static_cast<HMdcCalParRawMod*>((*array)[i]);
93  }
94  Int_t getSize() {return array->GetEntries();}
95  ClassDef(HMdcCalParRawSec,1) // Sector level of the MDC calibration parameters
96 };
97 
98 
99 class HMdcCalParRaw : public HParSet {
100 protected:
101  TObjArray* array; // array of pointers of type HMdcCalParRawSec
102 public:
103  HMdcCalParRaw(const Char_t* name="MdcCalParRaw",
104  const Char_t* title="raw calibration parameters for Mdc",
105  const Char_t* context="MdcCalParRawProduction",
106  Int_t n=6);
107  ~HMdcCalParRaw();
109  return *static_cast<HMdcCalParRawSec*>((*array)[i]);
110  }
111  Int_t getSize() {return array->GetEntries();}
112  Bool_t init(HParIo*, Int_t*);
113  Int_t write(HParIo*);
114  void readline(const Char_t*, Int_t*);
115  void putAsciiHeader(TString&);
116  Bool_t writeline(Char_t*, Int_t, Int_t, Int_t, Int_t);
117  void clear();
118  void printParam();
119  ClassDef(HMdcCalParRaw,2) // Container for the MDC calibration parameters on raw level
120 };
121 
122 #endif /*!HMDCCALPARRAW_H*/
123 
HMdcCalParRawMod & operator[](Int_t i)
Definition: hmdccalparraw.h:91
HMdcCalParRawMod(Int_t mbo=16)
TObjArray * array
Definition: hmdccalparraw.h:57
Float_t getOffsetErr()
Definition: hmdccalparraw.h:24
Int_t getSize()
Definition: hmdccalparraw.h:64
Int_t offsetMethod
Definition: hmdccalparraw.h:16
Float_t getOffset()
Definition: hmdccalparraw.h:22
Float_t offsetErr
Definition: hmdccalparraw.h:14
void fill(Float_t s, Float_t o, Float_t sE, Float_t oE, Int_t sM, Int_t oM)
Definition: hmdccalparraw.h:27
Int_t n
TObjArray * array
Definition: hmdccalparraw.h:71
Bool_t writeline(Char_t *, Int_t, Int_t, Int_t, Int_t)
Float_t getSlopeErr()
Definition: hmdccalparraw.h:23
void setSlopeMethod(Int_t sM)
Definition: hmdccalparraw.h:41
Definition: hpario.h:11
Int_t getSlopeMethod()
Definition: hmdccalparraw.h:25
HMdcCalParMbo & operator[](Int_t i)
Definition: hmdccalparraw.h:75
virtual Int_t write()
Definition: hparset.cc:119
void createMbo(Int_t, Int_t, const Char_t *)
TObjArray * array
Definition: hmdccalparraw.h:86
HMdcCalParMbo(Int_t tdc=96, const Text_t *name="")
void readline(const Char_t *, Int_t *)
Float_t slopeErr
Definition: hmdccalparraw.h:13
Definition: hparset.h:9
HMdcCalParRawSec(Int_t mod=4)
TObjArray * array
Float_t getSlope()
Definition: hmdccalparraw.h:21
void setOffsetErr(Float_t oE)
Definition: hmdccalparraw.h:40
Int_t getOffsetMethod()
Definition: hmdccalparraw.h:26
Float_t offset
Definition: hmdccalparraw.h:12
HMdcCalParTdc & operator[](Int_t i)
Definition: hmdccalparraw.h:61
HMdcCalParRawSec & operator[](Int_t i)
void setSlopeErr(Float_t sE)
Definition: hmdccalparraw.h:39
void putAsciiHeader(TString &)
void setSlope(Float_t s)
Definition: hmdccalparraw.h:37
HMdcCalParRaw(const Char_t *name="MdcCalParRaw", const Char_t *title="raw calibration parameters for Mdc", const Char_t *context="MdcCalParRawProduction", Int_t n=6)
void setOffsetMethod(Int_t oM)
Definition: hmdccalparraw.h:42
void setOffset(Float_t o)
Definition: hmdccalparraw.h:38
virtual Bool_t init(void)
Definition: hparset.h:21