LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
recob::PointCharge Class Reference

Charge reconstructed in the active volume. More...

#include "PointCharge.h"

Public Types

using Charge_t = float
 Type for the amount of reconstructed charge. More...
 

Public Member Functions

Constructors
constexpr PointCharge ()
 Default constructor (for ROOT only). More...
 
constexpr PointCharge (Charge_t charge)
 Constructor: sets all the data. More...
 
Access to the information
constexpr Charge_t charge () const
 Returns the stored value of the reconstructed charge. More...
 
Object status and data validity
constexpr bool hasCharge () const
 Returns whether the reconstructed charge value is valid. More...
 

Static Public Attributes

static constexpr Charge_t InvalidCharge = std::numeric_limits<Charge_t>::lowest()
 Value used for default-constructed ("invalid") charge. More...
 

Private Attributes

float fCharge
 Reconstructed charge. More...
 

Printing operations

static constexpr unsigned int DefaultVerbosity = 1U
 Default verbosity for dumping operations. More...
 
static constexpr unsigned int MaxVerbosity = 1U
 Maximum available verbosity for dumping operations. More...
 
template<typename Stream >
void dump (Stream &&out, unsigned int verbosity, std::string indent, std::string firstIndent) const
 Dump the content of this object into an output stream. More...
 
template<typename Stream >
void dump (Stream &&out, unsigned int verbosity, std::string indent="") const
 Default verbosity for dumping operations. More...
 
template<typename Stream >
void dump (Stream &&out, std::string indent, std::string firstIndent) const
 Default verbosity for dumping operations. More...
 
template<typename Stream >
void dump (Stream &&out, std::string indent="") const
 Default verbosity for dumping operations. More...
 

Detailed Description

Charge reconstructed in the active volume.

The reconstructed charge value is in arbitrary units in that it's hard to precisely define the normalization, which ends up being algorithm-dependent. As such, the charge from this object is expected to require a specific calibration.

Definition at line 30 of file PointCharge.h.

Member Typedef Documentation

Type for the amount of reconstructed charge.

Definition at line 33 of file PointCharge.h.

Constructor & Destructor Documentation

constexpr recob::PointCharge::PointCharge ( )
inline

Default constructor (for ROOT only).

Definition at line 43 of file PointCharge.h.

static constexpr Charge_t InvalidCharge
Value used for default-constructed ("invalid") charge.
Definition: PointCharge.h:36
float fCharge
Reconstructed charge.
Definition: PointCharge.h:126
constexpr recob::PointCharge::PointCharge ( Charge_t  charge)
inline

Constructor: sets all the data.

Parameters
chargereconstructed charge (used unchanged)

Definition at line 50 of file PointCharge.h.

50 : fCharge(charge) {}
float fCharge
Reconstructed charge.
Definition: PointCharge.h:126
constexpr Charge_t charge() const
Returns the stored value of the reconstructed charge.
Definition: PointCharge.h:60

Member Function Documentation

constexpr Charge_t recob::PointCharge::charge ( ) const
inline

Returns the stored value of the reconstructed charge.

Definition at line 60 of file PointCharge.h.

References fCharge.

Referenced by dump(), and hasCharge().

60 { return fCharge; }
float fCharge
Reconstructed charge.
Definition: PointCharge.h:126
template<typename Stream >
void recob::PointCharge::dump ( Stream &&  out,
unsigned int  verbosity,
std::string  indent,
std::string  firstIndent 
) const

Dump the content of this object into an output stream.

Template Parameters
Streamtype of stream to write into
Parameters
outoutput stream
verbositythe level of detail of dumped information, to be between 0 and MaxVerbosity _(default: DefaultVerbosity)_
indentall lines except the first are prepended this string _(default: none)_
firstIndentthe first output line is prepended this string _(default: same as indent)_

The output starts on the current line, with firstIndent as indentation. No end-of-line is inserted at the end of the output.

Definition at line 143 of file PointCharge.h.

References charge(), hasCharge(), and MaxVerbosity.

Referenced by dump(), and recob::operator<<().

147 {
148  if (verbosity <= 0U) return;
149 
150  //----------------------------------------------------------------------------
151  out << firstIndent << "charge: ";
152  if (hasCharge())
153  out << charge();
154  else
155  out << "none";
156 
157  // if (verbosity <= 1U) return;
158  //----------------------------------------------------------------------------
159  // if the following check fails,
160  // consistency between `dump()` and `MaxVerbosity` needs to be restored
161  static_assert(MaxVerbosity == 1U, "Please update the code!");
162 
163 } // recob::PointCharge::dump()
constexpr bool hasCharge() const
Returns whether the reconstructed charge value is valid.
Definition: PointCharge.h:70
static constexpr unsigned int MaxVerbosity
Maximum available verbosity for dumping operations.
Definition: PointCharge.h:83
constexpr Charge_t charge() const
Returns the stored value of the reconstructed charge.
Definition: PointCharge.h:60
template<typename Stream >
void recob::PointCharge::dump ( Stream &&  out,
unsigned int  verbosity,
std::string  indent = "" 
) const
inline

Default verbosity for dumping operations.

Definition at line 107 of file PointCharge.h.

References dump(), and art::detail::indent().

108  {
109  dump(std::forward<Stream>(out), verbosity, indent, indent);
110  }
void dump(Stream &&out, unsigned int verbosity, std::string indent, std::string firstIndent) const
Dump the content of this object into an output stream.
Definition: PointCharge.h:143
std::string indent(std::size_t const i)
template<typename Stream >
void recob::PointCharge::dump ( Stream &&  out,
std::string  indent,
std::string  firstIndent 
) const
inline

Default verbosity for dumping operations.

Definition at line 112 of file PointCharge.h.

References dump().

113  {
114  dump(std::forward<Stream>(out), DefaultVerbosity, indent, firstIndent);
115  }
void dump(Stream &&out, unsigned int verbosity, std::string indent, std::string firstIndent) const
Dump the content of this object into an output stream.
Definition: PointCharge.h:143
std::string indent(std::size_t const i)
static constexpr unsigned int DefaultVerbosity
Default verbosity for dumping operations.
Definition: PointCharge.h:80
template<typename Stream >
void recob::PointCharge::dump ( Stream &&  out,
std::string  indent = "" 
) const
inline

Default verbosity for dumping operations.

Definition at line 117 of file PointCharge.h.

References dump(), and art::detail::indent().

118  {
119  dump(std::forward<Stream>(out), indent, indent);
120  }
void dump(Stream &&out, unsigned int verbosity, std::string indent, std::string firstIndent) const
Dump the content of this object into an output stream.
Definition: PointCharge.h:143
std::string indent(std::size_t const i)
constexpr bool recob::PointCharge::hasCharge ( ) const
inline

Returns whether the reconstructed charge value is valid.

Definition at line 70 of file PointCharge.h.

References charge(), and InvalidCharge.

Referenced by dump().

70 { return charge() != InvalidCharge; }
static constexpr Charge_t InvalidCharge
Value used for default-constructed ("invalid") charge.
Definition: PointCharge.h:36
constexpr Charge_t charge() const
Returns the stored value of the reconstructed charge.
Definition: PointCharge.h:60

Member Data Documentation

constexpr unsigned int recob::PointCharge::DefaultVerbosity = 1U
static

Default verbosity for dumping operations.

Definition at line 80 of file PointCharge.h.

float recob::PointCharge::fCharge
private

Reconstructed charge.

Definition at line 126 of file PointCharge.h.

Referenced by charge().

constexpr Charge_t recob::PointCharge::InvalidCharge = std::numeric_limits<Charge_t>::lowest()
static

Value used for default-constructed ("invalid") charge.

Definition at line 36 of file PointCharge.h.

Referenced by hasCharge().

constexpr unsigned int recob::PointCharge::MaxVerbosity = 1U
static

Maximum available verbosity for dumping operations.

Definition at line 83 of file PointCharge.h.

Referenced by dump().


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