KaliVeda
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
8
9
10
13
14KVKinematicalFrame::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
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
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
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()) {
66 fParticle->SetFrameName(o.GetParticle()->GetFrameName());
67 }
68}
69
70
71
74
76{
77 // Assignment operator required for rootcint (not rootcling)
78
79 if (&o == this) return (*this);
81 fParticle.reset(o.GetParticle() ? (KVParticle*)o.GetParticle()->IsA()->New() : nullptr);
82 if (GetParticle()) {
86 fParticle->SetFrameName(o.GetParticle()->GetFrameName());
87 }
88 return *this;
89}
90
91
92
95
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
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 Char_t
winID h TVirtualViewer3D TVirtualGLPainter p
char name[80]
TClass * IsA() const override
Utility class for kinematical transformations of KVParticle class.
Kinematical representation of a particle in different reference frames.
KVParticle * GetParticle() const
std::unique_ptr< KVParticle > fParticle
kinematically transformed particle
KVKinematicalFrame & operator=(const KVKinematicalFrame &)
Assignment operator required for rootcint (not rootcling)
KVFrameTransform fTransform
kinematical transform wrt 'parent' frame
void ReapplyTransform(const KVParticle *original)
Apply stored kinematical transformation to the particle.
KVKinematicalFrame(const Char_t *name, const KVParticle *original, const KVFrameTransform &trans)
void ApplyTransform(const KVParticle *original, const KVFrameTransform &trans)
Apply new kinematical transformation to the particle and update all subframes.
Base class for relativistic kinematics of massive particles.
Definition KVParticle.h:396
const Char_t * GetFrameName(void) const
Definition KVParticle.h:800
void ResetFrameCopyOnly() const
Definition KVParticle.h:507
virtual void Copy(TObject &) const
void SetFrameCopyOnly() const
Definition KVParticle.h:503
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
TLorentzRotation Inverse() const
TClass * IsA() const override
ClassImp(TPyArg)