KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVKinematicalFrame.cpp
Go to the documentation of this file.
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 
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 }
22 
23 
24 
27 
29  : TNamed(), fTransform(trans), fParticle((KVParticle*)original->IsA()->New())
30 {
31  // Create representation of original particle in transformed frame
32 
33  ReapplyTransform(original);
34 }
35 
36 
37 
41 
43  : TNamed(), fTransform(t), fParticle(nullptr)
44 {
45  // Modify the kinematics of the particle according to the given transformation
46  // Recursively update the kinematics in all frames defined for this particle
48  p->UpdateAllFrames();
49 }
50 
51 
52 
55 
57  : TNamed((const TNamed&)o), fTransform(o.fTransform),
58  fParticle(o.GetParticle() ? (KVParticle*)o.GetParticle()->IsA()->New() : nullptr)
59 {
60  // Copy constructor required for rootcint (not rootcling)
61  if (GetParticle()) o.GetParticle()->Copy(*GetParticle());
62 }
63 
64 
65 
68 
70 {
71  // Assignment operator required for rootcint (not rootcling)
72 
73  if (&o == this) return (*this);
75  fParticle.reset(o.GetParticle() ? (KVParticle*)o.GetParticle()->IsA()->New() : nullptr);
76  if (GetParticle()) o.GetParticle()->Copy(*GetParticle());
77  return *this;
78 }
79 
80 
81 
84 
86 {
87  // Apply stored kinematical transformation to the particle
88 
89  original->Copy(*(fParticle.get())); //copy all information on particle
90  fParticle->Transform(fTransform.Inverse());
91 }
92 
93 
94 
97 
99 {
100  // Apply new kinematical transformation to the particle and update all subframes
101 
102  fTransform = trans;
103  ReapplyTransform(original);
104  // recursively update all subframes
105  fParticle->UpdateAllFrames();
106 }
107 
108 
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
char Char_t
Utility class for kinematical transformations of KVParticle class.
Kinematical representation of a particle in different reference frames.
unique_ptr< KVParticle > fParticle
kinematically transformed particle
KVParticle * GetParticle() const
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:398
void UpdateAllFrames()
virtual void Copy(TObject &) const
Definition: KVParticle.cpp:266
TLorentzRotation Inverse() const
TLorentzVector & Transform(const TLorentzRotation &)