2 #include "KVNucleusEvent.h"
24 SetTitle(
"Target for experiment");
27 fNormal.SetXYZ(0, 0, 1);
28 fIntPoint.SetXYZ(0, 0, 0);
55 AddLayer(material, thick);
68 #if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
77 #if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
91 ((
KVTarget&) obj).SetRandomized(IsRandomized());
92 ((
KVTarget&) obj).SetIncoming(IsIncoming());
93 ((
KVTarget&) obj).SetOutgoing(IsOutgoing());
97 TIter next(GetLayers());
166 for (
int i = lay1; i <= lay2; i++) {
256 Error(
"GetEffectiveThickness(Int_t ilayer, TVector3& direction)",
257 "Layer number %d is illegal. Valid values are between 1 and %d.",
310 return (thick < D ? 0 : i);
346 return (mat ?
GetLayers()->IndexOf(mat) + 1 : 0);
400 return (thick < depth ? 0 : i);
455 for (
Int_t i = ilay1; i <= ilay2; i++) {
466 KVTarget::~KVTarget()
497 if (kvp->
GetKE() <= 0.)
513 cout <<
"IP is in layer " << iplay_index << endl;
519 cout <<
"Particle is going ";
520 backwards ? cout <<
"backwards" : cout <<
"forwards";
538 e_thick_iplay : e_thick_iplay);
543 cout <<
"Effective thickness of IP layer is " << e_thick_iplay <<
560 i >= ilay2 && kvp->
GetKE() > 0.; i--)
565 i <= ilay2 && kvp->
GetKE() > 0.; i++)
574 Error(
"DetectParticle",
"Interaction point is outside of target");
623 clone_part.
SetKE(E0 - Eloss);
631 cout <<
"IP is in layer " << iplay_index << endl;
637 cout <<
"Particle is going ";
638 backwards ? cout <<
"backwards" : cout <<
"forwards";
656 e_thick_iplay : e_thick_iplay);
661 cout <<
"Effective thickness of IP layer is " << e_thick_iplay <<
678 i >= ilay2 && clone_part.
GetKE() > 0.; i--) {
682 clone_part.
SetKE(E0 - Eloss);
687 i <= ilay2 && clone_part.
GetKE() > 0.; i++) {
691 clone_part.
SetKE(E0 - Eloss);
700 Error(
"DetectParticle",
"Interaction point is outside of target");
824 "total effective thickness (along 'dir') of all layers before 'ilayer'="
833 cout <<
"dpeth inside interaction layer=" << depth << endl;
837 cout <<
"generated IP vector:" << endl;
864 Error(
"SetInteractionLayer",
865 "No layer in target with material type %s",
name);
984 clone_part.
SetKE(ERes);
994 cout <<
"IP is in layer " << iplay_index << endl;
1000 cout <<
"Particle is going ";
1001 backwards ? cout <<
"backwards" : cout <<
"forwards";
1019 e_thick_iplay : e_thick_iplay);
1024 cout <<
"Effective thickness of IP layer is " << e_thick_iplay <<
1047 clone_part.
SetKE(ERes);
1058 clone_part.
SetKE(ERes);
1068 Error(
"GetParticleEIncFromERes",
"Interaction point is outside of target");
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
Class for iterating over nuclei in events accessed through base pointer/reference.
Abstract base class container for multi-particle events.
Extended TList class which owns its objects by default.
Description of physical materials used to construct detectors & targets; interface to range tables.
Double_t GetEffectiveAreaDensity(TVector3 &norm, TVector3 &direction)
void Clear(Option_t *opt="") override
Reset absorber - set stored energy lost by particles in absorber to zero.
void SetAreaDensity(Double_t dens)
Double_t GetAreaDensity() const
virtual Double_t GetParticleEIncFromERes(KVNucleus *, TVector3 *norm=nullptr)
virtual void DetectParticle(KVNucleus *, TVector3 *norm=nullptr)
virtual void SetMaterial(const Char_t *type)
virtual Double_t GetELostByParticle(KVNucleus *, TVector3 *norm=nullptr)
void Copy(TObject &obj) const override
Make a copy of this material object.
Description of properties and kinematics of atomic nuclei.
Int_t GetZ() const
Return the number of proton / atomic number.
Base class for relativistic kinematics of massive particles.
TVector3 GetMomentum() const
void SetKE(Double_t ecin)
void SetMomentum(const TVector3 *v)
void Execute(const char *method, const char *params, Int_t *error=0) override
void Add(TObject *obj) override
virtual TObject * FindObjectByType(const Char_t *) const
Calculation/correction of energy losses of particles through an experimental target.
void DetectParticle(KVNucleus *, TVector3 *norm=0) override
Bool_t IsIncoming() const
Double_t GetThickness() const override
KVTarget()
Default costructor.
void Print(Option_t *opt="") const override
void SetAngleToBeam(Double_t a)
void Copy(TObject &obj) const override
Copy this to obj.
void init()
Default initialisations.
Double_t GetELostByParticle(KVNucleus *, TVector3 *norm=0) override
Int_t NumberOfLayers() const
KVList * fTargets
list of layers
Bool_t IsOutgoing() const
TVector3 & GetInteractionPoint(KVParticle *part=0)
Double_t GetParticleEIncFromERes(KVNucleus *, TVector3 *norm=0) override
Int_t fNLayers
number of layers
Double_t GetEffectiveThickness(KVParticle *part=0, Int_t ilayer=1)
void SetMaterial(const Char_t *type) override
Set material of first layer.
KVMaterial * GetLayer(TVector3 &depth)
KVMaterial * GetLayerByDepth(Double_t depth)
void AddLayer(const Char_t *material, Double_t thick)
Double_t GetTotalEffectiveThickness(KVParticle *part=0)
void SetInteractionLayer(Int_t ilayer, TVector3 &dir)
void DetectEvent(KVEvent *)
TVector3 fNormal
normal to target - (0,0,1) by default
Bool_t IsRandomized() const
KVList * GetLayers() const
const TVector3 & GetNormal()
void SetOutgoing(Bool_t r=kTRUE)
Double_t GetTotalThickness()
Double_t GetAtomsPerCM2() const
virtual UInt_t GetUnits() const;
Double_t GetAngleToBeam()
Gives angle of target to incident beam direction in degrees.
void SetLayerThickness(Float_t thick, Int_t ilayer=1)
Set 'thickness' in mg/cm**2 of a layer, by default this is the first layer.
Int_t GetLayerIndex(TVector3 &depth)
TVector3 fIntPoint
last randomly generated interaction point
virtual Double_t GetIncidentEnergyFromERes(Int_t Z, Int_t A, Double_t Eres) override
KVMaterial * GetLayerByIndex(Int_t ilayer) const
void Clear(Option_t *opt="") override
virtual void Print(Option_t *option, const char *wildcard, Int_t recurse=1) const
const char * GetName() const override
const char * GetTitle() const override
virtual void SetName(const char *name)
virtual void Error(const char *method, const char *msgfmt,...) const
virtual Double_t Uniform(Double_t x1, Double_t x2)
const char * Data() const
void SetXYZ(Double_t x, Double_t y, Double_t z)
void Print(Option_t *option="") const override
Double_t Angle(const TVector3 &) const
constexpr Double_t DegToRad()
constexpr Double_t RadToDeg()