icecube.clsim.tablemaker.tabulator module

icecube.clsim.tablemaker.tabulator.I3CLSimTabulatePhotons(tray, name, UseCPUs=True, UseGPUs=False, UseOnlyDeviceNumber=None, MCTreeName='I3MCTree', OutputMCTreeName=None, FlasherInfoVectName=None, FlasherPulseSeriesName=None, MMCTrackListName='MMCTrackList', ParallelEvents=1000, RandomService=None, MediumProperties='/Users/buildbot/actions-runner/_work/icetray/build/ice-models/resources/models/ICEMODEL/spice_mie', UseGeant4=False, UseI3PropagatorService=True, CrossoverEnergyEM=None, CrossoverEnergyHadron=None, UseCascadeExtension=False, DoNotParallelize=False, Area=None, WavelengthAcceptance=None, AngularAcceptance=None, UseHoleIceParameterization=True, OverrideApproximateNumberOfWorkItems=None, ExtraArgumentsToI3CLSimModule={}, If=<function <lambda>>)

Do standard clsim processing up to the I3Photon level. These photons still need to be converted to I3MCPEs to be usable for further steps in the standard IceCube MC processing chain. Reads its particles from an I3MCTree and writes an I3PhotonSeriesMap.

All available OpenCL GPUs (and optionally CPUs) will be used. This will take over your entire machine, so make sure to configure your batch jobs correctly when using this on a cluster. When using nVidia cards, you can set the CUDA_VISIBLE_DEVICES environment variable to limit GPU visibility. A setting of CUDA_VISIBLE_DEVICES=”0,3” would only use cards #0 and #3 and ignore cards #1 and #2. In case you are using a batch system, chances are this variable is already set. Unfortunately, there is no corresponding setting for the AMD driver.

This segment assumes that MMC has been applied to the I3MCTree and that MMC was NOT run using the “-recc” option.

Parameters:
  • UseCPUs – Turn this on to also use CPU-based devices. (This may potentially slow down photon generation, which is also done on the CPU in parallel.)

  • UseGPUs – Turn this off to not use GPU-based devices. This may be useful if your GPU is used for display purposes and you don’t want it to slow down.

  • UseOnlyDeviceNumber – Use only a single device number, even if there is more than one device found matching the required description. The numbering starts at 0.

  • MCTreeName – The name of the I3MCTree containing the particles to propagate.

  • OutputMCTreeName – A copy of the (possibly sliced) MCTree will be stored as this name.

  • FlasherInfoVectName – Set this to the name of I3FlasherInfoVect objects in the frame to enable flasher simulation. The module will read I3FlasherInfoVect objects and generate photons according to assumed parameterizations.

  • FlasherPulseSeriesName – Set this to the name of an I3FlasherPulseSeries object in the frame to enable flasher/Standard Candle simulation. This cannot be used at the same time as FlasherInfoVectName. (I3FlasherPulseSeries objects are clsim’s internal flasher representation, if “FlasherInfoVectName” is used, the I3FlasherInfoVect objects are converted to I3FlasherPulseSeries objects.)

  • MMCTrackListName – Only used if ChopMuons is active. Set it to the name of the I3MMCTrackList object that contains additional muon energy loss information.

  • ParallelEvents – clsim will work on a couple of events in parallel in order not to starve the GPU. Setting this too high will result in excessive memory usage (all your frames have to be cached in RAM). Setting it too low may impact simulation performance. The optimal value depends on your energy distribution/particle type.

  • RandomService – Set this to an instance of a I3RandomService. Alternatively, you can specify the name of a configured I3RandomServiceFactory added to I3Tray using tray.AddService(). If you don’t configure this, the default I3RandomServiceFactory will be used.

  • MediumProperties – Set this either to a directory containing a PPC-compatible ice description (icemodel.dat, icemodel.par and cfg.txt) or to a photonics ice table file. PPC-compatible ice files should generally lead to faster execution times on GPUs since it involves less interpolation between table entries (the PPC ice-specification is parametric w.r.t. wavelength, whereas the photonics specification is not).

  • Area – Geometric area of the sensor. If None, use the area of an IceCube DOM

  • WavelengthAcceptance – Quantum efficiency of the sensor, relative to the geometric area. If None, use the IceCube DOM (standard QE)

  • AngularAcceptance – Efficiency as a function of polar angle, relative to the geometric area. If None, use the IceCube angular efficiency, assuming hole ice.

  • UseGeant4 – Enabling this setting will disable all cascade and muon light yield parameterizations. All particles will sent to Geant4 for a full simulation. This does not apply to muons that do have a length assigned. These are assumed to have been generated by MMC and their light is generated according to the usual parameterization.

  • CrossoverEnergyEM – If set it defines the crossover energy between full Geant4 simulations and light yield parameterizations for electro magnetic cascades. This only works when UseGeant4 is set to true. It works in conjunction with CrossoverEnergyHadron. If one of both is set to a positiv value greater 0 (GeV), the hybrid simulation is used. If CrossoverEnergyEM is set to None while CrossoverEnergyHadron is set so hybrid mode is working, GEANT4 is used for EM cascades. If CrossoverEnergyEM is set to 0 (GeV) while CrossoverEnergyHadron is set so hybrid mode is working, leptons and EM cascades will use parameterizations for the whole energy range.

  • CrossoverEnergyHadron – If set it defines the crossover energy between full Geant4 simulations and light yield parameterizations for hadronic cascades. This only works when UseGeant4 is set to true. It works in conjunction with CrossoverEnergyEM. If one of both is set to a positiv value greater 0 (GeV), the hybrid simulation is used. If CrossoverEnergyHadron is set to None while CrossoverEnergyEM is set so hybrid mode is working, GEANT4 is used for hadronic cascades. If CrossoverEnergyHadron is set to 0 (GeV) while CrossoverEnergyHadron is set so hybrid mode is working, hadronic cascades will use parameterizations for the whole energy range.

  • UseCascadeExtension – If True, simulate the longitudinal development of cascades. Otherwise, simulate cascades as pointlike objects.

  • DoNotParallelize – Try only using a single work item in parallel when running the OpenCL simulation. This might be useful if you want to run jobs in parallel on a batch system. This will only affect CPUs and will be a no-op for GPUs.

  • OverrideApproximateNumberOfWorkItems – Allows to override the auto-detection for the maximum number of parallel work items. You should only change this if you know what you are doing.

  • If – Python function to use as conditional execution test for segment modules.

icecube.clsim.tablemaker.tabulator.TabulatePhotonsFromSource(tray, name, PhotonSource='cascade', Zenith=0.0, Azimuth=0.0, ZCoordinate=0.0, Energy=1.0, FlasherWidth=127, FlasherBrightness=127, Seed=12345, NEvents=100, IceModel='spice_mie', DisableTilt=False, Filename='', TabulateImpactAngle=False, PhotonPrescale=1, Axes=None, Directions=None, Sensor='DOM', RecordErrors=False, UseGeant4=False, HoleIce='as.h2-50cm')

Tabulate the distribution of photoelectron yields on IceCube DOMs from various light sources. The light profiles of the sources are computed from the same parameterizations used in PPC, but like in the direct propagation mode can be computed using GEANT4 instead.

The mode of tabulation is controlled primarily by the PhotonSource parameter.

  • ‘cascade’ will simulate an electromagnetic cascade of Energy GeV at (0, 0, ZCoordinate), oriented according to Zenith and Azimuth. The default coordinate system is spherical and centered the given vertex, with 200 quadratically spaced bins in radius, 36 linear bins in azimuthal angle (only from 0 to 180 degrees by default), 100 linear bins in the cosine of the polar angle, and 105 quadratic bins in time residual w.r.t the direct path from (0, 0, ZCoordinate).

  • ‘flasher’ will simulate a 405 nm LED flasher pulse with the given FlasherWidth and FlasherBrightness settings. The source position and coordinate system are the same as for the ‘cascade’ case.

  • ‘infinite-muon’ will simulate a “bare” muon of infinite length. The coordinate system is cylindrical and centered on the axis of the muon. Since the muon’s position is degenerate with time, the usual parallel distance is replaced by the z coordinate of the closest approach to the detection position, and the starting positions of the simulated muons are sampled randomly (ZCoordinate is ignored). There are 100 quadratic bins in perpendicular distance to the source axis, 36 linear bins in azimuthal angle (0 to \(\pi\) radians), 100 linear bins in z coordinate of closest approach, and 105 quadratic bins in time residual w.r.t. the earliest possible Cherenkov photon.

Parameters:
  • PhotonSource – the type of photon source (‘cascade’, ‘flasher’, or ‘infinite-muon’).

  • Zenith – the orientation of the source

  • ZCoordinate – the depth of the source

  • Energy – the energy of the source (only for cascade tables)

  • FlasherWidth – the width of the flasher pulse (only for flasher tables)

  • FlasherBrightness – the brightness of the flasher pulse (only for flasher tables)

  • Seed – the seed for the random number service

  • NEvents – the number of events to simulate

  • RecordErrors – record the squares of weights as well (useful for error bars)

  • IceModel – the path to an ice model in $I3_BUILD/ice-models/resources/models/ICEMODEL. Likely values include: ‘spice_mie’ ppc-style SPICE-Mie parametrization

  • DisableTilt – if true, disable tilt in ice model

  • Filename – the name of the FITS file to write

  • TabulateImpactAngle – if True, tabulate the impact position of the photon on the DOM instead of weighting by the DOM’s angular acceptance

  • Axes – a subclass of clsim::tabulator::Axes that defines the coordinate system. If None, an appropriate default will be chosen based on PhotonSource.

  • Directions – a set of directions to allow table generation for multiple sources. If None, only one direction given by Zenith and Azimuth is used.

icecube.clsim.tablemaker.tabulator.generate_seed()
icecube.clsim.tablemaker.tabulator.makeFlasherPulse(x, y, z, zenith, azimuth, width, brightness, scale)
icecube.clsim.tablemaker.tabulator.unpin_threads(delay=60)

When AMD OpenCL fissions the CPU device, it pins each sub-device to a a physical core. Since we always use sub-device 0, this means that multiple instances of the tabulator on a single machine will compete for core 0. Reset thread affinity after delay seconds to prevent this from happening.