icecube.polyplopia.timescalefixer module

class icecube.polyplopia.timescalefixer.CorsikaTimeScaleFixer(context)

Bases: I3Module

Adjusts the corsika timescale when only a fraction of events in a file are read. The module loops over the file to count the number of events at initialization and then uses this total number of events along with the number of events to read to rescale the TimeScale variable so that subsequent use of this file by e.g. polyplopia will correctly calculate the event rate.

This module will also limit the number of events read to the given number and request a suspension after the given number is reached. This means it can be used to limit the number of events more accurately than the frame limit given to the tray’s execute method which limits all frames, not just DAQ frames.

WARNING: This module should only be used when a Corsika file is deliberately truncated by not reading all the events e.g. in the case of a very large background event file. If all events are read but only a subset pass some selection criteria for output then the Corsika ‘TimeScale’ remains correct and should NOT be changed by use of this module!

Parameters:
  • InputFile – name of the file containing the events being read

  • ReadEvents – the maximum number of events to read from the input file

  • MaxExcess – the number of events over the read limit to tolerate before generating a fatal error

Configure((I3Module)arg1) None :
C++ signature :

void Configure(PythonModule<I3Module> {lvalue})

DAQ(frame)

Gets the corsika weightmap and changes the TimeScale value by the calculated scale factor. This has to happen for every DAQ frame because a copy of the Corsika weightmap is stored in each frame eventhough things like the ‘TimeScale’ are constant over the file. :param frame: frame read from the I3 file :return: True if everything worked, false otherwise

Finish((I3Module)arg1) None :
C++ signature :

void Finish(PythonModule<I3Module> {lvalue})