ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::Charged Class Reference

Simple helper class for defining track parameters for charged particles. More...

#include <Charged.h>

Collaboration diagram for Trk::Charged:

Public Member Functions

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

Private Attributes

double m_charge
 the charge value

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 {}
double charge() const
Return the charge.
Definition Charged.h:50
double m_charge
the charge value
Definition Charged.h:69

◆ 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 }
constexpr double tolerance

◆ setCharge()

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

Set the charge.

Definition at line 53 of file Charged.h.

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: