All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Typedefs | Functions
icarus::details Namespace Reference

Classes

class  ChannelToWireMap
 Mapping of ROP channels into wires. More...
 
struct  ChannelRange_t
 A simple range of channels. More...
 
class  StableMerger
 
class  ROPnumberDispatcher
 Algorithm assigning IDs to readout planes. More...
 
class  ROPandTPCsetBuildingAlg
 Extracts TPC sets and readout planes from a list of cryostats. More...
 
class  IntegerRangesBase
 A sequence of contiguous ranges of integral numbers. More...
 
class  KeyedCSVparser
 Parser to fill a KeyValuesData structure out of a character buffer. More...
 
struct  KeyValuesConverter
 
struct  BaseWrapper
 
struct  KeyValuesConverter< icarus::details::BaseWrapper< T, Base >, Enable >
 Specialization for conversions with a numeric base. More...
 
class  KeyValueParser
 Parser to fill a KeyValuesData structure out of a character buffer. More...
 

Typedefs

using TPCColl_t = std::vector< geo::TPCGeo const * >
 Type of collection of TPCs (pointers to geo::TPCGeo). More...
 
using PlaneColl_t = std::vector< geo::PlaneGeo const * >
 Type of collection of planes (pointers to geo::PlaneGeo). More...
 

Functions

template<typename SetColl >
SetColl stableMerge (SetColl const &sets)
 
template<typename T >
std::ostream & operator<< (std::ostream &out, typename IntegerRangesBase< T >::Data_t const &range)
 
template<typename ConfigMap >
sbn::PMTconfiguration extractPMTreadoutConfigurationImpl (ConfigMap const &configMap, icarus::PMTconfigurationExtractor extractor)
 
template<typename ConfigMap >
icarus::TriggerConfiguration extractTriggerReadoutConfigurationImpl (ConfigMap const &configMap, icarus::TriggerConfigurationExtractor extractor)
 

Typedef Documentation

typedef std::vector< geo::PlaneGeo const * > icarus::details::PlaneColl_t

Type of collection of planes (pointers to geo::PlaneGeo).

Definition at line 35 of file GeometryObjectCollections.h.

typedef std::vector< geo::TPCGeo const * > icarus::details::TPCColl_t

Type of collection of TPCs (pointers to geo::TPCGeo).

Definition at line 32 of file GeometryObjectCollections.h.

Function Documentation

template<typename ConfigMap >
sbn::PMTconfiguration icarus::details::extractPMTreadoutConfigurationImpl ( ConfigMap const &  configMap,
icarus::PMTconfigurationExtractor  extractor 
)

Definition at line 418 of file PMTconfigurationExtractor.h.

419  {
420 
421  /*
422  * Requirements: ConfigMap is a mapping type supporting iteration and whose
423  * elements support structured assignment into a pair, the first element
424  * being an identifier (process name, parameter set ID...) and the second
425  * being a `fhicl::ParameterSet` with the configuration (or something
426  * offering the same interface).
427  *
428  * The plan is to look in all the FHiCL configuration fragments we can find
429  * in the input config, and find all the useful configuration therein.
430  * Given that there may be multiple input files, there may also be multiple
431  * configurations for the same detector components.
432  * In that case, we will extract parameters from each and every one of the
433  * configurations, and throw an exception if they are not all consistent.
434  *
435  * Consistency is tested only for the extracted parameters, not for the whole
436  * FHiCL configuration fragment.
437  */
438 
439  using Key_t = std::tuple_element_t<0U, typename ConfigMap::value_type>;
440 
441  std::optional<std::pair<Key_t, sbn::PMTconfiguration>> config;
442 
443  // look in the global configuration for all parameter sets which contain
444  // `configuration_documents` as a (direct) name;
445  for (auto const& [ id, pset ]: configMap) {
446  if (!extractor.mayHaveConfiguration(pset)) continue;
447 
448  fhicl::ParameterSet const configDocs
450  (pset, "configuration_documents", { std::regex{ "icaruspmt.*" } })
451  ;
452 
453  sbn::PMTconfiguration candidateConfig = extractor.extract(configDocs);
454  if (config) {
455  if (config->second == candidateConfig) continue;
456  mf::LogError log("extractPMTreadoutConfiguration");
457  log << "Found two candidate configurations differring:"
458  "\nFirst [" << config->first << "]:\n" << config->second
459  << "\nSecond [" << id << "]:\n" << candidateConfig
460  ;
461  throw cet::exception("extractPMTreadoutConfiguration")
462  << "extractPMTreadoutConfiguration() found inconsistent configurations.\n";
463  } // if incompatible configurations
464 
465  config.emplace(std::move(id), std::move(candidateConfig));
466  } // for all configuration documents
467 
468  if (!config) {
469  throw cet::exception("extractPMTreadoutConfiguration")
470  << "extractPMTreadoutConfiguration() could not find a suitable configuration.\n";
471  }
472 
473  return extractor.finalize(std::move(config->second));
474  } // extractPMTreadoutConfigurationImpl(ConfigMap)
static fhicl::ParameterSet convertConfigurationDocuments(fhicl::ParameterSet const &container, std::string const &configListKey, std::initializer_list< std::regex const > components)
Returns a parameter set with the content of configuration_documents key from container.
static bool mayHaveConfiguration(fhicl::ParameterSet const &pset)
Returns whether pset may contain the needed configuration.
sbn::PMTconfiguration finalize(sbn::PMTconfiguration config) const
Assigns unique channel IDs to the channel information.
sbn::PMTconfiguration extract(fhicl::ParameterSet const &config) const
Extracts all supported PMT configuration from config.
Class containing configuration for PMT readout.
template<typename ConfigMap >
icarus::TriggerConfiguration icarus::details::extractTriggerReadoutConfigurationImpl ( ConfigMap const &  configMap,
icarus::TriggerConfigurationExtractor  extractor 
)

Definition at line 390 of file TriggerConfigurationExtractor.h.

391  {
392 
393  /*
394  * Requirements: ConfigMap is a mapping type supporting iteration and whose
395  * elements support structured assignment into a pair, the first element
396  * being an identifier (process name, parameter set ID...) and the second
397  * being a `fhicl::ParameterSet` with the configuration (or something
398  * offering the same interface).
399  *
400  * The plan is to look in all the FHiCL configuration fragments we can find
401  * in the input config, and find all the useful configuration therein.
402  * Given that there may be multiple input files, there may also be multiple
403  * configurations for the same detector components.
404  * In that case, we will extract parameters from each and every one of the
405  * configurations, and throw an exception if they are not all consistent.
406  *
407  * Consistency is tested only for the extracted parameters, not for the whole
408  * FHiCL configuration fragment.
409  */
410 
411  using Key_t = std::tuple_element_t<0U, typename ConfigMap::value_type>;
412 
413  std::optional<std::pair<Key_t, icarus::TriggerConfiguration>> config;
414 
415  // look in the global configuration for all parameter sets which contain
416  // `configuration_documents` as a (direct) name;
417  for (auto const& [ id, pset ]: configMap) {
418  if (!extractor.mayHaveConfiguration(pset)) continue;
419 
420  fhicl::ParameterSet const configDocs
422  (pset, "configuration_documents", { std::regex{ "icarustrigger.*" } })
423  ;
424 
425  icarus::TriggerConfiguration candidateConfig = extractor.extract(configDocs);
426  if (config) {
427  if (config->second == candidateConfig) continue;
428  mf::LogError log("extractTriggerReadoutConfiguration");
429  log << "Found two candidate configurations differring:"
430  "\nFirst [" << config->first << "]:\n" << config->second
431  << "\nSecond [" << id << "]:\n" << candidateConfig
432  ;
433  throw cet::exception("extractTriggerReadoutConfiguration")
434  << "extractTriggerReadoutConfiguration() found inconsistent configurations.\n";
435  } // if incompatible configurations
436 
437  config.emplace(std::move(id), std::move(candidateConfig));
438  } // for all configuration documents
439 
440  if (!config) {
441  throw cet::exception("extractTriggerReadoutConfiguration")
442  << "extractTriggerReadoutConfiguration() could not find a suitable configuration.\n";
443  }
444 
445  return std::move(config->second);
446  } // extractPMTreadoutConfigurationImpl(ConfigMap)
static fhicl::ParameterSet convertConfigurationDocuments(fhicl::ParameterSet const &container, std::string const &configListKey, std::initializer_list< std::regex const > components)
Returns a parameter set with the content of configuration_documents key from container.
static bool mayHaveConfiguration(fhicl::ParameterSet const &pset)
Returns whether pset may contain the needed configuration.
icarus::TriggerConfiguration extract(fhicl::ParameterSet const &config) const
Extracts all supported Trigger configuration from config.
template<typename T >
std::ostream& icarus::details::operator<< ( std::ostream &  out,
typename IntegerRangesBase< T >::Data_t const &  range 
)
template<typename SetColl >
SetColl icarus::details::stableMerge ( SetColl const &  sets)

Definition at line 92 of file ROPandTPCsetBuildingAlg.cxx.

static SetColl_t merge(SetColl_t const &sets)