vuvuzela C++ API Reference

class Inject : public I3ConditionalModule
#include <Inject.h>

This class will add all the parameters that are used in the vuvuzela noise generator to the Calibration frame.

class Inject

Version

date:

Rcs
Rcs
Author

D. Jason Koskinen (c) 2012 IceCube Collaboration IceTray module to add the noise parameters to the frame for Vuvuzela simulation

Public Functions

Inject(const I3Context &context)

Constructor: builds an instance of the module, with the context provided by IceTray.

Adds the default values for each of the configuration parameters

~Inject()

The destructor for Inject.

void Configure()

Configure: Reads the parameters from the python processing script.

Gets the values of each parameter. They’re as follows:

InputNoiseFile The .dat file containing the noise parameters for each DOM OutputName The name of the NoiseParamsMap that will be added to the D frame

void Calibration(I3FramePtr frame)

Calibration: Add the NoiseParamsMap to the Calibration frame.

Runs the Inject module, adding a NoiseParamsMap to the Calibration frame. The object will be visible to all subsequent frames.

Parameters:

frame – The frame to process

Private Functions

SET_LOGGER ("Inject")

Private Members

std::string InNoiseFileName_
class Vuvuzela : public I3Module
#include <Vuvuzela.h>

A noise generator for IceCube used to simulate both thermal noise and decay+scintillation noise.

class Vuvuzela

Version

date:

Rcs
Rcs
Author

Michael Larson (c) 2012 IceCube Collaboration IceTray module to simulate thermal and correlated noise

Public Functions

explicit Vuvuzela(const I3Context &ctx)

Constructor: builds an instance of the module, with the context provided by IceTray.

Adds the default values for each of the configuration parameters

~Vuvuzela()

The destructor for Vuvuzela.

void Configure()

Configure: Reads the parameters from the python processing script.

Gets the values of each parameter. They’re as follows:

InputHitSeriesMap The name of the input hit series. If empty, will produce a noise-only hit series. OutputHitSeriesMap The name of the output hit series. If empty, will replace the InputHitSeriesMap. StartWindow The amount of time relative to the first pre-existing hit to simulate. Negative for “Before first hit”. EndWindow The amount of time relative to the last pre-existing hit to simulate. Positive for “After last hit”. OMTypes Simulate noise in DOMs of these types. ScaleFactor Used to scale the thermal and nonthermal rates. DeepCoreScaleFactor Used to scale the noise rates for the HQE DOMs. DOMsToExclude A list of OMKeys to skip simulating. RandomService The name of the I3RandomService. ThermalRate Thermal noise rate. DecayRate The rate of decays that cause clusters. ScintillationMean The mean of the lognormal describing scintillation in Log10(dt/ns) ScintillationSigma The sigma of the lognormal describing scintillation in Log10(dt/ns) ScintillationHits The expected number of hits from a cluster. UseIndividual Use individual numbers for each DOM? DisableLowDTCutoff Removes the truncation at 2 microseconds for the timing distribution of noise hits

void DAQ(I3FramePtr frame)

DAQ: Add thermal and nonthermal noise to the frame.

Runs the Vuvuzela module, adding noise to the frame.

Parameters:

frame – The frame to process

void Finish()

Finish: Print out the number of hits and the total livetime of noise.

Runs after the final event. Prints out the number of total number of hits added to all frames as well as the total livetime of noise hits added.

void GetGoodDoms(const I3Geometry &geometry, const I3Calibration &calibration)

GetGoodDoms: Produce the list of DOMs to simulate.

Loops through the geometry and saves a list of the good doms to simulate. This is only done once to avoid the std::find used in the excludeList search.

Parameters:
  • geometry – The I3Geometry used to loop over all DOMs.

  • calibration – The I3Calibration used to pick noise rates for DOMs

I3MCPESeriesMapConstPtr GetNoiseHits(const I3Calibration &calibration, double start, double stop)

GetNoiseHits: Produce the map of noise hits to be added to this frame.

Fills the hit map with thermal and nonthermal noise for the entire period from start to stop and for each DOM.

Parameters:
  • calibration – The I3Calibration for the file. Used to get HQE/QE status

  • start – The time for the event to begin

  • stop – The time for the event to end

Returns:

An I3Map of OMKey to a vector of hit times to be used for sampling.

Private Functions

SET_LOGGER ("Vuvuzela")

Private Members

std::string inputHitSeriesMapName_
std::string outputHitSeriesMapName_
std::string inputI3EventHeaderName_
std::vector<OMKey> excludeList_
std::vector<OMKey> goodDOMs
double startWindow_
double endWindow_
double scaleFactor_
double deepCoreScaleFactor_
std::vector<int> goodOMTypes_
bool useIndividual_
bool simulateNewDoms_
bool useEventHeaderBounds_
bool disableLowDTcutoff_
double thermalRate_
double decayRate_
double scintillationMean_
double scintillationSigma_
double scintillationHits_
I3RandomServicePtr randomService
std::string randomServiceName_
std::map<OMKey, std::set<double>> bufferMap
bool firstTime
int nhits
double bufferTime
namespace std

STL namespace.

file Inject.cxx
#include <fstream>
#include “vuvuzela/Inject.h
#include “icetray/OMKey.h”

Functions

I3_MODULE(Inject)
file Inject.h
#include <dataclasses/I3Map.h>
#include <dataclasses/calibration/I3Calibration.h>
#include <dataclasses/calibration/I3DOMCalibration.h>
#include <icetray/I3ConditionalModule.h>
#include <icetray/I3Context.h>
#include <icetray/I3Frame.h>
#include <icetray/I3Logging.h>
#include <icetray/I3Units.h>
file Vuvuzela.cxx
#include “vuvuzela/Vuvuzela.h
#include <cmath>
#include <boost/foreach.hpp>

Functions

I3_MODULE(Vuvuzela)
file Vuvuzela.h
#include <algorithm>
#include <vector>
#include <set>
#include <iterator>
#include “icetray/I3ConditionalModule.h”
#include “icetray/I3Frame.h”
#include “icetray/I3Units.h”
#include “dataclasses/geometry/I3Geometry.h”
#include “dataclasses/geometry/I3OMGeo.h”
#include “dataclasses/calibration/I3Calibration.h”
#include “dataclasses/calibration/I3DOMCalibration.h”
#include “dataclasses/physics/I3EventHeader.h”
#include “simclasses/I3MCPE.h”
#include “phys-services/I3RandomService.h”
file VuvuzelaFunctions.cxx

Functions

void MakeNonThermalHits(I3RandomServicePtr random, std::set<double> &bufferSeries, const double bufferTime, std::set<double> &decayTimes, const double decayRate, const double nHits, const double mean, const double sigma, const double start, const double stop, bool disableCutoff)

A set of functions used by Vuvuzela. Separated to simplify the testing and readability slightly.

Produces the decay and scintillation hits. The former are produced by throwing decays uniformly in time from start to stop. The latter are produced by simulating a standard normal distribution (mu=0, sigma=1) and exponentiating according to f(x) = 10^(mean + sigma*g(x)) Hits produced are added to the buffer if the dt satisfy dt>2 us

Parameters:
  • random – A random service capable of producing a uniform distribution

  • bufferSeries – The buffer holding the hit times. New hits are added here

  • bufferTime – The current time of the buffer. This is used to keep ordering of the buffer hits.

  • decayTimes

  • decayRate – The decay rate

  • nHits – The mean number of scintillation hits from each decay

  • mean – The mean for the lognormal describing scintillation in Log10(dt/ns)

  • sigma – The sigma for the lognormal describing scintillation in Log10(dt/ns)

  • start – The time for the event to begin

  • stop – The time for the event to end

  • disableCutoff

void MakeThermalHits(I3RandomServicePtr random, std::set<double> &bufferSeries, const double bufferTime, const double rate, const double start, const double stop)

Produces the thermal hits by throwing hits uniform in time.

Produces the thermal hits by throwing hits uniform in time.

Parameters:
  • random – A random service capable of producing a uniform distribution

  • bufferSeries – The buffer holding the hit times. Hits are added to this directly

  • bufferTime – The current time of the buffer. This is used to keep ordering of the buffer hits.

  • rate – The thermal rate

  • start – The time for the event to begin

  • stop – The time for the event to end

std::pair<double, double> GetTimeRange(I3MCPESeriesMapConstPtr inputHitMap)

Reads the hit map to find the time of the first and last hits. There may be a faster way to do this, but this was taken from noise-generator.

Reads the hit map to find the time of the first and last hits. There may be a faster way to do this, but this was taken from noise-generator.

Parameters:

inputHitMap – The I3MCPESeriesMapConstPtr to check.

Returns:

A std::pair constaining the [first, last] hit times from the map.

bool CompareMCPEs(const I3MCPE &lhs, const I3MCPE &rhs)

A comparison operator for I3MCPEs. Used as a functor when merging the input and noise hit maps.

A comparison operator for I3MCPEs. Used as a functor when merging the input and noise hit maps.

Parameters:
  • lhs – The first MCPE

  • rhs – The second MCPE

Returns:

True if lhs comes before rhs, false otherwise.

I3MCPESeriesMapConstPtr AddHitMaps(I3MCPESeriesMapConstPtr firstterm, I3MCPESeriesMapConstPtr secondterm, I3ParticleIDMapPtr firstinfo)

Merges two I3MCPEMaps. Shamelessly stolen wholesale from noise-generator.

Merges two I3MCPEMaps. Shamelessly stolen wholesale from noise-generator.

Parameters:
  • firstterm – The input hit map from the frame

  • secondterm – The noise hit map produced by Vuvuzela

  • firstinfo – Parent particle information associated with firstterm. May be NULL, indicating that this information is inside the hits themselves.

Returns:

An I3MCPESeriesMapConstPtr for the merged and sorted hitmap

file VuvuzelaFunctions.h
#include <algorithm>
#include <functional>
#include <numeric>
#include <set>
#include <math.h>
#include “simclasses/I3MCPE.h”
#include <sim-services/MCPEMCPulseTools.hpp>
#include “icetray/I3Units.h”
#include “icetray/OMKey.h”
#include “phys-services/I3RandomService.h”

Functions

void MakeNonThermalHits(I3RandomServicePtr random, std::set<double> &bufferSeries, const double bufferTime, std::set<double> &decayTimes, const double rate, const double nHits, const double mean, const double sigma, const double start, const double stop, bool disableCutoff)

A set of functions used by Vuvuzela. Separated to simplify the testing and readability slightly.

class VuvuzelaFunctions Version

date:

Produces the decay and scintillation hits. The former are produced by throwing decays uniformly in time from start to stop. The latter are produced by simulating a standard normal distribution (mu=0, sigma=1) and exponentiating according to f(x) = 10^(mean + sigma*g(x)) Hits produced are added to the buffer if the dt satisfy dt>2 us
Rcs
Rcs
Author

Michael Larson (c) 2012 IceCube CollaborationProduces the decay and scintillation hits. The former are produced by throwing decays uniformly in time from start to stop. The latter follow a lognormal distribution.

Parameters:
  • random – A random service capable of producing a uniform distribution

  • bufferSeries – The buffer holding the hit times. New hits are added here

  • bufferTime – The current time of the buffer. This is used to keep ordering of the buffer hits.

  • decayTimes

  • decayRate – The decay rate

  • nHits – The mean number of scintillation hits from each decay

  • mean – The mean for the lognormal describing scintillation in Log10(dt/ns)

  • sigma – The sigma for the lognormal describing scintillation in Log10(dt/ns)

  • start – The time for the event to begin

  • stop – The time for the event to end

  • disableCutoff

void MakeThermalHits(I3RandomServicePtr random, std::set<double> &bufferSeries, const double bufferTime, const double rate, const double start, const double stop)

Produces the thermal hits by throwing hits uniform in time.

Produces the thermal hits by throwing hits uniform in time.

Parameters:
  • random – A random service capable of producing a uniform distribution

  • bufferSeries – The buffer holding the hit times. Hits are added to this directly

  • bufferTime – The current time of the buffer. This is used to keep ordering of the buffer hits.

  • rate – The thermal rate

  • start – The time for the event to begin

  • stop – The time for the event to end

std::pair<double, double> GetTimeRange(I3MCPESeriesMapConstPtr inputHitMap)

Reads the hit map to find the time of the first and last hits. There may be a faster way to do this, but this was taken from noise-generator.

Reads the hit map to find the time of the first and last hits. There may be a faster way to do this, but this was taken from noise-generator.

Parameters:

inputHitMap – The I3MCPESeriesMapConstPtr to check.

Returns:

A std::pair constaining the [first, last] hit times from the map.

bool CompareMCPEs(const I3MCPE &lhs, const I3MCPE &rhs)

A comparison operator for I3MCPEs. Used as a functor when merging the input and noise hit maps.

A comparison operator for I3MCPEs. Used as a functor when merging the input and noise hit maps.

Parameters:
  • lhs – The first MCPE

  • rhs – The second MCPE

Returns:

True if lhs comes before rhs, false otherwise.

I3MCPESeriesMapConstPtr AddHitMaps(I3MCPESeriesMapConstPtr firstterm, I3MCPESeriesMapConstPtr secondterm, I3ParticleIDMapPtr firstinfo)

Merges two I3MCPEMaps. Shamelessly stolen wholesale from noise-generator.

Merges two I3MCPEMaps. Shamelessly stolen wholesale from noise-generator.

Parameters:
  • firstterm – The input hit map from the frame

  • secondterm – The noise hit map produced by Vuvuzela

  • firstinfo – Parent particle information associated with firstterm. May be NULL, indicating that this information is inside the hits themselves.

Returns:

An I3MCPESeriesMapConstPtr for the merged and sorted hitmap

dir icetray
dir private
dir public
dir vuvuzela
dir vuvuzela
dir vuvuzela