24 #include "TLorentzVector.h"
27 #include "KVUniqueNameList.h"
28 #include "KVNameValueList.h"
29 #include "KVFrameTransform.h"
401 void print_frames(TString fmt =
"")
const;
413 void Add(TObject*)
override;
414 TObject*
Remove(TObject*)
override;
415 void Clear(Option_t* =
"")
override;
416 void AddAll(
const TCollection*)
override;
417 void Copy(TObject& _new_list)
const override;
421 mutable FrameList fBoosted{
this};
423 static Double_t kSpeedOfLight;
426 void SetVect(
const TVector3& vect3)
428 TLorentzVector::SetVect(vect3);
430 void SetVectM(
const TVector3& spatial, Double_t mass)
432 TLorentzVector::SetVectM(spatial, mass);
434 void SetVectMag(
const TVector3& spatial, Double_t magnitude)
436 TLorentzVector::SetVectMag(spatial, magnitude);
438 void SetPerp(Double_t p)
440 TLorentzVector::SetPerp(p);
442 void SetPtEtaPhiE(Double_t pt, Double_t eta, Double_t phi, Double_t e)
444 TLorentzVector::SetPtEtaPhiE(pt, eta, phi, e);
446 void SetPtEtaPhiM(Double_t pt, Double_t eta, Double_t phi, Double_t m)
448 TLorentzVector::SetPtEtaPhiM(pt, eta, phi, m);
450 void SetPx(Double_t a)
452 TLorentzVector::SetPx(a);
454 void SetPy(Double_t a)
456 TLorentzVector::SetPy(a);
458 void SetPz(Double_t a)
460 TLorentzVector::SetPz(a);
462 void SetPxPyPzE(Double_t px, Double_t py, Double_t pz, Double_t e)
464 TLorentzVector::SetPxPyPzE(px, py, pz, e);
466 void SetRho(Double_t rho)
468 TLorentzVector::SetRho(rho);
470 void SetT(Double_t a)
472 TLorentzVector::SetT(a);
474 void SetX(Double_t a)
476 TLorentzVector::SetX(a);
478 void SetY(Double_t a)
480 TLorentzVector::SetY(a);
482 void SetZ(Double_t a)
484 TLorentzVector::SetZ(a);
486 void SetXYZM(Double_t x, Double_t y, Double_t z, Double_t m)
488 TLorentzVector::SetXYZM(x, y, z, m);
490 void SetXYZT(Double_t x, Double_t y, Double_t z, Double_t t)
492 TLorentzVector::SetXYZT(x, y, z, t);
503 mutable Bool_t fFrameCopyOnly{kFALSE};
505 Int_t _GetNumberOfDefinedFrames()
const;
506 void SetFrameCopyOnly()
const
508 fFrameCopyOnly = kTRUE;
510 void ResetFrameCopyOnly()
const
512 fFrameCopyOnly = kFALSE;
522 const KVParticle* GetTopmostParentFrame()
const
527 auto top_node =
this;
528 while (top_node->GetParentFrame()) {
529 top_node = top_node->GetParentFrame();
535 return fOriginal ? fOriginal :
this;
539 return fOriginal ? fOriginal :
this;
545 void SetMomentum(
const TVector3* v)
566 KVParticle(Double_t m, Double_t px, Double_t py, Double_t pz);
570 void Copy(TObject&)
const override;
571 void Clear(Option_t* opt =
"")
override;
575 SetXYZM(Px(), Py(), Pz(), m);
583 SetXYZM(v(0), v(1), v(2), M());
585 void SetMomentum(Double_t px, Double_t py, Double_t pz, Option_t* opt =
587 void SetMomentum(Double_t T,
const TVector3& dir);
589 Double_t phmin, Double_t phmax,
590 Option_t* opt =
"isotropic");
591 void Print(Option_t* t =
"")
const override;
601 void SetKE(Double_t ecin);
630 return GetKE() * TMath::Power(TMath::Sin(Theta()), 2.0);
648 Double_t etran = Mt() -
GetMass();
664 Double_t h = TMath::H() * TMath::C() / TMath::Qe() * 1e9;
670 Double_t h = TMath::H() * TMath::C() / TMath::Qe() * 1e9;
671 return h / TMath::Sqrt(TMath::TwoPi() * temp *
GetMass());
685 return TMath::RadToDeg() * Theta();
689 return TMath::Cos(Theta());
693 Double_t phi = TMath::RadToDeg() * Phi();
694 return (phi < 0 ? 360. + phi : phi);
698 TLorentzVector::SetTheta(TMath::DegToRad() * theta);
702 TLorentzVector::SetPhi(TMath::DegToRad() * phi);
706 void SetIsOK(Bool_t flag = kTRUE);
716 void ls(Option_t* option =
"")
const override;
745 const Char_t*
GetName()
const override;
746 void SetName(
const Char_t* nom);
748 void AddGroup(
const Char_t* groupname,
const Char_t* from =
"")
const;
776 return GetTopmostParentFrame();
781 return GetTopmostParentFrame() ==
this;
793 if (!fFrameName.CompareTo(frame, TString::kIgnoreCase))
return true;
794 return (GetTopmostParentFrame()->get_frame(frame) !=
nullptr);
799 return GetTopmostParentFrame()->_GetNumberOfDefinedFrames();
801 KVParticle const*
GetFrame(
const Char_t* frame, Bool_t warn_and_return_null_if_unknown = kTRUE)
const;
813 fFrameName = framename;
814 if (fFrameName !=
"")
SetParameter(
"frameName", framename);
822 template<
typename ValType>
void SetParameter(
const Char_t* name, ValType value)
const
Kinematical representation of a particle in different reference frames.
Extended TList class which owns its objects by default.
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
void SetValue(const Char_t *name, value_type value)
void RemoveParameter(const Char_t *name)
void Clear(Option_t *="") override
When the frame list is cleared, this particle is no longer the parent of any frames in the list.
TObject * Remove(TObject *) override
When a kinematical frame is removed, this particle is no longer the parent frame.
void Add(TObject *) override
When a kinematical frame is added, this particle becomes the parent frame.
void Copy(TObject &_new_list) const override
void AddAll(const TCollection *) override
When all frames in a list are added to this one, this particle becomes the parent of all frames in th...
Base class for relativistic kinematics of massive particles.
Double_t GetWaveLength() const
Int_t GetNumberOfDefinedGroups() const
Double_t GetThermalWaveLength(Double_t temp) const
void SetIsOK(Bool_t flag=kTRUE)
void SetTheta(Double_t theta)
TVector3 * GetPInitial() const
Double_t GetREtran() const
virtual void SetMass(Double_t m)
void RemoveGroup(const Char_t *groupname)
Remove group from list of groups.
void AddGroup(const Char_t *groupname, const Char_t *from="") const
void SetPhi(Double_t phi)
TVector3 GetMomentum() const
void RemoveAllGroups()
Remove all groups.
KVNameValueList * GetParameters() const
Double_t GetTheta() const
KVParticle & operator=(const KVParticle &rhs)
KVParticle assignment operator.
const Char_t * GetFrameName(void) const
void SetMomentum(const TVector3 &v)
void ls(Option_t *option="") const override
void SetVelocity(const TVector3 &)
Set velocity of particle (in cm/ns units)
Double_t GetEnergy() const
Double_t GetTransverseEnergy() const
KVUniqueNameList * GetGroups() const
Double_t GetLongitudinalEnergy() const
Bool_t IsDetected() const
const Char_t * GetName() const override
return the field fName
void SetKE(Double_t ecin)
void init()
default initialisation
Double_t GetCosTheta() const
Bool_t HasFrame(const Char_t *frame) const
void Copy(TObject &) const override
Double_t GetRTransverseEnergy() const
Double_t GetElong() const
void Set4Mom(const TLorentzVector &p)
KVParticle InFrame(const KVFrameTransform &) const
void SetE0(TVector3 *e=0)
void Clear(Option_t *opt="") override
Reset particle properties i.e. before creating/reading a new event.
void SetParameter(const Char_t *name, ValType value) const
void ListGroups() const
List all stored groups.
void SetFrameName(const Char_t *framename)
void SetName(const Char_t *nom)
Set Name of the particle.
Bool_t IsDefaultKinematics() const
void SetFrame(const Char_t *frame, const KVFrameTransform &)
Int_t GetNumberOfDefinedFrames() const
KVParticle const * GetFrame(const Char_t *frame, Bool_t warn_and_return_null_if_unknown=kTRUE) const
void ChangeFrame(const KVFrameTransform &, const KVString &="")
Bool_t BelongsToGroup(const Char_t *groupname) const
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")
const KVParticle * GetCurrentDefaultKinematics() const
void SetEnergy(Double_t e)
void Print(Option_t *t="") const override
print out characteristics of particle
TVector3 GetVelocity() const
returns velocity vector in cm/ns units
Double_t GetVperp() const
Double_t GetEtran() const
KVList * GetListOfFrames() const
TVector3 GetTransverseMomentum() const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Optimised list in which named objects can only be placed once.