Class EmissionMap

Inheritance Relationships

Base Type

Class Documentation

class EmissionMap : public Referenced

Particle Type and energy binned emission maps.

Use SourceEmissionMap to suppress directions at the source. Use EmissionMapFiller to create EmissionMap from Observer.

Public Types

typedef std::pair<int, size_t> key_t
typedef std::map<key_t, ref_ptr<CylindricalProjectionMap>> map_t

Public Functions

EmissionMap()
EmissionMap(size_t nPhi, size_t nTheta, size_t nEnergy)
Parameters:
  • nPhi – number of bins for phi (0-2pi)

  • nTheta – number of bins for theta (0-pi)

  • nEnergy – number of bins for energy (1e-4 - 1e4 EeV)

EmissionMap(size_t nPhi, size_t nTheta, size_t nEnergy, double minEnergy, double maxEnergy)
Parameters:
  • nPhi – number of bins for phi (0-2pi)

  • nTheta – number of bins for theta (0-pi)

  • nEnergy – number of bins for energy (1e-4 - 1e4 EeV)

  • minEnergy – minimum energy for binning

  • maxEnergy – maximum energy for binning

double energyFromBin(size_t bin) const

Calculate energy from bin

size_t binFromEnergy(double energy) const

Calculate bin from energy

map_t &getMaps()
const map_t &getMaps() const
void fillMap(int pid, double energy, const Vector3d &direction, double weight = 1.)

Increment the value for particle type, energy and direction by weight.

void fillMap(const ParticleState &state, double weight = 1.)

Increment the value for the particle state by weight.

bool drawDirection(int pid, double energy, Vector3d &direction) const

Draw a random vector from the distribution.

bool drawDirection(const ParticleState &state, Vector3d &direction) const

Draw a random vector from the distribution.

bool checkDirection(int pid, double energy, const Vector3d &direction) const

Check if the direction has a non zero propabiliy.

bool checkDirection(const ParticleState &state) const

Check if the direction has a non zero propabiliy.

bool hasMap(int pid, double energy)

Check if a valid map exists

ref_ptr<CylindricalProjectionMap> getMap(int pid, double energy)

Get the map for the specified pid and energy

void save(const std::string &filename)

Save the content of the maps into a text file

void load(const std::string &filename)

Load the content of the maps from a text file

void merge(const EmissionMap *other)

Merge other maps, add pdfs

void merge(const std::string &filename)

Merge maps from file

inline size_t addReference() const
inline size_t removeReference() const
inline int removeReferenceNoDelete() const
inline size_t getReferenceCount() const

Protected Attributes

double minEnergy
double maxEnergy
double logStep
size_t nPhi
size_t nTheta
size_t nEnergy
map_t maps
mutable size_t _referenceCount