All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
icarus::trigger::WindowTopologyManager Class Reference

Class to extract and verify a window topology from trigger gates. More...

#include <WindowTopologyAlg.h>

Inheritance diagram for icarus::trigger::WindowTopologyManager:
icarus::ns::util::mfLoggingClass

Public Types

using TriggerGates_t = icarus::trigger::WindowTopologyAlg::TriggerGates_t
 Type of sets of trigger gates. More...
 
using TriggerGatesPerCryostat_t = icarus::trigger::WindowTopologyAlg::TriggerGatesPerCryostat_t
 Type of sets of trigger gates, grouped by cryostat. More...
 

Public Member Functions

 WindowTopologyManager (geo::GeometryCore const &geom, std::string const &logCategory="WindowTopologyManager")
 Constructor. More...
 
template<typename Gates >
std::string setOrVerify (Gates const &gates)
 Extracts topology or verifies it against gates . More...
 
template<typename Gates >
bool operator() (Gates const &gates)
 Extracts topology or verifies it against gates . More...
 
WindowChannelMap const & operator* () const
 
WindowChannelMap const * operator-> () const
 

Private Member Functions

template<typename Gates >
void extractTopology (Gates const &gates)
 Helper: creates the topology from gates. More...
 

Private Attributes

WindowTopologyVerification fVerify
 Verification algorithm; holds the current topology information. More...
 
geo::GeometryCore const *const fGeom
 Geometry service provider. More...
 

Additional Inherited Members

- Protected Member Functions inherited from icarus::ns::util::mfLoggingClass
 mfLoggingClass (std::string const &logCategory)
 Constructor: initializes with the specified log category. More...
 
std::string logCategory () const
 Returns the logging category string for this object. More...
 
mfLoggingClass const & loggingClass () const
 Returns this object (as a logging class object). More...
 
mf::LogError mfLogError (std::string const &file={}, int const lineNumber=0) const
 Returns a mf::LogError() stream for logging. More...
 
mf::LogWarning mfLogWarning (std::string const &file={}, int const lineNumber=0) const
 Returns a mf::LogWarning() stream for logging. More...
 
mf::LogProblem mfLogProblem (std::string const &file={}, int const lineNumber=0) const
 Returns a mf::LogProblem() stream for logging. More...
 
mf::LogInfo mfLogInfo (std::string const &file={}, int const lineNumber=0) const
 Returns a mf::LogInfo() stream for logging. More...
 
mf::LogVerbatim mfLogVerbatim (std::string const &file={}, int const lineNumber=0) const
 Returns a mf::LogVerbatim() stream for logging. More...
 
mf::LogDebug mfLogDebug (std::string const &file={}, int const lineNumber=0) const
 Returns a mf::LogDebug() stream for logging. More...
 
mf::LogTrace mfLogTrace (std::string const &file={}, int const lineNumber=0) const
 Returns a mf::LogTrace() stream for logging. More...
 

Detailed Description

Class to extract and verify a window topology from trigger gates.

This class is meant to provide a convenient interface for the creation (WindowTopologyAlg) and following verification (WindowTopologyVerification) of a window topology. The first time the class is given a trigger gate set, it extracts the topology from it. The following times, it will verify that the gates match that topology, and throw an exception otherwise.

The class can be reset to restart the cycle, and the topology can be obtained directly with the operator->.

The main methods support different types of input, collectively known as Gates. The complete set of supported input depends on what is supported by the underlying classes. Currently, supported input includes (flat) collections of gates and collections of gates grouped by cryostat.

Definition at line 333 of file WindowTopologyAlg.h.

Member Typedef Documentation

Type of sets of trigger gates.

Definition at line 345 of file WindowTopologyAlg.h.

Type of sets of trigger gates, grouped by cryostat.

Definition at line 349 of file WindowTopologyAlg.h.

Constructor & Destructor Documentation

icarus::trigger::WindowTopologyManager::WindowTopologyManager ( geo::GeometryCore const &  geom,
std::string const &  logCategory = "WindowTopologyManager" 
)
inline

Constructor.

Parameters
topologythe window topology to be verified against
logCategorycategory tag for messages from this algorithm

Definition at line 461 of file WindowTopologyAlg.h.

466  , fVerify{ logCategory }
467  , fGeom(&geom)
468 {}
Helper for logging classes.
geo::GeometryCore const *const fGeom
Geometry service provider.
std::string logCategory() const
Returns the logging category string for this object.
WindowTopologyVerification fVerify
Verification algorithm; holds the current topology information.

Member Function Documentation

template<typename Gates >
void icarus::trigger::WindowTopologyManager::extractTopology ( Gates const &  gates)
private

Helper: creates the topology from gates.

Definition at line 541 of file WindowTopologyAlg.h.

542 {
543  icarus::trigger::WindowTopologyAlg const topoMaker
544  { *fGeom, logCategory() + "_Extractor" };
545  fVerify.setTopology(topoMaker.createFromGates(gates));
546 } // icarus::trigger::WindowTopologyManager::extractTopology()
geo::GeometryCore const *const fGeom
Geometry service provider.
Algorithm to create trigger window topology information.
void setTopology(icarus::trigger::WindowChannelMap topology)
Resets the topology to be verified against.
std::string logCategory() const
Returns the logging category string for this object.
WindowTopologyVerification fVerify
Verification algorithm; holds the current topology information.
template<typename Gates >
bool icarus::trigger::WindowTopologyManager::operator() ( Gates const &  gates)

Extracts topology or verifies it against gates .

Template Parameters
Gatestype of gate collection
Parameters
gatesthe set of gates to match to the topology
Returns
whether this method extracted the topology
Exceptions
cet::exception(category: WindowTopologyVerification) if verification fails

Definition at line 527 of file WindowTopologyAlg.h.

527  {
528  if (fVerify.hasTopology()) {
529  fVerify(gates);
530  return false;
531  }
532  else {
533  extractTopology(gates);
534  return true;
535  }
536 } // icarus::trigger::WindowTopologyManager::operator()
bool hasTopology() const
Returns whether a window topology is set (see setTopology()).
void extractTopology(Gates const &gates)
Helper: creates the topology from gates.
WindowTopologyVerification fVerify
Verification algorithm; holds the current topology information.
auto icarus::trigger::WindowTopologyManager::operator* ( ) const
inline

Access to the stored topology.

Exceptions
std::bad_optional_accessif no topology has been set

Definition at line 472 of file WindowTopologyAlg.h.

474  { return fVerify.getTopology(); }
WindowChannelMap const & getTopology() const
WindowTopologyVerification fVerify
Verification algorithm; holds the current topology information.
auto icarus::trigger::WindowTopologyManager::operator-> ( ) const
inline

Access to the stored topology.

Exceptions
std::bad_optional_accessif no topology has been set

Definition at line 478 of file WindowTopologyAlg.h.

480  { return &(fVerify.getTopology()); }
WindowChannelMap const & getTopology() const
WindowTopologyVerification fVerify
Verification algorithm; holds the current topology information.
template<typename Gates >
std::string icarus::trigger::WindowTopologyManager::setOrVerify ( Gates const &  gates)

Extracts topology or verifies it against gates .

Template Parameters
Gatestype of gate collection
Parameters
gatesthe set of gates to match to the topology
Returns
a composite error message (empty on success)

Definition at line 513 of file WindowTopologyAlg.h.

514 {
515  if (fVerify.hasTopology()) {
516  return fVerify.verify(gates);
517  }
518  else {
519  extractTopology(gates);
520  return {};
521  }
522 } // icarus::trigger::WindowTopologyManager::setOrVerify()
bool hasTopology() const
Returns whether a window topology is set (see setTopology()).
void extractTopology(Gates const &gates)
Helper: creates the topology from gates.
std::string verify(TriggerGatesPerCryostat_t const &gates) const
Verifies that gates match the topology current set up.
WindowTopologyVerification fVerify
Verification algorithm; holds the current topology information.

Member Data Documentation

geo::GeometryCore const* const icarus::trigger::WindowTopologyManager::fGeom
private

Geometry service provider.

Definition at line 340 of file WindowTopologyAlg.h.

WindowTopologyVerification icarus::trigger::WindowTopologyManager::fVerify
private

Verification algorithm; holds the current topology information.

Definition at line 338 of file WindowTopologyAlg.h.


The documentation for this class was generated from the following file: