Python Scripting Interface

The seededRT algorithm of STTools provides a Python scripting interface for seededRT hit cleaning without icetray. This feature is an automatic (positive) result from the utility function approach used in STTools.

The seededRT Python module of STTools provides (based on the intended output type in analogy with the I3SeededRTCleaningModule icetray module) three Python functions for doing seededRT hit cleaning in a Python script or console:

icecube.STTools.seededRT.doSeededRTCleaning_RecoPulse((I3SeededRTConfigurationService)stConfigService, (seed_with_all_HLC_hits_I3RecoPulse)seedProcedure, (I3Frame)frame, (str)inputHitSeriesMapName[, (int)maxNIterations=-1[, (bool)allowNoSeedHits=False]]) I3RecoPulseSeriesMap :
Does a seededRT cleaning on a given I3RecoPulseSeriesMap or

I3RecoPulseSeriesMapMask named inputHitSeriesMapName stored inside a given I3Frame object using a given I3SeededRTConfigurationService object and a given seed procedure object.

return I3RecoPulseSeriesMap:

The seededRT cleaned hit series map as an I3RecoPulseSeriesMap object.

doSeededRTCleaning_RecoPulse( (I3SeededRTConfigurationService)stConfigService, (seed_with_all_core_hits_I3RecoPulse)seedProcedure, (I3Frame)frame, (str)inputHitSeriesMapName [, (int)maxNIterations=-1 [, (bool)allowNoSeedHits=False]]) -> I3RecoPulseSeriesMap

doSeededRTCleaning_RecoPulse( (I3SeededRTConfigurationService)stConfigService, (seed_with_HLC_core_hits_I3RecoPulse)seedProcedure, (I3Frame)frame, (str)inputHitSeriesMapName [, (int)maxNIterations=-1 [, (bool)allowNoSeedHits=False]]) -> I3RecoPulseSeriesMap

doSeededRTCleaning_RecoPulse( (I3SeededRTConfigurationService)stConfigService, (seed_with_OMKey_hits_I3RecoPulse)seedProcedure, (I3Frame)frame, (str)inputHitSeriesMapName [, (int)maxNIterations=-1 [, (bool)allowNoSeedHits=False]]) -> I3RecoPulseSeriesMap

doSeededRTCleaning_RecoPulse( (I3SeededRTConfigurationService)stConfigService, (seed_with_Nth_OMKey_hits_I3RecoPulse)seedProcedure, (I3Frame)frame, (str)inputHitSeriesMapName [, (int)maxNIterations=-1 [, (bool)allowNoSeedHits=False]]) -> I3RecoPulseSeriesMap

doSeededRTCleaning_RecoPulse( (I3SeededRTConfigurationService)stConfigService, (seed_with_hit_series_map_hits_from_frame_I3RecoPulse)seedProcedure, (I3Frame)frame, (str)inputHitSeriesMapName [, (int)maxNIterations=-1 [, (bool)allowNoSeedHits=False]]) -> I3RecoPulseSeriesMap

icecube.STTools.seededRT.doSeededRTCleaning_RecoPulseMask((I3SeededRTConfigurationService)stConfigService, (seed_with_all_HLC_hits_I3RecoPulse)seedProcedure, (I3Frame)frame, (str)inputHitSeriesMapName[, (int)maxNIterations=-1[, (bool)allowNoSeedHits=False]]) I3RecoPulseSeriesMapMask :
Does a seededRT cleaning on a given I3RecoPulseSeriesMap or

I3RecoPulseSeriesMapMask named inputHitSeriesMapName stored inside a given I3Frame object using a given I3SeededRTConfigurationService object and a given seed procedure object.

return I3RecoPulseSeriesMapMask:

The seededRT cleaned hit series map as an I3RecoPulseSeriesMapMask object.

doSeededRTCleaning_RecoPulseMask( (I3SeededRTConfigurationService)stConfigService, (seed_with_all_core_hits_I3RecoPulse)seedProcedure, (I3Frame)frame, (str)inputHitSeriesMapName [, (int)maxNIterations=-1 [, (bool)allowNoSeedHits=False]]) -> I3RecoPulseSeriesMapMask

doSeededRTCleaning_RecoPulseMask( (I3SeededRTConfigurationService)stConfigService, (seed_with_HLC_core_hits_I3RecoPulse)seedProcedure, (I3Frame)frame, (str)inputHitSeriesMapName [, (int)maxNIterations=-1 [, (bool)allowNoSeedHits=False]]) -> I3RecoPulseSeriesMapMask

doSeededRTCleaning_RecoPulseMask( (I3SeededRTConfigurationService)stConfigService, (seed_with_OMKey_hits_I3RecoPulse)seedProcedure, (I3Frame)frame, (str)inputHitSeriesMapName [, (int)maxNIterations=-1 [, (bool)allowNoSeedHits=False]]) -> I3RecoPulseSeriesMapMask

doSeededRTCleaning_RecoPulseMask( (I3SeededRTConfigurationService)stConfigService, (seed_with_Nth_OMKey_hits_I3RecoPulse)seedProcedure, (I3Frame)frame, (str)inputHitSeriesMapName [, (int)maxNIterations=-1 [, (bool)allowNoSeedHits=False]]) -> I3RecoPulseSeriesMapMask

doSeededRTCleaning_RecoPulseMask( (I3SeededRTConfigurationService)stConfigService, (seed_with_hit_series_map_hits_from_frame_I3RecoPulse)seedProcedure, (I3Frame)frame, (str)inputHitSeriesMapName [, (int)maxNIterations=-1 [, (bool)allowNoSeedHits=False]]) -> I3RecoPulseSeriesMapMask

icecube.STTools.seededRT.doSeededRTCleaning_DOMLaunch((I3SeededRTConfigurationService)stConfigService, (seed_with_all_HLC_hits_I3DOMLaunch)seedProcedure, (I3Frame)frame, (str)inputHitSeriesMapName[, (int)maxNIterations=-1[, (bool)allowNoSeedHits=False]]) I3DOMLaunchSeriesMap :
Does a seededRT cleaning on a given I3DOMLaunchSeriesMap named

inputHitSeriesMapName stored inside a given I3Frame object using a given I3SeededRTConfigurationService object and a given seed procedure object.

return I3DOMLaunchSeriesMap:

The seededRT cleaned hit series map as an I3DOMLaunchSeriesMap object.

doSeededRTCleaning_DOMLaunch( (I3SeededRTConfigurationService)stConfigService, (seed_with_all_core_hits_I3DOMLaunch)seedProcedure, (I3Frame)frame, (str)inputHitSeriesMapName [, (int)maxNIterations=-1 [, (bool)allowNoSeedHits=False]]) -> I3DOMLaunchSeriesMap

doSeededRTCleaning_DOMLaunch( (I3SeededRTConfigurationService)stConfigService, (seed_with_HLC_core_hits_I3DOMLaunch)seedProcedure, (I3Frame)frame, (str)inputHitSeriesMapName [, (int)maxNIterations=-1 [, (bool)allowNoSeedHits=False]]) -> I3DOMLaunchSeriesMap

doSeededRTCleaning_DOMLaunch( (I3SeededRTConfigurationService)stConfigService, (seed_with_OMKey_hits_I3DOMLaunch)seedProcedure, (I3Frame)frame, (str)inputHitSeriesMapName [, (int)maxNIterations=-1 [, (bool)allowNoSeedHits=False]]) -> I3DOMLaunchSeriesMap

doSeededRTCleaning_DOMLaunch( (I3SeededRTConfigurationService)stConfigService, (seed_with_Nth_OMKey_hits_I3DOMLaunch)seedProcedure, (I3Frame)frame, (str)inputHitSeriesMapName [, (int)maxNIterations=-1 [, (bool)allowNoSeedHits=False]]) -> I3DOMLaunchSeriesMap

doSeededRTCleaning_DOMLaunch( (I3SeededRTConfigurationService)stConfigService, (seed_with_hit_series_map_hits_from_frame_I3DOMLaunch)seedProcedure, (I3Frame)frame, (str)inputHitSeriesMapName [, (int)maxNIterations=-1 [, (bool)allowNoSeedHits=False]]) -> I3DOMLaunchSeriesMap

Seed Procedure Classes

The function described above take objects of seed procedure classes, which define the hit seed procedure. The following seed procedure classes exists:

class icecube.STTools.seededRT.seed_with_all_HLC_hits_I3RecoPulse
__init__((object)self) None :

Creates an object to seed with all reco pulses, that are HLC reco pulses.

class icecube.STTools.seededRT.seed_with_all_HLC_hits_I3DOMLaunch
__init__((object)self) None :

Creates an object to seed with all DOM launches, that are HLC DOM launches.

class icecube.STTools.seededRT.seed_with_all_core_hits_I3RecoPulse
__init__((object)self, (I3SeededRTConfigurationService)stConfigService, (int)nHitsThreshold, (bool)allowNoSeedHits) None :

Creates an object to seed all reco pulses that have at least nHitsThreshold partner ST reco pulses.

Note

If the allowNoSeedHits option is set to False and no reco pulses fulfill the requirements above, all reco pulses will be used as seed hits!

class icecube.STTools.seededRT.seed_with_all_core_hits_I3DOMLaunch
__init__((object)self, (I3SeededRTConfigurationService)stConfigService, (int)nHitsThreshold, (bool)allowNoSeedHits) None :

Creates an object to seed all DOM launches that have at least nHitsThreshold partner ST DOM launches.

Note

If the allowNoSeedHits option is set to False and no DOM launches fulfill the requirements above, all DOM launches will be used as seed hits!

class icecube.STTools.seededRT.seed_with_HLC_core_hits_I3RecoPulse
__init__((object)self, (I3SeededRTConfigurationService)stConfigService, (int)nHitsThreshold, (bool)allowNoSeedHits) None :

Creates an object to seed with all HLC reco pulses that have at least nHitsThreshold partner ST HLC reco pulses.

Note

If the allowNoSeedHits option is set to False and no HLC reco pulses fulfill the requirements above, all HLC reco pulses will be used as seed hits!

class icecube.STTools.seededRT.seed_with_HLC_core_hits_I3DOMLaunch
__init__((object)self, (I3SeededRTConfigurationService)stConfigService, (int)nHitsThreshold, (bool)allowNoSeedHits) None :

Creates an object to seed with all HLC DOM launches that have at least nHitsThreshold partner ST HLC DOM launches.

Note

If the allowNoSeedHits option is set to False and no HLC DOM launches fulfill the requirements above, all HLC DOM launches will be used as seed hits!

class icecube.STTools.seededRT.seed_with_OMKey_hits_I3RecoPulse
__init__((object)self, (vector_OMKey)omKeys) None :

Creates an object to seed with all reco pulses that belong to the OMs present in the given OMKey object list.

class icecube.STTools.seededRT.seed_with_OMKey_hits_I3DOMLaunch
__init__((object)self, (vector_OMKey)omKeys) None :

Creates an object to seed with all DOM launches that belong to the OMs present in the given OMKey object list.

class icecube.STTools.seededRT.seed_with_Nth_OMKey_hits_I3RecoPulse
__init__((object)self, (int)nth, (vector_OMKey)omKeys) None :

Creates an object to seed with all reco pulses that belong to the OMs present in the given OMKey object list and that are the N-th reco pulses within the OM’s reco pulse series.

class icecube.STTools.seededRT.seed_with_Nth_OMKey_hits_I3DOMLaunch
__init__((object)self, (int)nth, (vector_OMKey)omKeys) None :

Creates an object to seed with all DOM launches that belong to the OMs present in the given OMKey object list and that are the N-th DOM launches within the OM’s DOM launch series.

class icecube.STTools.seededRT.seed_with_hit_series_map_hits_from_frame_I3RecoPulse
__init__((object)self, (str)seedHitSeriesMapName) None :

Creates a class object to seed with all hits which are contained inside an I3RecoPulseSeriesMap or I3RecoPulseSeriesMapMask object named seedHitSeriesMapName present in the current processed frame.

class icecube.STTools.seededRT.seed_with_hit_series_map_hits_from_frame_I3DOMLaunch
__init__((object)self, (str)seedHitSeriesMapName) None :

Creates a class object to seed with all hits which are contained inside an I3DOMLaunchSeriesMap object named seedHitSeriesMapName present in the current processed frame.

Example

An example Python script can be found at $I3_BUILD/STTools/resources/examples/SeededRTCleaningScripting.py.

Four steps need to be performed in order to do a seededRT hit cleaning:

  1. Create a ST configuration service object.

  2. Setup the spatial context of the ST configuration object using an I3OMGeo object.

  3. Create a seed procedure object.

  4. Finally, call the seededRT hit cleaning utility function passing it the ST configuration service object, the seed procedure object, an I3Frame object, the name of the hit map inside that frame object, and optional parameters.

from icecube import STTools

# Create the ST configuration service using default values.
stConfigService = STTools.seededRT.configuration_services.I3DOMLinkSeededRTConfigurationService()

# Setup the spatial context for the detector geometry.
stConfigService.SetupSContext(frame['I3Geometry'].omgeo)

seedProcedure = STTools.seededRT.seed_with_HLC_core_hits_I3RecoPulse(
    stConfigService = stConfigService,
    nHitsThreshold  = 2,
    allowNoSeedHits = False)

srtCleanedPulseMap = STTools.seededRT.doSeededRTCleaning_RecoPulse(
    stConfigService       = stConfigService,
    seedProcedure         = seedProcedure,
    frame                 = frame,
    inputHitSeriesMapName = "OfflinePulses",
    maxNIterations        = 0,    # Optional, default is 0.
    allowNoSeedHits       = False # Optional, default is False.
)

# Put the cleaned pulse map into the frame.
frame['MySRTCleanedPulseMap'] = srtCleanedPulseMap