OscCalculatorPMNS.cxx
Go to the documentation of this file.
1 
2 // \file OscCalculatorPMNS.cxx
3 // \brief Source file for PMNS oscillation calculation
4 // \version $Id: OscCalculatorPMNS.cxx,v 1.1 2013/10/17 22:18:11 ljf26 Exp $
5 // \author
6 #include "OscCalculatorPMNS.h"
7 
8 #include <cassert>
9 #include <cstdlib>
10 
11 namespace osc
12 {
14  : fMixDirty(true), fDmDirty(true), fPropDirty(true), fPrevAnti(0)
15  {
16  }
17 
19  {
20  }
21 
22  double OscCalculatorPMNS::P(int flavBefore, int flavAfter, double E)
23  {
24  const int anti = (flavBefore > 0) ? +1 : -1;
25  assert(flavAfter/anti > 0);
26  if(anti != fPrevAnti) fPropDirty = true;
27 
28  int i = -1, j = -1;
29  if(abs(flavBefore) == 12) i = 0;
30  if(abs(flavBefore) == 14) i = 1;
31  if(abs(flavBefore) == 16) i = 2;
32  if(abs(flavAfter) == 12) j = 0;
33  if(abs(flavAfter) == 14) j = 1;
34  if(abs(flavAfter) == 16) j = 2;
35  assert(i >= 0 && j >= 0);
36 
37  if(fMixDirty){
39  fMixDirty = false;
40  }
41  if(fDmDirty){
43  fDmDirty = false;
44  }
45 
46  if(fPropDirty || E != fPrevE){
47  fPMNS.Reset();
48  // Assume Z/A=0.5
49  const double Ne = fRho/2;
50  fPMNS.PropMatter(fL, E, Ne, anti);
51 
52  fPropDirty = false;
53  fPrevE = E;
54  fPrevAnti = anti;
55  }
56 
57  return fPMNS.P(i, j);
58  }
59 } // namespace
void PropMatter(double L, double E, double Ne, int anti)
Definition: PMNS.cxx:432
T abs(T value)
Definition: EarthModel.h:12
void SetDeltaMsqrs(double dm21, double dm32)
Definition: PMNS.cxx:159
void SetMix(double th12, double th23, double th13, double deltacp)
Definition: PMNS.cxx:86
E
Definition: 018_def.c:13
virtual double P(int flavBefore, int flavAfter, double E)
double P(int i, int j) const
Definition: PMNS.cxx:519
void Reset()
Definition: PMNS.cxx:507