ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
Trk::Charged Class Reference

#include <Charged.h>

Collaboration diagram for Trk::Charged:

Public Member Functions

 Charged (const double &charge=1.)
 Default constructor. More...
 
 Charged (const Charged &)=default
 Copy constructor. More...
 
 Charged (Charged &&)=default
 Move constructor. More...
 
 ~Charged ()=default
 Destructor. More...
 
Chargedoperator= (const Charged &)=default
 Assignment operator. More...
 
Chargedoperator= (Charged &&)=default
 Move assignment operator. More...
 
double charge () const
 Return the charge. More...
 
void setCharge (double charge)
 Set the charge. More...
 
bool operator== (const Charged &rOther) const
 Equality operator. More...
 
bool operator!= (const Charged &rOther) const
 Inequality operator. More...
 

Private Attributes

double m_charge
 the charge value More...
 

Detailed Description

Simple helper class for defining track parameters for charged particles

Todo:
Do we really need a double for the charge? Would an int be sufficient?
Author
Christian Gumpert chris.nosp@m.tian.nosp@m..gump.nosp@m.ert@.nosp@m.cern..nosp@m.ch

Definition at line 26 of file Charged.h.

Constructor & Destructor Documentation

◆ Charged() [1/3]

Trk::Charged::Charged ( const double &  charge = 1.)
inline

Default constructor.

Definition at line 30 of file Charged.h.

30  :
32  {}

◆ Charged() [2/3]

Trk::Charged::Charged ( const Charged )
default

Copy constructor.

◆ Charged() [3/3]

Trk::Charged::Charged ( Charged &&  )
default

Move constructor.

◆ ~Charged()

Trk::Charged::~Charged ( )
default

Destructor.

Member Function Documentation

◆ charge()

double Trk::Charged::charge ( ) const
inline

Return the charge.

Definition at line 50 of file Charged.h.

50 {return m_charge;}

◆ operator!=()

bool Trk::Charged::operator!= ( const Charged rOther) const
inline

Inequality operator.

Definition at line 63 of file Charged.h.

64  {
65  return !(*this == rOther);
66  }

◆ operator=() [1/2]

Charged& Trk::Charged::operator= ( Charged &&  )
default

Move assignment operator.

◆ operator=() [2/2]

Charged& Trk::Charged::operator= ( const Charged )
default

Assignment operator.

◆ operator==()

bool Trk::Charged::operator== ( const Charged rOther) const
inline

Equality operator.

Definition at line 56 of file Charged.h.

57  {
58  constexpr double tolerance = 1e-8;
59  return std::abs(charge() - rOther.charge()) < tolerance;
60  }

◆ setCharge()

void Trk::Charged::setCharge ( double  charge)
inline

Set the charge.

Definition at line 53 of file Charged.h.

53 {m_charge = charge;}

Member Data Documentation

◆ m_charge

double Trk::Charged::m_charge
private

the charge value

Definition at line 69 of file Charged.h.


The documentation for this class was generated from the following file:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
tolerance
constexpr double tolerance
Definition: runMdtGeoComparison.cxx:104
Trk::Charged::charge
double charge() const
Return the charge.
Definition: Charged.h:50
Trk::Charged::m_charge
double m_charge
the charge value
Definition: Charged.h:69
tolerance
Definition: suep_shower.h:17