OscCalculator.h
Go to the documentation of this file.
1 #ifndef OSCCALCULATOR_H
2 #define OSCCALCULATOR_H
3 
4 // //
5 // \file OscCalculator.h //
6 // //
7 // \brief Class with methods for calculating all things //
8 // related to oscillation probabilities. //
9 // \author <rbpatter@caltech.edu> //
10 // //
11 
12 #include "IOscCalculator.h"
13 
14 class TF1;
15 
16 namespace osc
17 {
18 
20  {
21  public:
22  OscCalculator();
23  virtual ~OscCalculator();
24 
25  double P(int flavBefore, int flavAfter, double E);
26 
27  double P_me(double E, bool antinu=false);
28  double P_mm(double E, bool antinu=false);
29  double P_mt(double E, bool antinu=false);
30  double P_ee(double E, bool antinu=false);
31  double P_em(double E, bool antinu=false);
32  double P_et(double E, bool antinu=false);
33  double P_te(double E, bool antinu=false);
34  double P_tm(double E, bool antinu=false);
35  double P_tt(double E, bool antinu=false);
36 
37  double P_null(double, bool) { return 0; }
38 
39  void SetL (double L ) { fL = L; fUpdated = false; }
40  void SetRho (double rho ) { fRho = rho ? rho : 1e-10; fUpdated = false;}
41  void SetDmsq21(double dmsq21) { fDmsq21 = dmsq21; fUpdated = false; }
42  void SetDmsq32(double dmsq32) { fDmsq32 = dmsq32; fUpdated = false; }
43  void SetTh12 (double th12 ) { fTh12 = th12; fUpdated = false; }
44  void SetTh13 (double th13 ) { fTh13 = th13; fUpdated = false; }
45  void SetTh23 (double th23 ) { fTh23 = th23; fUpdated = false; }
46  void SetdCP (double dCP ) { fdCP = dCP; fUpdated = false; }
47 
48  // Get a TF1 for a give channel's P(E). Reconfigurations of
49  // the osc parameters do not require a new TF1. (The TF1 just
50  // accesses the same underlying functions.) Thus, you need
51  // a new OscCalculator if you want two configurations for
52  // the same channel. Having multiple channels (TF1s) from a
53  // single OscCalculator is fine, though.
54  //
55  // NOTE: It's up to you to delete the returned object.
56  TF1 *GetTF1(int flavBefore, int flavAfter);
57 
58  // You shouldn't call this ever. It needs to be public, though,
59  // so TF1 can access it.
60  double P_wrapper(double *x, double *p);
61 
62  //virtual TMD5* GetParamsHash() const override
63  // {
64  // return IOscCalculatorAdjustable::GetParamsHashDefault("OscCalc");
65  //}
66 
67  private:
68  // Update derived parameters when required
69  void UpdateBasic();
70  void UpdateEDep(double E, bool antinu, bool fliptime);
71 
72  double P_internal_ee(double E, bool antinu, bool fliptime);
73  double P_internal_me(double E, bool antinu, bool fliptime);
74  double P_internal_te(double E, bool antinu, bool fliptime);
75  double P_internal_mt(double E, bool antinu, bool fliptime);
76 
77  // Flags
78  bool fUpdated;
79 
80  // Calculated from user parameters once (non-E-dependent)
81  double fDmsq31;
82  double fsin_th12;
83  double fsin_th13;
84  double fsin_th23;
85  double fcos_th12;
86  double fcos_th13;
87  double fcos_th23;
88  double fsin_2th12;
89  double fsin_2th13;
90  double fsin_2th23;
91  double fcos_2th12;
92  double fcos_2th13;
93  double fcos_2th23;
94  double fsin_sq_th12;
95  double fsin_sq_th13;
96  double fsin_sq_th23;
97  double fcos_sq_th12;
98  double fcos_sq_th13;
99  double fcos_sq_th23;
106  double falpha;
107  double fV;
108 
109  // Calculated from user parameters every time (E-dependent)
110  double fA;
111  double fD;
112  double fC12;
113  double fC13;
114  double fdCPproxy;
117 
118  };
119 
120 }
121 
122 #endif
void SetTh12(double th12)
Definition: OscCalculator.h:43
double P_mm(double E, bool antinu=false)
double P_et(double E, bool antinu=false)
void SetTh23(double th23)
Definition: OscCalculator.h:45
double P_null(double, bool)
Definition: OscCalculator.h:37
double P_te(double E, bool antinu=false)
double P_tm(double E, bool antinu=false)
double P(int flavBefore, int flavAfter, double E)
void SetRho(double rho)
Definition: OscCalculator.h:40
void SetDmsq21(double dmsq21)
Definition: OscCalculator.h:41
double P_wrapper(double *x, double *p)
double P_internal_mt(double E, bool antinu, bool fliptime)
virtual ~OscCalculator()
double P_mt(double E, bool antinu=false)
void UpdateEDep(double E, bool antinu, bool fliptime)
double P_tt(double E, bool antinu=false)
double P_internal_me(double E, bool antinu, bool fliptime)
Definition: EarthModel.h:12
p
Definition: test.py:223
TF1 * GetTF1(int flavBefore, int flavAfter)
double P_ee(double E, bool antinu=false)
double P_em(double E, bool antinu=false)
void SetdCP(double dCP)
Definition: OscCalculator.h:46
double P_internal_ee(double E, bool antinu, bool fliptime)
void SetDmsq32(double dmsq32)
Definition: OscCalculator.h:42
void SetTh13(double th13)
Definition: OscCalculator.h:44
list x
Definition: train.py:276
double P_internal_te(double E, bool antinu, bool fliptime)
void SetL(double L)
Definition: OscCalculator.h:39
double P_me(double E, bool antinu=false)