MARLEY (Model of Argon Reaction Low Energy Yields) v2.0.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
Loading...
Searching...
No Matches
marley::GridNeutrinoSource Class Reference

Neutrino source that uses a tabulated energy spectrum. More...

#include <NeutrinoSource.hh>

Inheritance diagram for marley::GridNeutrinoSource:
marley::NeutrinoSource

Public Types

using Grid = InterpolationGrid<double>
 
using Method = Grid::InterpolationMethod
 

Public Member Functions

 GridNeutrinoSource (const Grid &g, int particle_id=marley_utils::ELECTRON_NEUTRINO)
 
 GridNeutrinoSource (const std::vector< double > &Es, const std::vector< double > &PDs, int particle_id=marley_utils::ELECTRON_NEUTRINO, Method method=Method::LinearLinear)
 
virtual double get_Emax () const override
 Get the maximum neutrino energy (MeV) that can be sampled by this source.
 
virtual double get_Emin () const override
 Get the minimum neutrino energy (MeV) that can be sampled by this source.
 
virtual double pdf (double E) const override
 Probability density function describing the incident neutrino energy distribution.
 
- Public Member Functions inherited from marley::NeutrinoSource
 NeutrinoSource (int particle_id)
 
virtual int get_pid () const
 Get the PDG particle ID for the neutrino type produced by this source.
 
virtual double sample_incident_neutrino (int &pdg, marley::Generator &gen) const
 Samples an incident neutrino energy and loads pdg with the PDG code of the appropriate neutrino type.
 

Protected Attributes

Grid grid_
 
- Protected Attributes inherited from marley::NeutrinoSource
int pid_
 PDG particle ID for the neutrinos produced by this source.
 

Additional Inherited Members

- Static Public Member Functions inherited from marley::NeutrinoSource
static bool pdg_is_allowed (const int pdg)
 

Detailed Description

Neutrino source that uses a tabulated energy spectrum.

Definition at line 293 of file NeutrinoSource.hh.

Member Typedef Documentation

◆ Grid

Definition at line 295 of file NeutrinoSource.hh.

◆ Method

using marley::GridNeutrinoSource::Method = Grid::InterpolationMethod

Definition at line 296 of file NeutrinoSource.hh.

Constructor & Destructor Documentation

◆ GridNeutrinoSource() [1/2]

marley::GridNeutrinoSource::GridNeutrinoSource ( const Grid & g,
int particle_id = marley_utils::ELECTRON_NEUTRINO )
inline
Parameters
gInterpolationGrid<double> object that describes this source's probability density function
particle_idPDG particle ID for the neutrinos produced by this source

Definition at line 369 of file NeutrinoSource.hh.

370 : NeutrinoSource(particle_id), grid_(g) { check_for_errors(); }
NeutrinoSource(int particle_id)

References marley::NeutrinoSource::NeutrinoSource().

◆ GridNeutrinoSource() [2/2]

marley::GridNeutrinoSource::GridNeutrinoSource ( const std::vector< double > & Es,
const std::vector< double > & PDs,
int particle_id = marley_utils::ELECTRON_NEUTRINO,
Method method = Method::LinearLinear )
inline
Parameters
Esvector of neutrino energy gridpoints (MeV)
PDsvector of probability densities (MeV -1)
particle_idPDG particle ID for the neutrinos produced by this source
methodspecifier indicating which interpolation rule should be used between grid points

Definition at line 372 of file NeutrinoSource.hh.

374 : NeutrinoSource(particle_id), grid_(Es, prob_densities, method)
375 { check_for_errors(); }

References marley::NeutrinoSource::NeutrinoSource().

Member Function Documentation

◆ get_Emax()

double marley::GridNeutrinoSource::get_Emax ( ) const
inlineoverridevirtual

Get the maximum neutrino energy (MeV) that can be sampled by this source.

Implements marley::NeutrinoSource.

Definition at line 362 of file NeutrinoSource.hh.

363 { return grid_.back().first; }

◆ get_Emin()

double marley::GridNeutrinoSource::get_Emin ( ) const
inlineoverridevirtual

Get the minimum neutrino energy (MeV) that can be sampled by this source.

Implements marley::NeutrinoSource.

Definition at line 364 of file NeutrinoSource.hh.

365 { return grid_.front().first; }

◆ pdf()

double marley::GridNeutrinoSource::pdf ( double E) const
inlineoverridevirtual

Probability density function describing the incident neutrino energy distribution.

The neutrino spectrum produced by this source will be folded with the relevant cross sections by a Generator object during event creation

Parameters
Eneutrino energy (MeV)
Returns
Probability density (MeV -1)

Implements marley::NeutrinoSource.

Definition at line 366 of file NeutrinoSource.hh.

367 { return grid_.interpolate(E); }

Member Data Documentation

◆ grid_

Grid marley::GridNeutrinoSource::grid_
protected

Definition at line 323 of file NeutrinoSource.hh.


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