corsika-reader C++ API Reference¶
-
class CorsikaClient¶
- #include <CorsikaClient.h>
Basic client for RemoteControl CORSIKA.
This client is stateful, and requires calls in the following sequence:
Call StartShower()
Call NextParticle() until it returns an empty vector
Call GetEventHeader()/GetEventTrailer()
Subclassed by CorsikaService
Public Functions
-
CorsikaClient(const std::string &corsika_executable, uint32_t seed1, uint32_t seed2, uint32_t atmosphere = 11)¶
param[in] corsika_executable path to CORSIKA binary
-
virtual ~CorsikaClient()¶
-
std::vector<double> StartShower(uint32_t particle_id, double energy, double theta, double phi, I3ShowerBias::BiasParticleType I3ShowerBiasBiasbias_target = I3ShowerBias::Mu, double bias_factor = 1, std::array<double, 4> elcuts = {{0.3, 0.3, 0.003, 0.003}})¶
Start a new shower simulation. Blocks until an event header and primary are received from CORSIKA.
- Parameters:
particle_id – [in] Particle number in CORSIKA convention
energy – [in] total energy of primary particle in GeV
theta – [in] zenith angle in rad as measured from the observation level
phi – [in] azimuth angle in rad
- Returns:
A particle block containing the primary at the top of the atmosphere.
-
std::vector<double> NextParticle()¶
Get the next particle at the observation level. Blocks until the next particle or the event end block is received.
May be called after StartShower().
- Returns:
A particle block containing the particle at the lowest observation level, or an empty vector if there are no more particles.
-
const std::vector<float> &GetEventHeader() const¶
Get the EVTH block from the current shower.
May be called after StartShower()
-
const std::vector<float> &GetEventEnd() const¶
Get the EVTE block from the current shower.
May be called after NextParticle() has returned an empty vector
-
class CORSIKAResampler : public I3Module¶
-
Private Functions
- SET_LOGGER ("I3CorsikaReader")
-
I3MCTreePtr ResampleEvent(const I3MCTree, const I3CorsikaShowerInfo)¶
-
class CorsikaService : public I3IncrementalEventGeneratorService, private CorsikaClient¶
- #include <I3CORSIKAService.h>
IceTray client for RemoteControl CORSIKA.
This client is stateful; see also CorsikaClient
Public Functions
-
inline CorsikaService(const std::string &corsika_executable, uint32_t seed1, uint32_t seed2, uint32_t atmosphere)¶
-
inline virtual ~CorsikaService()¶
-
void StartShower(I3Particle &primary, const I3Frame &frame)¶
Start simulation for an air shower.
- Parameters:
primary – [inout] The primary particle for the air shower. The particle should be initialized with the type, total energy, and direction (in IceCube frame) of the primary, as well as a position and time. On return, contains the primary particle at the top of the atmosphere.
-
bool NextParticle(I3Particle &particle)¶
Fetch the next particle at the surface.
- Parameters:
particle – [out] particle to fill
- Returns:
false if the shower is finished, true otherwise
Private Functions
-
void FillParticle(const std::vector<double> &block, I3Particle &particle, bool use_elevation)¶
Private Members
-
I3Orientation core_position_¶
-
double time_shift_¶
-
I3Particle primary_¶
-
bool save_weight_¶
-
inline CorsikaService(const std::string &corsika_executable, uint32_t seed1, uint32_t seed2, uint32_t atmosphere)¶
-
class I3CORSIKAReader : public I3Module¶
-
Private Functions
- SET_LOGGER ("I3CorsikaReader")
-
int FillFrameFromCORSIKA(I3FramePtr frame)¶
-
int ReadNextBlock(float corsika_block[313], char type[5])¶
-
void ProcessEventHeader(float *corsika_block, I3FramePtr frame, I3MCTreePtr mctree, I3Particle &primary, double core_displace[2])¶
-
void ProcessParticleBlock(float *corsika_block, I3FramePtr frame, std::vector<I3Particle> &daughters, I3MCTreePtr mctree, I3ParticleIDMapPtr weights, const I3Particle &primary, double core_displace[2])¶
Private Members
-
I3CorsikaInfoPtr info_¶
-
I3RandomServicePtr rng_¶
-
I3FileStagerPtr file_stager_¶
-
I3::dataio::shared_filehandle current_filename_¶
-
boost::iostreams::filtering_istream i3_ifs_¶
-
boost::iostreams::filtering_istream corsika_ifs_¶
-
std::vector<I3Particle::ParticleType> particles_to_write_¶
-
int nevents_¶
-
int legacy_oversampling_¶
-
bool runComplete_¶
-
bool checkOnly_¶
-
unsigned lastEventID_¶
-
unsigned eventID_¶
-
unsigned run_number_¶
-
I3MapStringDouble weightMap_¶
-
double obs_level_¶
-
bool padded_¶
-
bool curved_¶
-
bool curved_obs_¶
-
int sub_blocks_¶
-
bool thinned_¶
-
bool ehistory_¶
-
double corsika_version_¶
-
double arrang_¶
-
I3Particle mother_¶
-
I3Particle grandmother_¶
-
int ancestors_¶
-
int mother_hadr_gen_¶
Private Static Attributes
-
static constexpr float corsika_v_compat_ehist_arrang_ = 7.741¶
-
struct rng_stream¶
- #include <CorsikaClient.h>
-
class welford_gap_timer¶
-
namespace [anonymous]¶
-
namespace I3CORSIKAReaderUtils¶
-
Functions
-
bool is_charmed(int pdg_id)¶
-
bool is_resonance(int pdg_id)¶
- static CORSIKAtoPDGMap_t PDGtoCORSIKAMap (boost::make_transform_iterator(CORSIKAtoPDGMap.begin(), reverse< int, int >), boost::make_transform_iterator(CORSIKAtoPDGMap.end(), reverse< int, int >))
-
int32_t CorsikaToPDG(int corsika_id)¶
-
int32_t PDGToCorsika(int pdg_id)¶
-
double GetSlantDepth(const I3Direction &dir, const I3Position &pos, double altitude)¶
-
double LocalZenith(double reference_zenith, double reference_elevation, double target_elevation)¶
-
int32_t PDGToCorsika(int32_t pdg_id)¶
-
bool is_charmed(int pdg_id)¶
-
namespace std
STL namespace.
- file cli.cxx
- #include “corsika-reader/I3CORSIKAService.h”#include “I3CORSIKAReaderUtils.h”#include <iostream>#include <cmath>#include <chrono>#include <fstream>#include <dataclasses/physics/I3MCTreeUtils.h>#include <phys-services/surfaces/Cylinder.h>#include <phys-services/I3GSLRandomService.h>#include <neutrino-generator/legacy/I3NuGIncrementalEventGenerator.h>#include <neutrino-generator/Steering.h>#include <MuonGun/Cylinder.h>#include <earthmodel-service/EarthModelService.h>#include <weighting/fluxes.h>#include <boost/range/irange.hpp>
Functions
-
double muon_energy_threshold(double max_range)¶
-
void hoboplopia(I3MCTree &tree, I3MuonGun::SamplingSurface &surface, I3RandomService &rng)¶
-
void run_single_event(const std::string &corsika_executable, int nshowers = 1, bool neutrinos = true)¶
-
void run_powerlaw(const std::string &corsika_executable, int nshowers, double emin, double emax, double gamma, bool skip_subthreshold = false)¶
-
int main(int argc, char const *argv[])
-
double muon_energy_threshold(double max_range)¶
- file CorsikaClient.cxx
- #include “corsika-reader/CorsikaClient.h”#include <boost/asio.hpp>#include <boost/process.hpp>#include <iostream>
Enums
-
enum message_id¶
Values:
-
enum message_id¶
- file CorsikaClient.h
- #include <string>#include <vector>#include <memory>#include <cstdint>#include <array>#include “simclasses/I3ShowerBias.h”
- file CORSIKAResampler.cxx
- #include “dataclasses/I3Position.h”#include <icetray/open.h>#include <icetray/I3Frame.h>#include <icetray/I3Module.h>#include <dataio/I3FileStager.h>#include <dataclasses/physics/I3MCTreeUtils.h>#include <dataclasses/physics/I3Particle.h>#include <dataclasses/I3Double.h>#include <simclasses/I3CorsikaInfo.h>#include <simclasses/I3CorsikaShowerInfo.h>#include <phys-services/I3RandomService.h>#include <phys-services/surfaces/Cylinder.h>#include <boost/iostreams/filtering_stream.hpp>#include <boost/iostreams/device/file.hpp>#include <boost/iostreams/filter/gzip.hpp>#include <boost/assign.hpp>#include <boost/python.hpp>#include <boost/scoped_ptr.hpp>#include <cmath>
Typedefs
-
typedef I3Map<I3ParticleID, double> I3ParticleIDMap¶
-
typedef boost::shared_ptr<I3ParticleIDMap> I3ParticleIDMapPtr¶
Functions
-
I3_MODULE(CORSIKAResampler)¶
-
double GetSlantDepth(const I3Direction &dir, const I3Position &pos)¶
-
void AddParticleTree(const I3MCTree &mctree, I3MCTree &newtree, const I3Particle &orig_primary, const I3Particle &primary, const I3CorsikaShowerInfo &shower_info, const I3Position &surface_pos, const I3Particle &orig_leaf, const I3Particle &new_leaf)¶
Recursive function to copy a particle from an old tree to a new tree, with all it’s daughters, while keeping the tree-structure. Input naming is consistent with CORSIKAResampler::ResampleEvent.
- Parameters:
mctree – original tree where the particle will be copied from
newtree – new tree where the particle will be copied to
orig_primary – the primary particle of the original tree
primary – the primary particle in the new tree
shower_info – the I3CorsikaShowerInfo object of the shower
surface_pos – the surface position of the shower
orig_leaf – the leaf in the original tree
new_leaf – the same leaf in the new tree
Variables
-
const double EarthRadius = 637131500 * I3Units::cm¶
- Rcs
CORSIKAResampler.cxx 150715 2016-10-12 20:23:40Z hpandya
Copyright (C) 2012 The IceCube Collaboration http://www.icecube.wisc.edu
-
typedef I3Map<I3ParticleID, double> I3ParticleIDMap¶
- file I3CORSIKAReader.cxx
- #include <icetray/open.h>#include <icetray/I3Frame.h>#include <icetray/I3Module.h>#include <dataio/I3FileStager.h>#include <dataclasses/physics/I3MCTreeUtils.h>#include <dataclasses/physics/I3Particle.h>#include <dataclasses/I3Double.h>#include <simclasses/I3CorsikaInfo.h>#include <simclasses/I3CorsikaShowerInfo.h>#include <phys-services/I3RandomService.h>#include <boost/iostreams/filtering_stream.hpp>#include <boost/iostreams/device/file.hpp>#include <boost/iostreams/filter/gzip.hpp>#include <boost/assign.hpp>#include <boost/python.hpp>#include <boost/scoped_ptr.hpp>#include <cmath>#include “corsika-reader/I3CORSIKAReaderUtils.h”#include “icetray/I3Units.h”
Typedefs
-
typedef I3Map<I3ParticleID, double> I3ParticleIDMap
$Id$
Copyright (C) 2012 The IceCube Collaboration http://www.icecube.wisc.edu
-
typedef boost::shared_ptr<I3ParticleIDMap> I3ParticleIDMapPtr
Functions
-
I3_MODULE(I3CORSIKAReader)¶
-
inline bool IsEquivalent(double p1, double p2)¶
-
inline bool IsEquivalent(const I3Position &p1, const I3Position &p2)¶
-
inline bool IsEquivalent(const I3Particle &p1, const I3Particle &p2)¶
-
I3MCTree::iterator EnsureNode(I3MCTreePtr mctree, I3MCTree::iterator root, I3Particle &child)¶
-
typedef I3Map<I3ParticleID, double> I3ParticleIDMap
- file I3CORSIKAReaderUtils.cxx
- #include “corsika-reader/I3CORSIKAReaderUtils.h”#include “dataclasses/physics/I3Particle.h”#include “dataclasses/I3Direction.h”#include <phys-services/surfaces/Sphere.h>#include <boost/bimap.hpp>#include <boost/iterator/transform_iterator.hpp>
- file I3CORSIKAReaderUtils.h
- #include <cstdint>#include <icetray/I3Units.h>#include <dataclasses/I3Constants.h>#include <set>
- file I3CORSIKAService.cxx
- #include “simclasses/I3ShowerBias.h”#include “simclasses/I3CorsikaWeight.h”#include “corsika-reader/I3CORSIKAService.h”#include “corsika-reader/I3CORSIKAReaderUtils.h”
Functions
-
double muon_energy_threshold(double max_range)
-
double muon_energy_threshold(double max_range)
- file I3CORSIKAService.h
- #include <sim-services/I3CosmicEventGenerator.h>#include <dataclasses/I3Orientation.h>#include “corsika-reader/CorsikaClient.h”
- dir corsika-reader
- dir corsika-reader
- dir corsika-reader
- dir icetray
- dir private
- dir public