LArSoft  v10_04_05
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, PlaneID const &planeID, int badWireNo, int betterWireNo)
 Constructor with the complete information. More...
 
 InvalidWireError (std::string cat, 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...
 
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...
 
WireID suggestedWireID () const
 Returns a better wire ID. More...
 
Plane access
bool hasPlane () const
 Return whether a plane is recorded with the exception. More...
 
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

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

Private Attributes

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 37 of file Exceptions.h.

Constructor & Destructor Documentation

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

Constructor with the complete information.

Definition at line 43 of file Exceptions.h.

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

Constructor: no wire suggestions.

Definition at line 48 of file Exceptions.h.

49  : cet::exception(cat), fPlaneID(planeID), fWireNumber(badWireNo)
50  {}
PlaneID fPlaneID
plane the wire belongs to
Definition: Exceptions.h:101
PlaneID const & planeID() const
Return the plane ID recorded with the exception.
Definition: Exceptions.h:96
int fWireNumber
the invalid wire number
Definition: Exceptions.h:104
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 53 of file Exceptions.h.

54  : cet::exception(cat), fWireNumber(badWireNo), fBetterWireNo(betterWireNo)
55  {}
int fBetterWireNo
a suggestion for a good wire number
Definition: Exceptions.h:107
int fWireNumber
the invalid wire number
Definition: Exceptions.h:104
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 58 of file Exceptions.h.

58  : cet::exception(cat), fWireNumber(badWireNo)
59  {}
int fWireNumber
the invalid wire number
Definition: Exceptions.h:104
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 68 of file Exceptions.h.

References fWireNumber.

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

Returns the bad wire ID.

Definition at line 71 of file Exceptions.h.

References fWireNumber, and makeWireID().

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

Returns whether we known the bad wire number.

Definition at line 65 of file Exceptions.h.

References fWireNumber, and InvalidWireNo.

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

Return whether a plane is recorded with the exception.

Definition at line 93 of file Exceptions.h.

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

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

Returns whether we known a better wire number.

Definition at line 79 of file Exceptions.h.

References fBetterWireNo, and InvalidWireNo.

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

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

Transform a wire number into wire ID.

Definition at line 110 of file Exceptions.h.

References fPlaneID.

Referenced by badWireID(), and suggestedWireID().

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

Return the plane ID recorded with the exception.

Definition at line 96 of file Exceptions.h.

References fPlaneID.

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

Returns a better wire number.

Definition at line 82 of file Exceptions.h.

References fBetterWireNo.

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

Returns a better wire ID.

Definition at line 85 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().

85 { return makeWireID(fBetterWireNo); }
int fBetterWireNo
a suggestion for a good wire number
Definition: Exceptions.h:107
WireID makeWireID(int wireNo) const
Transform a wire number into wire ID.
Definition: Exceptions.h:110

Member Data Documentation

int geo::InvalidWireError::fBetterWireNo = InvalidWireNo
private

a suggestion for a good wire number

Definition at line 107 of file Exceptions.h.

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

PlaneID geo::InvalidWireError::fPlaneID
private

plane the wire belongs to

Definition at line 101 of file Exceptions.h.

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

int geo::InvalidWireError::fWireNumber = InvalidWireNo
private

the invalid wire number

Definition at line 104 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 40 of file Exceptions.h.

Referenced by hasBadWire(), and hasSuggestedWire().


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