KaliVeda
Toolkit for HIC analysis
KVFoxH2.cpp
1 #include "KVFoxH2.h"
2 
4 
5 
6 
10 void KVFoxH2::init(void)
11 {
12  // Initialisation of the fields of the KVFoxH2 class
13  // Set reference frame to "CM" by default
14 
15  den = 0;
16  num = 0;
17  SetFrame("CM");
18  fType = kTwoBody;
19 }
20 
21 
22 
24 
25 void KVFoxH2::Copy(TObject& a) const
26 {
28  ((KVFoxH2&)a).den = den;
29  ((KVFoxH2&)a).num = num;
30 }
31 
32 
33 
39 
40 void KVFoxH2::fill2(const KVNucleus* n1, const KVNucleus* n2)
41 {
42  // Calculate contribution to H(2) for the given pair of nuclei.
43  // By default, momenta in "CM" frame are used. (change with SetFrame()).
44  // NOTE: if one of the nuclei has zero momentum (strange, but could happen)
45  // it is excluded from the sum.
46 
47  Double_t p1, p2, cos_th_rel;
48 
49  if (n1 == n2) {
50  p1 = p2 = n1->GetMomentum().Mag();
51  cos_th_rel = 1.;
52  }
53  else {
54  p1 = n1->GetMomentum().Mag();
55  p2 = n2->GetMomentum().Mag();
56  if ((p1 * p2) > 0.0) cos_th_rel = n1->GetMomentum().Dot(n2->GetMomentum()) / (p1 * p2);
57  else cos_th_rel = 1.;
58  }
59  if ((p1 * p2) > 0.) {
60  num += p1 * p2 * (3.*cos_th_rel * cos_th_rel - 1.);
61  den += 2.*p1 * p2;
62  }
63 }
64 
65 
66 
68 
69 void KVFoxH2::Init(void)
70 {
72  den = 0;
73  num = 0;
74 }
75 
76 
77 
79 
80 void KVFoxH2::Reset(void)
81 {
83  den = 0;
84  num = 0;
85 }
86 
87 
88 
90 
92 {
93  if (den > 0)
94  SetValue(num / den);
95  else
96  SetValue(-99);
97 }
98 
99 
100 
double Double_t
Event shape global variable : second Fox-Wolfram moment, H(2)
Definition: KVFoxH2.h:28
void Init()
Definition: KVFoxH2.cpp:69
void fill2(const KVNucleus *n1, const KVNucleus *n2)
Definition: KVFoxH2.cpp:40
Double_t num
Definition: KVFoxH2.h:30
void Calculate()
Definition: KVFoxH2.cpp:91
void Reset()
Definition: KVFoxH2.cpp:80
virtual void Copy(TObject &obj) const
Definition: KVFoxH2.cpp:25
Double_t den
Definition: KVFoxH2.h:31
Description of properties and kinematics of atomic nuclei.
Definition: KVNucleus.h:126
TVector3 GetMomentum() const
Definition: KVParticle.h:604
void Init()
Definition: KVVarGlob1.h:56
void SetValue(Double_t val)
Definition: KVVarGlob1.h:27
void Copy(TObject &obj) const
Definition: KVVarGlob1.h:51
Double_t Dot(const TVector3 &) const
Double_t Mag() const
TArc a
ClassImp(TPyArg)