master
a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models
Loading...
Searching...
No Matches
FourMomentum.cpp
Go to the documentation of this file.
1
/*
2
* FourMomentum.cpp
3
*
4
* Created on: Jul 26, 2012
5
* Author: Ben O'Leary (benjamin.oleary@gmail.com)
6
* Copyright 2012 Ben O'Leary
7
*
8
* This file is part of LesHouchesParserClasses, released under the
9
* GNU General Public License. Please see the accompanying
10
* README.LHPC_CPP.txt file for a full list of files, brief documentation
11
* on how to use these classes, and further details on the license.
12
*/
13
14
#include "
LHCO.hpp
"
15
16
namespace
LHPC
17
{
18
FourMomentum::FourMomentum
() :
19
momentumComponents( 4,
20
BOL
::UsefulStuff::notANumber )
21
{
22
// just an initialization list.
23
}
24
25
FourMomentum::FourMomentum
(
double
const
initialEnergy,
26
double
const
initialXMomentum,
27
double
const
initialYMomentum,
28
double
const
initialZMomentum ) :
29
momentumComponents( 4,
30
initialEnergy )
31
{
32
momentumComponents
[ (int)
xComponent
] = initialXMomentum;
33
momentumComponents
[ (int)
yComponent
] = initialYMomentum;
34
momentumComponents
[ (int)
zComponent
] = initialZMomentum;
35
}
36
37
FourMomentum::FourMomentum
(
FourMomentum
const
& copySource ) :
38
momentumComponents( copySource.momentumComponents )
39
{
40
// just an initialization list.
41
}
42
43
FourMomentum::FourMomentum
(
LHEF::ParticleLine
const
& copySource ) :
44
momentumComponents( 4,
45
BOL
::UsefulStuff::notANumber )
46
{
47
assignFrom
( copySource );
48
}
49
50
FourMomentum::FourMomentum
(
LHCO::ObjectLine
const
& copySource ) :
51
momentumComponents( 4,
52
BOL
::UsefulStuff::notANumber )
53
{
54
assignFrom
( copySource );
55
}
56
57
FourMomentum::FourMomentum
(
58
std::pair< LhefPointer, LhefPointer >
const
& copySource ) :
59
momentumComponents( 4,
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
}
68
69
FourMomentum::FourMomentum
( std::vector< LhefPointer >
const
& copySource ) :
70
momentumComponents( 4,
71
0.0 )
72
{
73
for
(
int
whichElement( copySource.size() - 1 );
74
0 <= whichElement;
75
--whichElement )
76
{
77
momentumComponents
[ (int)
tComponent
]
78
+= copySource[ whichElement ]->getEnergy();
79
momentumComponents
[ (int)
xComponent
]
80
+= copySource[ whichElement ]->getXMomentum();
81
momentumComponents
[ (int)
yComponent
]
82
+= copySource[ whichElement ]->getYMomentum();
83
momentumComponents
[ (int)
zComponent
]
84
+= copySource[ whichElement ]->getZMomentum();
85
}
86
}
87
88
FourMomentum::FourMomentum
( std::list< LhefPointer >
const
& copySource ) :
89
momentumComponents( 4,
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
}
103
104
FourMomentum::FourMomentum
(
105
std::pair< LhcoPointer, LhcoPointer >
const
& copySource ) :
106
momentumComponents( 4,
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
}
116
117
FourMomentum::FourMomentum
( std::vector< LhcoPointer >
const
& copySource ) :
118
momentumComponents( 4,
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
}
133
134
FourMomentum::FourMomentum
( std::list< LhcoPointer >
const
& copySource ) :
135
momentumComponents( 4,
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
}
151
152
FourMomentum::~FourMomentum
()
153
{
154
// does nothing.
155
}
156
157
}
/* namespace LHPC */
LHCO.hpp
LHPC::FourMomentum
Definition
FourMomentum.hpp:28
LHPC::FourMomentum::getZ
double getZ() const
Definition
FourMomentum.hpp:101
LHPC::FourMomentum::yComponent
@ yComponent
Definition
FourMomentum.hpp:36
LHPC::FourMomentum::tComponent
@ tComponent
Definition
FourMomentum.hpp:34
LHPC::FourMomentum::zComponent
@ zComponent
Definition
FourMomentum.hpp:37
LHPC::FourMomentum::xComponent
@ xComponent
Definition
FourMomentum.hpp:35
LHPC::FourMomentum::FourMomentum
FourMomentum()
Definition
FourMomentum.cpp:18
LHPC::FourMomentum::getY
double getY() const
Definition
FourMomentum.hpp:97
LHPC::FourMomentum::getX
double getX() const
Definition
FourMomentum.hpp:93
LHPC::FourMomentum::getT
double getT() const
Definition
FourMomentum.hpp:89
LHPC::FourMomentum::~FourMomentum
~FourMomentum()
Definition
FourMomentum.cpp:152
LHPC::FourMomentum::assignFrom
void assignFrom(FourMomentum const ©Source)
Definition
FourMomentum.hpp:129
LHPC::FourMomentum::momentumComponents
std::vector< double > momentumComponents
Definition
FourMomentum.hpp:121
LHPC::LHCO::ObjectLine
Definition
ObjectLine.hpp:26
LHPC::LHEF::ParticleLine
Definition
ParticleLine.hpp:30
BOL
Definition
ArgumentParser.hpp:23
LHPC
Definition
FourMomentum.hpp:24
LHPC
source
LHCO
FourMomentum.cpp
Generated on Tue Aug 4 2026 for $\texttt{HEPfit}$ using
1.9.8