KaliVeda
1.14/2
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVKinematicalFrame.cpp
1
//Created by KVClassFactory on Thu Jan 19 17:29:54 2017
2
//Author: John Frankland,,,
3
4
#include "KVKinematicalFrame.h"
5
#include "
TClass.h
"
6
7
ClassImp
(
KVKinematicalFrame
)
8
9
10
13
14
KVKinematicalFrame
::
KVKinematicalFrame
(const
Char_t
* name, const
KVParticle
* original, const
KVFrameTransform
& trans)
15
:
TNamed
(name, "Kinematical frame"), fTransform(trans), fParticle((
KVParticle
*)original->IsA()->New())
16
{
17
// Create representation of original particle in transformed frame
18
// This frame has a name which can be used to retrieve it from a list
19
20
ReapplyTransform(original);
21
fParticle->SetFrameName(
name
);
22
}
23
24
25
28
29
KVKinematicalFrame::KVKinematicalFrame
(
const
KVFrameTransform
& trans,
const
KVParticle
* original)
30
:
TNamed
(), fTransform(trans), fParticle((
KVParticle
*)original->
IsA
()->New())
31
{
32
// Create representation of original particle in transformed frame
33
34
ReapplyTransform
(original);
35
}
36
37
38
42
43
KVKinematicalFrame::KVKinematicalFrame
(
KVParticle
* p,
const
KVFrameTransform
& t)
44
:
TNamed
(), fTransform(t), fParticle(nullptr)
45
{
46
// Modify the kinematics of the particle according to the given transformation
47
// Recursively update the kinematics in all frames defined for this particle
48
p
->Transform(
fTransform
.
Inverse
());
49
p
->UpdateAllFrames();
50
}
51
52
53
56
57
KVKinematicalFrame::KVKinematicalFrame
(
const
KVKinematicalFrame
& o)
58
:
TNamed
((const
TNamed
&)o), fTransform(o.fTransform),
59
fParticle(o.GetParticle() ? (
KVParticle
*)o.GetParticle()->
IsA
()->New() : nullptr)
60
{
61
// Copy constructor required for rootcint (not rootcling)
62
if
(
GetParticle
()) {
63
o.
GetParticle
()->
SetFrameCopyOnly
();
64
o.
GetParticle
()->
Copy
(*
GetParticle
());
65
o.
GetParticle
()->
ResetFrameCopyOnly
();
66
fParticle
->SetFrameName(o.
GetParticle
()->
GetFrameName
());
67
}
68
}
69
70
71
74
75
KVKinematicalFrame
&
KVKinematicalFrame::operator=
(
const
KVKinematicalFrame
& o)
76
{
77
// Assignment operator required for rootcint (not rootcling)
78
79
if
(&o ==
this
)
return
(*
this
);
80
fTransform
= o.
fTransform
;
81
fParticle
.reset(o.
GetParticle
() ? (
KVParticle
*)o.
GetParticle
()->
IsA
()->
New
() :
nullptr
);
82
if
(
GetParticle
()) {
83
o.
GetParticle
()->
SetFrameCopyOnly
();
84
o.
GetParticle
()->
Copy
(*
GetParticle
());
85
o.
GetParticle
()->
ResetFrameCopyOnly
();
86
fParticle
->SetFrameName(o.
GetParticle
()->
GetFrameName
());
87
}
88
return
*
this
;
89
}
90
91
92
95
96
void
KVKinematicalFrame::ReapplyTransform
(
const
KVParticle
* original)
97
{
98
// Apply stored kinematical transformation to the particle
99
100
original->
SetFrameCopyOnly
();
101
original->
Copy
(*(
fParticle
.get()));
102
original->
ResetFrameCopyOnly
();
103
fParticle
->Transform(
fTransform
.
Inverse
());
104
}
105
106
107
110
111
void
KVKinematicalFrame::ApplyTransform
(
const
KVParticle
* original,
const
KVFrameTransform
& trans)
112
{
113
// Apply new kinematical transformation to the particle and update all subframes
114
115
fTransform
= trans;
116
ReapplyTransform
(original);
117
// recursively update all subframes
118
fParticle
->UpdateAllFrames();
119
}
120
121
Char_t
char Char_t
TClass.h
p
winID h TVirtualViewer3D TVirtualGLPainter p
name
char name[80]
IsA
TClass * IsA() const override
KVFrameTransform
Utility class for kinematical transformations of KVParticle class.
Definition
KVFrameTransform.h:61
KVKinematicalFrame
Kinematical representation of a particle in different reference frames.
Definition
KVKinematicalFrame.h:22
KVKinematicalFrame::GetParticle
KVParticle * GetParticle() const
Definition
KVKinematicalFrame.h:34
KVKinematicalFrame::fParticle
std::unique_ptr< KVParticle > fParticle
kinematically transformed particle
Definition
KVKinematicalFrame.h:24
KVKinematicalFrame::operator=
KVKinematicalFrame & operator=(const KVKinematicalFrame &)
Assignment operator required for rootcint (not rootcling)
Definition
KVKinematicalFrame.cpp:75
KVKinematicalFrame::fTransform
KVFrameTransform fTransform
kinematical transform wrt 'parent' frame
Definition
KVKinematicalFrame.h:23
KVKinematicalFrame::ReapplyTransform
void ReapplyTransform(const KVParticle *original)
Apply stored kinematical transformation to the particle.
Definition
KVKinematicalFrame.cpp:96
KVKinematicalFrame::KVKinematicalFrame
KVKinematicalFrame(const Char_t *name, const KVParticle *original, const KVFrameTransform &trans)
Definition
KVKinematicalFrame.cpp:14
KVKinematicalFrame::ApplyTransform
void ApplyTransform(const KVParticle *original, const KVFrameTransform &trans)
Apply new kinematical transformation to the particle and update all subframes.
Definition
KVKinematicalFrame.cpp:111
KVParticle
Base class for relativistic kinematics of massive particles.
Definition
KVParticle.h:396
KVParticle::GetFrameName
const Char_t * GetFrameName(void) const
Definition
KVParticle.h:800
KVParticle::ResetFrameCopyOnly
void ResetFrameCopyOnly() const
Definition
KVParticle.h:507
KVParticle::Copy
virtual void Copy(TObject &) const
Definition
KVParticle.cpp:269
KVParticle::SetFrameCopyOnly
void SetFrameCopyOnly() const
Definition
KVParticle.h:503
TClass::New
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
TLorentzRotation::Inverse
TLorentzRotation Inverse() const
TLorentzVector::IsA
TClass * IsA() const override
TNamed
ClassImp
ClassImp(TPyArg)
kaliveda.doxygen
KVMultiDet
particles
KVKinematicalFrame.cpp
Generated on Wed Oct 23 2024 12:45:22 for KaliVeda by
1.9.8