LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
geo::InvalidWireError Class Reference

Exception thrown on invalid wire number. More...

#include "Exceptions.h"

Inheritance diagram for geo::InvalidWireError:

Public Member Functions

 InvalidWireError (std::string cat, geo::PlaneID const &planeID, int badWireNo, int betterWireNo)
 Constructor with the complete information. More...
 
 InvalidWireError (std::string cat, geo::PlaneID const &planeID, int badWireNo)
 Constructor: no wire suggestions. More...
 
 InvalidWireError (std::string cat, int badWireNo, int betterWireNo)
 Constructor: no plane information. More...
 
 InvalidWireError (std::string cat, int badWireNo)
 Constructor: no plane information and no suggestion. More...
 
Access to bad wire
bool hasBadWire () const
 Returns whether we known the bad wire number. More...
 
int badWire () const
 Returns the bad wire number. More...
 
geo::WireID badWireID () const
 Returns the bad wire ID. More...
 
Access to suggested wire
bool hasSuggestedWire () const
 Returns whether we known a better wire number. More...
 
int suggestedWire () const
 Returns a better wire number. More...
 
geo::WireID suggestedWireID () const
 Returns a better wire ID. More...
 
Plane access
bool hasPlane () const
 Return whether a plane is recorded with the exception. More...
 
geo::PlaneID const & planeID () const
 Return the plane ID recorded with the exception. More...
 

Static Public Attributes

static constexpr int InvalidWireNo = std::numeric_limits<int>::max()
 Value used to represent an invalid wire number. More...
 

Private Member Functions

geo::WireID makeWireID (int wireNo) const
 Transform a wire number into wire ID. More...
 

Private Attributes

geo::PlaneID fPlaneID
 plane the wire belongs to More...
 
int fWireNumber = InvalidWireNo
 the invalid wire number More...
 
int fBetterWireNo = InvalidWireNo
 a suggestion for a good wire number More...
 

Detailed Description

Exception thrown on invalid wire number.


This class is thrown, e.g., by Geometry::NearestWireID(). It contains the erroneous wire number, a suggestion of which one might be the right one, and a plane ID.

The wire numbers are signed.

Definition at line 39 of file Exceptions.h.

Constructor & Destructor Documentation

geo::InvalidWireError::InvalidWireError ( std::string  cat,
geo::PlaneID const &  planeID,
int  badWireNo,
int  betterWireNo 
)
inline

Constructor with the complete information.

Definition at line 45 of file Exceptions.h.

46  : cet::exception(cat), fPlaneID(planeID), fWireNumber(badWireNo), fBetterWireNo(betterWireNo)
47  {}
int fBetterWireNo
a suggestion for a good wire number
Definition: Exceptions.h:109
geo::PlaneID fPlaneID
plane the wire belongs to
Definition: Exceptions.h:103
geo::PlaneID const & planeID() const
Return the plane ID recorded with the exception.
Definition: Exceptions.h:98
int fWireNumber
the invalid wire number
Definition: Exceptions.h:106
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
geo::InvalidWireError::InvalidWireError ( std::string  cat,
geo::PlaneID const &  planeID,
int  badWireNo 
)
inline

Constructor: no wire suggestions.

Definition at line 50 of file Exceptions.h.

51  : cet::exception(cat), fPlaneID(planeID), fWireNumber(badWireNo)
52  {}
geo::PlaneID fPlaneID
plane the wire belongs to
Definition: Exceptions.h:103
geo::PlaneID const & planeID() const
Return the plane ID recorded with the exception.
Definition: Exceptions.h:98
int fWireNumber
the invalid wire number
Definition: Exceptions.h:106
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
geo::InvalidWireError::InvalidWireError ( std::string  cat,
int  badWireNo,
int  betterWireNo 
)
inline

Constructor: no plane information.

Definition at line 55 of file Exceptions.h.

56  : cet::exception(cat), fWireNumber(badWireNo), fBetterWireNo(betterWireNo)
57  {}
int fBetterWireNo
a suggestion for a good wire number
Definition: Exceptions.h:109
int fWireNumber
the invalid wire number
Definition: Exceptions.h:106
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
geo::InvalidWireError::InvalidWireError ( std::string  cat,
int  badWireNo 
)
inline

Constructor: no plane information and no suggestion.

Definition at line 60 of file Exceptions.h.

60  : cet::exception(cat), fWireNumber(badWireNo)
61  {}
int fWireNumber
the invalid wire number
Definition: Exceptions.h:106
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33

Member Function Documentation

int geo::InvalidWireError::badWire ( ) const
inline

Returns the bad wire number.

Definition at line 70 of file Exceptions.h.

References fWireNumber.

70 { return fWireNumber; }
int fWireNumber
the invalid wire number
Definition: Exceptions.h:106
geo::WireID geo::InvalidWireError::badWireID ( ) const
inline

Returns the bad wire ID.

Definition at line 73 of file Exceptions.h.

References fWireNumber, and makeWireID().

73 { return makeWireID(fWireNumber); }
geo::WireID makeWireID(int wireNo) const
Transform a wire number into wire ID.
Definition: Exceptions.h:112
int fWireNumber
the invalid wire number
Definition: Exceptions.h:106
bool geo::InvalidWireError::hasBadWire ( ) const
inline

Returns whether we known the bad wire number.

Definition at line 67 of file Exceptions.h.

References fWireNumber, and InvalidWireNo.

67 { return fWireNumber != InvalidWireNo; }
static constexpr int InvalidWireNo
Value used to represent an invalid wire number.
Definition: Exceptions.h:42
int fWireNumber
the invalid wire number
Definition: Exceptions.h:106
bool geo::InvalidWireError::hasPlane ( ) const
inline

Return whether a plane is recorded with the exception.

Definition at line 95 of file Exceptions.h.

References fPlaneID, and geo::CryostatID::isValid.

95 { return fPlaneID.isValid; }
bool isValid
Whether this ID points to a valid element.
Definition: geo_types.h:210
geo::PlaneID fPlaneID
plane the wire belongs to
Definition: Exceptions.h:103
bool geo::InvalidWireError::hasSuggestedWire ( ) const
inline

Returns whether we known a better wire number.

Definition at line 81 of file Exceptions.h.

References fBetterWireNo, and InvalidWireNo.

Referenced by hit::DisambigCheater::InitHitToWids().

81 { return fBetterWireNo != InvalidWireNo; }
int fBetterWireNo
a suggestion for a good wire number
Definition: Exceptions.h:109
static constexpr int InvalidWireNo
Value used to represent an invalid wire number.
Definition: Exceptions.h:42
geo::WireID geo::InvalidWireError::makeWireID ( int  wireNo) const
inlineprivate

Transform a wire number into wire ID.

Definition at line 112 of file Exceptions.h.

References fPlaneID.

Referenced by badWireID(), and suggestedWireID().

112 { return {fPlaneID, (geo::WireID::WireID_t)wireNo}; }
geo::PlaneID fPlaneID
plane the wire belongs to
Definition: Exceptions.h:103
unsigned int WireID_t
Type for the ID number.
Definition: geo_types.h:546
geo::PlaneID const& geo::InvalidWireError::planeID ( ) const
inline

Return the plane ID recorded with the exception.

Definition at line 98 of file Exceptions.h.

References fPlaneID.

98 { return fPlaneID; }
geo::PlaneID fPlaneID
plane the wire belongs to
Definition: Exceptions.h:103
int geo::InvalidWireError::suggestedWire ( ) const
inline

Returns a better wire number.

Definition at line 84 of file Exceptions.h.

References fBetterWireNo.

84 { return fBetterWireNo; }
int fBetterWireNo
a suggestion for a good wire number
Definition: Exceptions.h:109
geo::WireID geo::InvalidWireError::suggestedWireID ( ) const
inline

Returns a better wire ID.

Definition at line 87 of file Exceptions.h.

References fBetterWireNo, and makeWireID().

Referenced by cluster::ClusterCrawlerAlg::FindHammerClusters(), hit::DisambigCheater::InitHitToWids(), evd::RecoBaseDrawer::OpFlash2D(), shower::EMShowerAlg::Project3DPointOntoPlane_(), and cluster::ClusterCrawlerAlg::VtxMatch().

87 { return makeWireID(fBetterWireNo); }
int fBetterWireNo
a suggestion for a good wire number
Definition: Exceptions.h:109
geo::WireID makeWireID(int wireNo) const
Transform a wire number into wire ID.
Definition: Exceptions.h:112

Member Data Documentation

int geo::InvalidWireError::fBetterWireNo = InvalidWireNo
private

a suggestion for a good wire number

Definition at line 109 of file Exceptions.h.

Referenced by hasSuggestedWire(), suggestedWire(), and suggestedWireID().

geo::PlaneID geo::InvalidWireError::fPlaneID
private

plane the wire belongs to

Definition at line 103 of file Exceptions.h.

Referenced by hasPlane(), makeWireID(), and planeID().

int geo::InvalidWireError::fWireNumber = InvalidWireNo
private

the invalid wire number

Definition at line 106 of file Exceptions.h.

Referenced by badWire(), badWireID(), and hasBadWire().

constexpr int geo::InvalidWireError::InvalidWireNo = std::numeric_limits<int>::max()
static

Value used to represent an invalid wire number.

Definition at line 42 of file Exceptions.h.

Referenced by hasBadWire(), and hasSuggestedWire().


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