LeptonInjector C++ API Reference¶
-
struct BasicEventProperties : public I3FrameObject¶
- #include <LeptonInjector.h>
Parameters common to events injected in all modes.
Subclassed by LeptonInjector::RangedEventProperties, LeptonInjector::VolumeEventProperties
Public Functions
-
inline BasicEventProperties()¶
-
~BasicEventProperties()¶
-
double radius() const¶
-
double impactParameter() const¶
Public Members
-
double totalEnergy¶
Total energy in the final state (lab frame)
-
double zenith¶
Sampled zenith angle (of final state particle 1)
-
double azimuth¶
Sampled azimuth angle (of final state particle 1)
-
double finalStateX¶
Bjorken x for the interaction.
-
double finalStateY¶
Bjorken y for the interaction p1.energy = (1-finalStateY)*totalEnergy p2.energy = finalStateY*totalEnergy.
-
I3Particle::ParticleType finalType1¶
Type of first particle which was injected in the final state.
-
I3Particle::ParticleType finalType2¶
Type of second particle which was injected in the final state.
-
I3Particle::ParticleType initialType¶
Type of the neutrino which interacted to produce this event.
-
double x¶
X coordinate of the interaction vertex.
-
double y¶
Y coordinate of the interaction vertex.
-
double z¶
Z coordinate of the interaction vertex.
-
double totalColumnDepth¶
The total column depth along the particle path within which the interaction is sampled.
Friends
- friend class icecube::serialization::access
-
inline BasicEventProperties()¶
-
struct BasicInjectionConfiguration : public I3FrameObject¶
- #include <LeptonInjector.h>
Configuration parameters needed for all injection modes.
Subclassed by LeptonInjector::RangedInjectionConfiguration, LeptonInjector::VolumeInjectionConfiguration
Public Functions
-
BasicInjectionConfiguration()¶
-
~BasicInjectionConfiguration()¶
-
void setCrossSection(const photospline::splinetable<> &crossSection, const photospline::splinetable<> &totalCrossSection)¶
Public Members
-
double energyMinimum¶
Minimum total event energy to inject.
-
double energyMaximum¶
Maximum total event energy to inject.
-
double powerlawIndex¶
Powerlaw index of the energy spectrum to inject.
-
double azimuthMinimum¶
Minimum azimuth angle at which to inject events.
-
double azimuthMaximum¶
Maximum azimuth angle at which to inject events.
-
double zenithMinimum¶
Minimum zenith angle at which to inject events.
-
double zenithMaximum¶
Maximum zenith angle at which to inject events.
-
I3Particle::ParticleType finalType1¶
Type of first particle to be injected in the final state.
-
I3Particle::ParticleType finalType2¶
Type of second particle to be injected in the final state.
Friends
- friend class icecube::serialization::access
-
BasicInjectionConfiguration()¶
-
template<typename T>
struct endian_adapter¶
-
class EventPropertiesConverter : public I3ConverterImplementation<BasicEventProperties>¶
- #include <LeptonInjectionConfigurationConverter.h>
Public Functions
-
I3TableRowDescriptionPtr CreateDescription(const BasicEventProperties &p)¶
-
size_t FillRows(const BasicEventProperties &p, I3TableRowPtr rows)¶
-
I3TableRowDescriptionPtr CreateDescription(const BasicEventProperties &p)¶
-
class LeptonInjectorBase : public I3ConditionalModule¶
- #include <LeptonInjector.h>
Subclassed by LeptonInjector::RangedLeptonInjector, LeptonInjector::VolumeLeptonInjector
Public Functions
-
LeptonInjectorBase(const I3Context &context, BasicInjectionConfiguration &config)¶
-
virtual ~LeptonInjectorBase()¶
-
void Finish()¶
-
inline bool DoneGenerating() const¶
Protected Functions
-
void AddBaseParameters()¶
Add common I3Module parameters.
-
void BaseConfigure()¶
Get common I3Module parameter values.
-
I3Position SampleFromDisk(double radius, double zenith = 0., double azimuth = 0.)¶
Sample a random position on a disk with a given size and orientation. The disk is always centered on the origin of the coordinate system.
- Parameters:
radius – the radius of the disk
zenith – the zenith angle of the disk normal
azimuth – the azimuth angle of the disk normal
-
double SampleEnergy()¶
Sample one energy value from the energy spectrum.
-
I3Particle::ParticleType SampleParticleType(I3Particle::ParticleType baseType)¶
Sample either baseType or its antiparticle depending on config.toggleAntiparticles.
-
std::pair<double, double> computeFinalStateAngles(double E_total, double x, double y)¶
Determine the angles of the final state particles with respect to the initial state neutrino direction, in the lab frame.
- Parameters:
E_total – the energy of the initial neutrino
x – Bjorken x for the interaction
y – Bjorken y for the interaction
- Returns:
the relative zenith angles for the first and second final state particles
-
boost::shared_ptr<I3MCTree> FillTree(I3Position vertex, I3Direction dir, double energy, BasicEventProperties &properties)¶
Construct an I3MCTree representing an interaction.
Samples a suitable final state and computes all resulting directions and energies.
- Parameters:
vertex – the point at which the interaction occurs
dir – the direction of the interacting neutrino
energy – the energy of the interacting neutrino
properties – the associated structure where the event properties should be recorded
-
inline const photospline::splinetable &getCrossSection() const¶
-
inline const photospline::splinetable &getTotalCrossSection() const¶
Protected Attributes
-
boost::shared_ptr<I3RandomService> random¶
Random number source.
-
BasicInjectionConfiguration &config¶
Configuration structure in which to store parameters.
-
unsigned int eventsGenerated¶
Number of events produced so far.
-
bool wroteConfigFrame¶
Whether an S frame has been written.
-
bool suspendOnCompletion¶
Whether to suspend the tray after all events have been generated.
-
I3Particle::ParticleType initialType¶
The type of interacting neutrino this instance will produce. Note that in the presence of oscillations this may not be the type of the neutrino which arrived at the surface of the Earth.
Private Functions
- SET_LOGGER ("LeptonInjectorBase")
Private Members
-
I3CrossSection crossSection¶
-
LeptonInjectorBase(const I3Context &context, BasicInjectionConfiguration &config)¶
-
struct MinimalInjectionConfiguration¶
- #include <LeptonInjector.h>
Parameters for injectors placed within a MultiLeptonInjector.
Public Functions
-
inline MinimalInjectionConfiguration(unsigned int events, I3Particle::ParticleType finalType1, I3Particle::ParticleType finalType2, const std::string &crossSectionPath, const std::string &totalCrossSectionPath, bool ranged)¶
Public Members
-
unsigned int events¶
Number of events the generator should/did generate.
-
I3Particle::ParticleType finalType1¶
Type of first particle to be injected in the final state.
-
I3Particle::ParticleType finalType2¶
Type of second particle to be injected in the final state.
-
bool ranged¶
-
inline MinimalInjectionConfiguration(unsigned int events, I3Particle::ParticleType finalType1, I3Particle::ParticleType finalType2, const std::string &crossSectionPath, const std::string &totalCrossSectionPath, bool ranged)¶
-
class MultiLeptonInjector : public I3ConditionalModule¶
- #include <LeptonInjector.h>
Public Functions
-
MultiLeptonInjector(const I3Context &ctx, RangedInjectionConfiguration rconfig, VolumeInjectionConfiguration vconfig)¶
For properties appearing in both config objects, the values in rconfig will take precedence.
-
MultiLeptonInjector(const MultiLeptonInjector&) = delete¶
-
MultiLeptonInjector &operator=(const MultiLeptonInjector&) = delete¶
-
~MultiLeptonInjector() = default¶
-
void Configure()¶
Private Functions
-
void AddParameters()¶
Private Members
-
boost::shared_ptr<OutputCollector> collector¶
-
std::vector<MinimalInjectionConfiguration> generatorSettings¶
-
std::deque<boost::movelib::unique_ptr<LeptonInjectorBase>> generators¶
-
RangedInjectionConfiguration rangedConfig¶
-
VolumeInjectionConfiguration volumeConfig¶
-
MultiLeptonInjector(const I3Context &ctx, RangedInjectionConfiguration rconfig, VolumeInjectionConfiguration vconfig)¶
-
class OutputCollector : public I3Module¶
- #include <LeptonInjector.h>
A normal I3Module can only send its output frames to the inbox associated with another I3Module. This Module provides such an inbox, but instead of sending output to another module’s inbox it stores it in a queue of its own, which it makes externally accessible.
-
struct RangedEventProperties : public LeptonInjector::BasicEventProperties¶
- #include <LeptonInjector.h>
Parameters for events produced in ranged injection mode This class no longer does anything useful except provide backwards-compatibility with old data.
Friends
- friend class icecube::serialization::access
-
struct RangedInjectionConfiguration : public LeptonInjector::BasicInjectionConfiguration¶
- #include <LeptonInjector.h>
Configuration parameters for ranged injections mode.
Public Members
-
double injectionRadius¶
Radius around the origin within which to target events.
-
double endcapLength¶
Length of the fixed endcaps add to the distance along which to sample interactions.
Friends
- friend class icecube::serialization::access
-
double injectionRadius¶
-
class RangedLeptonInjector : public LeptonInjector::LeptonInjectorBase¶
- #include <LeptonInjector.h>
Public Functions
-
RangedLeptonInjector(const I3Context &context, RangedInjectionConfiguration config)¶
-
void Configure()¶
Private Members
-
boost::shared_ptr<earthmodel::EarthModelService> earthModel¶
Model to use for calculating lepton range due to matter.
-
RangedLeptonInjector(const I3Context &context, RangedInjectionConfiguration config)¶
-
struct VolumeEventProperties : public LeptonInjector::BasicEventProperties¶
- #include <LeptonInjector.h>
Parameters for events produced in volume injection mode This class no longer does anything useful except provide backwards-compatibility with old data.
Friends
- friend class icecube::serialization::access
-
struct VolumeInjectionConfiguration : public LeptonInjector::BasicInjectionConfiguration¶
- #include <LeptonInjector.h>
Configuration parameters for volume injection mode.
Public Members
-
double cylinderRadius¶
Radius of the origin-centered vertical cylinder within which to inject events.
-
double cylinderHeight¶
Height of the origin-centered vertical cylinder within which to inject events.
Friends
- friend class icecube::serialization::access
-
double cylinderRadius¶
-
class VolumeLeptonInjector : public LeptonInjector::LeptonInjectorBase¶
- #include <LeptonInjector.h>
Public Functions
-
VolumeLeptonInjector(const I3Context &context, VolumeInjectionConfiguration config)¶
-
void Configure()¶
Private Members
-
boost::shared_ptr<earthmodel::EarthModelService> earthModel¶
Model to use for calculating lepton range due to matter.
-
VolumeLeptonInjector(const I3Context &context, VolumeInjectionConfiguration config)¶
-
namespace LeptonInjector¶
Functions
-
bool isLepton(I3Particle::ParticleType p)¶
Determine whether a given particle type is a lepton.
Note
Only knows about the types used by LeptonInjector.
-
bool isCharged(I3Particle::ParticleType p)¶
Determine whether a given particle type is charged.
Note
Only knows about the types used by LeptonInjector.
-
std::string particleName(I3Particle::ParticleType p)¶
Extract the name for a given particle type.
-
double particleMass(I3Particle::ParticleType type)¶
-
double kineticEnergy(I3Particle::ParticleType type, double totalEnergy)¶
Compute the portion of a particle’s energy which is kinetic.
Note
Treats particles of unknown mass as massless, making their kinetic energy equal to their total energy
-
double particleSpeed(I3Particle::ParticleType type, double kineticEnergy)¶
Figure out a particle’s speed given its kinetic energy.
Note
Treats particles of unknown mass as massless, assigning them speed c.
-
I3Particle::ParticleShape decideShape(I3Particle::ParticleType t)¶
Guess the shape which should be associated with a given particle type. Particles with long ranges (at least multiple meters) in ice are considered tracks, while those with shorter ranges are labeled cascades.
Note
Only knows about the types used by LeptonInjector.
-
I3Particle::ParticleType deduceInitialType(I3Particle::ParticleType pType1, I3Particle::ParticleType pType2)¶
Determine the type of neutrino which would produce the specified final state. Verify that the user has provided a valid pair of particle types for the final state, call log_fatal() if the settings are not valid.
- Returns:
The interacting neutrino type required by the specified final state.
-
I3Direction rotateRelative(I3Direction base, double zenith, double azimuth)¶
Construct a new direction with the given relative angles with respect to an existing direction.
- Parameters:
base – the existing base direction
zenith – the angle of the new direction with respect to the base
azimuth – the rotation of the new direction about the base
-
I3_MODULE(RangedLeptonInjector)¶
-
I3_MODULE(VolumeLeptonInjector)¶
-
bool operator==(const MinimalInjectionConfiguration &c1, const MinimalInjectionConfiguration &c2)¶
-
std::tuple<I3Position, I3Position> computeCylinderIntersections(const I3Position &pos, const I3Direction &dir, double radius, double z_min, double z_max)¶
-
I3_MODULE(MultiLeptonInjector)¶
-
template<typename T>
endian_adapter<T> little_endian(const T &t)¶
-
template<typename T>
std::ostream &operator<<(std::ostream &os, const endian_adapter<T> &e)¶
-
std::ostream &operator<<(std::ostream &os, const endian_adapter<std::string> &e)¶
-
std::ostream &operator<<(std::ostream &os, const endian_adapter<std::vector<char>> &e)¶
-
void writeBlockHeader(std::ostream &os, uint64_t blockDataSize, const std::string &blockTypeName, uint8_t version)¶
-
template<typename Enum>
void writeEnumDefBlock(std::ostream &os, const std::string &enumName, const std::vector<std::pair<std::string, Enum>> &enumerators)¶
-
void writeConfiguration(std::ostream &os, const RangedInjectionConfiguration &config)¶
-
void writeConfiguration(std::ostream &os, const VolumeInjectionConfiguration &config)¶
-
bool does_file_exist(const char *filename)¶
-
I3_MODULE(InjectionConfigSerializer)¶
-
bool isLepton(I3Particle::ParticleType p)¶
-
namespace std
STL namespace.
- file LeptonInjectionConfigurationConverter.cxx
- #include “LeptonInjectionConfigurationConverter.h”
- file LeptonInjectionConfigurationConverter.h
- #include <tableio/I3Converter.h>#include <LeptonInjector/LeptonInjector.h>
- file LeptonInjector.cxx
- #include <LeptonInjector/LeptonInjector.h>#include <cassert>#include <fstream>#include <tuple>#include <utility>#include <boost/math/constants/constants.hpp>#include <boost/make_shared.hpp>#include <icetray/open.h>#include <icetray/I3Units.h>#include <dataclasses/physics/I3MCTree.h>
- file LeptonInjector.h
- #include <queue>#include <tuple>#include <icetray/I3ConditionalModule.h>#include <dataclasses/physics/I3Particle.h>#include <phys-services/I3RandomService.h>#include <earthmodel-service/EarthModelService.h>#include <dataclasses/physics/I3MCTree.h>#include <phys-services/I3CrossSection.h>#include <boost/move/unique_ptr.hpp>#include <boost/move/make_unique.hpp>
Functions
-
I3_CLASS_VERSION(LeptonInjector::BasicEventProperties, LeptonInjector::BasicEventProperties::classVersion)¶
-
I3_CLASS_VERSION(LeptonInjector::RangedEventProperties, LeptonInjector::RangedEventProperties::classVersion)¶
-
I3_CLASS_VERSION(LeptonInjector::VolumeEventProperties, LeptonInjector::VolumeEventProperties::classVersion)¶
-
I3_CLASS_VERSION(LeptonInjector::BasicEventProperties, LeptonInjector::BasicEventProperties::classVersion)¶
- file serialization.cxx
- #include <LeptonInjector/LeptonInjector.h>#include <fstream>#include <tableio/I3TableRowDescription.h>
Functions
-
I3_SERIALIZABLE(LeptonInjector::RangedInjectionConfiguration)¶
-
I3_SERIALIZABLE(LeptonInjector::BasicInjectionConfiguration)¶
-
I3_SERIALIZABLE(LeptonInjector::VolumeInjectionConfiguration)¶
-
I3_SERIALIZABLE(LeptonInjector::BasicEventProperties)¶
-
I3_SERIALIZABLE(LeptonInjector::RangedEventProperties)¶
-
I3_SERIALIZABLE(LeptonInjector::VolumeEventProperties)¶
-
I3_SERIALIZABLE(LeptonInjector::RangedInjectionConfiguration)¶
- dir converter
- dir icetray
- dir LeptonInjector
- dir LeptonInjector
- dir LeptonInjector
- dir private
- dir public