Added support for channel status service in ICARUS Python interface [2/2]#98
Open
PetrilloAtWork wants to merge 2 commits intoSBNSoftware:developfrom
Open
Added support for channel status service in ICARUS Python interface [2/2]#98PetrilloAtWork wants to merge 2 commits intoSBNSoftware:developfrom
PetrilloAtWork wants to merge 2 commits intoSBNSoftware:developfrom
Conversation
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.
There was a problem hiding this comment.
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
ICARUSextraServicesloader entry forChannelStatusServiceusinglariov::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>
0f65d34 to
c119cb8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A new preset is introduced in
ICARUSserviceManagerClassto streamline the initialisation ofChannelStatusservice 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, sinceChannelStatusProviderlives there) and a configuration for that service, for example fromicaruscode. So this feature is not self-contained inicarusalg.One suitable configuration is currently
icarus_wirecalibration_minimum_servicestable fromservices_common_icarus.fcl.With that,
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 forms * 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(). Thecppyyinterface obscures the details of thisstd::exceptionand 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.