Jpp  18.5.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::JParameter_t 
JParameter_t
 
typedef
JOscProbInterface::argument_type 
argument_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...
 
JOscParameters_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 argument_type &value) const
 Set value for a given oscillation parameter. More...
 
template<class... Args>
void set (const std::string &name, const argument_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 203 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.

Constructor & Destructor Documentation

JAANET::JFluxMap::JFluxMap ( )
inline

Default constructor.

Definition at line 209 of file JEvtWeightToolkit.hh.

210  {}

Member Function Documentation

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

Get multiparticle flux function.

Returns
multiparticle flux function

Definition at line 218 of file JEvtWeightToolkit.hh.

219  {
220  using namespace std;
221  using namespace JPP;
222 
223  JFluxMultiParticle multiFlux;
224 
225  for (map<int, JFlatFlux>::const_iterator i = flatFluxes.cbegin(); i != flatFluxes.cend(); ++i) {
226  multiFlux.insert(i->first, make_fluxFunction(i->second));
227  }
228 
230  multiFlux.insert(i->first, make_fluxFunction(i->second));
231  }
232 
233  const JOscProbInterface& oscProbInterface = getOscProbInterface();
234 
235  const JAtmosphericNeutrinoFlux atmFlux(oscProbInterface);
236 
238 
240  multiFlux.insert(*i, atmFluxFunction);
241  }
242 
243  return multiFlux;
244  }
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 252 of file JEvtWeightToolkit.hh.

253  {
254  return getMultiParticleFlux();
255  }
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 297 of file JEvtWeightToolkit.hh.

298  {
299  JProperties properties;
300 
301  properties.insert(gmake_property(object.flatFluxes));
302  properties.insert(gmake_property(object.powerLawFluxes));
303  properties.insert(gmake_property(object.atmosphericFluxes));
304 
305  return properties;
306  }
#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 66 of file JOscProbHelper.hh.

67  {
68  this->reset(oscProb.clone());
69  }
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 77 of file JOscProbHelper.hh.

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

Get reference to oscillation parameters interface.

Returns
reference to oscillation parameters interface

Definition at line 94 of file JOscProbHelper.hh.

95  {
97  }
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 105 of file JOscProbHelper.hh.

106  {
107  return getParameters().set(parameters);
108  }
JOscParameters_t & getParameters() const
Get reference to oscillation parameters interface.
*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, argument_type value)
Set value for a given oscillation parameter.
virtual void JOSCPROB::JOscProbHelper::set ( const std::string name,
const argument_type value 
) const
inlinevirtualinherited

Set value for a given oscillation parameter.

Parameters
nameparameter name
valueparameter value

Definition at line 117 of file JOscProbHelper.hh.

119  {
120  getParameters().set(name, value);
121  }
JOscParameters_t & getParameters() const
Get reference to oscillation parameters interface.
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
void set(const std::string &name, argument_type value)
Set value for a given oscillation parameter.
template<class... Args>
void JOSCPROB::JOscProbHelper::set ( const std::string name,
const argument_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 132 of file JOscProbHelper.hh.

135  {
136  getParameters().set(name, value, args...);
137  }
JOscParameters_t & getParameters() const
Get reference to oscillation parameters interface.
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
void set(const std::string &name, argument_type value)
Set value for a given oscillation parameter.
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 149 of file JOscProbHelper.hh.

152  {
153  return getOscProbInterface().getP(channel, energy, costh);
154  }
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 167 of file JOscProbHelper.hh.

171  {
172  return getOscProbInterface().getP(parameters, channel, energy, costh);
173  }
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 187 of file JOscProbHelper.hh.

192  {
193  return getOscProbInterface().getP(name, value, channel, E, costh);
194  }
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 echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
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 206 of file JOscProbHelper.hh.

209  {
210  return getOscProbInterface().getP(name, value, args...);
211  }
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 echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
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 220 of file JOscProbHelper.hh.

221  {
222  return getOscProbInterface().getCosth(L);
223  }
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 232 of file JOscProbHelper.hh.

233  {
234  return getOscProbInterface().getBaseline(costh);
235  }
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 265 of file JEvtWeightToolkit.hh.

266  {
267  return getProperties(fluxMap).read(in);
268  }
static JProperties getProperties(JFluxMap_t &object)
Get properties of this class.
bool read(const JEquation &equation)
Read equation.
Definition: JProperties.hh:679
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] 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 278 of file JEvtWeightToolkit.hh.

279  {
280  return getProperties(fluxMap).write(out);
281  }
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 284 of file JEvtWeightToolkit.hh.

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

Power-law flux functions.

Definition at line 285 of file JEvtWeightToolkit.hh.

JNeutrinoTypeCollection JAANET::JFluxMap::atmosphericFluxes

Atmospheric neutrino flux functions.

Definition at line 287 of file JEvtWeightToolkit.hh.


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