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

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

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

Inheritance diagram for osc::_OscCalcPMNS< T >:
osc::_IOscCalcAdjustable< T > osc::_IOscCalc< T >

Public Member Functions

 _OscCalcPMNS ()
 
virtual ~_OscCalcPMNS ()
 
virtual _IOscCalcAdjustable< 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::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)
 

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::_OscCalcPMNS< T >

Adapt the PMNS calculator to standard interface.

Definition at line 28 of file StanTypedefs.h.

Constructor & Destructor Documentation

template<typename T >
osc::_OscCalcPMNS< T >::_OscCalcPMNS ( )

Definition at line 7 of file OscCalcPMNS.cxx.

8  : fMixDirty(true), fDmDirty(true), fPropDirty(true), fPrevAnti(0)
9  {
10  }
template<typename T >
osc::_OscCalcPMNS< T >::~_OscCalcPMNS ( )
virtual

Definition at line 14 of file OscCalcPMNS.cxx.

15  {
16  }

Member Function Documentation

template<typename T >
_IOscCalcAdjustable< T > * osc::_OscCalcPMNS< T >::Copy ( ) const
overridevirtual

Implements osc::_IOscCalcAdjustable< T >.

Definition at line 20 of file OscCalcPMNS.cxx.

21  {
22  return new _OscCalcPMNS<T>(*this);
23  }
template<typename T>
virtual T osc::_IOscCalcAdjustable< T >::GetdCP ( ) const
inlinevirtualinherited
template<typename T>
virtual T osc::_IOscCalcAdjustable< T >::GetDmsq21 ( ) const
inlinevirtualinherited
template<typename T>
virtual T osc::_IOscCalcAdjustable< T >::GetDmsq32 ( ) const
inlinevirtualinherited
template<typename T>
virtual double osc::_IOscCalcAdjustable< T >::GetL ( ) const
inlinevirtualinherited
template<typename T>
TMD5* osc::_OscCalcPMNS< 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::_IOscCalc< T >.

Definition at line 42 of file OscCalcPMNS.h.

References osc::_IOscCalcAdjustable< 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...
Definition: IOscCalc.cxx:49
template<typename T >
TMD5 * osc::_IOscCalcAdjustable< 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 49 of file IOscCalc.cxx.

References runNovaSAM::ret, and T.

Referenced by osc::_OscCalcPMNS< T >::GetParamsHash(), osc::_OscCalcPMNSOpt< T >::GetParamsHash(), and osc::analytic::_OscCalc< T >::GetParamsHash().

50  {
51  TMD5* ret = new TMD5;
52  ret->Update((unsigned char*)txt.c_str(), txt.size());
53  const int kNumParams = 8;
54  T buf[kNumParams] = {fRho, fL, fDmsq21, fDmsq32,
55  fTh12, fTh13, fTh23, fdCP};
56  ret->Update((unsigned char*)buf, sizeof(T)*kNumParams);
57  ret->Final();
58  return ret;
59  }
double T
Definition: Xdiff_gwt.C:5
template<typename T>
virtual double osc::_IOscCalcAdjustable< T >::GetRho ( ) const
inlinevirtualinherited
template<typename T>
virtual T osc::_IOscCalcAdjustable< T >::GetTh12 ( ) const
inlinevirtualinherited
template<typename T>
virtual T osc::_IOscCalcAdjustable< T >::GetTh13 ( ) const
inlinevirtualinherited
template<typename T>
virtual T osc::_IOscCalcAdjustable< T >::GetTh23 ( ) const
inlinevirtualinherited
template<typename T>
virtual void osc::_IOscCalcAdjustable< 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::_OscCalcDMP< T >.

Definition at line 102 of file IOscCalc.h.

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<typename T >
T osc::_OscCalcPMNS< T >::P ( int  flavBefore,
int  flavAfter,
double  E 
)
overridevirtual

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

Implements osc::_IOscCalc< T >.

Definition at line 27 of file OscCalcPMNS.cxx.

References abs(), ana::assert(), E, osc::_IOscCalcAdjustable< T >::fdCP, osc::_OscCalcPMNS< T >::fDmDirty, osc::_IOscCalcAdjustable< T >::fDmsq21, osc::_IOscCalcAdjustable< T >::fDmsq32, osc::_IOscCalcAdjustable< T >::fL, osc::_OscCalcPMNS< T >::fMixDirty, osc::_OscCalcPMNS< T >::fPMNS, osc::_OscCalcPMNS< T >::fPrevAnti, osc::_OscCalcPMNS< T >::fPrevE, osc::_OscCalcPMNS< T >::fPropDirty, osc::_IOscCalcAdjustable< T >::fRho, osc::_IOscCalcAdjustable< T >::fTh12, osc::_IOscCalcAdjustable< T >::fTh13, osc::_IOscCalcAdjustable< 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
_PMNS< T > fPMNS
Definition: OscCalcPMNS.h:48
assert(nhit_max >=nhit_nbins)
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)
template<typename T>
void osc::_OscCalcPMNS< T >::SetdCP ( const T dCP)
inlineoverridevirtual
template<typename T>
void osc::_OscCalcPMNS< T >::SetDmsq21 ( const T dmsq21)
inlineoverridevirtual
template<typename T>
void osc::_OscCalcPMNS< T >::SetDmsq32 ( const T dmsq32)
inlineoverridevirtual
template<typename T>
void osc::_OscCalcPMNS< T >::SetL ( double  L)
inlineoverridevirtual
template<typename T>
void osc::_OscCalcPMNS< T >::SetRho ( double  rho)
inlineoverridevirtual
template<typename T>
void osc::_OscCalcPMNS< T >::SetTh12 ( const T th12)
inlineoverridevirtual
template<typename T>
void osc::_OscCalcPMNS< T >::SetTh13 ( const T th13)
inlineoverridevirtual
template<typename T>
void osc::_OscCalcPMNS< T >::SetTh23 ( const T th23)
inlineoverridevirtual

Member Data Documentation

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

Definition at line 48 of file OscCalcPMNS.h.

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

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

Definition at line 54 of file OscCalcPMNS.h.

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

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

Definition at line 53 of file OscCalcPMNS.h.

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

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

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