1 | #ifndef MARS_MParameters
|
---|
2 | #define MARS_MParameters
|
---|
3 |
|
---|
4 | #ifndef MARS_MParContainer
|
---|
5 | #include "MParContainer.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | class MParameterD : public MParContainer
|
---|
9 | {
|
---|
10 | private:
|
---|
11 | Double_t fVal;
|
---|
12 |
|
---|
13 | public:
|
---|
14 | MParameterD(const char *name=NULL, const char *title=NULL);
|
---|
15 |
|
---|
16 | void SetVal(Double_t v) { fVal = v; }
|
---|
17 | Double_t GetVal() const { return fVal; }
|
---|
18 |
|
---|
19 | void Print(Option_t *o="") const;
|
---|
20 |
|
---|
21 | ClassDef(MParameterD, 1) // Container to hold a generalized parameters (double)
|
---|
22 | };
|
---|
23 |
|
---|
24 | class MParameterDerr : public MParContainer
|
---|
25 | {
|
---|
26 | private:
|
---|
27 | Double_t fVal;
|
---|
28 | Double_t fErr;
|
---|
29 |
|
---|
30 | public:
|
---|
31 | MParameterDerr(const char *name=NULL, const char *title=NULL);
|
---|
32 |
|
---|
33 | void SetVal(Double_t v, Double_t e) { fVal = v; fErr = e; }
|
---|
34 | Double_t GetVal() const { return fVal; }
|
---|
35 | Double_t GetErr() const { return fErr; }
|
---|
36 |
|
---|
37 | void Print(Option_t *o="") const;
|
---|
38 |
|
---|
39 | ClassDef(MParameterDerr, 1) // Container to hold a generalized parameters (double) and its Error
|
---|
40 | };
|
---|
41 |
|
---|
42 | class MParameterI : public MParContainer
|
---|
43 | {
|
---|
44 | private:
|
---|
45 | Int_t fVal;
|
---|
46 |
|
---|
47 | public:
|
---|
48 | MParameterI(const char *name=NULL, const char *title=NULL);
|
---|
49 |
|
---|
50 | void SetVal(Int_t v) { fVal = v; }
|
---|
51 | Int_t GetVal() const { return fVal; }
|
---|
52 |
|
---|
53 | void Print(Option_t *o="") const;
|
---|
54 |
|
---|
55 | ClassDef(MParameterI, 1) // Container to hold a generalized parameters (integer)
|
---|
56 | };
|
---|
57 | /*
|
---|
58 | class MParameters : public MParContainer
|
---|
59 | {
|
---|
60 | private:
|
---|
61 | TObjArray fList;
|
---|
62 | TObjArray fNames;
|
---|
63 |
|
---|
64 | public:
|
---|
65 | MParameters(const char *name=NULL, const char *title=NULL)
|
---|
66 | {
|
---|
67 | fName = name ? name : "MParameters";
|
---|
68 | fTitle = title ? title : "Additional temporary parameters";
|
---|
69 |
|
---|
70 | SetReadyToSave();
|
---|
71 | }
|
---|
72 |
|
---|
73 | MParamaterI &AddInteger(const TString name, const TString title, Int_t val=0)
|
---|
74 | {
|
---|
75 | MParameterI &p = *new MParameterI(name, title);
|
---|
76 | p.SetValue(val);
|
---|
77 |
|
---|
78 | fList.Add(&p);
|
---|
79 |
|
---|
80 | TNamed &n = *new TNamed(name, title);
|
---|
81 | fNames.Add(&n);
|
---|
82 |
|
---|
83 | return p;
|
---|
84 | }
|
---|
85 |
|
---|
86 | MParameterD &AddDouble(const TString name, const TString title, Double_t val=0)
|
---|
87 | {
|
---|
88 | MParameterD &p = *new MParameterD(name, title);
|
---|
89 | p.SetValue(val);
|
---|
90 |
|
---|
91 | fList.Add(&p);
|
---|
92 |
|
---|
93 | TNamed &n = *new TNamed(name, title);
|
---|
94 | fNames.Add(&n);
|
---|
95 |
|
---|
96 | return p;
|
---|
97 | }
|
---|
98 |
|
---|
99 | const TObjArray &GetList()
|
---|
100 | {
|
---|
101 | fList.SetNames(&fNames);
|
---|
102 | return fList;
|
---|
103 | }
|
---|
104 |
|
---|
105 | MParameterD *GetParameterD(const TString &name)
|
---|
106 | {
|
---|
107 | fList.SetNames(&fNames);
|
---|
108 | return (MParamaterD*)fList.FindObject(name);
|
---|
109 | }
|
---|
110 |
|
---|
111 | MParameterI *GetParameterI(const TString &name)
|
---|
112 | {
|
---|
113 | fList.SetNames(&fNames);
|
---|
114 | return (MParameterI*)fList.FindObject(name);
|
---|
115 | }
|
---|
116 |
|
---|
117 | ClassDef(MParameters, 1) // List to hold generalized parameters (MParameterD/I)
|
---|
118 | }
|
---|
119 | */
|
---|
120 | #endif
|
---|