ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
G4Extensions
Quirks
src
StringVector.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef STRINGVECTOR_H
6
#define STRINGVECTOR_H
7
8
#include "G4ThreeVector.hh"
9
#include "G4LorentzVector.hh"
10
11
class
StringVector
{
12
public
:
13
StringVector
() =
default
;
14
StringVector
(
StringVector
&&) =
default
;
15
StringVector
(
const
StringVector
&) =
default
;
16
StringVector
&
operator =
(
StringVector
&&) =
default
;
17
StringVector
&
operator =
(
const
StringVector
&) =
default
;
18
StringVector
(
const
G4ThreeVector& p, G4double m);
19
StringVector
(G4double
x
, G4double
y
, G4double
z
, G4double m);
20
~StringVector
() =
default
;
21
G4ThreeVector
vect
()
const
;
22
G4double
mag
()
const
;
23
G4double
x
()
const
;
24
G4double
y
()
const
;
25
G4double
z
()
const
;
26
G4double
t
()
const
;
27
G4LorentzVector
lv
()
const
;
28
StringVector
reflect
(
const
G4LorentzVector& axis)
const
;
29
void
set
(
const
G4ThreeVector& p, G4double m);
30
void
set
(G4double
x
, G4double
y
, G4double
z
, G4double m);
31
void
operator *=
(G4double
a
);
32
33
private
:
34
G4ThreeVector
m_p
{0,0,0};
35
G4double
m_m
{};
36
};
37
38
inline
StringVector
operator *
(G4double
a
,
const
StringVector
& s) {
39
return
StringVector
(
a
* s.vect(),
a
* s.mag());
40
}
41
42
inline
StringVector
operator *
(
const
StringVector
& s, G4double
a
) {
43
return
StringVector
(
a
* s.vect(),
a
* s.mag());
44
}
45
46
inline
G4ThreeVector
StringVector::vect
()
const
{
47
return
m_p
;
48
}
49
50
inline
G4double
StringVector::mag
()
const
{
51
return
m_m
;
52
}
53
54
inline
G4double
StringVector::x
()
const
{
55
return
m_p
.x();
56
}
57
58
inline
G4double
StringVector::y
()
const
{
59
return
m_p
.y();
60
}
61
62
inline
G4double
StringVector::z
()
const
{
63
return
m_p
.z();
64
}
65
66
inline
G4double
StringVector::t
()
const
{
67
return
std::sqrt(
m_p
.mag2() +
m_m
*
m_m
);
68
}
69
70
inline
G4LorentzVector
StringVector::lv
()
const
{
71
return
G4LorentzVector(
m_p
,
t
());
72
}
73
74
inline
StringVector
StringVector::reflect
(
const
G4LorentzVector& axis)
const
{
75
return
StringVector
(axis.vect() * (2 *
lv
() * axis) / axis.mag2() -
m_p
,
m_m
);
76
}
77
78
inline
void
StringVector::set
(
const
G4ThreeVector& p, G4double m) {
79
m_p
= p;
80
m_m
= m;
81
}
82
83
inline
void
StringVector::set
(G4double
x
, G4double
y
, G4double
z
, G4double m) {
84
m_p
.set(
x
,
y
,
z
);
85
m_m
= m;
86
}
87
88
inline
void
StringVector::operator *=
(G4double
a
) {
89
m_p
*=
a
;
90
m_m
*=
a
;
91
}
92
93
#endif
operator*
ElementConstReference operator*() const
Return a reference to the referenced element.
a
static Double_t a
Definition
LArPhysWaveHECTool.cxx:38
StringVector
Definition
StringVector.h:11
StringVector::StringVector
StringVector()=default
StringVector::set
void set(const G4ThreeVector &p, G4double m)
Definition
StringVector.h:78
StringVector::StringVector
StringVector(StringVector &&)=default
StringVector::m_m
G4double m_m
Definition
StringVector.h:35
StringVector::operator=
StringVector & operator=(StringVector &&)=default
StringVector::m_p
G4ThreeVector m_p
Definition
StringVector.h:34
StringVector::StringVector
StringVector(const StringVector &)=default
StringVector::reflect
StringVector reflect(const G4LorentzVector &axis) const
Definition
StringVector.h:74
StringVector::lv
G4LorentzVector lv() const
Definition
StringVector.h:70
StringVector::x
G4double x() const
Definition
StringVector.h:54
StringVector::z
G4double z() const
Definition
StringVector.h:62
StringVector::~StringVector
~StringVector()=default
StringVector::mag
G4double mag() const
Definition
StringVector.h:50
StringVector::vect
G4ThreeVector vect() const
Definition
StringVector.h:46
StringVector::y
G4double y() const
Definition
StringVector.h:58
StringVector::operator*=
void operator*=(G4double a)
Definition
StringVector.h:88
StringVector::t
G4double t() const
Definition
StringVector.h:66
Generated on
for ATLAS Offline Software by
1.17.0