All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OscCalcSterileApprox.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "OscLib/IOscCalc.h"
4 
5 namespace ana
6 {
7  enum class SterileOscAngles {
8  kNone = 0,
10  kSinSq2ThetaMuE = (1 << 1),
11  kSinSq2ThetaEE = (1 << 2)
12  };
13 
15  {
16  public:
17  // if flavAfter == 0, give the active fraction
18  virtual double P(int from, int to, double E) override;
19  double P_range(int from, int to, double Elo, double Ehi);
20 
21  double P_LoverE(int from, int to, double LElo, double LEhi);
22 
23  using osc::IOscCalc::P;
24 
25  virtual OscCalcSterileApprox* Copy() const override;
26 
27  void SetDmsq(double d) {fDmsq = d;}
28  double GetDmsq() const {return fDmsq;}
29 
30  void SetSinSq2ThetaMuMu(double t);
31  double GetSinSq2ThetaMuMu() const;
32 
33  void SetSinSq2ThetaMuE(double t);
34  double GetSinSq2ThetaMuE() const;
35 
36  void SetSinSq2ThetaEE(double t);
37  double GetSinSq2ThetaEE() const;
38 
39  // TODO - potentially remove L in the brave new L/E future
40  void SetL(double L) {fL = L;}
41  double GetL() const {return fL;}
42 
43  TMD5* GetParamsHash() const override;
44  protected:
45  double PFromDelta(int from, int to, double Delta) const;
46 
47  double fDmsq;
51  bool fSinSq2ThetaMuMuSet = false;
52  bool fSinSq2ThetaMuESet = false;
53  bool fSinSq2ThetaEESet = false;
54  double fL;
55  };
56 
58  {
59  public:
61 
62  virtual double P(int from, int to, double E) override
63  {
64  return calc.P(from, to, E);
65  }
66 
67  using osc::IOscCalc::P;
68 
69  virtual OscCalcSterileApproxAdjustable* Copy() const override
70  {
71  auto ret = new OscCalcSterileApproxAdjustable;
72  auto c = calc.Copy();
73  ret->calc = *c;
74  delete c;
75  return ret;
76  }
77 
78  virtual void SetL (double L ) override {calc.SetL(L);}
79  virtual void SetRho (double rho ) override {}
80  virtual void SetDmsq21(const double& dmsq21) override {}
81  virtual void SetDmsq32(const double& dmsq32) override {}
82  virtual void SetTh12 (const double& th12 ) override {}
83  virtual void SetTh13 (const double& th13 ) override {}
84  virtual void SetTh23 (const double& th23 ) override {}
85  virtual void SetdCP (const double& dCP ) override {}
86 
87  TMD5* GetParamsHash() const override {return calc.GetParamsHash();}
88  };
89 
91  {
92  int a_int = static_cast<int>(a);
93  int b_int = static_cast<int>(b);
94  return static_cast<SterileOscAngles>(a_int | b_int);
95  }
96 
98  {
99  int a_int = static_cast<int>(a);
100  int b_int = static_cast<int>(b);
101  return static_cast<SterileOscAngles>(a_int & b_int);
102  }
103 
105 
106  const OscCalcSterileApprox* DowncastToSterileApprox(const osc::IOscCalc* calc, bool allowFail = false);
107  OscCalcSterileApprox* DowncastToSterileApprox(osc::IOscCalc* calc, bool allowFail = false);
108 }
virtual void SetTh23(const double &th23) override
virtual void SetL(double L) override
double P_LoverE(int from, int to, double LElo, double LEhi)
const OscCalcSterileApprox * DowncastToSterileApprox(const osc::IOscCalc *calc, bool allowFail)
Fitter::Precision operator|(Fitter::Precision a, Fitter::Precision b)
Definition: Fit.h:199
virtual void SetTh12(const double &th12) override
process_name E
process_name opflashCryoW ana
process_name gaushit a
virtual double P(int from, int to, double E) override
double PFromDelta(int from, int to, double Delta) const
OscCalcSterileApproxAdjustable * DefaultSterileApproxCalc(SterileOscAngles angles)
SterileOscAngles operator&(const SterileOscAngles a, const SterileOscAngles b)
virtual OscCalcSterileApprox * Copy() const override
virtual void SetdCP(const double &dCP) override
virtual double P(int from, int to, double E) override
virtual void SetDmsq21(const double &dmsq21) override
double P_range(int from, int to, double Elo, double Ehi)
virtual void SetDmsq32(const double &dmsq32) override
virtual void SetRho(double rho) override
TMD5 * GetParamsHash() const override
virtual void SetTh13(const double &th13) override
virtual OscCalcSterileApproxAdjustable * Copy() const override