Skip to content

Added support for channel status service in ICARUS Python interface [2/2]#98

Open
PetrilloAtWork wants to merge 2 commits intoSBNSoftware:developfrom
PetrilloAtWork:feature/gp_pyChanStatus_develop
Open

Added support for channel status service in ICARUS Python interface [2/2]#98
PetrilloAtWork wants to merge 2 commits intoSBNSoftware:developfrom
PetrilloAtWork:feature/gp_pyChanStatus_develop

Conversation

@PetrilloAtWork
Copy link
Member

@PetrilloAtWork PetrilloAtWork commented Mar 13, 2026

A new preset is introduced in ICARUSserviceManagerClass to streamline the initialisation of ChannelStatus service provider.
Note that there is nothing special of ICARUS for this, and if SBND uses the same service provider (lariov::SIOVChannelStatusProvider) the same pattern can be used in there too.

It uses extensions to the Python infrastructure for LArSoft in sbnalg, which are subject of PR SBNSoftware/sbnalg#7.

Reviewers:

This PR was "built" against v10_06_00_01. Since it's Python, there is no actual build though.

Usage

For this to work, software from the full LArSoft setup is needed (at least larevt, since ChannelStatusProvider lives there) and a configuration for that service, for example from icaruscode. So this feature is not self-contained in icarusalg.
One suitable configuration is currently icarus_wirecalibration_minimum_services table from services_common_icarus.fcl.
With that,

chanStatus = ICARUSservices.ServiceManager.get("ChannelStatusService")

should "just work" in constructing and initialising a channel status service provider.
Remember that in order to use that service one has also to call chanStatus.Update(ts) with the appropriate timestamp, which is apparently in the form s * 1_000_000_000 + ns (nanoseconds don't really make any difference since the tables are run-based).

Limitations

Exceptions have been observed when calling chanStatus.BadChannels(). The cppyy interface obscures the details of this std::exception and I could not easily track the issue down; however, an ugly workaround can be implemented by querying all the TPC channels one by one in a loop.

It requires software from the full LArSoft setup (larevt)
and a configuration from icaruscode, so it's not self-contained in icarusalg.
Example of configuration: `icarus_wirecalibration_minimum_services`
from `services_common_icarus.fcl`.
With that, `ICARUSservices.ServiceManager.get("ChannelStatusService")`
should "just work" (remember to call `.Update()` with the appropriate timestamp!).

Exceptions have been observed when calling `.BadChannels()` though.
@PetrilloAtWork PetrilloAtWork added the enhancement New feature or request label Mar 13, 2026
@PetrilloAtWork PetrilloAtWork changed the title Added support for channel status service in ICARUS Python interface Added support for channel status service in ICARUS Python interface [2/2] Mar 13, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new “preset” service loader to the ICARUS Python/Gallery service manager so users can instantiate a ChannelStatus provider via the existing ServiceManager.get(...) interface.

Changes:

  • Introduces an ICARUSextraServices loader entry for ChannelStatusService using lariov::SIOVChannelStatusProvider.
  • Overrides serviceLoaderTable() to merge ICARUS-specific extra loaders into the base loader table.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@PetrilloAtWork PetrilloAtWork force-pushed the feature/gp_pyChanStatus_develop branch from 0f65d34 to c119cb8 Compare March 13, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants