KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVQuadMoment.cpp
1//Created by KVClassFactory on Wed Jan 23 16:46:57 2013
2//Author: John Frankland,,,
3
4#include "KVQuadMoment.h"
5
7
8
9
11
13{
14 // Default constructor
15 init_KVQuadMoment();
16}
17
18
19
20
23
25{
26 // Write your code here
28}
29
30
31
32
40
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
64{
65 SetNameIndex("Qzz", 0);
66 SetNameIndex("Qxx", 1);
67 SetNameIndex("Qyy", 2);
68}
69
70
72
74{
75 Reset();
76}
77
78
79
81
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
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
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
int Int_t
#define c(i)
char Char_t
double Double_t
Description of properties and kinematics of atomic nuclei.
Definition KVNucleus.h:126
Quadrupole moment tensor of particle momenta.
KVQuadMoment()
Default constructor.
virtual void Init(void)
void Copy(TObject &obj) const
virtual void Reset(void)
void init_KVQuadMoment(void)
Double_t matrix[3][3]
virtual Double_t getvalue_int(Int_t i) const
virtual void fill(const KVNucleus *c)
Add the particle's contribution to the momentum tensor.
Base class for all global variable implementations.
Definition KVVarGlob.h:233
void Copy(TObject &obj) const
Definition KVVarGlob.h:346
void SetNameIndex(const Char_t *name, Int_t index)
Double_t Mag2() const
TArc a
ClassImp(TPyArg)