Project

General

Profile

Feature #10954

Provide getValidHandle for Run and SubRun

Added by Brian Rebel almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Navigation
Target version:
Start date:
11/18/2015
Due date:
% Done:

100%

Estimated time:
Spent time:
Scope:
Internal
Experiment:
NOvA
SSI Package:
art
Duration:

Description

Please see the (soon to be) linked issue for details.


Related issues

Related to art - Support #10949: Unable to retrieve objects stored in SubRun from analyzer moduleClosed11/18/2015

History

#1 Updated by Brian Rebel almost 5 years ago

See Issue #10949

#2 Updated by Kyle Knoepfel almost 5 years ago

  • Related to Support #10949: Unable to retrieve objects stored in SubRun from analyzer module added

#3 Updated by Kyle Knoepfel almost 5 years ago

Instead of changing the semantic of getByLabel, we would likely implement a new function template called getValidHandle. For example, for events, one can currently do:

auto vh = e.getValidHandle<SomeProduct>(tag); // throws if product not found

// or

art::Handle<SomeProduct> h;
bool found = e.getByLabel(tag, h);  // returns 'false' if product not found

The return type of getByLabel is not always used. But when used, it can make things more succinct:

art::Handle<SomeProduct> h;
if ( e.getByLabel(tag, h) ) {
  // 'h' guaranteed to be valid since 'getByLabel' call was 'true'
}

The getValidHandle<T>(tag) function template, however, is currently not available for Run and SubRun objects; and it was that particular facility I was suggesting we could add to SubRun and Run.

Note that a parallel pattern exists in fhiclcpp:

auto s = pset.get<string>("s"); // throws if "s" is absent from config.

// or

string s;
bool found = pset.get_if_present("s", s); // returns 'false' if "s" is absent from config.

#4 Updated by Brian Rebel almost 5 years ago

I would be happy to have the getValidHandle implemented.

Thanks

#5 Updated by Kyle Knoepfel almost 5 years ago

  • Subject changed from Sub(Run)::getByLabel should throw an exception if the requested data product is not found to Provide getValidHandle for Run and SubRun

#6 Updated by Marc Paterno almost 5 years ago

  • Category set to Navigation
  • Status changed from New to Feedback
  • Assignee set to Kyle Knoepfel
  • Target version set to 2.01.00

This is currently implemented on the 'get_valid_handle' branch, and will go into our next release of art.

Does NOvA want a v1.17.04 release with this addition, or will NOvA be moving to art 1.18.x?

#7 Updated by Brian Rebel almost 5 years ago

NOvA won't be able to move forward to ROOT v6 until after the summer Neutrino conference, so a v1.17.04 would be appreciated.

#8 Updated by Lynn Garren almost 5 years ago

  • Status changed from Feedback to Resolved

The nu-v1_17_01 distribution is now available with nutools v1_17_01 and art v1_17_04 (s24).

http://scisoft.fnal.gov/scisoft/bundles/nu/v1_17_01/nu-v1_17_01.html
http://scisoft.fnal.gov/scisoft/bundles/art/v1_17_04/art-v1_17_04.html

#9 Updated by Kyle Knoepfel almost 5 years ago

  • Target version changed from 2.01.00 to 1.17.04
  • % Done changed from 0 to 100
  • SSI Package art added
  • SSI Package deleted ()

#10 Updated by Kyle Knoepfel almost 5 years ago

  • Status changed from Resolved to Closed


Also available in: Atom PDF