a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
LHPC::FourMomentum Class Reference

#include <FourMomentum.hpp>

Detailed Description

Definition at line 27 of file FourMomentum.hpp.

Public Types

typedef LHCO::ObjectLine const * LhcoPointer
 
typedef LHEF::ParticleLine const * LhefPointer
 
enum  VectorComponent { tComponent = 0 , xComponent = 1 , yComponent = 2 , zComponent = 3 }
 

Public Member Functions

void assignFrom (FourMomentum const &copySource)
 
void assignFrom (LHCO::ObjectLine const &copySource)
 
void assignFrom (LHEF::ParticleLine const &copySource)
 
 FourMomentum ()
 
 FourMomentum (double const initialEnergy, double const initialXMomentum, double const initialYMomentum, double const initialZMomentum)
 
 FourMomentum (FourMomentum const &copySource)
 
 FourMomentum (LHCO::ObjectLine const &copySource)
 
 FourMomentum (LHEF::ParticleLine const &copySource)
 
 FourMomentum (std::list< LhcoPointer > const &copySource)
 
 FourMomentum (std::list< LhefPointer > const &copySource)
 
 FourMomentum (std::pair< LhcoPointer, LhcoPointer > const &copySource)
 
 FourMomentum (std::pair< LhefPointer, LhefPointer > const &copySource)
 
 FourMomentum (std::vector< LhcoPointer > const &copySource)
 
 FourMomentum (std::vector< LhefPointer > const &copySource)
 
double getInvariantMass () const
 
double getInvariantMassSquared () const
 
double getSpatialMagnitude () const
 
double getSpatialMagnitudeSquared () const
 
double getT () const
 
double getTransverseMagnitude () const
 
double getTransverseMagnitudeSquared () const
 
double getX () const
 
double getY () const
 
double getZ () const
 
double operator* (FourMomentum const &sourceFourMomentum)
 
void operator*= (double const scalingFactor)
 
FourMomentum operator+ (FourMomentum const &sourceFourMomentum)
 
void operator+= (FourMomentum const &sourceFourMomentum)
 
FourMomentum operator- (FourMomentum const &sourceFourMomentum)
 
void operator-= (FourMomentum const &sourceFourMomentum)
 
void operator/= (double const scalingFactor)
 
void operator= (FourMomentum const &copySource)
 
void operator= (LHCO::ObjectLine const &copySource)
 
void operator= (LHEF::ParticleLine const &copySource)
 
double & operator[] (int const whichComponent)
 
double const & operator[] (int const whichComponent) const
 
void setT (double const inputValue)
 
void setX (double const inputValue)
 
void setY (double const inputValue)
 
void setZ (double const inputValue)
 
std::string toString () const
 
 ~FourMomentum ()
 

Protected Attributes

std::vector< double > momentumComponents
 

Member Typedef Documentation

◆ LhcoPointer

Definition at line 31 of file FourMomentum.hpp.

◆ LhefPointer

Definition at line 30 of file FourMomentum.hpp.

Member Enumeration Documentation

◆ VectorComponent

Enumerator
tComponent 
xComponent 
yComponent 
zComponent 

Definition at line 32 of file FourMomentum.hpp.

Constructor & Destructor Documentation

◆ FourMomentum() [1/11]

LHPC::FourMomentum::FourMomentum ( )

Definition at line 18 of file FourMomentum.cpp.

18 :
21 {
22 // just an initialization list.
23 }
static double const notANumber
Definition: UsefulStuff.hpp:28
std::vector< double > momentumComponents

◆ FourMomentum() [2/11]

LHPC::FourMomentum::FourMomentum ( double const  initialEnergy,
double const  initialXMomentum,
double const  initialYMomentum,
double const  initialZMomentum 
)

Definition at line 25 of file FourMomentum.cpp.

28 :
30 initialEnergy )
31 {
32 momentumComponents[ (int)xComponent ] = initialXMomentum;
33 momentumComponents[ (int)yComponent ] = initialYMomentum;
34 momentumComponents[ (int)zComponent ] = initialZMomentum;
35 }

◆ FourMomentum() [3/11]

LHPC::FourMomentum::FourMomentum ( FourMomentum const &  copySource)

Definition at line 37 of file FourMomentum.cpp.

37 :
38 momentumComponents( copySource.momentumComponents )
39 {
40 // just an initialization list.
41 }

◆ FourMomentum() [4/11]

LHPC::FourMomentum::FourMomentum ( LHEF::ParticleLine const &  copySource)

Definition at line 43 of file FourMomentum.cpp.

43 :
46 {
47 assignFrom( copySource );
48 }
void assignFrom(FourMomentum const &copySource)

◆ FourMomentum() [5/11]

LHPC::FourMomentum::FourMomentum ( LHCO::ObjectLine const &  copySource)

Definition at line 50 of file FourMomentum.cpp.

50 :
53 {
54 assignFrom( copySource );
55 }

◆ FourMomentum() [6/11]

LHPC::FourMomentum::FourMomentum ( std::pair< LhefPointer, LhefPointer > const &  copySource)

Definition at line 57 of file FourMomentum.cpp.

58 :
60 0.0 )
61 {
62 assignFrom( *(copySource.first) );
63 momentumComponents[ (int)tComponent ] += copySource.second->getEnergy();
64 momentumComponents[ (int)xComponent ] += copySource.second->getXMomentum();
65 momentumComponents[ (int)yComponent ] += copySource.second->getYMomentum();
66 momentumComponents[ (int)zComponent ] += copySource.second->getZMomentum();
67 }

◆ FourMomentum() [7/11]

LHPC::FourMomentum::FourMomentum ( std::vector< LhefPointer > const &  copySource)

Definition at line 69 of file FourMomentum.cpp.

69 :
71 0.0 )
72 {
73 for( int whichElement( copySource.size() - 1 );
74 0 <= whichElement;
75 --whichElement )
76 {
78 += copySource[ whichElement ]->getEnergy();
80 += copySource[ whichElement ]->getXMomentum();
82 += copySource[ whichElement ]->getYMomentum();
84 += copySource[ whichElement ]->getZMomentum();
85 }
86 }

◆ FourMomentum() [8/11]

LHPC::FourMomentum::FourMomentum ( std::list< LhefPointer > const &  copySource)

Definition at line 88 of file FourMomentum.cpp.

88 :
90 0.0 )
91 {
92 for( std::list< LhefPointer >::const_iterator
93 whichLine( copySource.begin() );
94 copySource.end() != whichLine;
95 ++whichLine )
96 {
97 momentumComponents[ (int)tComponent ] += (*whichLine)->getEnergy();
98 momentumComponents[ (int)xComponent ] += (*whichLine)->getXMomentum();
99 momentumComponents[ (int)yComponent ] += (*whichLine)->getYMomentum();
100 momentumComponents[ (int)zComponent ] += (*whichLine)->getZMomentum();
101 }
102 }

◆ FourMomentum() [9/11]

LHPC::FourMomentum::FourMomentum ( std::pair< LhcoPointer, LhcoPointer > const &  copySource)

Definition at line 104 of file FourMomentum.cpp.

105 :
107 0.0 )
108 {
109 assignFrom( *(copySource.first) );
110 FourMomentum copyMomentum( *(copySource.second) );
111 momentumComponents[ (int)tComponent ] += copyMomentum.getT();
112 momentumComponents[ (int)xComponent ] += copyMomentum.getX();
113 momentumComponents[ (int)yComponent ] += copyMomentum.getY();
114 momentumComponents[ (int)zComponent ] += copyMomentum.getZ();
115 }

◆ FourMomentum() [10/11]

LHPC::FourMomentum::FourMomentum ( std::vector< LhcoPointer > const &  copySource)

Definition at line 117 of file FourMomentum.cpp.

117 :
119 0.0 )
120 {
121 FourMomentum copyMomentum;
122 for( int whichElement( copySource.size() - 1 );
123 0 <= whichElement;
124 --whichElement )
125 {
126 copyMomentum = *(copySource[ whichElement ]);
127 momentumComponents[ (int)tComponent ] += copyMomentum.getT();
128 momentumComponents[ (int)xComponent ] += copyMomentum.getX();
129 momentumComponents[ (int)yComponent ] += copyMomentum.getY();
130 momentumComponents[ (int)zComponent ] += copyMomentum.getZ();
131 }
132 }

◆ FourMomentum() [11/11]

LHPC::FourMomentum::FourMomentum ( std::list< LhcoPointer > const &  copySource)

Definition at line 134 of file FourMomentum.cpp.

134 :
136 0.0 )
137 {
138 FourMomentum copyMomentum;
139 for( std::list< LhcoPointer >::const_iterator
140 whichLine( copySource.begin() );
141 copySource.end() != whichLine;
142 ++whichLine )
143 {
144 copyMomentum = *(*whichLine);
145 momentumComponents[ (int)tComponent ] += copyMomentum.getT();
146 momentumComponents[ (int)xComponent ] += copyMomentum.getX();
147 momentumComponents[ (int)yComponent ] += copyMomentum.getY();
148 momentumComponents[ (int)zComponent ] += copyMomentum.getZ();
149 }
150 }

◆ ~FourMomentum()

LHPC::FourMomentum::~FourMomentum ( )

Definition at line 152 of file FourMomentum.cpp.

153 {
154 // does nothing.
155 }

Member Function Documentation

◆ assignFrom() [1/3]

void LHPC::FourMomentum::assignFrom ( FourMomentum const &  copySource)
inline

Definition at line 129 of file FourMomentum.hpp.

130 {
131 momentumComponents = copySource.momentumComponents;
132 }

◆ assignFrom() [2/3]

void LHPC::FourMomentum::assignFrom ( LHCO::ObjectLine const &  copySource)
inline

Definition at line 144 of file FourMomentum.hpp.

145 {
147 = ( copySource.getTransverseMomentum()
148 * cos( copySource.getAzimuthalAngle() ) );
150 = ( copySource.getTransverseMomentum()
151 * sin( copySource.getAzimuthalAngle() ) );
153 = ( copySource.getTransverseMomentum()
154 * sinh( copySource.getPseudorapidity() ) );
156 = sqrt( ( copySource.getInvariantMass() * copySource.getInvariantMass() )
158 }
double getSpatialMagnitudeSquared() const

◆ assignFrom() [3/3]

void LHPC::FourMomentum::assignFrom ( LHEF::ParticleLine const &  copySource)
inline

Definition at line 135 of file FourMomentum.hpp.

136 {
137 momentumComponents[ (int)tComponent ] = copySource.getEnergy();
138 momentumComponents[ (int)xComponent ] = copySource.getXMomentum();
139 momentumComponents[ (int)yComponent ] = copySource.getYMomentum();
140 momentumComponents[ (int)zComponent ] = copySource.getZMomentum();
141 }

◆ getInvariantMass()

double LHPC::FourMomentum::getInvariantMass ( ) const
inline

Definition at line 283 of file FourMomentum.hpp.

284 {
285 return sqrt( getInvariantMassSquared() );
286 }
double getInvariantMassSquared() const

◆ getInvariantMassSquared()

double LHPC::FourMomentum::getInvariantMassSquared ( ) const
inline

Definition at line 275 of file FourMomentum.hpp.

276 {
277 return ( ( momentumComponents[ (int)tComponent ]
280 }

◆ getSpatialMagnitude()

double LHPC::FourMomentum::getSpatialMagnitude ( ) const
inline

Definition at line 269 of file FourMomentum.hpp.

270 {
271 return sqrt( getSpatialMagnitudeSquared() );
272 }

◆ getSpatialMagnitudeSquared()

double LHPC::FourMomentum::getSpatialMagnitudeSquared ( ) const
inline

Definition at line 261 of file FourMomentum.hpp.

262 {
265 * momentumComponents[ (int)zComponent ] ) );
266 }
double getTransverseMagnitudeSquared() const

◆ getT()

double LHPC::FourMomentum::getT ( ) const
inline

Definition at line 89 of file FourMomentum.hpp.

89{ return (*this)[ (int)tComponent ]; }

◆ getTransverseMagnitude()

double LHPC::FourMomentum::getTransverseMagnitude ( ) const
inline

Definition at line 255 of file FourMomentum.hpp.

256 {
257 return sqrt( getTransverseMagnitudeSquared() );
258 }

◆ getTransverseMagnitudeSquared()

double LHPC::FourMomentum::getTransverseMagnitudeSquared ( ) const
inline

Definition at line 246 of file FourMomentum.hpp.

247 {
248 return ( ( momentumComponents[ (int)xComponent ]
251 * momentumComponents[ (int)yComponent ] ) );
252 }

◆ getX()

double LHPC::FourMomentum::getX ( ) const
inline

Definition at line 93 of file FourMomentum.hpp.

93{ return (*this)[ (int)xComponent ]; }

◆ getY()

double LHPC::FourMomentum::getY ( ) const
inline

Definition at line 97 of file FourMomentum.hpp.

97{ return (*this)[ (int)yComponent ]; }

◆ getZ()

double LHPC::FourMomentum::getZ ( ) const
inline

Definition at line 101 of file FourMomentum.hpp.

101{ return (*this)[ (int)zComponent ]; }

◆ operator*()

double LHPC::FourMomentum::operator* ( FourMomentum const &  sourceFourMomentum)
inline

Definition at line 233 of file FourMomentum.hpp.

234 {
235 return ( ( momentumComponents[ (int)tComponent ]
236 * sourceFourMomentum[ (int)tComponent ] )
238 * sourceFourMomentum[ (int)xComponent ] )
240 * sourceFourMomentum[ (int)yComponent ] )
242 * sourceFourMomentum[ (int)zComponent ] ) );
243 }

◆ operator*=()

void LHPC::FourMomentum::operator*= ( double const  scalingFactor)
inline

Definition at line 199 of file FourMomentum.hpp.

200 {
201 momentumComponents[ (int)tComponent ] *= scalingFactor;
202 momentumComponents[ (int)xComponent ] *= scalingFactor;
203 momentumComponents[ (int)yComponent ] *= scalingFactor;
204 momentumComponents[ (int)zComponent ] *= scalingFactor;
205 }

◆ operator+()

FourMomentum LHPC::FourMomentum::operator+ ( FourMomentum const &  sourceFourMomentum)
inline

Definition at line 217 of file FourMomentum.hpp.

218 {
219 FourMomentum returnFourMomentum( *this );
220 returnFourMomentum += sourceFourMomentum;
221 return returnFourMomentum;
222 }

◆ operator+=()

void LHPC::FourMomentum::operator+= ( FourMomentum const &  sourceFourMomentum)
inline

Definition at line 173 of file FourMomentum.hpp.

174 {
176 += sourceFourMomentum[ (int)tComponent ];
178 += sourceFourMomentum[ (int)xComponent ];
180 += sourceFourMomentum[ (int)yComponent ];
182 += sourceFourMomentum[ (int)zComponent ];
183 }

◆ operator-()

FourMomentum LHPC::FourMomentum::operator- ( FourMomentum const &  sourceFourMomentum)
inline

Definition at line 225 of file FourMomentum.hpp.

226 {
227 FourMomentum returnFourMomentum( *this );
228 returnFourMomentum -= sourceFourMomentum;
229 return returnFourMomentum;
230 }

◆ operator-=()

void LHPC::FourMomentum::operator-= ( FourMomentum const &  sourceFourMomentum)
inline

Definition at line 186 of file FourMomentum.hpp.

187 {
189 -= sourceFourMomentum[ (int)tComponent ];
191 -= sourceFourMomentum[ (int)xComponent ];
193 -= sourceFourMomentum[ (int)yComponent ];
195 -= sourceFourMomentum[ (int)zComponent ];
196 }

◆ operator/=()

void LHPC::FourMomentum::operator/= ( double const  scalingFactor)
inline

Definition at line 208 of file FourMomentum.hpp.

209 {
210 momentumComponents[ (int)tComponent ] /= scalingFactor;
211 momentumComponents[ (int)xComponent ] /= scalingFactor;
212 momentumComponents[ (int)yComponent ] /= scalingFactor;
213 momentumComponents[ (int)zComponent ] /= scalingFactor;
214 }

◆ operator=() [1/3]

void LHPC::FourMomentum::operator= ( FourMomentum const &  copySource)
inline

Definition at line 59 of file FourMomentum.hpp.

59{ assignFrom( copySource ); }

◆ operator=() [2/3]

void LHPC::FourMomentum::operator= ( LHCO::ObjectLine const &  copySource)
inline

Definition at line 68 of file FourMomentum.hpp.

68 { assignFrom(
69 copySource ); }

◆ operator=() [3/3]

void LHPC::FourMomentum::operator= ( LHEF::ParticleLine const &  copySource)
inline

Definition at line 63 of file FourMomentum.hpp.

63 { assignFrom(
64 copySource ); }

◆ operator[]() [1/2]

double & LHPC::FourMomentum::operator[] ( int const  whichComponent)
inline

Definition at line 161 of file FourMomentum.hpp.

162 {
163 return momentumComponents[ whichComponent ];
164 }

◆ operator[]() [2/2]

double const & LHPC::FourMomentum::operator[] ( int const  whichComponent) const
inline

Definition at line 167 of file FourMomentum.hpp.

168 {
169 return momentumComponents[ whichComponent ];
170 }

◆ setT()

void LHPC::FourMomentum::setT ( double const  inputValue)
inline

Definition at line 91 of file FourMomentum.hpp.

91{ (*this)[ (int)tComponent ] = inputValue; }

◆ setX()

void LHPC::FourMomentum::setX ( double const  inputValue)
inline

Definition at line 95 of file FourMomentum.hpp.

95{ (*this)[ (int)xComponent ] = inputValue; }

◆ setY()

void LHPC::FourMomentum::setY ( double const  inputValue)
inline

Definition at line 99 of file FourMomentum.hpp.

99{ (*this)[ (int)yComponent ] = inputValue; }

◆ setZ()

void LHPC::FourMomentum::setZ ( double const  inputValue)
inline

Definition at line 103 of file FourMomentum.hpp.

103{ (*this)[ (int)zComponent ] = inputValue; }

◆ toString()

std::string LHPC::FourMomentum::toString ( ) const
inline

Definition at line 289 of file FourMomentum.hpp.

290 {
291 std::stringstream stringBuilder;
292 stringBuilder
293 << "( " << getT() << ", " << getX() << ", " << getY() << ", " << getZ()
294 << " )";
295 return stringBuilder.str();
296 }
double getZ() const
double getY() const
double getX() const
double getT() const

Member Data Documentation

◆ momentumComponents

std::vector< double > LHPC::FourMomentum::momentumComponents
protected

Definition at line 121 of file FourMomentum.hpp.


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