Jpp  19.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | Static Private Member Functions | Friends | List of all members
JAANET::JFluxMap Struct Reference

Auxiliary class for parsing multiparticle fluxes. More...

#include <JEvtWeightToolkit.hh>

Inheritance diagram for JAANET::JFluxMap:
JOSCPROB::JOscProbHelper

Public Types

typedef
JOscProbInterface::JOscParameters_t 
JOscParameters_t
 
typedef
JOscProbInterface::JOscParameterReferences_t 
JOscParameterReferences_t
 
typedef
JOscProbInterface::JParameter_t 
JParameter_t
 
typedef
JOscProbInterface::argument_type 
argument_type
 
typedef
JOscProbInterface::value_type 
value_type
 

Public Member Functions

 JFluxMap ()
 Default constructor. More...
 
JFluxMultiParticle getMultiParticleFlux () const
 Get multiparticle flux function. More...
 
 operator JFluxMultiParticle () const
 Conversion operator. More...
 
void configure (const JOscProbInterface &oscProb)
 Configure oscillation probability function. More...
 
JOscProbInterfacegetOscProbInterface () const
 Get reference to oscillation probability interface. More...
 
JOscParameterReferences_tgetParameters () const
 Get reference to oscillation parameters interface. More...
 
void set (const JOscParameters_t &parameters) const
 Set oscillation parameters. More...
 
virtual void set (const std::string &name, const value_type &value) const
 Set value for a given oscillation parameter. More...
 
template<class... Args>
void set (const std::string &name, const value_type &value, const Args &...args) const
 Set value for given list of oscillation parameters. More...
 
double getP (const JOscChannel &channel, const double energy, const double costh) const
 Get oscillation probability corresponding to given oscillation channel, neutrino energy and zenith angle. More...
 
double getP (const JOscParameters_t &parameters, const JOscChannel &channel, const double energy, const double costh) const
 Get oscillation probability for a given set of oscillation parameters
and a given oscillation channel. More...
 
double getP (const std::string &name, const double value, const JOscChannel &channel, const double E, const double costh) const
 Get oscillation probability for a given oscillation parameter
and a given oscillation channel. More...
 
template<class... Args>
double getP (const std::string &name, const double value, const Args &...args) const
 Get oscillation probability for a given set of oscillation parameters
and a given oscillation channel. More...
 
virtual double getCosth (const double L) const
 Get cosine zenith angle for a given baseline. More...
 
virtual double getBaseline (const double costh) const
 Get baseline for a given cosine zenith angle. More...
 

Public Attributes

std::map< int, JFlatFluxflatFluxes
 Uniform flux functions. More...
 
std::map< int, JPowerLawFluxpowerLawFluxes
 Power-law flux functions. More...
 
JNeutrinoTypeCollection atmosphericFluxes
 Atmospheric neutrino flux functions. More...
 

Static Private Member Functions

template<class JFluxMap_t >
static JProperties getProperties (JFluxMap_t &object)
 Get properties of this class. More...
 

Friends

std::istream & operator>> (std::istream &in, JFluxMap &fluxMap)
 Stream input. More...
 
std::ostream & operator<< (std::ostream &out, const JFluxMap &fluxMap)
 Stream output. More...
 

Detailed Description

Auxiliary class for parsing multiparticle fluxes.

Definition at line 214 of file JEvtWeightToolkit.hh.

Member Typedef Documentation

Definition at line 28 of file JOscProbHelper.hh.

Definition at line 29 of file JOscProbHelper.hh.

Definition at line 30 of file JOscProbHelper.hh.

Definition at line 32 of file JOscProbHelper.hh.

Definition at line 33 of file JOscProbHelper.hh.

Constructor & Destructor Documentation

JAANET::JFluxMap::JFluxMap ( )
inline

Default constructor.

Definition at line 220 of file JEvtWeightToolkit.hh.

221  {}

Member Function Documentation

JFluxMultiParticle JAANET::JFluxMap::getMultiParticleFlux ( ) const
inline

Get multiparticle flux function.

Returns
multiparticle flux function

Definition at line 229 of file JEvtWeightToolkit.hh.

230  {
231  using namespace std;
232  using namespace JPP;
233 
234  JFluxMultiParticle multiFlux;
235 
236  for (map<int, JFlatFlux>::const_iterator i = flatFluxes.cbegin(); i != flatFluxes.cend(); ++i) {
237  multiFlux.insert(i->first, make_fluxFunction(i->second));
238  }
239 
241  multiFlux.insert(i->first, make_fluxFunction(i->second));
242  }
243 
244  const JOscProbInterface& oscProbInterface = getOscProbInterface();
245 
246  const JAtmosphericNeutrinoFlux atmFlux(oscProbInterface);
247 
249 
251  multiFlux.insert(*i, atmFluxFunction);
252  }
253 
254  return multiFlux;
255  }
JOscProbInterface & getOscProbInterface() const
Get reference to oscillation probability interface.
void insert(const int type, const JEvtWeightFactor_t &factor)
Insert pair of particle code and event-weight factor.
std::vector< int >::const_iterator cbegin() const noexcept
Get constant iterator to the first element of the collection.
Implementation of event-weight factor interface.
JEvtWeightFactorFunction< JFunction_t, JFlux > make_fluxFunction(const JFunction_t &flux)
Auxiliary method for creating an interface to a flux function.
std::map< int, JPowerLawFlux > powerLawFluxes
Power-law flux functions.
std::vector< int >::const_iterator cend() const noexcept
Get constant iterator to the last element of the collection.
Implementation of atmospheric neutrino flux using official KM3NeT atmospheric flux function...
Implementation of event-weight factor for multiple particle types.
JNeutrinoTypeCollection atmosphericFluxes
Atmospheric neutrino flux functions.
std::map< int, JFlatFlux > flatFluxes
Uniform flux functions.
JAANET::JFluxMap::operator JFluxMultiParticle ( ) const
inline

Conversion operator.

Returns
multiparticle flux function

Definition at line 263 of file JEvtWeightToolkit.hh.

264  {
265  return getMultiParticleFlux();
266  }
JFluxMultiParticle getMultiParticleFlux() const
Get multiparticle flux function.
template<class JFluxMap_t >
static JProperties JAANET::JFluxMap::getProperties ( JFluxMap_t &  object)
inlinestaticprivate

Get properties of this class.

Parameters
objectflux map object
Returns
properties

Definition at line 308 of file JEvtWeightToolkit.hh.

309  {
310  JProperties properties;
311 
312  properties.insert(gmake_property(object.flatFluxes));
313  properties.insert(gmake_property(object.powerLawFluxes));
314  properties.insert(gmake_property(object.atmosphericFluxes));
315 
316  return properties;
317  }
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
Utility class to parse parameter values.
Definition: JProperties.hh:497
std::map< int, JPowerLawFlux > powerLawFluxes
Power-law flux functions.
JNeutrinoTypeCollection atmosphericFluxes
Atmospheric neutrino flux functions.
std::map< int, JFlatFlux > flatFluxes
Uniform flux functions.
void JOSCPROB::JOscProbHelper::configure ( const JOscProbInterface oscProb)
inlineinherited

Configure oscillation probability function.

Parameters
oscProboscillation probability function

Definition at line 69 of file JOscProbHelper.hh.

70  {
71  this->reset(oscProb.clone());
72  }
virtual clone_type clone() const override
Get clone of this object.
Definition: JClonable.hh:69
void reset(T &value)
Reset value.
JOscProbInterface& JOSCPROB::JOscProbHelper::getOscProbInterface ( ) const
inlineinherited

Get reference to oscillation probability interface.

Returns
oscillation parameters

Definition at line 80 of file JOscProbHelper.hh.

81  {
82  using namespace JPP;
83 
84  if (static_cast<const JOscProbHelper&>(*this)) {
85  return *(this->get());
86  } else {
87  THROW(JNullPointerException, "JOscProbHelper::getOscProbInterface(): Oscillation probability interface is not set.");
88  }
89  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
JOscParameterReferences_t& JOSCPROB::JOscProbHelper::getParameters ( ) const
inlineinherited

Get reference to oscillation parameters interface.

Returns
reference to oscillation parameters interface

Definition at line 97 of file JOscProbHelper.hh.

98  {
100  }
JOscProbInterface & getOscProbInterface() const
Get reference to oscillation probability interface.
JOscParameters_t & getParameters() const
Get reference to oscillation parameters interface.
void JOSCPROB::JOscProbHelper::set ( const JOscParameters_t parameters) const
inlineinherited

Set oscillation parameters.

Parameters
parametersoscillation parameters

Definition at line 108 of file JOscProbHelper.hh.

109  {
110  return getParameters().set(parameters);
111  }
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
void set(const std::string &name, const value_type &value)
Set value for a given oscillation parameter.
JOscParameterReferences_t & getParameters() const
Get reference to oscillation parameters interface.
virtual void JOSCPROB::JOscProbHelper::set ( const std::string &  name,
const value_type value 
) const
inlinevirtualinherited

Set value for a given oscillation parameter.

Parameters
nameparameter name
valueparameter value

Definition at line 120 of file JOscProbHelper.hh.

122  {
123  getParameters().set(name, value);
124  }
void set(const std::string &name, const value_type &value)
Set value for a given oscillation parameter.
then fatal The output file must have the wildcard in the name
Definition: JCanberra.sh:31
JOscParameterReferences_t & getParameters() const
Get reference to oscillation parameters interface.
template<class... Args>
void JOSCPROB::JOscProbHelper::set ( const std::string &  name,
const value_type value,
const Args &...  args 
) const
inlineinherited

Set value for given list of oscillation parameters.

Parameters
nameparameter name
valueparameter value
argsremaining pairs of parameter names and values

Definition at line 135 of file JOscProbHelper.hh.

138  {
139  getParameters().set(name, value, args...);
140  }
void set(const std::string &name, const value_type &value)
Set value for a given oscillation parameter.
then fatal The output file must have the wildcard in the name
Definition: JCanberra.sh:31
JOscParameterReferences_t & getParameters() const
Get reference to oscillation parameters interface.
double JOSCPROB::JOscProbHelper::getP ( const JOscChannel channel,
const double  energy,
const double  costh 
) const
inlineinherited

Get oscillation probability corresponding to given oscillation channel, neutrino energy and zenith angle.

Parameters
channeloscillation channel
energyneutrino energy [GeV]
costhcosine zenith angle
Returns
oscillation probability

Definition at line 152 of file JOscProbHelper.hh.

155  {
156  return getOscProbInterface().getP(channel, energy, costh);
157  }
JOscProbInterface & getOscProbInterface() const
Get reference to oscillation probability interface.
virtual double getP(const JOscChannel &channel, const double E, const double costh) const =0
Get oscillation probability for a given oscillation channel.
then for APP in event gandalf start energy
Definition: JMuonMCEvt.sh:44
double JOSCPROB::JOscProbHelper::getP ( const JOscParameters_t parameters,
const JOscChannel channel,
const double  energy,
const double  costh 
) const
inlineinherited

Get oscillation probability for a given set of oscillation parameters
and a given oscillation channel.

Parameters
channeloscillation channel
parametersoscillation parameters
energyneutrino energy [GeV]
costhcosine zenith angle
Returns
oscillation probability

Definition at line 170 of file JOscProbHelper.hh.

174  {
175  return getOscProbInterface().getP(parameters, channel, energy, costh);
176  }
JOscProbInterface & getOscProbInterface() const
Get reference to oscillation probability interface.
virtual double getP(const JOscChannel &channel, const double E, const double costh) const =0
Get oscillation probability for a given oscillation channel.
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
then for APP in event gandalf start energy
Definition: JMuonMCEvt.sh:44
double JOSCPROB::JOscProbHelper::getP ( const std::string &  name,
const double  value,
const JOscChannel channel,
const double  E,
const double  costh 
) const
inlineinherited

Get oscillation probability for a given oscillation parameter
and a given oscillation channel.

Parameters
nameparameter name
valueparameter value
channeloscillation channel
Eneutrino energy [GeV]
costhcosine zenith angle
Returns
oscillation probability

Definition at line 190 of file JOscProbHelper.hh.

195  {
196  return getOscProbInterface().getP(name, value, channel, E, costh);
197  }
JOscProbInterface & getOscProbInterface() const
Get reference to oscillation probability interface.
virtual double getP(const JOscChannel &channel, const double E, const double costh) const =0
Get oscillation probability for a given oscillation channel.
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
Definition: JMuonPostfit.sh:40
then fatal The output file must have the wildcard in the name
Definition: JCanberra.sh:31
template<class... Args>
double JOSCPROB::JOscProbHelper::getP ( const std::string &  name,
const double  value,
const Args &...  args 
) const
inlineinherited

Get oscillation probability for a given set of oscillation parameters
and a given oscillation channel.

Parameters
nameparameter name
valueparameter value
argsremaining arguments

Definition at line 209 of file JOscProbHelper.hh.

212  {
213  return getOscProbInterface().getP(name, value, args...);
214  }
JOscProbInterface & getOscProbInterface() const
Get reference to oscillation probability interface.
virtual double getP(const JOscChannel &channel, const double E, const double costh) const =0
Get oscillation probability for a given oscillation channel.
then fatal The output file must have the wildcard in the name
Definition: JCanberra.sh:31
virtual double JOSCPROB::JOscProbHelper::getCosth ( const double  L) const
inlinevirtualinherited

Get cosine zenith angle for a given baseline.

Parameters
Lbaseline [km]
Returns
cosine zenith angle

Definition at line 223 of file JOscProbHelper.hh.

224  {
225  return getOscProbInterface().getCosth(L);
226  }
JOscProbInterface & getOscProbInterface() const
Get reference to oscillation probability interface.
virtual double getCosth(const double L) const =0
Get cosine zenith angle for a given baseline.
virtual double JOSCPROB::JOscProbHelper::getBaseline ( const double  costh) const
inlinevirtualinherited

Get baseline for a given cosine zenith angle.

Parameters
costhcosine zenith angle
Returns
baseline [km]

Definition at line 235 of file JOscProbHelper.hh.

236  {
237  return getOscProbInterface().getBaseline(costh);
238  }
JOscProbInterface & getOscProbInterface() const
Get reference to oscillation probability interface.
virtual double getBaseline(const double costh) const =0
Get baseline for a given cosine zenith angle.

Friends And Related Function Documentation

std::istream& operator>> ( std::istream &  in,
JFluxMap fluxMap 
)
friend

Stream input.

Parameters
ininput stream
fluxMapflux map
Returns
input stream

Definition at line 276 of file JEvtWeightToolkit.hh.

277  {
278  return getProperties(fluxMap).read(in);
279  }
static JProperties getProperties(JFluxMap_t &object)
Get properties of this class.
bool read(const JEquation &equation)
Read equation.
Definition: JProperties.hh:679
then fatal The output file must have the wildcard in the e g root fi eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:48
std::ostream& operator<< ( std::ostream &  out,
const JFluxMap fluxMap 
)
friend

Stream output.

Parameters
outoutput stream
fluxMapflux map
Returns
output stream

Definition at line 289 of file JEvtWeightToolkit.hh.

290  {
291  return getProperties(fluxMap).write(out);
292  }
static JProperties getProperties(JFluxMap_t &object)
Get properties of this class.
std::ostream & write(std::ostream &out) const
Write the current parameter values.
Definition: JProperties.hh:847

Member Data Documentation

std::map<int, JFlatFlux> JAANET::JFluxMap::flatFluxes

Uniform flux functions.

Definition at line 295 of file JEvtWeightToolkit.hh.

std::map<int, JPowerLawFlux> JAANET::JFluxMap::powerLawFluxes

Power-law flux functions.

Definition at line 296 of file JEvtWeightToolkit.hh.

JNeutrinoTypeCollection JAANET::JFluxMap::atmosphericFluxes

Atmospheric neutrino flux functions.

Definition at line 298 of file JEvtWeightToolkit.hh.


The documentation for this struct was generated from the following file: