All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FitVars.cxx
Go to the documentation of this file.
2 
3 #include "OscLib/IOscCalc.h"
5 
6 #include <cassert>
7 #include <cmath>
8 
9 namespace ana
10 {
11  //----------------------------------------------------------------------
13  {
14  return osc->GetTh13();
15  }
16 
17  //----------------------------------------------------------------------
18  void FitTheta13::SetValue(osc::IOscCalcAdjustable* osc, double val) const
19  {
20  osc->SetTh13(val);
21  }
22 
23  //----------------------------------------------------------------------
25  {
26  return util::sqr(sin(2*osc->GetTh13()));
27  }
28 
29  //----------------------------------------------------------------------
31  {
32  osc->SetTh13(asin(sqrt(Clamp(val)))/2);
33  }
34 
35  //----------------------------------------------------------------------
37  {
38  double ret = osc->GetdCP()/M_PI;
39 
40  // convert to the range 0-2
41  long long int a = ret/2+1;
42  ret -= 2*a;
43  // Instead of figuring out all the rounding just nudge the last little bit
44  while(ret < 0) ret += 2;
45  while(ret > 2) ret -= 2;
46 
47  return ret;
48  }
49 
50  //----------------------------------------------------------------------
52  {
53  osc->SetdCP(M_PI*val);
54  }
55  //----------------------------------------------------------------------
57  {
58  return osc->GetTh23();
59  }
60 
61  //----------------------------------------------------------------------
62  void FitTheta23::SetValue(osc::IOscCalcAdjustable* osc, double val) const
63  {
64  osc->SetTh23(val);
65  }
66 
67  //----------------------------------------------------------------------
68 
69  //----------------------------------------------------------------------
71  {
72  return util::sqr(sin(osc->GetTh23()));
73  }
74 
75  //----------------------------------------------------------------------
77  {
78  osc->SetTh23(asin(sqrt(Clamp(val))));
79  }
80 
81  //----------------------------------------------------------------------
83  {
84  return util::sqr(sin(2*osc->GetTh23()));
85  }
86 
87  //----------------------------------------------------------------------
89  {
90  osc->SetTh23(asin(sqrt(Clamp(val)))/2);
91  }
92 
93  //----------------------------------------------------------------------
95  {
96  return osc->GetDmsq32();
97  }
98 
99  //----------------------------------------------------------------------
100  void FitDmSq32::SetValue(osc::IOscCalcAdjustable* osc, double val) const
101  {
102  osc->SetDmsq32(Clamp(val));
103  }
104 
105  //----------------------------------------------------------------------
107  {
108  return osc->GetDmsq32()*1000.0;
109  }
110 
111  //----------------------------------------------------------------------
113  {
114  osc->SetDmsq32(Clamp(val/1000.0));
115  }
116 
117  //----------------------------------------------------------------------
119  {
120  return util::sqr(tan(osc->GetTh12()));
121  }
122 
123  //----------------------------------------------------------------------
125  {
126  osc->SetTh12(atan(sqrt(Clamp(val))));
127  }
128 
129  //----------------------------------------------------------------------
131  {
132  return util::sqr(sin(2*osc->GetTh12()));
133  }
134 
135  //----------------------------------------------------------------------
137  {
138  osc->SetTh12(asin(sqrt(Clamp(val)))/2);
139  }
140 
141  //----------------------------------------------------------------------
143  {
144  return osc->GetDmsq21();
145  }
146 
147  //----------------------------------------------------------------------
148  void FitDmSq21::SetValue(osc::IOscCalcAdjustable* osc, double val) const
149  {
150  osc->SetDmsq21(Clamp(val));
151  }
152  //----------------------------------------------------------------------
153  double FitRho::GetValue(const osc::IOscCalcAdjustable* osc) const
154  {
155  return osc->GetRho();
156  }
157 
158  //----------------------------------------------------------------------
159  void FitRho::SetValue(osc::IOscCalcAdjustable* osc, double val) const
160  {
161  osc->SetRho(Clamp(val));
162  }
163 
164 } // namespace
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
Definition: FitVars.cxx:70
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
Definition: FitVars.cxx:30
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
Definition: FitVars.cxx:136
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
Definition: FitVars.cxx:51
process_name opflashCryoW ana
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
Definition: FitVars.cxx:88
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
Definition: FitVars.cxx:12
T sqr(T x)
More efficient square function than pow(x,2)
Definition: MathUtil.h:23
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
Definition: FitVars.cxx:36
process_name gaushit a
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
Definition: FitVars.cxx:62
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
Definition: FitVars.cxx:124
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
Definition: FitVars.cxx:100
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
Definition: FitVars.cxx:148
double Clamp(double val) const
Definition: IFitVar.cxx:31
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
Definition: FitVars.cxx:24
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
Definition: FitVars.cxx:76
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
Definition: FitVars.cxx:18
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
Definition: FitVars.cxx:142
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
Definition: FitVars.cxx:106
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
Definition: FitVars.cxx:153
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
Definition: FitVars.cxx:56
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
Definition: FitVars.cxx:112
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
Definition: FitVars.cxx:94
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
Definition: FitVars.cxx:118
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
Definition: FitVars.cxx:130
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
Definition: FitVars.cxx:82
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
Definition: FitVars.cxx:159