icecube.icetray.i3tray module

class icecube.icetray.i3tray.I3Tray

Bases: _I3TrayBase

A convenience wrapper around the wrapped c++ class _icetray.I3Tray. This class provides keyword-arguments to the AddModule and so forth.

Add(_type: str | Type[_icetray.I3Module] | Callable[..., Any], _name: str | None = None, **kwargs)

Add a module, service, or segment to the tray.

AddModule(_type: str | Type[_icetray.I3Module] | Callable[..., Any], _name: str | None = None, *, If=None, **kwargs) Self

Add a module to the tray’s processing stream.

Parameters:
  • _type – either a string (search for a registered c++ module in the module factory) or a python class (create a module of this type), or a python function (create a python module to wrap this function).

  • _name – instance name for this module, needed when connecting in/outboxes in unusual ways, otherwise just make this string unique among the set of name parameters passed to AddModule and AddService.

  • kwargs – parameter values forwarded to the added module

Example:

tray.AddModule("I3Reader", "reader",
               Filename = "/path/to/foo.i3",
               SkipKeys = ['I3DST', 'RecoPulses'])
AddSegment(_segment, _name: str | None = None, *, If=None, **kwargs)

Add a tray segment to the tray. This is a small scriptlet that can autoconfigure some set of modules and services according to a predefined configuration.

Parameters:
  • _segment – tray segment (a python callable registered with @icetray.traysegment)

  • _name – base for names of all added modules and services

  • kwargs – parameter values forwarded to the added segment

Example:

tray.AddSegment(icetray.ExampleSegment, "example")
AddService(_type: str, _name: str | None = None, **kwargs)

Add a service factory to the tray.

Parameters:
  • _type – a string (search for a registered c++ service factory)

  • _name – instance name for this factory

  • kwargs – parameter values forwarded to the added module

Example:

tray.AddService("I3GSLRandomServiceFactory", "gslrng")
Execute((_I3TrayBase)arg1) None :
C++ signature :

void Execute(I3Tray {lvalue})

Execute( (_I3TrayBase)arg1, (int)arg2) -> None :

C++ signature :

void Execute(I3Tray {lvalue},unsigned int)

PrintUsage(fraction=0.9)

Pretty-print the time spent in each module, as usually done in the I3Module destructor.

Parameters:

fraction – Print out the usage of modules consuming this much of the total runtime.

Returns:

Returns a list of keys that were printed. Implemented for testing.

SetParameter((_I3TrayBase)arg1, (str)arg2, (str)arg3, (object)arg4) bool :
C++ signature :

bool SetParameter(I3Tray {lvalue},std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>,std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>,boost::python::api::object)