art series 2.06

Previous series release notes
Next series release notes

 New features

Extended abilities for Assns lookup

Functionality of bi-directional associations ("Assns") in the art suite has been extended in two important ways, via issues #14801 and #10539:

  • Previously, behavior of the FindXXX smart query classes upon finding non-dereferencable pointers was somewhat non-intuitive and suboptimal due to the underlying mechanisms used to populate such objects from art::Assns. The behavior going forward is:
    • Attempts to create art::FindOne[P] where an art::FindMany[P] is required will cause an exception to be thrown. Note that this is determined by the characteristics of the associations specified by the reference collection, not those of the art::Assns as a whole.
    • Attempts to create art::FindOne where associated items are not available will cause an exception to be thrown: use an art::FindOneP instead.
    • When creating art::FindMany where associated items are not available, a nullptr will be inserted in the apprpriate slot.
  • The lookup rules for art::Assns data products have been expanded to allow fallback to art::Assns<A, B, D> when art::Assns<A, B> is specified but unavailable where that makes sense and is unambiguous. For full details, see Inter-Product References#Event-lookup-rules-for-Assns.

Introduction of the art tool

This release of art introduces the concept of the tool, which is a dynamically-loaded, user-specified library whose allowed scope is the module, source, service, or other plugin that requires it. Although quite flexible, the tool is not a replacement for a module, and it should only be used when certain criteria are met. For general design considerations and when using a tool might apply to your case, see the documentation here. Once you have determine that a tool is the correct utility for your use case, please see the details for writing and using an art tool (resolves feature request #13917).

Extended MixFilter abilities

The art::MixFilter now has the ability to deal with run- and subrun-level products in a well-defined way. See Product Mixing for full details. As a side effect of changes to support this new ability, it is also now possible to create a mixed product at any level (including "standard" event product mixing) which differs in type from that of the products from which it is derived. (Resolves feature request #15334.)

Removal of Boost state chart state machine

This would not normally be a user-visible change, but the simplification of this code:
  • Fixed a long-standing bug, issue #15456 (see below).
  • Significantly reduces the depth of the call stack, meaning that stack traces while debugging should be significantly shorter and more straightforward.

Configuration for delayed read for event products

A new RootInput configuration option, delayedReadEventProducts is now available, which defaults to true (resolves feature request #14333).

cet::for_all_with_index (introduced with art 2.06.03)

The cet::for_all_with_index container algorithm is now available for cases where the index into a container needs to be accessed in addition to the element to which that index refers (e.g.):

// Using a range-for
auto positionMap(vector<string> const& names)
  map<string, std::size_t> posMap;
  std::size_t i {};
  for (auto const& name : names)
    posMap[name] = i;
  return posMap;

// Using the for_all_with_index
auto positionMap(vector<string> const& names)
  map<string, std::size_t> posMap;
                          [&posMap](std::size_t const i, auto const& name){
                            posMap[name] = i;
  return posMap;

The type of the first argument of the callable type (a lambda in the above case) must be convertible from an std::size_t.

fhicl::Comment(std::string const&) signature (introduced with art 2.06.03)

Past versions of fhicl-cpp required users to specify a fhicl::Comment with a char const* argument. This restriction has been relaxed so that a fhicl::Comment can be constructed with an std::string const& argument.

 Breaking changes

Exception and demangling utilities have been moved from cetlib -> cetlib_except

In order to provide exception-handling utilities with less dependencies for DAQ applications on restricted architectures such as ARM, these utilities have been relocated to a new package and any dependence on external libraries such as Boost removed. The relocated headers are:

  • cetlib/coded_exception.h
  • cetlib/demangle.h
  • cetlib/exception_collector.h
  • cetlib/exception.h

In order to update the header includes in your own code, the following, "one-liner" will efficiently update every file containing a reference to the moved headers, saving the pre-update files with a "~" backup extension.

egrep -R -l -e '\bcetlib/(coded_exception|exception|exception_collector|demangle)\.h' | xargs perl -wapi\~ -e 's&\bcetlib/((?:coded_exception|exception|exception_collector|demangle)\.h)&cetlib_except/${1}&g'

You will need to update your link lines for libraries and executables for any code of yours that uses library code for these utilities, either explicitly, or implicitly by (directly or indirectly) including headers defining inlined code that does. (Resolves feature request #14293.)

Non-dictionary canvas libraries have been combined into one library

The following libraries have been combined into one library, canvas:

  • canvas_Persistency_Provenance
  • canvas_Persistency_Common
  • canvas_Utilities
  • canvas_Version

You will need to update your link lines for libraries and executables requiring canvas libraries. No header files have moved. (Resolves feature request #12995.)

Removal of on-demand facilities

In order to facilitate the upcoming multi-threaded upgrade, on-demand facilities have been removed from the system. An analogous functionality is expected to be part of the eventual multi-threaded art suite, although likely not in the first release. In the meantime, any existing on-demand workflows should be converted to fully-specified path workflows. If you have any trouble at all doing this, please contact us for assistance. (Resolves feature request #15398.)

Change in art::Source template readNext pre-conditions

Whenever an input file is closed, the inR and inSR pointers to readNext are now set to null, requiring users to set outR and outSR at the first call to readNext after the next input file is opened.

Change in art::error categories

Due to ambiguities in error messages (see issue #14664), the InsertFailure error code has been replaced with ProductRegistrationFailure and ProductPutFailure, with the appropriate adjustments in art-constructed exception objects. Any user code attempting to catch exceptions based on the InsertFailure enumerator should be suitably adjusted.

Relocation of all installed cetlib headers (introduced with art 2.06.01)

cetlib headers have been relocated from ${CETLIB_DIR}/include to ${CETLIB_FQ_DIR}/include due to the need to generate a header whose contents differ according to the compiler. The value of ${CETLIB_INC} has been adjusted accordingly, so if you are using the recommended variable for locating the headers you need do nothing, regardless of whether you are using cetbuildtools / mrb.

  art releases