BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | Friends
BDSFourVector< Type > Class Template Reference

A simple templated four vector class. More...

#include <BDSFourVector.hh>

Collaboration diagram for BDSFourVector< Type >:
Collaboration graph

Public Member Functions

 BDSFourVector ()
 Default constructor.
 
 BDSFourVector (Type xIn, Type yIn, Type zIn, Type tIn)
 Alternate constructor.
 
 BDSFourVector (const BDSFourVector &other)
 Copy constructor.
 
BDSFourVectoroperator= (const BDSFourVector &rhs)
 Assignment operator.
 
Type & operator[] (const G4int index)
 Access / set a single element.
 
const Type & operator[] (const G4int index) const
 Access a single element.
 
const Type & x () const
 Accessor by name.
 
const Type & y () const
 Accessor by name.
 
const Type & z () const
 Accessor by name.
 
const Type & t () const
 Accessor by name.
 

Private Attributes

Type values [4]
 Member data x,y,z,t.
 
std::vector< G4int > indices = {0,1,2,3}
 

Friends

std::ostream & operator<< (std::ostream &out, BDSFourVector const &v)
 Output stream.
 

Detailed Description

template<typename Type>
class BDSFourVector< Type >

A simple templated four vector class.

Author
Laurie Nevay

Definition at line 35 of file BDSFourVector.hh.

Constructor & Destructor Documentation

◆ BDSFourVector() [1/3]

template<typename Type >
BDSFourVector< Type >::BDSFourVector ( )
inline

Default constructor.

Definition at line 39 of file BDSFourVector.hh.

References BDSFourVector< Type >::values.

◆ BDSFourVector() [2/3]

template<typename Type >
BDSFourVector< Type >::BDSFourVector ( Type  xIn,
Type  yIn,
Type  zIn,
Type  tIn 
)
inline

Alternate constructor.

Definition at line 43 of file BDSFourVector.hh.

References BDSFourVector< Type >::values.

◆ BDSFourVector() [3/3]

template<typename Type >
BDSFourVector< Type >::BDSFourVector ( const BDSFourVector< Type > &  other)
inline

Copy constructor.

Definition at line 47 of file BDSFourVector.hh.

References BDSFourVector< Type >::values.

Member Function Documentation

◆ operator=()

template<typename Type >
BDSFourVector & BDSFourVector< Type >::operator= ( const BDSFourVector< Type > &  rhs)
inline

Assignment operator.

Definition at line 54 of file BDSFourVector.hh.

References BDSFourVector< Type >::values.

◆ operator[]() [1/2]

template<typename Type >
Type & BDSFourVector< Type >::operator[] ( const G4int  index)
inline

Access / set a single element.

Definition at line 64 of file BDSFourVector.hh.

References BDSFourVector< Type >::values.

◆ operator[]() [2/2]

template<typename Type >
const Type & BDSFourVector< Type >::operator[] ( const G4int  index) const
inline

Access a single element.

Definition at line 72 of file BDSFourVector.hh.

References BDSFourVector< Type >::values.

◆ t()

template<typename Type >
const Type & BDSFourVector< Type >::t ( ) const
inline

Accessor by name.

Definition at line 83 of file BDSFourVector.hh.

References BDSFourVector< Type >::values.

Referenced by BDSArray4D::operator()().

Here is the caller graph for this function:

◆ x()

template<typename Type >
const Type & BDSFourVector< Type >::x ( ) const
inline

Accessor by name.

Definition at line 80 of file BDSFourVector.hh.

References BDSFourVector< Type >::values.

Referenced by BDSArray4D::operator()().

Here is the caller graph for this function:

◆ y()

template<typename Type >
const Type & BDSFourVector< Type >::y ( ) const
inline

Accessor by name.

Definition at line 81 of file BDSFourVector.hh.

References BDSFourVector< Type >::values.

Referenced by BDSArray4D::operator()().

Here is the caller graph for this function:

◆ z()

template<typename Type >
const Type & BDSFourVector< Type >::z ( ) const
inline

Accessor by name.

Definition at line 82 of file BDSFourVector.hh.

References BDSFourVector< Type >::values.

Referenced by BDSArray4D::operator()().

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<<

template<typename Type >
std::ostream & operator<< ( std::ostream &  out,
BDSFourVector< Type > const &  v 
)
friend

Output stream.

Definition at line 87 of file BDSFourVector.hh.

Field Documentation

◆ indices

template<typename Type >
std::vector<G4int> BDSFourVector< Type >::indices = {0,1,2,3}
private

Definition at line 102 of file BDSFourVector.hh.

◆ values

template<typename Type >
Type BDSFourVector< Type >::values[4]
private

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