All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ana::OscCalcSterileApprox Class Reference

#include <OscCalcSterileApprox.h>

Inheritance diagram for ana::OscCalcSterileApprox:
osc::_IOscCalc< T >

Public Member Functions

virtual double P (int from, int to, double E) override
 
double P_range (int from, int to, double Elo, double Ehi)
 
double P_LoverE (int from, int to, double LElo, double LEhi)
 
virtual OscCalcSterileApproxCopy () const override
 
void SetDmsq (double d)
 
double GetDmsq () const
 
void SetSinSq2ThetaMuMu (double t)
 
double GetSinSq2ThetaMuMu () const
 
void SetSinSq2ThetaMuE (double t)
 
double GetSinSq2ThetaMuE () const
 
void SetSinSq2ThetaEE (double t)
 
double GetSinSq2ThetaEE () const
 
void SetL (double L)
 
double GetL () const
 
TMD5 * GetParamsHash () const override
 

Protected Member Functions

double PFromDelta (int from, int to, double Delta) const
 

Protected Attributes

double fDmsq
 
double fSinSq2ThetaMuMu
 
double fSinSq2ThetaMuE
 
double fSinSq2ThetaEE
 
bool fSinSq2ThetaMuMuSet = false
 
bool fSinSq2ThetaMuESet = false
 
bool fSinSq2ThetaEESet = false
 
double fL
 

Detailed Description

Definition at line 14 of file OscCalcSterileApprox.h.

Member Function Documentation

OscCalcSterileApprox * ana::OscCalcSterileApprox::Copy ( ) const
overridevirtual

Definition at line 252 of file OscCalcSterileApprox.cxx.

253  {
254  OscCalcSterileApprox* ret = new OscCalcSterileApprox;
255 
256  ret->fDmsq = fDmsq;
257  ret->fSinSq2ThetaMuMuSet = fSinSq2ThetaMuMuSet;
258  ret->fSinSq2ThetaMuESet = fSinSq2ThetaMuESet;
259  ret->fSinSq2ThetaEESet = fSinSq2ThetaEESet;
261  ret->fSinSq2ThetaMuMu = fSinSq2ThetaMuMu;
263  ret->fSinSq2ThetaMuE = fSinSq2ThetaMuE;
265  ret->fSinSq2ThetaEE = fSinSq2ThetaEE;
266  ret->fL = fL;
267 
268  return ret;
269  }
double ana::OscCalcSterileApprox::GetDmsq ( ) const
inline

Definition at line 28 of file OscCalcSterileApprox.h.

double ana::OscCalcSterileApprox::GetL ( ) const
inline

Definition at line 41 of file OscCalcSterileApprox.h.

41 {return fL;}
TMD5 * ana::OscCalcSterileApprox::GetParamsHash ( ) const
override

Definition at line 272 of file OscCalcSterileApprox.cxx.

273  {
274  TMD5* ret = new TMD5;
275  const std::string txt = "SterileApprox";
276  ret->Update((unsigned char*)txt.c_str(), txt.size());
277  const int kNumParams = 4;
278  double angles[2] = {0, 0};
279  int angles_set = 0;
280  if(fSinSq2ThetaMuMuSet && angles_set < 2)
281  angles[angles_set++] = fSinSq2ThetaMuMu;
282  if(fSinSq2ThetaMuESet && angles_set < 2)
283  angles[angles_set++] = fSinSq2ThetaMuE;
284  if(fSinSq2ThetaEESet && angles_set < 2)
285  angles[angles_set++] = fSinSq2ThetaEE;
286  double buf[kNumParams] = {fDmsq, angles[0], angles[1], fL};
287  ret->Update((unsigned char*)buf, sizeof(double)*kNumParams);
288  ret->Final();
289  return ret;
290  }
double ana::OscCalcSterileApprox::GetSinSq2ThetaEE ( ) const

Definition at line 24 of file OscCalcSterileApprox.cxx.

25  {
27  if(!fSinSq2ThetaMuMuSet && !fSinSq2ThetaMuESet) return 0;
28 
29  // The three angles are coupled via
30  //
31  // ss2thmm = 4*Um4^2*(1-Um4^2)
32  // ss2thee = 4*Ue4^2*(1-Ue4^2)
33  // ss2thme = 4*Um4^2*Ue4^2
34  //
35  // Solve for the final (nue survival angle). Emperically, choosing the
36  // negative sign in the expression works well.
37 
38  // A couple of limits
39  if(fSinSq2ThetaMuMu <= 0) return fSinSq2ThetaMuE / 4;
40  if(fSinSq2ThetaMuMu >= 1) return fSinSq2ThetaMuE / 2;
41 
42  // General case
43  const double Ue4sq = fSinSq2ThetaMuE/(2*fSinSq2ThetaMuMu)*(1-sqrt(1-fSinSq2ThetaMuMu));
44  assert(!isinf(Ue4sq) && !isnan(Ue4sq));
45  const double sinsq2thetaee = 4.0*Ue4sq*(1-Ue4sq);
46 
47  assert(sinsq2thetaee >= 0 && sinsq2thetaee <= 1);
48 
49  // Cross-check that we actually solved the equations correctly
50  if(Ue4sq > 0){
51  const double Umu4sq = fSinSq2ThetaMuE/(4*Ue4sq);
52  assert(fabs(4*Umu4sq*(1-Umu4sq) - fSinSq2ThetaMuMu) < 1e-6);
53  }
54 
55  return sinsq2thetaee;
56  }
do i e
double ana::OscCalcSterileApprox::GetSinSq2ThetaMuE ( ) const

Definition at line 110 of file OscCalcSterileApprox.cxx.

111  {
113  if(!fSinSq2ThetaMuMuSet && !fSinSq2ThetaEESet) return 0;
114 
115  // The three angles are coupled via
116  //
117  // ss2thmm = 4*Um4^2*(1-Um4^2)
118  // ss2thee = 4*Ue4^2*(1-Ue4^2)
119  // ss2thme = 4*Um4^2*Ue4^2
120  //
121  // Choose 1-sqrt() case instead of 1+sqrt() since in the later
122  // if both ss2thmm and ss2thee are 0 we stil get ss2thme = 1,
123  // which seems wrong.
124 
125  const double Um4sq = 0.5 * (1.0 - std::sqrt(1.0 - fSinSq2ThetaMuMu));
126  const double Ue4sq = 0.5 * (1.0 - std::sqrt(1.0 - fSinSq2ThetaEE));
127 
128  assert(!isinf(Um4sq) && !isnan(Um4sq));
129  assert(!isinf(Ue4sq) && !isnan(Ue4sq));
130  const double sinsq2thetame = 4.0*Um4sq*Ue4sq;
131 
132  assert(sinsq2thetame >= 0 && sinsq2thetame <= 1);
133 
134  return sinsq2thetame;
135  }
double ana::OscCalcSterileApprox::GetSinSq2ThetaMuMu ( ) const

Definition at line 67 of file OscCalcSterileApprox.cxx.

68  {
70  if(!fSinSq2ThetaEESet && !fSinSq2ThetaMuESet) return 0;
71 
72  // The three angles are coupled via
73  //
74  // ss2thmm = 4*Um4^2*(1-Um4^2)
75  // ss2thee = 4*Ue4^2*(1-Ue4^2)
76  // ss2thme = 4*Um4^2*Ue4^2
77  //
78  // Solve for the final (numu survival angle). Emperically, choosing the
79  // negative sign in the expression works well.
80 
81  // A couple of limits
82  if(fSinSq2ThetaEE <= 0) return fSinSq2ThetaMuE / 4;
83  if(fSinSq2ThetaEE >= 1) return fSinSq2ThetaMuE / 2;
84 
85  // General case
86  const double Um4sq = fSinSq2ThetaMuE/(2*fSinSq2ThetaEE)*(1-sqrt(1-fSinSq2ThetaEE));
87  assert(!isinf(Um4sq) && !isnan(Um4sq));
88  const double sinsq2thetamm = 4.0*Um4sq*(1-Um4sq);
89 
90  assert(sinsq2thetamm >= 0 && sinsq2thetamm <= 1);
91 
92  // Cross-check that we actually solved the equations correctly
93  if(Um4sq > 0){
94  const double Ue4sq = fSinSq2ThetaMuE/(4*Um4sq);
95  assert(fabs(4*Ue4sq*(1-Ue4sq) - fSinSq2ThetaEE) < 1e-6);
96  }
97 
98  return sinsq2thetamm;
99  }
do i e
double ana::OscCalcSterileApprox::P ( int  from,
int  to,
double  E 
)
overridevirtual

Definition at line 178 of file OscCalcSterileApprox.cxx.

179  {
180  return P_range(from, to, E, E);
181  }
process_name E
double P_range(int from, int to, double Elo, double Ehi)
double ana::OscCalcSterileApprox::P_LoverE ( int  from,
int  to,
double  LElo,
double  LEhi 
)

Definition at line 232 of file OscCalcSterileApprox.cxx.

234  {
235  if(fDmsq == 0) return (from == to || to == 0) ? 1 : 0;
236 
237  LElo = std::max(0., LElo);
238 
239  LElo *= 1.267*fDmsq;
240  LEhi *= 1.267*fDmsq;
241 
242  if(LElo == LEhi) return PFromDelta(from, to, util::sqr(sin(LElo)));
243 
244  // Average value of sin^2 over the range
245  const double Delta = (.25*(sin(2*LElo) - sin(2*LEhi)) + .5*(LEhi - LElo))/(LEhi-LElo);
246  assert(!isnan(Delta));
247 
248  return PFromDelta(from, to, Delta);
249  }
T sqr(T x)
More efficient square function than pow(x,2)
Definition: MathUtil.h:23
double PFromDelta(int from, int to, double Delta) const
double ana::OscCalcSterileApprox::P_range ( int  from,
int  to,
double  Elo,
double  Ehi 
)

Definition at line 216 of file OscCalcSterileApprox.cxx.

217  {
218  if(Ehi <= 0) return 0;
219 
220  if(fDmsq == 0) return (from == to || to == 0) ? 1 : 0;
221 
222  Elo = std::max(0., Elo);
223 
224  assert(fL != 0);
225  const double Delta = AvgSinSq(1.267*fDmsq*fL, Elo, Ehi);
226  assert(!isnan(Delta));
227 
228  return PFromDelta(from, to, Delta);
229  }
double PFromDelta(int from, int to, double Delta) const
double AvgSinSq(double k, double a, double b)
double ana::OscCalcSterileApprox::PFromDelta ( int  from,
int  to,
double  Delta 
) const
protected

Definition at line 184 of file OscCalcSterileApprox.cxx.

185  {
186  if(abs(from) == 14 && abs(to) == 14){
187  return 1-GetSinSq2ThetaMuMu()*Delta;
188  }
189  else if(abs(from) == 12 && abs(to) == 12){
190  return 1-GetSinSq2ThetaEE()*Delta;
191  }
192  else if(abs(from) == 14 && abs(to) == 12){
193  return GetSinSq2ThetaMuE()*Delta;
194  }
195  else if(abs(from) == 12 && abs(to) == 14){
196  // TODO - this seems reasonable, is it right?
197  return GetSinSq2ThetaMuE()*Delta;
198  }
199  else if(abs(to) == 16){ // no tau appearance
200  return 0;
201  }
202 
203  //Option to return the active fraction
204  else if (abs(from) == 14 && to == 0) {
205  return (1-GetSinSq2ThetaMuMu()*Delta) + (GetSinSq2ThetaMuE()*Delta);
206  }
207  else if (abs(from) == 12 && to == 0) {
208  return (1-GetSinSq2ThetaEE()*Delta) + (GetSinSq2ThetaMuE()*Delta);
209  }
210 
211  std::cout << "OscCalcSterileApprox: P(" << from << ", " << to << ") not implemented" << std::endl;
212  abort();
213  }
T abs(T value)
BEGIN_PROLOG could also be cout
void ana::OscCalcSterileApprox::SetDmsq ( double  d)
inline

Definition at line 27 of file OscCalcSterileApprox.h.

void ana::OscCalcSterileApprox::SetL ( double  L)
inline

Definition at line 40 of file OscCalcSterileApprox.h.

void ana::OscCalcSterileApprox::SetSinSq2ThetaEE ( double  t)
void ana::OscCalcSterileApprox::SetSinSq2ThetaMuE ( double  t)
void ana::OscCalcSterileApprox::SetSinSq2ThetaMuMu ( double  t)

Member Data Documentation

double ana::OscCalcSterileApprox::fDmsq
protected

Definition at line 47 of file OscCalcSterileApprox.h.

double ana::OscCalcSterileApprox::fL
protected

Definition at line 54 of file OscCalcSterileApprox.h.

double ana::OscCalcSterileApprox::fSinSq2ThetaEE
protected

Definition at line 50 of file OscCalcSterileApprox.h.

bool ana::OscCalcSterileApprox::fSinSq2ThetaEESet = false
protected

Definition at line 53 of file OscCalcSterileApprox.h.

double ana::OscCalcSterileApprox::fSinSq2ThetaMuE
protected

Definition at line 49 of file OscCalcSterileApprox.h.

bool ana::OscCalcSterileApprox::fSinSq2ThetaMuESet = false
protected

Definition at line 52 of file OscCalcSterileApprox.h.

double ana::OscCalcSterileApprox::fSinSq2ThetaMuMu
protected

Definition at line 48 of file OscCalcSterileApprox.h.

bool ana::OscCalcSterileApprox::fSinSq2ThetaMuMuSet = false
protected

Definition at line 51 of file OscCalcSterileApprox.h.


The documentation for this class was generated from the following files: