NuOscillator
Loading...
Searching...
No Matches
OscillatorBase Class Referenceabstract

Oscillation calculation (binned, unbinned, etc.) implementation agnostic base class. More...

#include <OscillatorBase.h>

Inheritance diagram for OscillatorBase:
[legend]
Collaboration diagram for OscillatorBase:
[legend]

Public Member Functions

virtual ~OscillatorBase ()
 Destructor.
 
void SanityCheck ()
 Perform a sanity check which ensures that #fOscProbCalcers have been set correctly.
 
void CalculateProbabilities (const std::vector< FLOAT_T > &OscParams)
 Calculate the oscillation probabilities for the providied oscillation probabilities.
 
void CalculateProbabilities ()
 Calculate the oscillation probabilities for the providied oscillation probabilities.
 
void DefineParameter (const std::string &ParName_, FLOAT_T *ParValue_)
 Define the oscillation parameters with a given name and pointer to a value.
 
int ReturnNOscParams ()
 Return number of expected oscillation parameters for a particular OscProbCalcerBase::OscProbCalcerBase() instance in #fOscProbCalcers.
 
void PrintWeights ()
 Print the oscillation probabilities for a particular OscProbCalcerBase::OscProbCalcerBase() instance in fOscProbCalcer.
 
void Setup ()
 Setup each instance of OscProbCalcerBase::OscProbCalcerBase() instance in fOscProbCalcer.
 
std::string ReturnImplementationName ()
 Return a string which encapsulates the calculation type along with the calculation engine.
 
int ReturnNEnergyPoints ()
 Return the number of Energy points which are being evaluated in the OscProbCalcerBase::OscProbCalcerBase() object.
 
std::vector< FLOAT_T > ReturnEnergyArray ()
 Return the vector of Energy points which are being used by the specific instance of OscProbCalcerBase::OscProbCalcerBase() contained in this instance of OscillatorBase::OscillatorBase()
 
int ReturnNCosineZPoints ()
 Return the number of CosineZ points which are being evaluated in the OscProbCalcerBase::OscProbCalcerBase() object.
 
std::vector< FLOAT_T > ReturnCosineZArray ()
 Return the vector of CosineZ points which are being used by the specific instance of OscProbCalcerBase::OscProbCalcerBase() contained in this instance of OscillatorBase::OscillatorBase()
 
std::vector< NuOscillator::OscillationChannel > ReturnOscChannels ()
 Return the oscillation channels the specific implementation expects.
 
std::vector< int > ReturnNeutrinoTypes ()
 Return the neutrino types the specific implementation expects.
 
bool HasOscProbCalcerGotOscillationChannel (int GeneratedFlavour, int DetectedFlavour)
 Check whether a particular OscProbCalcerBase::OscProbCalcerBase() instance has a particular oscillation channel.
 
void SetEnergyArrayInCalcer (std::vector< FLOAT_T > Array)
 Set the energy array which will be used by the OscProbCalcerBase::OscProbCalcerBase() instance stored in a particular index in #fOscProbCalcers.
 
void SetCosineZArrayInCalcer (std::vector< FLOAT_T > Array)
 Set the energy array which will be used by the OscProbCalcerBase::OscProbCalcerBase() instance stored in fOscProbCalcer.
 
bool EvalPointsSetInConstructor ()
 Return flag which describes whether the OscProbCalcerBase::OscProbCalcerBase() has had it's Energy and CosineZ evaluation points set in the constructor of the derived OscillatorBase::OscillatorBase() object.
 
bool ReturnCosineZIgnored ()
 Return flag which describes whether CosineZ binning is considered in the object.
 
FLOAT_T ReturnOscillationProbability (int InitNuFlav, int FinalNuFlav, FLOAT_T EnergyVal, FLOAT_T CosineZVal=DUMMYVAL)
 Return oscillation probability for a given initial and final flavour, for a given energy and cosineZ.
 
virtual const FLOAT_T * ReturnWeightPointer (int InitNuFlav, int FinalNuFlav, FLOAT_T EnergyVal, FLOAT_T CosineZVal=DUMMYVAL)=0
 Return a pointer to the oscillation probability for the requested event attributes.
 
virtual std::vector< FLOAT_T > ReturnBinEdgesForPlotting (bool ReturnEnergy)=0
 Return a vector of bin edges which can be used to plot the oscillation probability.
 

Protected Member Functions

 OscillatorBase (std::string ConfigName_)
 Default constructor.
 
 OscillatorBase (YAML::Node Config_)
 Default constructor.
 
const FLOAT_T * ReturnPointerToWeightinCalcer (int InitNuFlav, int FinalNuFlav, FLOAT_T EnergyVal, FLOAT_T CosineZVal=DUMMYVAL)
 Return a pointer to the oscillation probability memory address in a particular index of #fOscProbCalcers for a particular event.
 
virtual void PostCalculateProbabilities ()
 Do follow-up calculations with the oscillation probabilities. E.g.: averages in the SubSampling CalculationType.
 
virtual void SetupOscillatorImplementation ()
 Setup specific oscillator implementation.
 

Protected Attributes

bool fCosineZIgnored
 A boolean used for declaring whether the OscillatorBase() object expects to care about the CosineZ dimension.
 
bool fEvalPointsSetInConstructor
 Flad which describes whether the Energy and CosineZ evaluation points where set in the constructor of the OscillatorBase() derived object.
 
OscProbCalcerBase * fOscProbCalcer
 The instance of OscProbCalcerBase()
 
std::string fCalculationTypeName
 A string describing the calculation implementation, e.g. Binned.
 
int fVerbose
 The verbosity level of console output.
 
YAML::Node Config
 YAML Config manager.
 

Private Member Functions

void InitialiseOscProbCalcer ()
 Return an OscProbCalcerBase::OscProbCalcerBase() object from the requested inputs.
 
void Initialise (YAML::Node Config_)
 Initialise OscillatorBase object.
 

Private Attributes

bool fOscProbCalcerSet
 A boolean which declares whether fOscProbCalcer has been initialised.
 

Detailed Description

Oscillation calculation (binned, unbinned, etc.) implementation agnostic base class.

The base class which controls the calculation of neutrino oscillation probabilities through various calculation techniques. There are oscillation calculation techniques which can be implemented (e.g. binned, unbinned) which are expected to be derived classes of this base function.

Constructor & Destructor Documentation

◆ ~OscillatorBase()

OscillatorBase::~OscillatorBase ( )
virtual

Destructor.

◆ OscillatorBase() [1/2]

OscillatorBase::OscillatorBase ( std::string ConfigName_)
protected

Default constructor.

It is protected to prevent initialisation of base class

Parameters
ConfigName_YAML config file used to set runtime constants

◆ OscillatorBase() [2/2]

OscillatorBase::OscillatorBase ( YAML::Node Config_)
protected

Default constructor.

It is protected to prevent initialisation of base class

Parameters
ConfigName_YAML config file used to set runtime constants

Member Function Documentation

◆ CalculateProbabilities() [1/2]

void OscillatorBase::CalculateProbabilities ( )

Calculate the oscillation probabilities for the providied oscillation probabilities.

◆ CalculateProbabilities() [2/2]

void OscillatorBase::CalculateProbabilities ( const std::vector< FLOAT_T > & OscParams)

Calculate the oscillation probabilities for the providied oscillation probabilities.

Parameters
OscParamsVector of oscillation parameters to calculate probabities at.

◆ DefineParameter()

void OscillatorBase::DefineParameter ( const std::string & ParName_,
FLOAT_T * ParValue_ )
inline

Define the oscillation parameters with a given name and pointer to a value.

Parameters
ParName_Oscillation parameter name
ParValue_Point to oscillation parameter value

◆ EvalPointsSetInConstructor()

bool OscillatorBase::EvalPointsSetInConstructor ( )
inline

Return flag which describes whether the OscProbCalcerBase::OscProbCalcerBase() has had it's Energy and CosineZ evaluation points set in the constructor of the derived OscillatorBase::OscillatorBase() object.

Returns
Boolean flag

◆ HasOscProbCalcerGotOscillationChannel()

bool OscillatorBase::HasOscProbCalcerGotOscillationChannel ( int GeneratedFlavour,
int DetectedFlavour )

Check whether a particular OscProbCalcerBase::OscProbCalcerBase() instance has a particular oscillation channel.

Parameters
GeneratedFlavourThe oscillation channel generated neutrino flavour to check for
DetectedFlavourThe oscillation channel detected neutrino flavour to check for
Returns
Boolean flag which describes whether the oscillation channel was found in the instance of OscProbCalcerBase::OscProbCalcerBase()

◆ Initialise()

void OscillatorBase::Initialise ( YAML::Node Config_)
private

Initialise OscillatorBase object.

Define everything which is needed for the OscillatorBase object to function

Parameters
Config_YAML Node to be initialised from

◆ InitialiseOscProbCalcer()

void OscillatorBase::InitialiseOscProbCalcer ( )
private

Return an OscProbCalcerBase::OscProbCalcerBase() object from the requested inputs.

Create and initialise fOscProbCalcer to be an instance of OscProbCalcerBase::OscProbCalcerBase() associated with a particular implementation denoted by

Parameters
OscProbCalcerImplementationToCreateand config path
OscProbCalcerConfigname,recastit to a base object OscProbCalcerBase::OscProbCalcerBase() and returns it.

◆ PostCalculateProbabilities()

virtual void OscillatorBase::PostCalculateProbabilities ( )
inlineprotectedvirtual

Do follow-up calculations with the oscillation probabilities. E.g.: averages in the SubSampling CalculationType.

Reimplemented in OscillatorSubSampling.

◆ PrintWeights()

void OscillatorBase::PrintWeights ( )

Print the oscillation probabilities for a particular OscProbCalcerBase::OscProbCalcerBase() instance in fOscProbCalcer.

Print the calculated oscillation probability values for a particular OscProbCalcerBase::OscProbCalcerBase() instance in #fOscProbCalcers. This is typically performed after a call to CalculateProbabilities()

◆ ReturnBinEdgesForPlotting()

virtual std::vector< FLOAT_T > OscillatorBase::ReturnBinEdgesForPlotting ( bool ReturnEnergy)
pure virtual

Return a vector of bin edges which can be used to plot the oscillation probability.

If we want to plot the oscillation probabilties, we need to define a binning which can be used to create the histogram. This is implementation dependent because the binned implementation should return the binning used to define the probability binning, but event-by-event needs to return a binning such that a single evaluation point falls in a single bin

Parameters
ReturnEnergyFlag to return the binning for Energy or CosineZ
Returns
Vector of bin edges which should be used to create a histogram for plotting purposes

Implemented in OscillatorBinned, OscillatorSubSampling, and OscillatorUnbinned.

◆ ReturnCosineZArray()

std::vector< FLOAT_T > OscillatorBase::ReturnCosineZArray ( )

Return the vector of CosineZ points which are being used by the specific instance of OscProbCalcerBase::OscProbCalcerBase() contained in this instance of OscillatorBase::OscillatorBase()

Returns
Return the vector of CosineZ points which are being used by the specific instance of OscProbCalcerBase::OscProbCalcerBase() contained in this instance of OscillatorBase::OscillatorBase()

◆ ReturnCosineZIgnored()

bool OscillatorBase::ReturnCosineZIgnored ( )
inline

Return flag which describes whether CosineZ binning is considered in the object.

Returns
Boolean flag

◆ ReturnEnergyArray()

std::vector< FLOAT_T > OscillatorBase::ReturnEnergyArray ( )

Return the vector of Energy points which are being used by the specific instance of OscProbCalcerBase::OscProbCalcerBase() contained in this instance of OscillatorBase::OscillatorBase()

Returns
Return the vector of Energy points which are being used by the specific instance of OscProbCalcerBase::OscProbCalcerBase() contained in this instance of OscillatorBase::OscillatorBase()

◆ ReturnImplementationName()

std::string OscillatorBase::ReturnImplementationName ( )

Return a string which encapsulates the calculation type along with the calculation engine.

Returns
Returns a string which looks like CalculationType_CalculationEngine (e.g. Binned_CUDAProb3)

◆ ReturnNCosineZPoints()

int OscillatorBase::ReturnNCosineZPoints ( )

Return the number of CosineZ points which are being evaluated in the OscProbCalcerBase::OscProbCalcerBase() object.

Returns
Returns an integer describing the number of CosineZ points which are being evaluated in the OscProbCalcerBase::OscProbCalcerBase() object

◆ ReturnNEnergyPoints()

int OscillatorBase::ReturnNEnergyPoints ( )

Return the number of Energy points which are being evaluated in the OscProbCalcerBase::OscProbCalcerBase() object.

Returns
Returns an integer describing the number of Energy points which are being evaluated in the OscProbCalcerBase::OscProbCalcerBase() object

◆ ReturnNeutrinoTypes()

std::vector< int > OscillatorBase::ReturnNeutrinoTypes ( )

Return the neutrino types the specific implementation expects.

Returns
Return the neutrino types the specific implementation expects

◆ ReturnNOscParams()

int OscillatorBase::ReturnNOscParams ( )

Return number of expected oscillation parameters for a particular OscProbCalcerBase::OscProbCalcerBase() instance in #fOscProbCalcers.

Each instance of OscProbCalcerBase::OscProbCalcerBase expects a particular number of oscillation parameters. This function returns this value for an OscProbCalcerBase::OscProbCalcerBase instance in fOscProbCalcer.

Returns
The number of expected oscillation parameters from fOscProbCalcer

◆ ReturnOscChannels()

std::vector< NuOscillator::OscillationChannel > OscillatorBase::ReturnOscChannels ( )

Return the oscillation channels the specific implementation expects.

Returns
Return the oscillation channels the specific implementation expects

◆ ReturnOscillationProbability()

FLOAT_T OscillatorBase::ReturnOscillationProbability ( int InitNuFlav,
int FinalNuFlav,
FLOAT_T EnergyVal,
FLOAT_T CosineZVal = DUMMYVAL )
inline

Return oscillation probability for a given initial and final flavour, for a given energy and cosineZ.

Parameters
InitNuFlavInitial neutrino flavour of the neutrino
FinalNuFlavFinal neutrino flavour of the neutrino
EnergyValTrue energy of the neutrino
CosineZValTrue direction of the neutrino in CosineZ
Returns
Value of the oscillation probability for events of the specific requested type will be stored

◆ ReturnPointerToWeightinCalcer()

const FLOAT_T * OscillatorBase::ReturnPointerToWeightinCalcer ( int InitNuFlav,
int FinalNuFlav,
FLOAT_T EnergyVal,
FLOAT_T CosineZVal = DUMMYVAL )
protected

Return a pointer to the oscillation probability memory address in a particular index of #fOscProbCalcers for a particular event.

Return the memory address for the oscillation probability which is calculated for neutrinos of a particular initial and final flavour, energy and cosine value. This is a memory address for a particular OscProbCalcerBase::OscProbCalcerBase() instance stored in a particular index in #fOscProbCalcers.

Parameters
CalcerIndexThe index in #fOscProbCalcers.
InitNuFlavInitial neutrino flavour of event
FinalNuFlavFinal neutrino flavour of event
EnergyValNeutrino energy of event
CosineZValNetrino cosine zenith direction of event
Returns
Memory address associated with given event attributes for CalcerIndex-th index in #fOscProbCalcers

◆ ReturnWeightPointer()

virtual const FLOAT_T * OscillatorBase::ReturnWeightPointer ( int InitNuFlav,
int FinalNuFlav,
FLOAT_T EnergyVal,
FLOAT_T CosineZVal = DUMMYVAL )
pure virtual

Return a pointer to the oscillation probability for the requested event attributes.

Determine the memory address address where the calculated oscillation probability for events of the specific requested type will be stored. This will be different depending on the calculation implementation. For the binned approach, the particular bin in which the requested energy and cosine falls will need to be determined. For unbinned approach, the exact neutrino energy and cosine are expected to be used. Alternative approachs which smear the oscillation probability will be able to use this function to apply the smear.

Parameters
InitNuFlavInitial neutrino flavour of the neutrino
FinalNuFlavFinal neutrino flavour of the neutrino
EnergyValTrue energy of the neutrino
CosineZValTrue direction of the neutrino in CosineZ
Returns
Pointer to the memory address where the calculated oscillation probability for events of the specific requested type will be stored

Implemented in OscillatorBinned, OscillatorSubSampling, and OscillatorUnbinned.

◆ SanityCheck()

void OscillatorBase::SanityCheck ( )

Perform a sanity check which ensures that #fOscProbCalcers have been set correctly.

Ensure that: the #fOscProbCalcers has been initialised with atleast one OscProbCalcerBase::OscProbCalcerBase() instance, each OscProbCalcerBase::OscProbCalcerBase() instance passes the sanity check, and that each OscProbCalcerBase::OscProbCalcerBase() instance has the same CosineZ treatement as the OscillatorBase() instance expects.

◆ SetCosineZArrayInCalcer()

void OscillatorBase::SetCosineZArrayInCalcer ( std::vector< FLOAT_T > Array)

Set the energy array which will be used by the OscProbCalcerBase::OscProbCalcerBase() instance stored in fOscProbCalcer.

Each instance of OscProbCalcerBase::OscProbCalcerBase() needs an energy array which will be used to calculate the oscillation probabilities. This function sets that array

Parameters
ArrayThe energy array which will be passed to the OscProbCalcerBase::OscProbCalcerBase() instance

◆ SetEnergyArrayInCalcer()

void OscillatorBase::SetEnergyArrayInCalcer ( std::vector< FLOAT_T > Array)

Set the energy array which will be used by the OscProbCalcerBase::OscProbCalcerBase() instance stored in a particular index in #fOscProbCalcers.

Each instance of OscProbCalcerBase::OscProbCalcerBase() needs an energy array which will be used to calculate the oscillation probabilities. This function sets that array

Parameters
ArrayThe energy array which will be passed to the OscProbCalcerBase::OscProbCalcerBase() instance

◆ Setup()

void OscillatorBase::Setup ( )

Setup each instance of OscProbCalcerBase::OscProbCalcerBase() instance in fOscProbCalcer.

Setup function is public so that OscProbCalcerBase::OscProbCalcerBase() instances, when using the unbinned calculation implementation, can be setup. The unbinned implementation assumes that the Energy and CosineZ arrays will be set after the OscillatorBase() object has been initialised.

◆ SetupOscillatorImplementation()

virtual void OscillatorBase::SetupOscillatorImplementation ( )
inlineprotectedvirtual

Setup specific oscillator implementation.

Reimplemented in OscillatorSubSampling.

Member Data Documentation

◆ Config

YAML::Node OscillatorBase::Config
protected

YAML Config manager.

◆ fCalculationTypeName

std::string OscillatorBase::fCalculationTypeName
protected

A string describing the calculation implementation, e.g. Binned.

◆ fCosineZIgnored

bool OscillatorBase::fCosineZIgnored
protected

A boolean used for declaring whether the OscillatorBase() object expects to care about the CosineZ dimension.

◆ fEvalPointsSetInConstructor

bool OscillatorBase::fEvalPointsSetInConstructor
protected

Flad which describes whether the Energy and CosineZ evaluation points where set in the constructor of the OscillatorBase() derived object.

◆ fOscProbCalcer

OscProbCalcerBase* OscillatorBase::fOscProbCalcer
protected

The instance of OscProbCalcerBase()

◆ fOscProbCalcerSet

bool OscillatorBase::fOscProbCalcerSet
private

A boolean which declares whether fOscProbCalcer has been initialised.

◆ fVerbose

int OscillatorBase::fVerbose
protected

The verbosity level of console output.


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