OscCalcPMNS_NSI.cxx
Go to the documentation of this file.
2 
3 #include <cassert>
4 #include <cstdlib>
5 #include <iostream>
6 #include <iomanip>
7 
8 namespace osc
9 {
11  : fMixDirty(true), fDmDirty(true), fPropDirty(true), fEpsDirty(true), fPrevAnti(0)
12  {
13  }
14 
15  //---------------------------------------------------------------------------
16  // 2016-10-24 - Getting all oscillation parameters (Standard and NSI)
17  std::vector<double> OscCalcPMNS_NSI::GetState() const
18  {
19  std::vector<double> state;
20  state.push_back(fL);
21  state.push_back(fRho);
22  state.push_back(fDmsq21);
23  state.push_back(fDmsq32);
24  state.push_back(fTh12);
25  state.push_back(fTh13);
26  state.push_back(fTh23);
27  state.push_back(fdCP);
28  state.push_back(fEps_ee);
29  state.push_back(fEps_emu);
30  state.push_back(fEps_etau);
31  state.push_back(fEps_mumu);
32  state.push_back(fEps_mutau);
33  state.push_back(fEps_tautau);
34  state.push_back(fDelta_emu);
35  state.push_back(fDelta_etau);
36  state.push_back(fDelta_mutau);
37 
38  return state;
39  }
40  //---------------------------------------------------------------------------
41 
42  //---------------------------------------------------------------------------
43  // 2016-10-24 - Setting all oscillation parameters (Standard and NSI) - or the State
44  void OscCalcPMNS_NSI::SetState(std::vector<double> state)
45  {
46  int iState(0);
47  fMixDirty = true ;
48  SetL(state[iState++]);
49  SetRho(state[iState++]);
50  SetDmsq21(state[iState++]);
51  SetDmsq32(state[iState++]);
52  SetTh12(state[iState++]);
53  SetTh13(state[iState++]);
54  SetTh23(state[iState++]);
55  SetdCP(state[iState++]);
56  SetEps_ee(state[iState++]);
57  SetEps_emu(state[iState++]);
58  SetEps_etau(state[iState++]);
59  SetEps_mumu(state[iState++]);
60  SetEps_mutau(state[iState++]);
61  SetEps_tautau(state[iState++]);
62  SetDelta_emu(state[iState++]);
63  SetDelta_etau(state[iState++]);
64  SetDelta_mutau(state[iState++]);
65  }
66  //---------------------------------------------------------------------------
67 
69  {
70  }
71 
72  double OscCalcPMNS_NSI::P(int flavBefore, int flavAfter, double E)
73  {
74  const int anti = (flavBefore > 0) ? +1 : -1;
75  assert(flavAfter/anti > 0);
76  if(anti != fPrevAnti) fPropDirty = true;
77 
78  int i = -1, j = -1;
79  if(abs(flavBefore) == 12) i = 0;
80  if(abs(flavBefore) == 14) i = 1;
81  if(abs(flavBefore) == 16) i = 2;
82  if(abs(flavAfter) == 12) j = 0;
83  if(abs(flavAfter) == 14) j = 1;
84  if(abs(flavAfter) == 16) j = 2;
85  assert(i >= 0 && j >= 0);
86 
87  if(fMixDirty){
89  fMixDirty = false;
90  }
91  if(fDmDirty){
93  fDmDirty = false;
94  }
95  if(fEpsDirty){
99  fEpsDirty = false;
100  }
101 
102 
104  // Assume Z/A=0.5
105  const double Ne = fRho/2;
106  fPMNS_NSI.PropMatter(fL, E, Ne, anti);
107  return fPMNS_NSI.P(j);
108  }
109 
110  //---------------------------------------------------------------------------
112  {
113  return new OscCalcPMNS_NSI(*this);
114  }
115 
116  //---------------------------------------------------------------------------
118  {
119  const OscCalcPMNS_NSI* calc_nsi = dynamic_cast<const OscCalcPMNS_NSI*>(calc);
120  if(calc_nsi) return calc_nsi;
121  else std::cout << "Input calculator was not of type OscCalcPMNS_NSI." << std::endl;
122  return nullptr; // If the cast failed, calc_nsi should be nullptr anyway (?)
123  }
124 
125  //---------------------------------------------------------------------------
127  {
128  OscCalcPMNS_NSI* calc_nsi = dynamic_cast<OscCalcPMNS_NSI*>(calc);
129  if(calc_nsi) return calc_nsi;
130  else std::cout << "Input calculator was not of type OscCalcPMNS_NSI." << std::endl;
131  return nullptr; // If the cast failed, calc_nsi should be nullptr anyway (?)
132  }
133 
134 } // namespace
virtual void SetRho(double rho) override
Optimized version of OscCalcPMNS.
virtual void SetDmsq32(const double &dmsq32) override
virtual void SetTh13(const double &th13) override
virtual void SetEps_tautau(double eps_tautau)
std::vector< double > GetState() const
virtual void ResetToFlavour(int flv=1)
Definition: PMNSOpt.cxx:368
General interface to oscillation calculators.
Definition: StanTypedefs.h:22
virtual void SetDelta_etau(double Delta_etau)
void abs(TH1 *hist)
virtual void SetTh12(const double &th12) override
osc::OscCalcDumb calc
virtual void SetMix(const T &th12, const T &th23, const T &th13, const T &deltacp)
Definition: PMNSOpt.cxx:97
virtual void SetDeltaMsqrs(const T &dm21, const T &dm32)
Definition: PMNSOpt.cxx:115
virtual void SetL(double L) override
virtual void SetEps_mutau(double eps_mutau)
void SetNSI(double eps_ee, double eps_emu, double eps_etau, double eps_mumu, double eps_mutau, double eps_tautau, double delta_emu=0, double delta_etau=0, double delta_mutau=0)
Definition: PMNS_NSI.cxx:54
Float_t E
Definition: plot.C:20
virtual void SetDelta_mutau(double Delta_mutau)
const double j
Definition: BetheBloch.cxx:29
virtual void SetDelta_emu(double Delta_emu)
virtual void SetEps_mumu(double eps_mumu)
Oscillation probability calculators.
Definition: Calcs.h:5
OStream cout
Definition: OStream.cxx:6
const OscCalcPMNS_NSI * DowncastToNSI(const IOscCalc *calc)
IOscCalcAdjustable * Copy() const override
virtual void SetdCP(const double &dCP) override
void SetState(std::vector< double > state)
virtual void SetEps_ee(double eps_ee)
virtual double P(int flavBefore, int flavAfter, double E) override
E in GeV; flavors as PDG codes (so, neg==>antinu)
virtual void SetEps_emu(double eps_emu)
assert(nhit_max >=nhit_nbins)
virtual void PropMatter(double L, double E, double Ne, int anti=1)
Definition: PMNSOpt.cxx:242
virtual T P(int flv) const
Definition: PMNSOpt.cxx:384
virtual void SetDmsq21(const double &dmsq21) override
virtual void SetTh23(const double &th23) override
virtual void SetEps_etau(double eps_etau)