ATLAS Offline Software
StringVector.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 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();
14  StringVector(const G4ThreeVector& p, G4double m);
15  StringVector(G4double x, G4double y, G4double z, G4double m);
16  ~StringVector();
17  G4ThreeVector vect() const;
18  G4double mag() const;
19  G4double x() const;
20  G4double y() const;
21  G4double z() const;
22  G4double t() const;
23  G4LorentzVector lv() const;
24  StringVector reflect(const G4LorentzVector& axis) const;
25  void set(const G4ThreeVector& p, G4double m);
26  void set(G4double x, G4double y, G4double z, G4double m);
27  void operator *= (G4double a);
28 
29 private:
30  G4ThreeVector m_p;
31  G4double m_m;
32 };
33 
34 inline StringVector operator * (G4double a, const StringVector& s) {
35  return StringVector(a * s.vect(), a * s.mag());
36 }
37 
38 inline StringVector operator * (const StringVector& s, G4double a) {
39  return StringVector(a * s.vect(), a * s.mag());
40 }
41 
42 inline G4ThreeVector StringVector::vect() const {
43  return m_p;
44 }
45 
46 inline G4double StringVector::mag() const {
47  return m_m;
48 }
49 
50 inline G4double StringVector::x() const {
51  return m_p.x();
52 }
53 
54 inline G4double StringVector::y() const {
55  return m_p.y();
56 }
57 
58 inline G4double StringVector::z() const {
59  return m_p.z();
60 }
61 
62 inline G4double StringVector::t() const {
63  return std::sqrt(m_p.mag2() + m_m*m_m);
64 }
65 
66 inline G4LorentzVector StringVector::lv() const {
67  return G4LorentzVector(m_p, t());
68 }
69 
70 inline StringVector StringVector::reflect(const G4LorentzVector& axis) const {
71  return StringVector(axis.vect() * (2 * lv() * axis) / axis.mag2() - m_p, m_m);
72 }
73 
74 inline void StringVector::set(const G4ThreeVector& p, G4double m) {
75  m_p = p;
76  m_m = m;
77 }
78 
79 inline void StringVector::set(G4double x, G4double y, G4double z, G4double m) {
80  m_p.set(x,y,z);
81  m_m = m;
82 }
83 
84 inline void StringVector::operator *= (G4double a) {
85  m_p *= a;
86  m_m *= a;
87 }
88 
89 #endif
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
StringVector::t
G4double t() const
Definition: StringVector.h:62
StringVector::m_p
G4ThreeVector m_p
Definition: StringVector.h:30
StringVector::operator*=
void operator*=(G4double a)
Definition: StringVector.h:84
StringVector::set
void set(const G4ThreeVector &p, G4double m)
Definition: StringVector.h:74
yodamerge_tmp.axis
list axis
Definition: yodamerge_tmp.py:241
Analysis::StringVector
std::vector< std::string > StringVector
Definition: LifetimeInfo.h:32
x
#define x
StringVector::StringVector
StringVector()
Definition: StringVector.cxx:7
z
#define z
StringVector::reflect
StringVector reflect(const G4LorentzVector &axis) const
Definition: StringVector.h:70
StringVector::y
G4double y() const
Definition: StringVector.h:54
StringVector::z
G4double z() const
Definition: StringVector.h:58
StringVector
Definition: StringVector.h:11
StringVector::m_m
G4double m_m
Definition: StringVector.h:31
StringVector::vect
G4ThreeVector vect() const
Definition: StringVector.h:42
a
TList * a
Definition: liststreamerinfos.cxx:10
y
#define y
StringVector::lv
G4LorentzVector lv() const
Definition: StringVector.h:66
StringVector::mag
G4double mag() const
Definition: StringVector.h:46
StringVector::x
G4double x() const
Definition: StringVector.h:50
StringVector::~StringVector
~StringVector()
Definition: StringVector.cxx:10
operator*
StringVector operator*(G4double a, const StringVector &s)
Definition: StringVector.h:34