All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FitVarsSterile.cxx
Go to the documentation of this file.
2 
3 #include "OscLib/IOscCalc.h"
4 #include "OscLib/OscCalcSterile.h"
6 
7 #include <cassert>
8 #include <cmath>
9 
10 namespace ana
11 {
12 
13  //---------------------------------------------------------------------------
15  {
16  const osc::IOscCalcSterile* sterile = osc::DowncastToSterile(osc);
17  double dm221 = sterile->GetDm(2);
18  double dm231 = sterile->GetDm(3);
19  return dm231 - dm221;
20  }
21 
22  //---------------------------------------------------------------------------
24  {
25  osc::IOscCalcSterile* sterile = osc::DowncastToSterile(osc);
26  double dm221 = sterile->GetDm(2);
27  double dm231 = val + dm221;
28  sterile->SetDm(3, dm231);
29  }
30 
31  //---------------------------------------------------------------------------
33  {
34  return osc::DowncastToSterile(osc)->GetDm(4);
35  }
36 
37  //---------------------------------------------------------------------------
39  {
40  osc::DowncastToSterile(osc)->SetDm(4, val);
41  }
42 
43  //---------------------------------------------------------------------------
45  {
46  const osc::IOscCalcSterile* sterile = osc::DowncastToSterile(osc);
47  double dm241 = sterile->GetDm(4);
48  double dm231 = sterile->GetDm(3);
49  return dm241 - dm231;
50  }
51 
52  //---------------------------------------------------------------------------
54  {
55  osc::IOscCalcSterile* sterile = osc::DowncastToSterile(osc);
56  double dm231 = sterile->GetDm(3);
57  double dm241 = val + dm231;
58  sterile->SetDm(4, dm241);
59  }
60 
61  //----------------------------------------------------------------------
63  {
64  const osc::IOscCalcSterile* sterile = osc::DowncastToSterile(osc);
65  double ret = sterile->GetDelta(1, 3)/M_PI;
66  while(ret < 0) ret += 2;
67  while(ret > 2) ret -= 2;
68  return ret;
69  }
70 
71  //----------------------------------------------------------------------
73  {
74  osc::DowncastToSterile(osc)->SetDelta(1, 3, M_PI*val);
75  }
76 
77  //----------------------------------------------------------------------
79  {
80  const osc::IOscCalcSterile* sterile = osc::DowncastToSterile(osc);
81  double ret = sterile->GetDelta(1, 4)/M_PI;
82  while(ret < 0) ret += 2;
83  while(ret > 2) ret -= 2;
84  return ret;
85  }
86 
87  //----------------------------------------------------------------------
89  {
90  osc::DowncastToSterile(osc)->SetDelta(1, 4, M_PI*val);
91  }
92 
93  //----------------------------------------------------------------------
95  {
96  const osc::IOscCalcSterile* sterile = osc::DowncastToSterile(osc);
97  double ret = sterile->GetDelta(2, 4)/M_PI;
98  while(ret < 0) ret += 2;
99  while(ret > 2) ret -= 2;
100  return ret;
101  }
102 
103  //----------------------------------------------------------------------
105  {
106  osc::DowncastToSterile(osc)->SetDelta(2, 4, M_PI*val);
107  }
108 
109  //---------------------------------------------------------------------------
111  {
112  return osc::DowncastToSterile(osc)->GetAngle(1,3);
113  }
114 
115  //----------------------------------------------------------------------
117  {
118  osc::DowncastToSterile(osc)->SetAngle(1, 3, Clamp(val));
119  }
120 
121  //----------------------------------------------------------------------
123  {
124  return util::sqr(sin(osc::DowncastToSterile(osc)->GetAngle(1,3)));
125  }
126 
127  //----------------------------------------------------------------------
129  {
130  osc::DowncastToSterile(osc)->SetAngle(1, 3, asin(sqrt(Clamp(val))));
131  }
132 
133  //---------------------------------------------------------------------------
135  {
136  return osc::DowncastToSterile(osc)->GetAngle(2,3);
137  }
138 
139  //----------------------------------------------------------------------
141  {
142  osc::DowncastToSterile(osc)->SetAngle(2, 3, Clamp(val));
143  }
144 
145  //----------------------------------------------------------------------
147  {
148  return util::sqr(sin(osc::DowncastToSterile(osc)->GetAngle(2,3)));
149  }
150 
151  //----------------------------------------------------------------------
153  {
154  osc::DowncastToSterile(osc)->SetAngle(2, 3, asin(sqrt(Clamp(val))));
155  }
156 
157  //---------------------------------------------------------------------------
159  {
160  return osc::DowncastToSterile(osc)->GetAngle(1,4);
161  }
162 
163  //----------------------------------------------------------------------
165  {
166  osc::DowncastToSterile(osc)->SetAngle(1, 4, Clamp(val));
167  }
168 
169  //----------------------------------------------------------------------
171  {
172  return util::sqr(sin(osc::DowncastToSterile(osc)->GetAngle(1,4)));
173  }
174 
175  //----------------------------------------------------------------------
177  {
178  osc::DowncastToSterile(osc)->SetAngle(1, 4, asin(sqrt(Clamp(val))));
179  }
180 
181  //----------------------------------------------------------------------
183  {
184  return util::sqr(sin(2*osc::DowncastToSterile(osc)->GetAngle(1,4)));
185  }
186 
187  //----------------------------------------------------------------------
189  {
190  osc::DowncastToSterile(osc)->SetAngle(1,4, asin(sqrt(Clamp(val)))/2);
191  }
192 
193  //---------------------------------------------------------------------------
195  {
196  return osc::DowncastToSterile(osc)->GetAngle(2,4);
197  }
198 
199  //----------------------------------------------------------------------
201  {
202  osc::DowncastToSterile(osc)->SetAngle(2, 4, Clamp(val));
203  }
204 
205  //----------------------------------------------------------------------
207  {
208  return util::sqr(sin(osc::DowncastToSterile(osc)->GetAngle(2,4)));
209  }
210 
211  //----------------------------------------------------------------------
213  {
214  osc::DowncastToSterile(osc)->SetAngle(2, 4, asin(sqrt(Clamp(val))));
215  }
216 
217  //----------------------------------------------------------------------
219  {
220  return util::sqr(sin(2*osc::DowncastToSterile(osc)->GetAngle(2,4)));
221  }
222 
223  //----------------------------------------------------------------------
225  {
226  osc::DowncastToSterile(osc)->SetAngle(2,4, asin(sqrt(Clamp(val)))/2);
227  }
228 
229  //---------------------------------------------------------------------------
231  {
232  return osc::DowncastToSterile(osc)->GetAngle(3,4);
233  }
234 
235  //----------------------------------------------------------------------
237  {
238  osc::DowncastToSterile(osc)->SetAngle(3, 4, Clamp(val));
239  }
240 
241  //----------------------------------------------------------------------
243  {
244  return util::sqr(sin(osc::DowncastToSterile(osc)->GetAngle(3,4)));
245  }
246 
247  //----------------------------------------------------------------------
249  {
250  osc::DowncastToSterile(osc)->SetAngle(3, 4, asin(sqrt(Clamp(val))));
251  }
252 
253  //----------------------------------------------------------------------
255  {
256  return util::sqr(sin(2*osc::DowncastToSterile(osc)->GetAngle(3,4)));
257  }
258 
259  //----------------------------------------------------------------------
261  {
262  osc::DowncastToSterile(osc)->SetAngle(3,4, asin(sqrt(Clamp(val)))/2);
263  }
264 
265  //---------------------------------------------------------------------------
267  {
268  return TMath::RadToDeg()*osc::DowncastToSterile(osc)->GetAngle(1,3);
269  }
270 
271  //----------------------------------------------------------------------
273  {
274  osc::DowncastToSterile(osc)->SetAngle(1, 3, TMath::DegToRad()*Clamp(val));
275  }
276 
277  //---------------------------------------------------------------------------
279  {
280  return TMath::RadToDeg()*osc::DowncastToSterile(osc)->GetAngle(2,3);
281  }
282 
283  //----------------------------------------------------------------------
285  {
286  osc::DowncastToSterile(osc)->SetAngle(2, 3, TMath::DegToRad()*Clamp(val));
287  }
288 
289  //---------------------------------------------------------------------------
291  {
292  return TMath::RadToDeg()*osc::DowncastToSterile(osc)->GetAngle(1,4);
293  }
294 
295  //----------------------------------------------------------------------
297  {
298  osc::DowncastToSterile(osc)->SetAngle(1, 4, TMath::DegToRad()*Clamp(val));
299  }
300 
301  //---------------------------------------------------------------------------
303  {
304  return TMath::RadToDeg()*osc::DowncastToSterile(osc)->GetAngle(2,4);
305  }
306 
307  //----------------------------------------------------------------------
309  {
310  osc::DowncastToSterile(osc)->SetAngle(2, 4, TMath::DegToRad()*Clamp(val));
311  }
312 
313  //---------------------------------------------------------------------------
315  {
316  return TMath::RadToDeg()*osc::DowncastToSterile(osc)->GetAngle(3,4);
317  }
318 
319  //----------------------------------------------------------------------
321  {
322  osc::DowncastToSterile(osc)->SetAngle(3, 4, TMath::DegToRad()*Clamp(val));
323  }
324 
325 } // namespace
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
process_name opflashCryoW ana
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
T sqr(T x)
More efficient square function than pow(x,2)
Definition: MathUtil.h:23
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
double Clamp(double val) const
Definition: IFitVar.cxx:31
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const
virtual void SetValue(osc::IOscCalcAdjustable *osc, double val) const
virtual double GetValue(const osc::IOscCalcAdjustable *osc) const