OscCalcPMNS.cxx
Go to the documentation of this file.
1 #include "OscLib/OscCalcPMNS.h"
2 
3 namespace osc
4 {
5  // --------------------------------------------------------------------------
6  template <typename T>
8  : fMixDirty(true), fDmDirty(true), fPropDirty(true), fPrevAnti(0)
9  {
10  }
11 
12  // --------------------------------------------------------------------------
13  template<typename T>
15  {
16  }
17 
18  // --------------------------------------------------------------------------
19  template <typename T>
21  {
22  return new _OscCalcPMNS<T>(*this);
23  }
24 
25  // --------------------------------------------------------------------------
26  template <typename T>
27  T _OscCalcPMNS<T>::P(int flavBefore, int flavAfter, double E)
28  {
29  const int anti = (flavBefore > 0) ? +1 : -1;
30  assert(flavAfter/anti > 0);
31  if(anti != fPrevAnti) fPropDirty = true;
32 
33  int i = -1, j = -1;
34  if(abs(flavBefore) == 12) i = 0;
35  if(abs(flavBefore) == 14) i = 1;
36  if(abs(flavBefore) == 16) i = 2;
37  if(abs(flavAfter) == 12) j = 0;
38  if(abs(flavAfter) == 14) j = 1;
39  if(abs(flavAfter) == 16) j = 2;
40  assert(i >= 0 && j >= 0);
41 
42  if(fMixDirty){
43  fPMNS.SetMix(this->fTh12, this->fTh23, this->fTh13, this->fdCP);
44  fMixDirty = false;
45  }
46  if(fDmDirty){
47  fPMNS.SetDeltaMsqrs(this->fDmsq21, this->fDmsq32);
48  fDmDirty = false;
49  }
50 
51  if(fPropDirty || E != fPrevE){
52  fPMNS.Reset();
53  // Assume Z/A=0.5
54  const double Ne = this->fRho/2;
55  fPMNS.PropMatter(this->fL, E, Ne, anti);
56 
57  fPropDirty = false;
58  fPrevE = E;
59  fPrevAnti = anti;
60  }
61 
62  return fPMNS.P(i, j);
63  }
64 }
65 
66 //---------------------------------------------------------------------------
67 template class osc::_OscCalcPMNS<double>;
68 
69 #ifdef OSCLIB_STAN
70 #include "stan/math/rev/scal.hpp"
72 #endif
Adapt the PMNS calculator to standard interface.
Definition: StanTypedefs.h:28
void abs(TH1 *hist)
virtual ~_OscCalcPMNS()
Definition: OscCalcPMNS.cxx:14
Float_t E
Definition: plot.C:20
const double j
Definition: BetheBloch.cxx:29
virtual T P(int flavBefore, int flavAfter, double E) override
E in GeV; flavors as PDG codes (so, neg==>antinu)
Definition: OscCalcPMNS.cxx:27
Oscillation probability calculators.
Definition: Calcs.h:5
_PMNS< T > fPMNS
Definition: OscCalcPMNS.h:48
General interface to any calculator that lets you set the parameters.
assert(nhit_max >=nhit_nbins)
double T
Definition: Xdiff_gwt.C:5
virtual _IOscCalcAdjustable< T > * Copy() const override
Definition: OscCalcPMNS.cxx:20