Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
osc::OscCalcSterileTrivial Class Reference

Version of OscCalcSterile that always returns probability of 1. More...

#include "/cvmfs/nova.opensciencegrid.org/externals/osclib/v00.07/src/OscLib/OscCalcSterile.h"

Inheritance diagram for osc::OscCalcSterileTrivial:
osc::OscCalcSterile osc::_IOscCalcAdjustable< double > osc::_IOscCalc< T >

Public Member Functions

 OscCalcSterileTrivial ()
 
 OscCalcSterileTrivial (const OscCalcSterile &calc)
 
 OscCalcSterileTrivial (const OscCalcSterileTrivial &calc)
 
virtual ~OscCalcSterileTrivial ()
 
virtual IOscCalcAdjustableCopy () const override
 
virtual double P (int flavBefore, int flavAfter, double E) override
 E in GeV; flavors as PDG codes (so, neg==>antinu) More...
 
void SetNFlavors (int nflavors)
 
virtual Eigen::Array< T, Eigen::Dynamic, 1 > P (int flavBefore, int flavAfter, const std::vector< double > &E)
 
virtual Eigen::Array< T, Eigen::Dynamic, 1 > P (int flavBefore, int flavAfter, const Eigen::ArrayXd &E)
 
virtual void SetL (double L) override
 
virtual void SetRho (double rho) override
 
void SetAngle (int i, int j, double th)
 
void SetDelta (int i, int j, double delta)
 
void SetDm (int i, double dm)
 
void SetState (std::vector< double > state)
 
int GetNFlavors () const
 
double GetL () const override
 
double GetRho () const override
 
double GetDm (int i) const
 
double GetAngle (int i, int j) const
 
double GetDelta (int i, int j) const
 
std::vector< double > GetState () const
 
virtual TMD5 * GetParamsHash () const override
 Use to check two calculators are in the same state. More...
 
virtual double GetDmsq21 () const
 
virtual double GetDmsq32 () const
 
virtual double GetTh12 () const
 
virtual double GetTh13 () const
 
virtual double GetTh23 () const
 
virtual double GetdCP () const
 
virtual void InvalidateCache ()
 Invalidate any caching used internally by the calculator. More...
 

Protected Member Functions

virtual void SetDmsq21 (const double &dmsq21) override
 
virtual void SetDmsq32 (const double &dmsq32) override
 
virtual void SetTh12 (const double &th12) override
 
virtual void SetTh13 (const double &th13) override
 
virtual void SetTh23 (const double &th23) override
 
virtual void SetdCP (const double &dCP) override
 
TMD5 * GetParamsHashDefault (const std::string &txt) const
 This is only a safe implementation if your calculator only depends on these eight parameters. More...
 

Protected Attributes

PMNS_SterilefPMNS_Sterile
 
int fNFlavors
 
double fRho
 
bool fDirty
 
double fPrevE
 
int fPrevAnti
 
int fPrevFlavBefore
 
double fL
 
double fDmsq21
 
double fDmsq32
 
double fTh12
 
double fTh13
 
double fTh23
 
double fdCP
 

Detailed Description

Version of OscCalcSterile that always returns probability of 1.

Definition at line 76 of file OscCalcSterile.h.

Constructor & Destructor Documentation

osc::OscCalcSterileTrivial::OscCalcSterileTrivial ( )

Definition at line 192 of file OscCalcSterile.cxx.

Referenced by Copy().

193  : OscCalcSterile()
194  {}
osc::OscCalcSterileTrivial::OscCalcSterileTrivial ( const OscCalcSterile calc)

Definition at line 197 of file OscCalcSterile.cxx.

References osc::OscCalcSterile::GetState(), osc::OscCalcSterile::SetState(), and makeDatasetsPage::state.

200  {
201  std::vector<double> state = calc.GetState();
202  SetState(state);
203  }
void SetState(std::vector< double > state)
osc::OscCalcDumb calc
osc::OscCalcSterileTrivial::OscCalcSterileTrivial ( const OscCalcSterileTrivial calc)

Definition at line 206 of file OscCalcSterile.cxx.

References osc::OscCalcSterile::GetState(), osc::OscCalcSterile::SetState(), and makeDatasetsPage::state.

209  {
210  std::vector<double> state = calc.GetState();
211  SetState(state);
212  }
void SetState(std::vector< double > state)
osc::OscCalcDumb calc
virtual osc::OscCalcSterileTrivial::~OscCalcSterileTrivial ( )
inlinevirtual

Member Function Documentation

IOscCalcAdjustable * osc::OscCalcSterileTrivial::Copy ( ) const
overridevirtual

Reimplemented from osc::OscCalcSterile.

Definition at line 215 of file OscCalcSterile.cxx.

References OscCalcSterileTrivial().

216  {
217  return new OscCalcSterileTrivial(*this);
218  }
double osc::OscCalcSterile::GetAngle ( int  i,
int  j 
) const
inlineinherited
virtual double osc::_IOscCalcAdjustable< double >::GetdCP ( ) const
inlinevirtualinherited

Reimplemented in osc::OscCalcCPT.

Definition at line 95 of file IOscCalc.h.

95 { return fdCP ; }
double osc::OscCalcSterile::GetDelta ( int  i,
int  j 
) const
inlineinherited
double osc::OscCalcSterile::GetDm ( int  i) const
inlineinherited
virtual double osc::_IOscCalcAdjustable< double >::GetDmsq21 ( ) const
inlinevirtualinherited

Reimplemented in osc::OscCalcCPT.

Definition at line 90 of file IOscCalc.h.

90 { return fDmsq21 ; }
virtual double osc::_IOscCalcAdjustable< double >::GetDmsq32 ( ) const
inlinevirtualinherited

Reimplemented in osc::OscCalcCPT.

Definition at line 91 of file IOscCalc.h.

91 { return fDmsq32 ; }
double osc::OscCalcSterile::GetL ( ) const
inlineoverridevirtualinherited

Reimplemented from osc::_IOscCalcAdjustable< double >.

Definition at line 49 of file OscCalcSterile.h.

References osc::_IOscCalcAdjustable< double >::fL.

Referenced by ana::ToEigenSterile().

49 { return fL; }
int osc::OscCalcSterile::GetNFlavors ( ) const
inlineinherited

Definition at line 48 of file OscCalcSterile.h.

References osc::OscCalcSterile::fPMNS_Sterile, and osc::PMNS_Sterile::GetNFlavors().

48 { return fPMNS_Sterile->GetNFlavors(); }
PMNS_Sterile * fPMNS_Sterile
virtual int GetNFlavors() const
Getters.
Definition: PMNS_Sterile.h:57
TMD5 * osc::OscCalcSterile::GetParamsHash ( ) const
overridevirtualinherited

Use to check two calculators are in the same state.

Returns
Null means not implemented for this calculator

Reimplemented from osc::_IOscCalc< T >.

Reimplemented in osc::OscCalcSterileBeam.

Definition at line 59 of file OscCalcSterile.cxx.

References osc::OscCalcSterile::GetState(), runNovaSAM::ret, and string.

Referenced by osc::OscCalcSterile::GetDelta().

60  {
61  TMD5* ret = new TMD5;
62  std::string txt = "PMNSSterile";
63  ret->Update((unsigned char*)txt.c_str(), txt.size());
64  std::vector<double> buf = GetState();
65  ret->Update((unsigned char*)&buf[0], sizeof(double)*buf.size());
66  ret->Final();
67  return ret;
68  }
std::vector< double > GetState() const
enum BeamMode string
TMD5* osc::_IOscCalcAdjustable< double >::GetParamsHashDefault ( const std::string txt) const
protectedinherited

This is only a safe implementation if your calculator only depends on these eight parameters.

Parameters
txtA string to uniquely identify your calculator class

Referenced by osc::OscCalcGeneral::GetParamsHash(), osc::OscCalcPMNS_CPT::GetParamsHash(), and osc::OscCalc::GetParamsHash().

double osc::OscCalcSterile::GetRho ( ) const
inlineoverridevirtualinherited

Reimplemented from osc::_IOscCalcAdjustable< double >.

Definition at line 50 of file OscCalcSterile.h.

References osc::OscCalcSterile::fRho.

50 { return fRho; }
std::vector< double > osc::OscCalcSterile::GetState ( ) const
inherited

Definition at line 17 of file OscCalcSterile.cxx.

References osc::_IOscCalcAdjustable< double >::fL, osc::OscCalcSterile::fNFlavors, osc::OscCalcSterile::fRho, osc::OscCalcSterile::GetAngle(), osc::OscCalcSterile::GetDelta(), osc::OscCalcSterile::GetDm(), MECModelEnuComparisons::i, calib::j, and makeDatasetsPage::state.

Referenced by osc::OscCalcSterile::GetDelta(), osc::OscCalcSterile::GetParamsHash(), osc::OscCalcSterile::OscCalcSterile(), OscCalcSterileTrivial(), and ana::SaveTo().

18  {
19  std::vector<double> state;
20  state.push_back((double)fNFlavors);
21  state.push_back(fL);
22  state.push_back(fRho);
23  for(int i = 2; i <= fNFlavors; ++i) state.push_back(GetDm(i));
24  for(int j = 2; j <= fNFlavors; ++j) {
25  for(int i = 1; i < j; ++i) {
26  state.push_back(GetAngle(i, j));
27  if(i+1 != j) state.push_back(GetDelta(i, j));
28  }
29  }
30  return state;
31  }
double GetDelta(int i, int j) const
const double j
Definition: BetheBloch.cxx:29
double GetDm(int i) const
double GetAngle(int i, int j) const
virtual double osc::_IOscCalcAdjustable< double >::GetTh12 ( ) const
inlinevirtualinherited

Reimplemented in osc::OscCalcCPT.

Definition at line 92 of file IOscCalc.h.

92 { return fTh12 ; }
virtual double osc::_IOscCalcAdjustable< double >::GetTh13 ( ) const
inlinevirtualinherited

Reimplemented in osc::OscCalcCPT.

Definition at line 93 of file IOscCalc.h.

93 { return fTh13 ; }
virtual double osc::_IOscCalcAdjustable< double >::GetTh23 ( ) const
inlinevirtualinherited

Reimplemented in osc::OscCalcCPT.

Definition at line 94 of file IOscCalc.h.

94 { return fTh23 ; }
virtual void osc::_IOscCalcAdjustable< double >::InvalidateCache ( )
inlinevirtualinherited

Invalidate any caching used internally by the calculator.

Some calculators use a cache that can become stale in ways that the calculator may not know about (e.g., Stan var clearing). Default implementation does nothing.

Definition at line 102 of file IOscCalc.h.

References string.

102 {};
template<class T >
Eigen::Array< T, Eigen::Dynamic, 1 > osc::_IOscCalc< T >::P ( int  flavBefore,
int  flavAfter,
const std::vector< double > &  E 
)
virtualinherited

Default implementation forwards to non-vector version using a simple loop. Override if your calculator has a more efficient implementation.

Reimplemented in osc::analytic::_OscCalc< T >, osc::OscCalcPMNSOptEigen, and osc::_OscCalcDMP< T >.

Definition at line 27 of file IOscCalc.cxx.

References MECModelEnuComparisons::i, osc::_IOscCalc< T >::P(), runNovaSAM::ret, and submit_hadd::u.

Referenced by osc::_IOscCalc< T >::P().

28  {
29  Eigen::Matrix<T,Eigen::Dynamic,1> ret(E.size());
30  for(auto i = 0u; i < E.size(); i++) {
31  ret(i) = this->P(flavBefore, flavAfter, E[i]);
32  }
33  return ret.array().isNaN().select(0, ret);
34  }
Float_t E
Definition: plot.C:20
virtual T P(int flavBefore, int flavAfter, double E)=0
E in GeV; flavors as PDG codes (so, neg==>antinu)
template<class T >
Eigen::Array< T, Eigen::Dynamic, 1 > osc::_IOscCalc< T >::P ( int  flavBefore,
int  flavAfter,
const Eigen::ArrayXd &  E 
)
virtualinherited

Default implementation forawrds to vector<double> version. Override if your calculator has a more efficient implementation.

Reimplemented in osc::analytic::_OscCalc< T >.

Definition at line 37 of file IOscCalc.cxx.

References P.

38  {
39  return P(flavBefore, flavAfter, std::vector<double>(&E[0], &E[0]+E.size()));
40  }
Float_t E
Definition: plot.C:20
virtual T P(int flavBefore, int flavAfter, double E)=0
E in GeV; flavors as PDG codes (so, neg==>antinu)
double osc::OscCalcSterileTrivial::P ( int  flavBefore,
int  flavAfter,
double  E 
)
overridevirtual

E in GeV; flavors as PDG codes (so, neg==>antinu)

Reimplemented from osc::OscCalcSterile.

Definition at line 221 of file OscCalcSterile.cxx.

222  {
223  return 1;
224  }
void osc::OscCalcSterile::SetAngle ( int  i,
int  j,
double  th 
)
inherited

Definition at line 92 of file OscCalcSterile.cxx.

References osc::OscCalcSterile::fDirty, osc::OscCalcSterile::fPMNS_Sterile, and osc::PMNS_Sterile::SetAngle().

Referenced by BlessedPlotsAna(), BlessedPlotsAnaByPeriod(), FitSystEffectsAna(), LOverEPlot(), MiniBooNEParameters(), PlotNus17Prediction(), ana::PredictionSterile::PredictUnoscillated(), ResetAngles(), ana::ResetSterileCalcToDefault(), SetAngles(), SetCalcParam(), SetFakeSignalParams(), SetNus20Params(), osc::OscCalcSterile::SetRho(), osc::OscCalcSterile::SetState(), ana::FitTheta13Sterile::SetValue(), ana::FitSinSqTheta13Sterile::SetValue(), ana::FitSinSq2Theta13Sterile::SetValue(), ana::FitTheta23Sterile::SetValue(), ana::FitSinSqTheta23Sterile::SetValue(), ana::FitTheta14Sterile::SetValue(), ana::FitSinSqTheta14Sterile::SetValue(), ana::FitTheta24Sterile::SetValue(), ana::FitSinSqTheta24Sterile::SetValue(), ana::FitTheta34Sterile::SetValue(), ana::FitSinSqTheta34Sterile::SetValue(), ana::FitTheta13InDegreesSterile::SetValue(), ana::FitTheta23InDegreesSterile::SetValue(), ana::FitTheta14InDegreesSterile::SetValue(), ana::FitTheta24InDegreesSterile::SetValue(), ana::FitTheta34InDegreesSterile::SetValue(), sterile_demo(), SterileOscillator(), and SystsOscParamAna().

93  {
94  fDirty = true;
95  fPMNS_Sterile->SetAngle(i, j, th);
96  }
virtual void SetAngle(int i, int j, double th)
PMNS_Sterile * fPMNS_Sterile
const double j
Definition: BetheBloch.cxx:29
void osc::OscCalcSterile::SetdCP ( const double &  dCP)
overrideprotectedvirtualinherited

Implements osc::_IOscCalcAdjustable< double >.

Definition at line 148 of file OscCalcSterile.cxx.

References ana::assert(), om::cerr, and allTimeWatchdog::endl.

149  {
150  std::cerr << "Must use SetDelta!" << std::endl;
151  assert(false);
152  }
OStream cerr
Definition: OStream.cxx:7
assert(nhit_max >=nhit_nbins)
void osc::OscCalcSterile::SetDelta ( int  i,
int  j,
double  delta 
)
inherited
void osc::OscCalcSterile::SetDm ( int  i,
double  dm 
)
inherited
void osc::OscCalcSterile::SetDmsq21 ( const double &  dmsq21)
overrideprotectedvirtualinherited

Implements osc::_IOscCalcAdjustable< double >.

Definition at line 113 of file OscCalcSterile.cxx.

References ana::assert(), om::cerr, and allTimeWatchdog::endl.

114  {
115  std::cerr << "Must use SetDm!" << std::endl;
116  assert(false);
117  }
OStream cerr
Definition: OStream.cxx:7
assert(nhit_max >=nhit_nbins)
void osc::OscCalcSterile::SetDmsq32 ( const double &  dmsq32)
overrideprotectedvirtualinherited

Implements osc::_IOscCalcAdjustable< double >.

Definition at line 120 of file OscCalcSterile.cxx.

References ana::assert(), om::cerr, and allTimeWatchdog::endl.

121  {
122  std::cerr << "Must use SetDm!" << std::endl;
123  assert(false);
124  }
OStream cerr
Definition: OStream.cxx:7
assert(nhit_max >=nhit_nbins)
virtual void osc::OscCalcSterile::SetL ( double  L)
inlineoverridevirtualinherited
void osc::OscCalcSterile::SetNFlavors ( int  nflavors)
inherited
virtual void osc::OscCalcSterile::SetRho ( double  rho)
inlineoverridevirtualinherited
void osc::OscCalcSterile::SetState ( std::vector< double >  state)
inherited

Definition at line 34 of file OscCalcSterile.cxx.

References osc::OscCalcSterile::fDirty, osc::OscCalcSterile::fNFlavors, MECModelEnuComparisons::i, calib::j, osc::OscCalcSterile::SetAngle(), osc::OscCalcSterile::SetDelta(), osc::OscCalcSterile::SetDm(), osc::OscCalcSterile::SetL(), osc::OscCalcSterile::SetNFlavors(), and osc::OscCalcSterile::SetRho().

Referenced by osc::OscCalcSterile::OscCalcSterile(), OscCalcSterileTrivial(), and osc::OscCalcSterile::SetRho().

35  {
36  int iState(0);
37  fDirty = true ;
38  SetNFlavors((int)state[iState++]);
39  SetL(state[iState++]);
40  SetRho(state[iState++]);
41  for (int i = 2; i <= fNFlavors; ++i) SetDm(i, state[iState++]);
42  for(int j = 2; j <= fNFlavors; ++j) {
43  for(int i = 1; i < j; ++i) {
44  SetAngle(i, j, state[iState++]);
45  if(i+1 != j) SetDelta(i, j, state[iState++]);
46  }
47  }
48  }
void SetNFlavors(int nflavors)
void SetDelta(int i, int j, double delta)
const double j
Definition: BetheBloch.cxx:29
void SetAngle(int i, int j, double th)
void SetDm(int i, double dm)
virtual void SetL(double L) override
virtual void SetRho(double rho) override
void osc::OscCalcSterile::SetTh12 ( const double &  th12)
overrideprotectedvirtualinherited

Implements osc::_IOscCalcAdjustable< double >.

Definition at line 127 of file OscCalcSterile.cxx.

References ana::assert(), om::cerr, and allTimeWatchdog::endl.

128  {
129  std::cerr << "Must use SetAngle!" << std::endl;
130  assert(false);
131  }
OStream cerr
Definition: OStream.cxx:7
assert(nhit_max >=nhit_nbins)
void osc::OscCalcSterile::SetTh13 ( const double &  th13)
overrideprotectedvirtualinherited

Implements osc::_IOscCalcAdjustable< double >.

Definition at line 134 of file OscCalcSterile.cxx.

References ana::assert(), om::cerr, and allTimeWatchdog::endl.

135  {
136  std::cerr << "Must use SetAngle!" << std::endl;
137  assert(false);
138  }
OStream cerr
Definition: OStream.cxx:7
assert(nhit_max >=nhit_nbins)
void osc::OscCalcSterile::SetTh23 ( const double &  th23)
overrideprotectedvirtualinherited

Implements osc::_IOscCalcAdjustable< double >.

Definition at line 141 of file OscCalcSterile.cxx.

References ana::assert(), om::cerr, and allTimeWatchdog::endl.

142  {
143  std::cerr << "Must use SetAngle!" << std::endl;
144  assert(false);
145  }
OStream cerr
Definition: OStream.cxx:7
assert(nhit_max >=nhit_nbins)

Member Data Documentation

double osc::_IOscCalcAdjustable< double >::fdCP
protectedinherited
bool osc::OscCalcSterile::fDirty
protectedinherited
double osc::_IOscCalcAdjustable< double >::fDmsq21
protectedinherited
double osc::_IOscCalcAdjustable< double >::fDmsq32
protectedinherited
double osc::_IOscCalcAdjustable< double >::fL
protectedinherited
int osc::OscCalcSterile::fNFlavors
protectedinherited
PMNS_Sterile* osc::OscCalcSterile::fPMNS_Sterile
protectedinherited
int osc::OscCalcSterile::fPrevAnti
protectedinherited

Definition at line 71 of file OscCalcSterile.h.

Referenced by osc::OscCalcSterile::P().

double osc::OscCalcSterile::fPrevE
protectedinherited

Definition at line 70 of file OscCalcSterile.h.

Referenced by osc::OscCalcSterile::P().

int osc::OscCalcSterile::fPrevFlavBefore
protectedinherited

Definition at line 72 of file OscCalcSterile.h.

Referenced by osc::OscCalcSterile::P().

double osc::OscCalcSterile::fRho
protectedinherited
double osc::_IOscCalcAdjustable< double >::fTh12
protectedinherited
double osc::_IOscCalcAdjustable< double >::fTh13
protectedinherited
double osc::_IOscCalcAdjustable< double >::fTh23
protectedinherited

The documentation for this class was generated from the following files: