FitVars.cxx
Go to the documentation of this file.
1 #include "CAFAna/Vars/FitVars.h"
2 
4 #include "Utilities/func/MathUtil.h"
5 
6 #include <cassert>
7 #include <cmath>
8 
9 namespace ana
10 {
11  // declared as 'extern' in FitVars.h
27 
28 
29  //----------------------------------------------------------------------
31  {
32  return osc->GetTh13();
33  }
34 
35  //----------------------------------------------------------------------
37  {
38  return osc->SetTh13(val);
39  }
40 
41 //----------------------------------------------------------------------
43  {
44  return util::sqr(sin(2*osc->GetTh13()));
45  }
46 
47  //----------------------------------------------------------------------
49  {
50  osc->SetTh13(asin(sqrt(Clamp(val)))/2);
51  }
52 
53  //----------------------------------------------------------------------
55  {
56  double ret = osc->GetdCP()/M_PI;
57 
58  // convert to the range 0-2
59  long long int a = ret/2+1;
60  ret -= 2*a;
61  // Instead of figuring out all the rounding just nudge the last little bit
62  while(ret < 0) ret += 2;
63  while(ret > 2) ret -= 2;
64 
65  return ret;
66  }
67 
68  //----------------------------------------------------------------------
70  {
71  osc->SetdCP(M_PI*val);
72  }
73 
74  //----------------------------------------------------------------------
76  {
77  return util::sqr(sin(osc->GetTh23()));
78  }
79 
80  //----------------------------------------------------------------------
82  {
83  return util::sqr(sin(osc->GetTh23()));
84  }
85 
86  //----------------------------------------------------------------------
88  {
89  osc->SetTh23(asin(sqrt(this->Clamp(val))));
90  }
91 
92  //----------------------------------------------------------------------
94  {
95  osc->SetTh23(asin(sqrt(this->Clamp(val))));
96  }
97 
98  //----------------------------------------------------------------------
100  {
101  return util::sqr(sin(osc->GetTh23()));
102  }
104  {
105  return util::sqr(sin(osc->GetTh23()));
106  }
107  //----------------------------------------------------------------------
109  {
110  osc->SetTh23(asin(sqrt(this->Clamp(val))));
111  }
112 
113  //----------------------------------------------------------------------
115  {
116  osc->SetTh23(asin(sqrt(this->Clamp(val))));
117  }
118 
119  //----------------------------------------------------------------------
121  {
122  return util::sqr(sin(osc->GetTh23()));
123  }
125  {
126  return util::sqr(sin(osc->GetTh23()));
127  }
128 
129  //----------------------------------------------------------------------
131  {
132  osc->SetTh23(asin(sqrt(this->Clamp(val))));
133  }
134 
135  //----------------------------------------------------------------------
137  {
138  osc->SetTh23(asin(sqrt(this->Clamp(val))));
139  }
140 
141  //----------------------------------------------------------------------
143  {
144  return util::sqr(sin(2*osc->GetTh23()));
145  }
146 
147  //----------------------------------------------------------------------
149  {
150  osc->SetTh23(asin(sqrt(Clamp(val)))/2);
151  }
152 
153  //----------------------------------------------------------------------
155  {
156  return osc->GetDmsq32();
157  }
158 
159  //----------------------------------------------------------------------
161  {
162  osc->SetDmsq32(this->Clamp(val));
163  }
164 
165  //----------------------------------------------------------------------
167  {
168  return osc->GetDmsq32()*1000.0;
169  }
170 
171  //----------------------------------------------------------------------
173  {
174  return osc->GetDmsq32()*1000.0;;
175  }
176 
177  //----------------------------------------------------------------------
179  {
180  osc->SetDmsq32(this->Clamp(val)/1000.0);
181  }
182 
183  //----------------------------------------------------------------------
185  {
186  osc->SetDmsq32(this->Clamp(val)/1000.0);
187  }
188 
189 
190 //----------------------------------------------------------------------
192  {
193  return osc->GetDmsq32();
194  }
195 
196  //---------------------------------------------------------------------
198  {
199  osc->SetDmsq32(Clamp(val));
200  }
201 
202  //---------------------------------------------------------------------
204  {
205  osc->SetDmsq32(Clamp(val)/1000.0);
206  }
207 
208  //--------------------------------------------------------------------
210  {
211  return osc->GetDmsq32()*1000.0;
212  }
213 
214  //---------------------------------------------------------------------
216  {
217  osc->SetDmsq32(Clamp(val)/1000.0);
218  }
219 
220  //--------------------------------------------------------------------
222  {
223  return osc->GetDmsq32()*1000.0;
224  }
225 
226  //---------------------------------------------------------------------
228  {
229  return osc->GetDmsq32();
230  }
231 
232  //---------------------------------------------------------------------
234  {
235  osc->SetDmsq32(Clamp(val));
236  }
237 
238 
239  //----------------------------------------------------------------------
241  {
242  return util::sqr(tan(osc->GetTh12()));
243  }
244 
245  //----------------------------------------------------------------------
247  {
248  osc->SetTh12(atan(sqrt(Clamp(val))));
249  }
250 
251  //----------------------------------------------------------------------
253  {
254  return util::sqr(sin(2*osc->GetTh12()));
255  }
256 
257  //----------------------------------------------------------------------
259  {
260  osc->SetTh12(asin(sqrt(Clamp(val)))/2);
261  }
262 
263  //----------------------------------------------------------------------
265  {
266  return osc->GetDmsq21();
267  }
268 
269  //----------------------------------------------------------------------
271  {
272  osc->SetDmsq21(Clamp(val));
273  }
274 } // namespace
void SetValue(osc::IOscCalculatorAdjustable *osc, double val) const override
Definition: FitVars.cxx:203
const FitSinSq2Theta12 kFitSinSq2Theta12
Definition: FitVars.cxx:25
void SetValue(osc::IOscCalculatorAdjustable *osc, double val) const override
Definition: FitVars.cxx:36
double GetValue(const osc::IOscCalculatorAdjustable *osc) const override
Definition: FitVars.cxx:252
void SetValue(osc::IOscCalculatorAdjustable *osc, double val) const override
Definition: FitVars.cxx:87
virtual T GetDmsq21() const
double GetValue(const osc::IOscCalculatorAdjustable *osc) const override
Definition: FitVars.cxx:191
Cuts and Vars for the 2020 FD DiF Study.
Definition: CutFlow_header.h:5
const FitTheta13 kFitTheta13
Definition: FitVars.cxx:12
const FitDmSq32 kFitDmSq32
Definition: FitVars.cxx:18
const FitDmSq32ScaledNH kFitDmSq32ScaledNH
Definition: FitVars.cxx:21
double GetValue(const osc::IOscCalculatorAdjustable *osc) const override
Definition: FitVars.cxx:54
void SetValue(osc::IOscCalculatorAdjustable *osc, double val) const override
Definition: FitVars.cxx:69
double GetValue(const osc::IOscCalculatorAdjustable *osc) const override
Definition: FitVars.cxx:103
T sqrt(T number)
Definition: d0nt_math.hpp:156
const FitSinSqTheta23UpperOctant kFitSinSqTheta23UpperOctant
Definition: FitVars.cxx:16
void SetValue(osc::IOscCalculatorAdjustable *osc, double val) const override
Definition: FitVars.cxx:197
void SetValue(osc::IOscCalculatorAdjustable *osc, double val) const override
Definition: FitVars.cxx:160
virtual void SetdCP(const T &dCP)=0
virtual void SetDmsq21(const T &dmsq21)=0
T sqr(T x)
More efficient square function than pow(x,2)
Definition: MathUtil.h:23
#define M_PI
Definition: SbMath.h:34
const FitDmSq21 kFitDmSq21
Definition: FitVars.cxx:26
int Clamp(int x)
T atan(T number)
Definition: d0nt_math.hpp:66
void SetValue(osc::IOscCalculatorAdjustable *osc, double val) const override
Definition: FitVars.cxx:270
double GetValue(const osc::IOscCalculatorAdjustable *osc) const override
Definition: FitVars.cxx:209
double GetValue(const osc::IOscCalculatorAdjustable *osc) const override
Definition: FitVars.cxx:75
double GetValue(const osc::IOscCalculatorAdjustable *osc) const override
Definition: FitVars.cxx:30
void SetValue(osc::IOscCalculatorAdjustable *osc, double val) const override
Definition: FitVars.cxx:215
const double a
double GetValue(const osc::IOscCalculatorAdjustable *osc) const override
Definition: FitVars.cxx:154
double GetValue(const osc::IOscCalculatorAdjustable *osc) const override
Definition: FitVars.cxx:166
virtual void SetTh23(const T &th23)=0
virtual void SetDmsq32(const T &dmsq32)=0
void SetValue(osc::IOscCalculatorAdjustable *osc, double val) const override
Definition: FitVars.cxx:178
const FitDmSq32Scaled kFitDmSq32Scaled
Definition: FitVars.cxx:19
Oscillation probability calculators.
Definition: Calcs.h:5
double GetValue(const osc::IOscCalculatorAdjustable *osc) const override
Definition: FitVars.cxx:264
double GetValue(const osc::IOscCalculatorAdjustable *osc) const override
Definition: FitVars.cxx:124
void SetValue(osc::IOscCalculatorAdjustable *osc, double val) const override
Definition: FitVars.cxx:48
const FitDmSq32ScaledIH kFitDmSq32ScaledIH
Definition: FitVars.cxx:22
T sin(T number)
Definition: d0nt_math.hpp:132
double GetValue(const osc::IOscCalculatorAdjustable *osc) const override
Definition: FitVars.cxx:221
void SetValue(osc::IOscCalculatorAdjustable *osc, double val) const override
Definition: FitVars.cxx:108
virtual T GetDmsq32() const
void SetValue(osc::IOscCalculatorAdjustable *osc, double val) const override
Definition: FitVars.cxx:130
const FitSinSqTheta23LowerOctant kFitSinSqTheta23LowerOctant
Definition: FitVars.cxx:17
const FitSinSqTheta23 kFitSinSqTheta23
Definition: FitVars.cxx:15
double GetValue(const osc::IOscCalculatorAdjustable *osc) const override
Definition: FitVars.cxx:42
void SetValue(osc::IOscCalculatorAdjustable *osc, double val) const override
Definition: FitVars.cxx:258
virtual void SetTh13(const T &th13)=0
double GetValue(const osc::IOscCalculatorAdjustable *osc) const override
Definition: FitVars.cxx:227
const FitSinSq2Theta13 kFitSinSq2Theta13
Definition: FitVars.cxx:13
void SetValue(osc::IOscCalculatorAdjustable *osc, double val) const override
Definition: FitVars.cxx:233
const FitDmSq32InvertedHierarchy kFitDmSq32InvertedHierarchy
Definition: FitVars.cxx:23
double GetValue(const osc::IOscCalculatorAdjustable *osc) const override
Definition: FitVars.cxx:240
T tan(T number)
Definition: d0nt_math.hpp:144
void SetValue(osc::IOscCalculatorAdjustable *osc, double val) const override
Definition: FitVars.cxx:148
const FitDeltaInPiUnits kFitDeltaInPiUnits
Definition: FitVars.cxx:14
const FitDmSq32NormalHierarchy kFitDmSq32NormalHierarchy
Definition: FitVars.cxx:20
void SetValue(osc::IOscCalculatorAdjustable *osc, double val) const override
Definition: FitVars.cxx:246
const FitTanSqTheta12 kFitTanSqTheta12
Definition: FitVars.cxx:24
double GetValue(const osc::IOscCalculatorAdjustable *osc) const override
Definition: FitVars.cxx:142
T asin(T number)
Definition: d0nt_math.hpp:60
virtual void SetTh12(const T &th12)=0