1 #include "KVRangeTableGeoNavigator.h"
2 #include <TGeoMaterial.h>
3 #include <TGeoManager.h>
4 #include <TGeoVolume.h>
7 #include <KVIonRangeTableMaterial.h>
48 Double_t e = part->GetEnergy();
49 if (e <= fCutOffEnergy) {
53 AddPointToCurrentTrack(GetEntryPoint().X(), GetEntryPoint().Y(), GetEntryPoint().Z());
54 AddPointToCurrentTrack(GetExitPoint().X(), GetExitPoint().Y(), GetExitPoint().Z());
60 TGeoMaterial* material = GetCurrentVolume()->GetMaterial();
62 if ((irmat = fRangeTable->GetMaterial(material))) {
66 part->GetZ(), part->GetA(), e, GetStepSize(), 0.,
67 material->GetTemperature(),
68 material->GetPressure());
70 if (e <= fCutOffEnergy) {
75 part->SetIsDetected();
78 if (!part->GetPInitial()) part->SetE0();
80 TString absorber_name;
81 KVDetector* theDet = GetDetectorFromPath(GetCurrentPath());
83 Bool_t active_layer = kFALSE;
84 int subdet_number = -1;
87 subdet_number = GetSubDetectorFromPathAndNodeName(theDet, GetCurrentPath(), GetCurrentNode()->GetName());
89 absorber_name.Form(
"%s/%s", theDet->GetName(), GetCurrentNode()->GetName());
90 if (strncmp(GetCurrentNode()->GetName(),
"ACTIVE", 6) == 0) active_layer = kTRUE;
93 absorber_name = theDet->GetName();
98 absorber_name = irmat->GetName();
101 part->GetParameters()->SetValue(Form(
"DE:%s", absorber_name.Data()), de);
102 part->GetParameters()->SetValue(Form(
"DX:%s", absorber_name.Data()), GetStepSize());
103 if (subdet_number > -1)
104 part->GetParameters()->SetValue(Form(
"%s:SUBDET", absorber_name.Data()), subdet_number);
119 if (StopPropagation()) {
123 TVector3 path = GetExitPoint() - GetEntryPoint();
124 TVector3 midVol = GetEntryPoint() + (r / path.Mag()) * path;
129 AddPointToCurrentTrack(GetEntryPoint().X(), GetEntryPoint().Y(), GetEntryPoint().Z());
130 AddPointToCurrentTrack(midVol.X(), midVol.Y(), midVol.Z());
138 AddPointToCurrentTrack(GetEntryPoint().X(), GetEntryPoint().Y(), GetEntryPoint().Z());
139 AddPointToCurrentTrack(GetExitPoint().X(), GetExitPoint().Y(), GetExitPoint().Z());
151 void KVRangeTableGeoNavigator::InitialiseTrack(
KVNucleus* part, TVector3* TheOrigin)
156 Int_t pdg = part->
GetN() * 100 + part->
GetZ();
157 gGeoManager->SetPdgName(pdg, part->
GetSymbol());
158 Int_t itrack = gGeoManager->AddTrack(
GetTrackID(), pdg, part);
160 fCurrentTrack = gGeoManager->GetTrack(itrack);
161 if (TheOrigin) AddPointToCurrentTrack(TheOrigin->x(), TheOrigin->y(), TheOrigin->z());
162 else AddPointToCurrentTrack(0, 0, 0);
174 if (
IsTracking()) InitialiseTrack(part, TheOrigin);
Base class for detector geometry description, interface to energy-loss calculations.
virtual void AddEnergyLossInSubDetector(int, double)
Bool_t IsSingleLayer() const
void SetEnergyLoss(Double_t e) const override
Double_t GetEnergyLoss() const override
virtual Bool_t IsSegmented() const
Bool_t IsTracking() const
virtual void PropagateParticle(KVNucleus *, TVector3 *TheOrigin=0)
const TVector3 & GetEntryPoint() const
Material for use in energy loss & range calculations.
virtual Double_t GetLinearDeltaEOfIon(Int_t Z, Int_t A, Double_t E, Double_t e, Double_t isoAmat=0., Double_t T=-1., Double_t P=-1.)
Double_t GetDensity() const
Double_t GetRangeOfLastDE() const
Bool_t HasParameter(const Char_t *name) const
Description of properties and kinematics of atomic nuclei.
const Char_t * GetSymbol(Option_t *opt="") const
Int_t GetN() const
Return the number of neutron.
Int_t GetZ() const
Return the number of proton / atomic number.
KVNameValueList * GetParameters() const
Propagate particles through array geometry calculating energy losses.
void PropagateParticle(KVNucleus *, TVector3 *TheOrigin=0) override
We start a new track to represent the particle's trajectory through the array.