All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Static Public Attributes | Private Attributes | List of all members
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
 
template<typename Stream >
void dump (Stream &&out, std::string indent, std::string firstIndent) const
 
template<typename Stream >
void dump (Stream &&out, std::string indent="") const
 

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 31 of file PointCharge.h.

Member Typedef Documentation

Type for the amount of reconstructed charge.

Definition at line 35 of file PointCharge.h.

Constructor & Destructor Documentation

constexpr recob::PointCharge::PointCharge ( )
inline

Default constructor (for ROOT only).

Definition at line 47 of file PointCharge.h.

static constexpr Charge_t InvalidCharge
Value used for default-constructed (&quot;invalid&quot;) charge.
Definition: PointCharge.h:39
float fCharge
Reconstructed charge.
Definition: PointCharge.h:128
constexpr recob::PointCharge::PointCharge ( Charge_t  charge)
inline

Constructor: sets all the data.

Parameters
chargereconstructed charge (used unchanged)

Definition at line 54 of file PointCharge.h.

54 : fCharge(charge) {}
float fCharge
Reconstructed charge.
Definition: PointCharge.h:128
constexpr Charge_t charge() const
Returns the stored value of the reconstructed charge.
Definition: PointCharge.h:65

Member Function Documentation

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

Returns the stored value of the reconstructed charge.

Definition at line 65 of file PointCharge.h.

65 { return fCharge; }
float fCharge
Reconstructed charge.
Definition: PointCharge.h:128
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 147 of file PointCharge.h.

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

Definition at line 115 of file PointCharge.h.

116  { dump(std::forward<Stream>(out), verbosity, indent, indent); }
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:147
template<typename Stream >
void recob::PointCharge::dump ( Stream &&  out,
std::string  indent,
std::string  firstIndent 
) const
inline

Definition at line 118 of file PointCharge.h.

119  { dump(std::forward<Stream>(out), DefaultVerbosity, indent, firstIndent); }
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:147
static constexpr unsigned int DefaultVerbosity
Default verbosity for dumping operations.
Definition: PointCharge.h:87
template<typename Stream >
void recob::PointCharge::dump ( Stream &&  out,
std::string  indent = "" 
) const
inline

Definition at line 121 of file PointCharge.h.

122  { dump(std::forward<Stream>(out), indent, indent); }
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:147
constexpr bool recob::PointCharge::hasCharge ( ) const
inline

Returns whether the reconstructed charge value is valid.

Definition at line 76 of file PointCharge.h.

76 { return charge() != InvalidCharge; }
static constexpr Charge_t InvalidCharge
Value used for default-constructed (&quot;invalid&quot;) charge.
Definition: PointCharge.h:39
constexpr Charge_t charge() const
Returns the stored value of the reconstructed charge.
Definition: PointCharge.h:65

Member Data Documentation

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

Default verbosity for dumping operations.

Definition at line 87 of file PointCharge.h.

float recob::PointCharge::fCharge
private

Reconstructed charge.

Definition at line 128 of file PointCharge.h.

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

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

Definition at line 39 of file PointCharge.h.

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

Maximum available verbosity for dumping operations.

Definition at line 90 of file PointCharge.h.


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