KaliVeda
1.14/2
Toolkit for HIC analysis
KVQuadMoment.cpp
1
//Created by KVClassFactory on Wed Jan 23 16:46:57 2013
2
//Author: John Frankland,,,
3
4
#include "KVQuadMoment.h"
5
6
ClassImp(
KVQuadMoment
)
7
8
9
12
KVQuadMoment
::
KVQuadMoment
()
13
{
14
// Default constructor
15
init_KVQuadMoment();
16
}
17
18
19
20
23
24
KVQuadMoment::KVQuadMoment
(
const
Char_t* nom) :
KVVarGlob
(nom)
25
{
26
// Write your code here
27
init_KVQuadMoment
();
28
}
29
30
31
32
40
41
void
KVQuadMoment::Copy
(TObject& obj)
const
42
{
43
// This method copies the current state of 'this' object into 'obj'
44
// You should add here any member variables, for example:
45
// (supposing a member variable KVQuadMoment::fToto)
46
// CastedObj.fToto = fToto;
47
// or
48
// CastedObj.SetToto( GetToto() );
49
50
KVVarGlob::Copy
(obj);
51
KVQuadMoment
& CastedObj = (
KVQuadMoment
&)obj;
52
for
(
int
i = 0; i < 3; ++i) {
53
for
(
int
j = 0; j < 3; ++j) {
54
CastedObj.
matrix
[i][j] =
matrix
[i][j];
55
}
56
}
57
}
58
59
60
62
63
void
KVQuadMoment::init_KVQuadMoment
(
void
)
64
{
65
SetNameIndex
(
"Qzz"
, 0);
66
SetNameIndex
(
"Qxx"
, 1);
67
SetNameIndex
(
"Qyy"
, 2);
68
}
69
70
72
73
void
KVQuadMoment::Init
(
void
)
74
{
75
Reset
();
76
}
77
78
79
81
82
void
KVQuadMoment::Reset
(
void
)
83
{
84
for
(
int
i = 0; i < 3; i++)
for
(
int
j = 0; j < 3; j++)
matrix
[i][j] = 0.;
85
}
86
87
88
91
92
void
KVQuadMoment::fill
(
const
KVNucleus
* c)
93
{
94
//Add the particle's contribution to the momentum tensor.
95
96
TVector3 P = c->
GetMomentum
();
97
Double_t P2 = P.Mag2();
98
for
(
int
i = 0; i < 3; i++) {
99
for
(
int
j = i; j < 3; j++) {
100
if
(i == j)
matrix
[i][j] += 3.*P(i) * P(j) - P2;
101
else
{
102
Double_t a = 3.*P(i) * P(j);
103
matrix
[i][j] += a;
104
matrix
[j][i] += a;
105
}
106
}
107
}
108
}
109
110
111
116
117
Double_t
KVQuadMoment::getvalue_int
(Int_t i)
const
118
{
119
// i=0 : Qzz
120
// i=1 : Qxx
121
// i=2 : Qyy
122
123
switch
(i) {
124
case
0:
125
return
matrix
[2][2];
126
case
1:
127
return
matrix
[0][0];
128
case
2:
129
return
matrix
[1][1];
130
default
:
131
break
;
132
}
133
return
0;
134
}
135
136
137
138
KVNucleus
Description of properties and kinematics of atomic nuclei.
Definition:
KVNucleus.h:126
KVParticle::GetMomentum
TVector3 GetMomentum() const
Definition:
KVParticle.h:604
KVQuadMoment
Quadrupole moment tensor of particle momenta.
Definition:
KVQuadMoment.h:14
KVQuadMoment::KVQuadMoment
KVQuadMoment()
Default constructor.
Definition:
KVQuadMoment.cpp:12
KVQuadMoment::Init
virtual void Init(void)
Definition:
KVQuadMoment.cpp:73
KVQuadMoment::Copy
void Copy(TObject &obj) const
Definition:
KVQuadMoment.cpp:41
KVQuadMoment::Reset
virtual void Reset(void)
Definition:
KVQuadMoment.cpp:82
KVQuadMoment::init_KVQuadMoment
void init_KVQuadMoment(void)
Definition:
KVQuadMoment.cpp:63
KVQuadMoment::matrix
Double_t matrix[3][3]
Definition:
KVQuadMoment.h:15
KVQuadMoment::getvalue_int
virtual Double_t getvalue_int(Int_t i) const
Definition:
KVQuadMoment.cpp:117
KVQuadMoment::fill
virtual void fill(const KVNucleus *c)
Add the particle's contribution to the momentum tensor.
Definition:
KVQuadMoment.cpp:92
KVVarGlob
Base class for all global variable implementations.
Definition:
KVVarGlob.h:233
KVVarGlob::Copy
void Copy(TObject &obj) const
Definition:
KVVarGlob.h:346
KVVarGlob::SetNameIndex
void SetNameIndex(const Char_t *name, Int_t index)
Definition:
KVVarGlob.cpp:223
kaliveda.doxygen
KVMultiDet
globvars
KVQuadMoment.cpp
Generated on Tue Apr 1 2025 15:24:32 for KaliVeda by
1.9.1