20#include "KVPosition.h"
21#include "KVParticle.h"
27#include "KVKinematicalFrame.h"
67#if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
198 cout << fmt <<
" " << frame->
GetName() <<
": ";
200 cout <<
" Theta=" << part->
GetTheta() <<
" Phi=" << part->
GetPhi()
201 <<
" KE=" << part->
GetKE() <<
" Vpar=" << part->
GetVpar() << endl;
216 cout <<
"KVParticle mass=" <<
M() <<
239 if (et * et >
M2()) {
242 if (pmod && newp.
Mag()) {
260#if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
281 if (!fFrameCopyOnly) {
285 fParameters.Copy(((
KVParticle&) obj).fParameters);
377 if (rhs.GetPInitial())
SetE0(rhs.GetPInitial());
497 nf +=
p->GetParticle()->_GetNumberOfDefinedFrames();
562 cout <<
"Particle belongs to no groups" << endl;
566 cout <<
"----------------------------------------" << endl;
567 cout <<
"List of groups this particle belongs to:" << endl;
568 cout <<
"----------------------------------------" << endl;
573 cout <<
"----------------------------------------" << endl;
635 if (_defname ==
"") _defname =
"default";
654 f->GetParticle()->GetListOfFrames()->Remove(newdframe);
656 next_trans =
f->GetTransform();
665 Set4Mom(*(save_newdef->GetParticle()));
666 save_newdef->GetParticle()->
Set4Mom(old_def_p);
667 save_newdef->SetTransform(next_trans.
Inverse());
668 save_newdef->
SetName(_defname);
804 if (!strcmp(frame,
""))
return;
822 tmp->ApplyTransform(
this, ft);
907 (warn_and_return_null_if_unknown ?
908 Warning(
"GetFrame(const Char_t*)",
"No frame \"%s\" defined for particle. 0x0 returned.",
932 f->ReapplyTransform(
this);
934 f->GetParticle()->UpdateAllFrames();
964 if ((
f =
p->GetParticle()->get_frame(_frame)))
break;
989 if ((
r =
p->GetParticle()->get_parent_frame(_frame,
p)))
return r;
1018 Error(
"SetFrame(newframe,oldframe)",
"oldframe=%s does not exist!", oldframe);
1021 f->GetParticle()->SetFrame(newframe, ft);
1038 beta.SetXYZ(0, 0, 0);
1073 if (!strcmp(
"spher", opt) || !strcmp(
"spherical", opt)) {
1081 if (strcmp(
"cart", opt) && strcmp(
"cartesian", opt)) {
1082 Warning(
"SetMomentum(Double_t,Double_t,Double_t,Option_t*)",
1083 "Unkown coordinate system\n known system are :\n\t\"cartesian\" or \"cart\" (default)\n\t\"spherical\" or \"spher\"");
1084 Warning(
"SetMomentum(Double_t,Double_t,Double_t,Option_t*)",
1149 if (_f->GetParticle()->GetParentFrame() == parent) {
1168 if (
f->GetParticle()->GetParentFrame() == parent) {
1169 f->GetParticle()->SetParentFrame(
nullptr);
1186 f->GetParticle()->SetParentFrame(parent);
winID h TVirtualViewer3D TVirtualGLPainter p
Kinematical representation of a particle in different reference frames.
virtual void Print(Option_t *opt="") const
virtual void Clear(Option_t *opt="")
const Char_t * GetStringValue(const Char_t *name) const
void AddAll(const TCollection *)
When all frames in a list are added to this one, this particle becomes the parent of all frames in th...
void Clear(Option_t *="")
When the frame list is cleared, this particle is no longer the parent of any frames in the list.
TObject * Remove(TObject *)
When a kinematical frame is removed, this particle is no longer the parent frame.
void Add(TObject *)
When a kinematical frame is added, this particle becomes the parent frame.
Base class for relativistic kinematics of massive particles.
KVList * GetListOfFrames() const
Int_t GetNumberOfDefinedGroups() const
void AddGroups(KVUniqueNameList *un)
list of groups added to the current one
void SetIsOK(Bool_t flag=kTRUE)
virtual void SetMass(Double_t m)
void RemoveGroup(const Char_t *groupname)
Remove group from list of groups.
const KVParticle * GetOriginal() const
const KVParticle * GetTopmostParentFrame() const
void AddGroup(const Char_t *groupname, const Char_t *from="") const
const Char_t * GetFrameName(void) const
TVector3 * GetPInitial() const
KVUniqueNameList * GetGroups() const
TVector3 GetMomentum() const
void RemoveAllGroups()
Remove all groups.
KVUniqueNameList fGroups
list of momenta of the particle in different Lorentz-boosted frames
Double_t GetTheta() const
KVParticle & operator=(const KVParticle &rhs)
KVParticle assignment operator.
void SetVectM(const TVector3 &spatial, Double_t mass)
void SetVelocity(const TVector3 &)
Set velocity of particle (in cm/ns units)
const Char_t * GetName() const
return the field fName
Bool_t IsDetected() const
void SetKE(Double_t ecin)
virtual void Clear(Option_t *opt="")
Reset particle properties i.e. before creating/reading a new event.
void ls(Option_t *option="") const
void init()
default initialisation
KVNameValueList fParameters
a general-purpose list of parameters associated with this particle
void SetMomentum(const TVector3 *v)
virtual void Copy(TObject &) const
void Set4Mom(const TLorentzVector &p)
KVKinematicalFrame * get_parent_frame(const Char_t *, KVKinematicalFrame *F=nullptr) const
virtual void Print(Option_t *t="") const
print out characteristics of particle
KVParticle InFrame(const KVFrameTransform &)
void SetE0(TVector3 *e=0)
TString fFrameName
non-persistent frame name field, sets when calling SetFrame method
void ListGroups() const
List all stored groups.
KVNameValueList * GetParameters() const
void SetFrameName(const Char_t *framename)
static Double_t kSpeedOfLight
speed of light in cm/ns
void SetParentFrame(KVParticle *p)
void SetXYZM(Double_t x, Double_t y, Double_t z, Double_t m)
void SetName(const Char_t *nom)
Set Name of the particle.
void SetFrame(const Char_t *frame, const KVFrameTransform &)
friend class KVKinematicalFrame
KVParticle const * GetFrame(const Char_t *frame, Bool_t warn_and_return_null_if_unknown=kTRUE) const
void ChangeFrame(const KVFrameTransform &, const KVString &="")
void SetOriginal(KVParticle *p)
void SetGroups(KVUniqueNameList *un)
Define for the particle a new list of groups.
Bool_t BelongsToGroup(const Char_t *groupname) const
TVector3 * fE0
the momentum of the particle before it is slowed/stopped by an absorber
void ChangeDefaultFrame(const Char_t *, const Char_t *defname="")
void SetRandomMomentum(Double_t T, Double_t thmin, Double_t thmax, Double_t phmin, Double_t phmax, Option_t *opt="isotropic")
TString fName
non-persistent name field - Is useful
KVKinematicalFrame * get_frame(const Char_t *) const
TVector3 GetVelocity() const
returns velocity vector in cm/ns units
Double_t GetVperp() const
virtual ~KVParticle()
Info("~KVParticle","%p",this);.
Int_t _GetNumberOfDefinedFrames() const
used to inhibit full copying of particles in different kinematical frames
void print_frames(TString fmt="") const
recursive print out of all defined kinematical frames
Base class used for handling geometry in a multidetector array.
virtual TVector3 GetRandomDirection(Option_t *t="isotropic")
virtual void SetOwner(Bool_t enable=kTRUE)
virtual void Clear(Option_t *option="")
virtual void Add(TObject *obj)
virtual TObject * Remove(TObject *obj)
Remove object from list.
virtual void Delete(Option_t *option="")
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Optimised list in which named objects can only be placed once.
virtual void Add(TObject *obj)
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual TObject * Remove(TObject *obj)=0
virtual void AddAll(const TCollection *col)
virtual Int_t GetEntries() const
virtual void Add(TObject *obj)=0
void Clear(Option_t *option="") override=0
void Add(TObject *obj) override
TLorentzRotation Inverse() const
TLorentzVector & operator=(const TLorentzVector &)
void Streamer(TBuffer &) override
const char * GetName() const override
virtual const char * GetName() const
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void Warning(const char *method, const char *msgfmt,...) const
virtual TObject * FindObject(const char *name) const
virtual void Error(const char *method, const char *msgfmt,...) const
virtual void ls(Option_t *option="") const
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
const char * Data() const
void Form(const char *fmt,...)
void SetXYZ(Double_t x, Double_t y, Double_t z)
double beta(double x, double y)
RVec< PromoteTypes< T0, T1 > > pow(const RVec< T0 > &v, const T1 &y)
Expr< UnaryOp< Sqrt< T >, Expr< A, T, D, D2, R >, T >, T, D, D2, R > sqrt(const Expr< A, T, D, D2, R > &rhs)
Double_t Sqrt(Double_t x)