23 SetTitle(
"Target for experiment");
26 fNormal.SetXYZ(0, 0, 1);
27 fIntPoint.SetXYZ(0, 0, 0);
54 AddLayer(material, thick);
67 #if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
76 #if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
90 ((
KVTarget&) obj).SetRandomized(IsRandomized());
91 ((
KVTarget&) obj).SetIncoming(IsIncoming());
92 ((
KVTarget&) obj).SetOutgoing(IsOutgoing());
96 TIter next(GetLayers());
165 for (
int i = lay1; i <= lay2; i++) {
255 Error(
"GetEffectiveThickness(Int_t ilayer, TVector3& direction)",
256 "Layer number %d is illegal. Valid values are between 1 and %d.",
309 return (thick < D ? 0 : i);
345 return (mat ?
GetLayers()->IndexOf(mat) + 1 : 0);
399 return (thick < depth ? 0 : i);
454 for (
Int_t i = ilay1; i <= ilay2; i++) {
465 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");
829 "total effective thickness (along 'dir') of all layers before 'ilayer'="
838 cout <<
"dpeth inside interaction layer=" << depth << endl;
842 cout <<
"generated IP vector:" << endl;
869 Error(
"SetInteractionLayer",
870 "No layer in target with material type %s", name);
989 clone_part->
SetKE(ERes);
1017 e_thick_iplay : e_thick_iplay);
1041 clone_part->
SetKE(ERes);
1052 clone_part->
SetKE(ERes);
1062 Error(
"GetParticleEIncFromERes",
"Interaction point is outside of target");
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
Base class container for multi-particle events.
Extended TList class which owns its objects by default.
Description of physical materials used to construct detectors; interface to range tables.
virtual void Copy(TObject &obj) const
Copy this to obj.
Double_t GetEffectiveAreaDensity(TVector3 &norm, TVector3 &direction)
void SetAreaDensity(Double_t dens)
Double_t GetAreaDensity() const
Return area density of material in g/cm**2.
virtual void SetMaterial(const Char_t *type)
virtual Double_t GetELostByParticle(KVNucleus *, TVector3 *norm=0)
virtual void Clear(Option_t *opt="")
Reset absorber - set energy lost by particles to zero.
virtual void DetectParticle(KVNucleus *, TVector3 *norm=0)
virtual Double_t GetParticleEIncFromERes(KVNucleus *, TVector3 *norm=0)
Double_t GetMass() const
Returns atomic mass of material. Will be isotopic mass if set.
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 SetMomentum(const TVector3 &v)
void SetKE(Double_t ecin)
virtual void Execute(const char *method, const char *params, Int_t *error=0)
virtual TObject * FindObjectByType(const Char_t *) const
virtual void Add(TObject *obj)
Calculation/correction of energy losses of particles through an experimental target.
void Print(Option_t *opt="") const
Show information on this material.
Bool_t IsIncoming() const
KVTarget()
Default costructor.
void SetAngleToBeam(Double_t a)
void init()
Default initialisations.
virtual void Copy(TObject &obj) const
Copy this to obj.
virtual void DetectParticle(KVNucleus *, TVector3 *norm=0)
virtual Double_t GetELostByParticle(KVNucleus *, TVector3 *norm=0)
Int_t NumberOfLayers() const
virtual Double_t GetParticleEIncFromERes(KVNucleus *, TVector3 *norm=0)
KVList * fTargets
list of layers
Bool_t IsOutgoing() const
virtual Double_t GetIncidentEnergyFromERes(Int_t Z, Int_t A, Double_t Eres)
void Clear(Option_t *opt="")
Reset absorber - set energy lost by particles to zero.
TVector3 & GetInteractionPoint(KVParticle *part=0)
Int_t fNLayers
number of layers
Double_t GetEffectiveThickness(KVParticle *part=0, Int_t ilayer=1)
KVMaterial * GetLayer(TVector3 &depth)
KVMaterial * GetLayerByDepth(Double_t depth)
void AddLayer(const Char_t *material, Double_t thick)
Double_t GetTotalEffectiveThickness(KVParticle *part=0)
Double_t GetThickness() const
void SetInteractionLayer(Int_t ilayer, TVector3 &dir)
void DetectEvent(KVEvent *)
virtual void SetMaterial(const Char_t *type)
Set material of first layer.
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
KVMaterial * GetLayerByIndex(Int_t ilayer) const
virtual void Print(Option_t *option, const char *wildcard, Int_t recurse=1) const
virtual const char * GetName() const
virtual const char * GetTitle() const
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)
Double_t Angle(const TVector3 &) const
void Print(Option_t *option="") const
constexpr Double_t DegToRad()
constexpr Double_t RadToDeg()