Accessing a specific event from the command line
I have been working on a script that would allow a user to input a text file listing runs, subruns, and events. Ideally, the script would then obtain those events and make the appropriate calls to art. However, art doesn't allow event access from the command line, and, since the number of events in any given subrun is variable, --nskip will not resolve the issue. At the moment, I am modifying the source portion of the fcl file to include firstEvent : <EVENT #>, and then using sed to insert the appropriate number. If possible, I would love to streamline this process, especially since text files can include repeat runs and subruns. In other words, if my script were to separate all events corresponding to a given root file, I would like to find a way to make only one call to art, instead of making a separate call for each event. At the moment, command line access seems like the most efficient way to accomplish this.
#2 Updated by Christopher Green almost 5 years ago
- Category set to Application
- Status changed from New to Accepted
- Estimated time set to 24.00 h
- SSI Package art added
- SSI Package deleted (
We will come up with a proposal for event ID specification from the command line, and disseminate it to stakeholders for consensus, since other experiments have expressed a desire for similar features in the past and we would like to meet everyone's needs, if possible. Please consult with your representative (currently Ken Herner, we believe) to ensure your needs are represented as you would wish in this discussion.
#9 Updated by Kyle Knoepfel almost 2 years ago
- Status changed from Accepted to Resolved
- Assignee set to Kyle Knoepfel
- % Done changed from 0 to 100
This has been resolved with commits:
The proper specification for
-e|--estart is no longer a single number, but a valid
EventID, which contains a triplet of numbers that corresponds to the run, subrun, and event numbers. For example, to start processing at run 12, subrun 3, event 16, the user would type:
art -c config.fcl -e 12:3:16
A legacy mode is permitted, where single integers can be specified corresponding to the event number in run 1, subrun 0:
art -c config.fcl -e 7 ... Specifying an event number of 7 is now deprecated when using the -e|--estart program option. Please explicitly specify the run and subrun numbers (e.g.): -e "1:0:7"
EventIDs will result in an exception throw:
art -c config.fcl -e "1:9:hi bob" ... OptionsHandler caught a cet::exception calling art::BasicSourceOptionsHandler::doProcessOptions() ---- Configuration BEGIN An error was encountered while processing the -e|--estart program option. The specification '1:9:hi bob' is not a valid EventID. Please specify a value of the form '<run>:<subrun>:<event>' where: <run> is in the range [1, 4294967295) <subrun> is in the range [0, 4294967295) <event> is in the range [1, 4294967295) ---- Configuration END Art has completed and will exit with status 90.
N.B. The current behavior is that each input file is opened and event processing begins once there is an event whose ID is greater than or equal to the specified
EventID. If event-processing begins and a subsequent input file has events with IDs lower than the specified
EventID, then those events will be skipped. In other words, the event-ID search occurs for each input file. This behavior should probably be changed in the future so that it is not specific to each input file.