4 #include "KVGeoNavigator.h"
5 #include "KVTemplateEvent.h"
6 #include "KV3DGeoTrack.h"
7 #include "KVNucleusEvent.h"
10 #include "KVGeoStrucElement.h"
66 name.Form(
"%s_%d", type, number);
87 void KVGeoNavigator::FormatDetectorName(
const Char_t* basename,
KVString& name)
102 if (!fCurStrucNumber) {
107 if (fDetNameFmt ==
"") {
108 for (
int i = 0; i < fCurStrucNumber; i++) {
119 fDetNameFmt.
Begin(
"$");
120 while (!fDetNameFmt.
End()) {
125 if (itbit ==
"det") {
137 else if (itbit ==
"struc") {
140 for (
int i = 0; i < fCurStrucNumber; i++) {
142 if (el->
IsType(struc_typ))
break;
192 : fGeometry(
g), fCurrentStructures(
"KVGeoStrucElement", 50), fDetStrucNameCorrespList(nullptr),
193 fDetectorPaths(
kTRUE)
208 fCurrentStructures.
Delete();
314 KVError::Warning(
this,
"SetNameCorrespondanceList",
"File %s not found", listfile);
317 if (!fDetStrucNameCorrespList) fDetStrucNameCorrespList =
new TEnv;
330 if (list) fDetStrucNameCorrespList = (
TEnv*)list->
Clone();
348 if (fDetStrucNameCorrespList) {
436 return &fCurrentMatrix;
464 multilayer = segmented =
kFALSE;
465 fCurrentDetectorNode = 0;
476 fCurrentDetectorNode = fMotherNode;
477 detector_volume = mother_vol;
496 fCurrentDetectorNode = fMotherNode;
497 detector_volume = mother_vol;
504 return detector_volume;
519 return fCurrentDetectorNode;
728 fCurrentStructures.
Clear(
"C");
730 while (!path.
End()) {
735 FormatDetectorName(basename, detname);
744 TString nums = struc_name(last_ + 1, struc_name.
Length() - last_ - 1);
747 FormatStructureName(
type, number,
name);
754 FormatDetectorName(basename, detname);
776 if (TheOrigin) fGeometry->
SetCurrentPoint(TheOrigin->
X(), TheOrigin->
Y(), TheOrigin->
Z());
789 fCurrentPath = fGeometry->
GetPath();
792 fStepSize = fGeometry->
GetStep();
819 fEntryPoint.
SetXYZ(XX, YY, ZZ);
823 fExitPoint.
SetXYZ(XX, YY, ZZ);
838 fCurrentVolume = newVol;
839 fCurrentNode = newNod;
840 fMotherNode = newMom;
841 fCurrentMatrix = *newMatx;
842 fCurrentPath = newPath;
849 fStepSize = fGeometry->
GetStep();
854 newPath = fGeometry->
GetPath();
888 else gtrack->
Draw(
"ogl");
891 else gtrack->
Draw(
"same");
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 g
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
char * Form(const char *fmt,...)
Class for iterating over nuclei in events accessed through base pointer/reference.
Visualise particle trajectories through array geometry.
void Draw(Option_t *option="") override
Override Draw to add a TPolyMarker3D at the end of the track.
virtual const Char_t * GetType() const
virtual Bool_t IsType(const Char_t *typ) const
virtual void SetNumber(UInt_t num)
static Bool_t SearchKVFile(const Char_t *name, TString &fullpath, const Char_t *kvsubdir="")
Abstract base class container for multi-particle events.
Base class for propagation of particles through array geometry.
virtual void AddPointToCurrentTrack(Double_t, Double_t, Double_t)
Bool_t IsTracking() const
void PropagateEvent(KVEvent *, TVector3 *TheOrigin=0)
const TGeoHMatrix * GetCurrentMatrix() const
Returns pointer to internal copy of current global transformation matrix.
void ExtractDetectorNameFromPath(KVString &)
TGeoNode * GetCurrentNode() const
void SetTracking(Bool_t on=kTRUE)
KVGeoNavigator(TGeoManager *)
Constructor. Call with pointer to geometry.
void SetNameCorrespondanceList(const Char_t *)
void SetStopPropagation(Bool_t stop=kTRUE)
virtual void PropagateParticle(KVNucleus *, TVector3 *TheOrigin=0)
TGeoVolume * GetCurrentDetectorNameAndVolume(KVString &, Bool_t &, Bool_t &segmented)
TGeoNode * GetCurrentDetectorNode() const
virtual void ParticleEntersNewVolume(KVNucleus *)
TString GetCurrentPath() const
TGeoVolume * GetCurrentVolume() const
Bool_t GetNameCorrespondance(const Char_t *, TString &)
Bool_t StopPropagation() const
virtual ~KVGeoNavigator()
Destructor.
void ResetTrackID(Int_t id=0)
void SetStructureNameFormat(const Char_t *type, const Char_t *fmt)
void DrawTracks(KVNumberList *=nullptr)
Base class describing elements of array geometry.
void SetValue(const Char_t *name, value_type value)
const Char_t * GetStringValue(const Char_t *name) const
Bool_t HasParameter(const Char_t *name) const
Description of properties and kinematics of atomic nuclei.
Int_t GetZ() const
Return the number of proton / atomic number.
Strings used to represent a set of ranges of values.
Bool_t Contains(Int_t val) const
returns kTRUE if the value 'val' is contained in the ranges defined by the number list
TVector3 GetMomentum() const
KVNameValueList * GetParameters() const
void SetOwner(Bool_t enable=kTRUE) override
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
void Begin(TString delim) const
KVString Next(Bool_t strip_whitespace=kFALSE) const
void Clear(Option_t *option="") override
void Delete(Option_t *option="") override
TObject * ConstructedAt(Int_t idx)
virtual const char * GetValue(const char *name, const char *dflt) const
virtual Int_t ReadFile(const char *fname, EEnvLevel level)
TGeoNode * GetMother(Int_t up=1) const
TObjArray * GetListOfTracks() const
TGeoNode * GetCurrentNode() const
void SetCurrentDirection(Double_t *dir)
TGeoNode * FindNextBoundaryAndStep(Double_t stepmax=TGeoShape::Big(), Bool_t compsafe=kFALSE)
void SetCurrentPoint(Double_t *point)
TGeoNode * FindNode(Bool_t safe_start=kTRUE)
const Double_t * GetCurrentPoint() const
TGeoHMatrix * GetCurrentMatrix() const
const char * GetPath() const
TGeoVolume * GetCurrentVolume() const
TGeoVolume * GetMotherVolume() const
const char * GetName() const override
virtual void SetNameTitle(const char *name, const char *title)
void AbstractMethod(const char *method) const
virtual TObject * Clone(const char *newname="") const
const char * Data() const
Ssiz_t Last(char c) const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
TString & Remove(EStripType s, char c)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
void SetXYZ(Double_t x, Double_t y, Double_t z)
const char * GetName() const override
void Warning(UserClass p, const char *location, const char *va_(fmt),...)