Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
osc::_OscCalculatorPMNS< T > Class Template Reference

Adapt the PMNS calculator to standard interface. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-08-04/CAFAna/Core/StanTypedefs.h"

Inheritance diagram for osc::_OscCalculatorPMNS< T >:
osc::_IOscCalculatorAdjustable< T > osc::_IOscCalculator< T >

Public Member Functions

 _OscCalculatorPMNS ()
 
virtual ~_OscCalculatorPMNS ()
 
virtual _IOscCalculatorAdjustable< T > * Copy () const override
 
virtual T P (int flavBefore, int flavAfter, double E) override
 E in GeV; flavors as PDG codes (so, neg==>antinu) More...
 
void SetL (double L) override
 
void SetRho (double rho) override
 
void SetDmsq21 (const T &dmsq21) override
 
void SetDmsq32 (const T &dmsq32) override
 
void SetTh12 (const T &th12) override
 
void SetTh13 (const T &th13) override
 
void SetTh23 (const T &th23) override
 
void SetdCP (const T &dCP) override
 
TMD5 * GetParamsHash () const override
 Use to check two calculators are in the same state. More...
 
virtual double GetL () const
 
virtual double GetRho () const
 
virtual T GetDmsq21 () const
 
virtual T GetDmsq32 () const
 
virtual T GetTh12 () const
 
virtual T GetTh13 () const
 
virtual T GetTh23 () const
 
virtual T GetdCP () const
 
virtual void InvalidateCache ()
 Invalidate any caching used internally by the calculator. More...
 
virtual Eigen::Matrix< T, Eigen::Dynamic, 1 > P (int flavBefore, int flavAfter, const std::vector< double > &E)
 

Protected Member Functions

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< TfPMNS
 
bool fMixDirty
 
bool fDmDirty
 
bool fPropDirty
 
double fPrevE
 
int fPrevAnti
 
double fRho
 
double fL
 
T fDmsq21
 
T fDmsq32
 
T fTh12
 
T fTh13
 
T fTh23
 
T fdCP
 

Detailed Description

template<typename T>
class osc::_OscCalculatorPMNS< T >

Adapt the PMNS calculator to standard interface.

Definition at line 28 of file StanTypedefs.h.

Constructor & Destructor Documentation

template<typename T >
osc::_OscCalculatorPMNS< T >::_OscCalculatorPMNS ( )
template<typename T >
osc::_OscCalculatorPMNS< T >::~_OscCalculatorPMNS ( )
virtual

Definition at line 14 of file OscCalculatorPMNS.cxx.

15  {
16  }

Member Function Documentation

template<typename T >
_IOscCalculatorAdjustable< T > * osc::_OscCalculatorPMNS< T >::Copy ( ) const
overridevirtual

Implements osc::_IOscCalculatorAdjustable< T >.

Definition at line 20 of file OscCalculatorPMNS.cxx.

21  {
22  return new _OscCalculatorPMNS<T>(*this);
23  }
template<typename T>
virtual T osc::_IOscCalculatorAdjustable< T >::GetdCP ( ) const
inlinevirtualinherited
template<typename T>
virtual T osc::_IOscCalculatorAdjustable< T >::GetDmsq21 ( ) const
inlinevirtualinherited
template<typename T>
virtual T osc::_IOscCalculatorAdjustable< T >::GetDmsq32 ( ) const
inlinevirtualinherited
template<typename T>
virtual double osc::_IOscCalculatorAdjustable< T >::GetL ( ) const
inlinevirtualinherited
template<typename T>
TMD5* osc::_OscCalculatorPMNS< T >::GetParamsHash ( ) const
inlineoverridevirtual

Use to check two calculators are in the same state.

Returns
Null means not implemented for this calculator

Reimplemented from osc::_IOscCalculator< T >.

Definition at line 42 of file OscCalculatorPMNS.h.

References osc::_IOscCalculatorAdjustable< T >::GetParamsHashDefault().

43  {
45  }
TMD5 * GetParamsHashDefault(const std::string &txt) const
This is only a safe implementation if your calculator only depends on these eight parameters...
template<typename T >
TMD5 * osc::_IOscCalculatorAdjustable< T >::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

Definition at line 34 of file IOscCalculator.cxx.

References runNovaSAM::ret, and T.

Referenced by osc::_OscCalculatorPMNS< T >::GetParamsHash(), osc::_OscCalculatorPMNSOpt< T >::GetParamsHash(), and osc::_OscCalculatorAnalytic< T >::GetParamsHash().

35  {
36  TMD5* ret = new TMD5;
37  ret->Update((unsigned char*)txt.c_str(), txt.size());
38  const int kNumParams = 8;
39  T buf[kNumParams] = {fRho, fL, fDmsq21, fDmsq32,
40  fTh12, fTh13, fTh23, fdCP};
41  ret->Update((unsigned char*)buf, sizeof(T)*kNumParams);
42  ret->Final();
43  return ret;
44  }
double T
Definition: Xdiff_gwt.C:5
template<typename T>
virtual double osc::_IOscCalculatorAdjustable< T >::GetRho ( ) const
inlinevirtualinherited
template<typename T>
virtual T osc::_IOscCalculatorAdjustable< T >::GetTh12 ( ) const
inlinevirtualinherited
template<typename T>
virtual T osc::_IOscCalculatorAdjustable< T >::GetTh13 ( ) const
inlinevirtualinherited
template<typename T>
virtual T osc::_IOscCalculatorAdjustable< T >::GetTh23 ( ) const
inlinevirtualinherited
template<typename T>
virtual void osc::_IOscCalculatorAdjustable< T >::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.

Reimplemented in osc::_OscCalculatorDMP< T >.

Definition at line 97 of file IOscCalculator.h.

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

Reimplemented in osc::OscCalculatorPMNSOptEigen, and osc::_OscCalculatorDMP< T >.

Definition at line 18 of file IOscCalculator.cxx.

References MECModelEnuComparisons::i, P, runNovaSAM::ret, and submit_hadd::u.

19  {
20  Eigen::Matrix<T,Eigen::Dynamic,1> ret(E.size());
21  for(auto i = 0u; i < E.size(); i++) {
22  ret(i) = util::GetValAs<T>(this->P(flavBefore, flavAfter, E[i]));
23  }
24  return ret.array().isNaN().select(0, ret);
25  }
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<typename T >
T osc::_OscCalculatorPMNS< T >::P ( int  flavBefore,
int  flavAfter,
double  E 
)
overridevirtual

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

Implements osc::_IOscCalculator< T >.

Definition at line 27 of file OscCalculatorPMNS.cxx.

References abs(), ana::assert(), E, osc::_IOscCalculatorAdjustable< T >::fdCP, osc::_OscCalculatorPMNS< T >::fDmDirty, osc::_IOscCalculatorAdjustable< T >::fDmsq21, osc::_IOscCalculatorAdjustable< T >::fDmsq32, osc::_IOscCalculatorAdjustable< T >::fL, osc::_OscCalculatorPMNS< T >::fMixDirty, osc::_OscCalculatorPMNS< T >::fPMNS, osc::_OscCalculatorPMNS< T >::fPrevAnti, osc::_OscCalculatorPMNS< T >::fPrevE, osc::_OscCalculatorPMNS< T >::fPropDirty, osc::_IOscCalculatorAdjustable< T >::fRho, osc::_IOscCalculatorAdjustable< T >::fTh12, osc::_IOscCalculatorAdjustable< T >::fTh13, osc::_IOscCalculatorAdjustable< T >::fTh23, MECModelEnuComparisons::i, and calib::j.

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  }
void abs(TH1 *hist)
Float_t E
Definition: plot.C:20
const double j
Definition: BetheBloch.cxx:29
assert(nhit_max >=nhit_nbins)
template<typename T>
void osc::_OscCalculatorPMNS< T >::SetdCP ( const T dCP)
inlineoverridevirtual
template<typename T>
void osc::_OscCalculatorPMNS< T >::SetDmsq21 ( const T dmsq21)
inlineoverridevirtual
template<typename T>
void osc::_OscCalculatorPMNS< T >::SetDmsq32 ( const T dmsq32)
inlineoverridevirtual
template<typename T>
void osc::_OscCalculatorPMNS< T >::SetL ( double  L)
inlineoverridevirtual
template<typename T>
void osc::_OscCalculatorPMNS< T >::SetRho ( double  rho)
inlineoverridevirtual
template<typename T>
void osc::_OscCalculatorPMNS< T >::SetTh12 ( const T th12)
inlineoverridevirtual
template<typename T>
void osc::_OscCalculatorPMNS< T >::SetTh13 ( const T th13)
inlineoverridevirtual
template<typename T>
void osc::_OscCalculatorPMNS< T >::SetTh23 ( const T th23)
inlineoverridevirtual

Member Data Documentation

template<typename T>
T osc::_IOscCalculatorAdjustable< T >::fdCP
protectedinherited
template<typename T>
bool osc::_OscCalculatorPMNS< T >::fDmDirty
protected
template<typename T>
T osc::_IOscCalculatorAdjustable< T >::fDmsq21
protectedinherited
template<typename T>
T osc::_IOscCalculatorAdjustable< T >::fDmsq32
protectedinherited
template<typename T>
double osc::_IOscCalculatorAdjustable< T >::fL
protectedinherited
template<typename T>
bool osc::_OscCalculatorPMNS< T >::fMixDirty
protected
template<typename T>
_PMNS<T> osc::_OscCalculatorPMNS< T >::fPMNS
protected

Definition at line 48 of file OscCalculatorPMNS.h.

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

template<typename T>
int osc::_OscCalculatorPMNS< T >::fPrevAnti
protected

Definition at line 54 of file OscCalculatorPMNS.h.

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

template<typename T>
double osc::_OscCalculatorPMNS< T >::fPrevE
protected

Definition at line 53 of file OscCalculatorPMNS.h.

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

template<typename T>
bool osc::_OscCalculatorPMNS< T >::fPropDirty
protected
template<typename T>
double osc::_IOscCalculatorAdjustable< T >::fRho
protectedinherited
template<typename T>
T osc::_IOscCalculatorAdjustable< T >::fTh12
protectedinherited
template<typename T>
T osc::_IOscCalculatorAdjustable< T >::fTh13
protectedinherited
template<typename T>
T osc::_IOscCalculatorAdjustable< T >::fTh23
protectedinherited

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