KaliVeda
Toolkit for HIC analysis
KVGeoNavigator.cpp
1 //Created by KVClassFactory on Mon Apr 22 14:53:13 2013
2 //Author: John Frankland,,,
3 
4 #include "KVGeoNavigator.h"
5 #include "KVTemplateEvent.h"
6 #include "KV3DGeoTrack.h"
7 #include "KVNucleusEvent.h"
8 #include <TGeoManager.h>
9 #include <TGeoMatrix.h>
10 #include "KVGeoStrucElement.h"
11 #include <TVirtualPad.h>
12 
14 
15 
16 
26 void KVGeoNavigator::FormatStructureName(const Char_t* type, Int_t number, KVString& name)
27 {
28  // If a format for naming structures of given type has been defined by a call
29  // to SetStructureNameFormat(const Char_t *, const Char_t *), we use it to
30  // format the name in the TString.
31  //
32  // If no format was given, we use by default "[type]_[number]".
33  //
34  // If SetNameCorrespondanceList(const Char_t *) was used, we use it to translate
35  // any names resulting from this formatting to their final value.
36 
37  name = "";
38  if (fStrucNameFmt.HasParameter(type)) {
39  KVString fmt = fStrucNameFmt.GetStringValue(type);
40  fmt.Begin("$");
41  while (!fmt.End()) {
42  KVString bit = fmt.Next();
43  if (bit.BeginsWith("type")) {
44  Ssiz_t ind = bit.Index("%");
45  if (ind > -1) {
46  bit.Remove(0, ind);
47  name += Form(bit.Data(), type);
48  }
49  else
50  name += type;
51  }
52  else if (bit.BeginsWith("number")) {
53  Ssiz_t ind = bit.Index("%");
54  if (ind > -1) {
55  bit.Remove(0, ind);
56  name += Form(bit.Data(), number);
57  }
58  else
59  name += number;
60  }
61  else
62  name += bit;
63  }
64  }
65  else
66  name.Form("%s_%d", type, number);
67  TString tmp;
68  GetNameCorrespondance(name.Data(), tmp);
69  name = tmp;
70 }
71 
72 
73 
86 
88 {
89  // If a format for naming detectors has been defined by a call
90  // to SetDetectorNameFormat(const Char_t *), we use it to
91  // format the name in the TString.
92  //
93  // If no format was given we prefix the names of the parent structures
94  // to the basename in order to generate the full name of the detector:
95  //~~~~~~~~
96  // [struc1-name]_[struc2-name]_..._[detector-basename]
97  //~~~~~~~~
98  // If SetNameCorrespondanceList(const Char_t *) was used, we use it to translate
99  // any names resulting from this formatting to their final value.
100 
101  name = "";
102  if (!fCurStrucNumber) {
103  // no parent structures
104  name = basename;
105  }
106  else {
107  if (fDetNameFmt == "") {
108  for (int i = 0; i < fCurStrucNumber; i++) {
110  name += Form("%s_", el->GetName());
111  }
112  name += basename;
113  }
114  else {
115  // $det:name$ - will be replaced by the detector basename
116  // $struc:[type]:name$ - will be replaced by the name of the parent structure of given type
117  // $struc:[type]:type$ - will be replaced by the type of the parent structure of given type
118  // $struc:[type]:number$ - will be replaced by the number of the parent structure of given type
119  fDetNameFmt.Begin("$");
120  while (!fDetNameFmt.End()) {
121  KVString bit = fDetNameFmt.Next();
122  if (bit.Contains(":")) {
123  bit.Begin(":");
124  KVString itbit = bit.Next();
125  if (itbit == "det") {
126  itbit = bit.Next();
127  if (itbit.BeginsWith("name")) {
128  Ssiz_t ind = itbit.Index("%");
129  if (ind > -1) {
130  itbit.Remove(0, ind);
131  name += Form(itbit.Data(), basename);
132  }
133  else
134  name += basename;
135  }
136  }
137  else if (itbit == "struc") {
138  KVString struc_typ = bit.Next();
139  KVGeoStrucElement* el = 0;
140  for (int i = 0; i < fCurStrucNumber; i++) {
142  if (el->IsType(struc_typ)) break;
143  }
144  if (el) {
145  itbit = bit.Next();
146  if (itbit.BeginsWith("name")) {
147  Ssiz_t ind = itbit.Index("%");
148  if (ind > -1) {
149  itbit.Remove(0, ind);
150  name += Form(itbit.Data(), el->GetName());
151  }
152  else
153  name += el->GetName();
154  }
155  else if (itbit.BeginsWith("type")) {
156  Ssiz_t ind = itbit.Index("%");
157  if (ind > -1) {
158  itbit.Remove(0, ind);
159  name += Form(itbit.Data(), el->GetType());
160  }
161  else
162  name += el->GetType();
163  }
164  else if (itbit.BeginsWith("number")) {
165  Ssiz_t ind = itbit.Index("%");
166  if (ind > -1) {
167  itbit.Remove(0, ind);
168  name += Form(itbit.Data(), el->GetNumber());
169  }
170  else
171  name += el->GetNumber();
172  }
173  }
174  }
175  }
176  else
177  name += bit;
178  }
179  }
180  }
181  TString tmp;
182  GetNameCorrespondance(name.Data(), tmp);
183  name = tmp;
184 }
185 
186 
187 
190 
192  : fGeometry(g), fCurrentStructures("KVGeoStrucElement", 50), fDetStrucNameCorrespList(nullptr),
193  fDetectorPaths(kTRUE)
194 {
195  // Constructor. Call with pointer to geometry.
198 }
199 
200 
201 
204 
206 {
207  // Destructor
210 }
211 
212 
213 
233 
235 {
236  // The default names for structures are taken from the node name by stripping off
237  // the **STRUCT_** prefix. It is assumed that the remaining string is of the form
238  //~~~~~~~~
239  // "[structure type]_[structure number]"
240  //~~~~~~~~
242  //
243  // However, this format can be change by calling this method
244  //~~~~~~~~{.cpp}
245  // SetStructureNameFormat("[structure type]", "[format]")
246  //~~~~~~~~
247  // where format can contain any of the following tokens:
248  //~~~~~~~
249  // $type$ - will be replaced by the structure type name
250  // $type%[fmt]$ - will be replaced by the structure type name using given format
251  // $number$ - will be replaced by the structure number
252  // $number%[fmt]$ - will be replaced by the structure number using given format
253  //~~~~~~~
255 }
256 
257 
258 
284 
286 {
287  // Allows to provide a list of "translations" for naming structures/detectors
288  // "listfile" must be a file in TEnv format, e.g.
289  //
290  //~~~~~~~~
291  // SI_06_1_A1: SI_0601
292  // SI_06_1_A2: SI_0602
293  // SI_06_1_B1: SI_0701
294  // SI_06_1_B2: SI_0702
295  // SI_06_2_A1: SI_0603
296  // SI_06_2_A2: SI_0604
297  // SI_06_2_B1: SI_0703
298  //~~~~~~~~
299  //
300  // The name before ':' is the name of the detector or structure as deduced
301  // from the geometry, including any formatting due to SetStructureNameFormat()
302  // or SetDetectorNameFormat().
303  //
304  // The name after ':' is the name that will be used 'externally', e.g. by a
305  // KVMultiDetArray created from the geometry using KVGeoImport.
306  //
307  // Several lists can be combined by calling this method several times.
308  //
309  // "listfile" can be an absolute path name; if not, we look for it in
310  // `$KVROOT/KVFiles/data`, or in `$HOME`, or (finally) in `$PWD`.
311 
312  TString fullpath;
313  if (!SearchKVFile(listfile, fullpath, "data")) {
314  Warning("SetNameCorrespondanceList", "File %s not found", listfile);
315  return;
316  }
319 }
320 
321 
322 
325 
327 {
328  // copy TEnv of name correspondances
330  if (list) fDetStrucNameCorrespList = (TEnv*)list->Clone();
331 }
332 
333 
334 
340 
342 {
343  // IF name correspondance lists have been set with SetNameCorrespondanceList(const Char_t*),
344  // look up new name for 'name'.
345  //
346  // If found, returns kTRUE and 'tran' is the 'translated' name, otherwise returns kFALSE and tran=name.
347 
350  if (tran == "") {
351  tran = name;
352  //Info("GetNameCorrespondance","...not found");
353  return kFALSE;
354  }
355  //Info("GetNameCorrespondance","...found %s", tran.Data());
356  return kTRUE;
357  }
358  //Info("GetNameCorrespondance","...not found");
359  tran = name;
360  return kFALSE;
361 }
362 
363 
364 
370 
372 {
373  // Propagate a set of particles through the geometry.
374  //
375  // By default, propagates particles from (0,0,0) (world coordinates),
376  // unless a different origin is given.
377 
378  ResetTrackID();
379  for (auto& part : EventIterator(TheEvent)) {
380  PropagateParticle(&part, TheOrigin);
381  }
382 }
383 
384 
385 
404 
406 {
407  // User-overridable method, to be redefined in child classes.
408  //
409  // This method is called every time that a propagated particle enters a new volume
410  // in the geometry.
411  // The user then has access to the following informations:
412  //
413  // - the TGeoVolume the particle is now entering (GetCurrentVolume());
414  // - the node in the geometry this volume occupies (GetCurrentNode());
415  // - the distance the particle will have to travel in this volume before
416  // leaving it (GetStepSize());
417  // - the position of the particle on the boundary as it enters this volume
418  // (GetEntryPoint()).
419  // - the position of the particle on the boundary as it leaves this volume
420  // (GetExitPoint()).
421  //
422  // If required, propagation of the particle can be stopped at any time by calling
423  // SetStopPropagation()
424 
425  AbstractMethod("ParticleEntersNewVolume");
426 }
427 
428 
429 
432 
434 {
435  // Returns pointer to internal copy of current global transformation matrix
436  return &fCurrentMatrix;
437 }
438 
439 
440 
451 
453 {
454  // Returns the name of the current detector (if we are inside a detector)
455  // and whether it is a multilayer or simple detector, or a segmented detector
456  //
457  // Returns nullptr if we are not inside a detector volume.
458  //
459  // **N.B.** the returned volume corresponds to the *whole* detector (even if it has several layers or is segmented).
460  // For a multilayer detector, GetCurrentVolume() returns the volume for the current layer.
461  //
462  // See ExtractDetectorNameFromPath() for details on detector name formatting.
463 
464  multilayer = segmented = kFALSE;
466  TString volNom = GetCurrentVolume()->GetName();
467  TGeoVolume* detector_volume = 0;
468  if (volNom.BeginsWith("SUBDET")) {
469  // we appear to have hit a subdetector of a KVSegmentedDetector ?
470  TGeoVolume* mother_vol = GetCurrentNode()->GetMotherVolume();
471  if (mother_vol) {
472  TString mom = mother_vol->GetName();
473  if (mom.BeginsWith("DET_")) {
474  // it *is* a segmented detector (youpi! :-)
475  if (fMotherNode) { // this is the node corresponding to the whole detector,
477  detector_volume = mother_vol;
478  segmented = kTRUE;
479  }
480  }
481  }
482  }
483  else if (volNom.BeginsWith("DET_")) {
484  // simple detector
486  detector_volume = GetCurrentVolume();
487  }
488  else {
489  // have we hit 1 layer of a multilayer detector?
490  TGeoVolume* mother_vol = GetCurrentNode()->GetMotherVolume();
491  if (mother_vol) {
492  TString mom = mother_vol->GetName();
493  if (mom.BeginsWith("DET_")) {
494  // it *is* a multilayer detector (youpi! :-)
495  if (fMotherNode) { // this is the node corresponding to the whole detector,
497  detector_volume = mother_vol;
498  multilayer = kTRUE;
499  }
500  }
501  }
502  }
503  if (detector_volume) ExtractDetectorNameFromPath(detector_name);
504  return detector_volume;
505 }
506 
507 
508 
513 
515 {
516  // Returns the node corresponding to the current detector volume
517  //
518  // **N.B.** the returned node corresponds to the *whole* detector (even if it has several layers).
519  return fCurrentDetectorNode;
520 }
521 
522 
523 
623 
625 {
626  // We analyse the current path in order to construct the full (unique) name
627  // of the detector, i.e. if the current path is
628  //
629  //~~~~~~~
630  // /TOP_1/STRUCT_BLOCK_2/CHIO_WALL_1/DET_CHIO_2/WINDOW_1
631  //~~~~~~~
632  //
633  // then the default name of the detector will be **BLOCK_2_CHIO_2**
634  // (see below to override this).
635  //
636  // This method also fills the fCurrentStructures array with elements
637  // deduced from the path, e.g. if the path is
638  //
639  //~~~~~~~
640  // /TOP_1/STRUCT_BLOCK_2/STRUCT_QUARTET_1/DET_SI1-T1
641  //~~~~~~~
642  //
643  // then by default
644  //~~~~~~~{.cpp}
645  // fCurrentStructures[0] = KVGeoStrucElement(name = "BLOCK_2", type = "BLOCK", number = 2)
646  // fCurrentStructures[1] = KVGeoStrucElement(name = "QUARTET_1", type = "QUARTET", number = 1)
647  //~~~~~~~
648  //
649  // and the default name of the detector will be **BLOCK_2_QUARTET_1_SI1-T1**
650  //
651  // ### STRUCTURE & DETECTOR NAME FORMATTING ###
652  // #### Structures ####
653  // The default names for structures are taken from the node name by stripping off
654  // the **STRUCT_** prefix. It is assumed that the remaining string is of the form
655  //~~~~~~~~~~
656  // "[structure type]_[structure number]"
657  //~~~~~~~~~~
658  // (the structure number is always taken after the last occurence of '_' in the
659  // node name). This is the name that will be used by default for the structure.
660  //
661  // However, this format can be change by calling method
662  //~~~~~{.cpp}
663  // SetStructureNameFormat("[structure type]", "[format]")
664  //~~~~~
665  // where format can contain any of the following tokens:
666  //~~~~~
667  // $type$ - will be replaced by the structure type name
668  // $type%[fmt]$ - will be replaced by the structure type name using given format
669  // $number$ - will be replaced by the structure number
670  // $number%[fmt]$ - will be replaced by the structure number using given format
671  //~~~~~
672  //
673  // Example: to change the name of the block in the previous example to "B-02":
674  //~~~~~~{.cpp}
675  // SetStructureNameFormat("BLOCK", "$type%.1s$-$number%02d$")
676  //~~~~~~
677  //
678  // #### Detectors ####
679  // The default base names for detectors are taken from the node name by stripping off
680  // the **DET_** prefix. In order to ensure that all detectors have unique names,
681  // by default we prefix the names of the parent structures to the basename in
682  // order to generate the full name of the detector:
683  //~~~~~~~
684  // [struc1-name]_[struc2-name]_..._[detector-basename]
685  //~~~~~~~
686  // However, this format can be changed by calling method
687  //~~~~~{.cpp}
688  // SetDetectorNameFormat("[format]")
689  //~~~~~
690  // where format can contain any of the following tokens:
691  //~~~~~~
692  // $det:name$ - will be replaced by the detector basename
693  // $struc:[type]:name$ - will be replaced by the name of the parent structure of given type
694  // $struc:[type]:type$ - will be replaced by the type of the parent structure of given type
695  // $struc:[type]:number$ - will be replaced by the number of the parent structure of given type
696  //~~~~~~
697  // plus additional formatting information as for SetStructureNameFormat() (see above).
698  //
699  // Example: to change the name of the **SI1-T1** detector in the previous example to
700  // **SI1-T1-Q1-B2**:
701  //~~~~~~{.cpp}
702  // SetDetectorNameFormat("$det:name$-Q$struc:QUARTET:number$-B$struc:BLOCK:number$");
703  //~~~~~~
704  // Or if you also change the format of the structure names:
705  //~~~~~~
706  // SetStructureNameFormat("BLOCK", "$type%.1s$$number$");
707  // SetStructureNameFormat("QUARTET", "$type%.1s$$number$");
708  // SetDetectorNameFormat("$det:name$-$struc:QUARTET:name$-$struc:BLOCK:name$");
709  //~~~~~~
710  //
711  // #### Segmented/position sensitive detectors
712  // In this case we expect to have a top level node/volume representing the whole detector,
713  // containing volumes/nodes for each subdetector/segment, e.g.
714  //
715  //~~~
716  // /WORLD_1/SEGDET_SI_1/SUBDET_1
717  // /WORLD_1/SEGDET_SI_1/SUBDET_2
718  // /WORLD_1/SEGDET_SI_1/SUBDET_3
719  // /WORLD_1/SEGDET_SI_1/SUBDET_4
720  // /WORLD_1/SEGDET_SI_1/SUBDET_5
721  //~~~
722  //
723  // could represent a silicon detector "SI_1" with 5 strips.
724 
725  KVString path = GetCurrentPath();
726  path.Begin("/");
727  detname = "";
729  fCurStrucNumber = 0;
730  while (!path.End()) {
731  KVString elem = path.Next();
732  if (elem.BeginsWith("SEGDET_")) {
733  // segmented detector
734  KVString basename(elem(7, elem.Length() - 7));
735  FormatDetectorName(basename, detname);
736  break; // rest of path is subdetector number: ignore
737  }
738  else if (elem.BeginsWith("STRUCT_")) {
739  // structure element. strip off "STRUCT_" and extract type and number of structure.
740  KVString struc_name(elem(7, elem.Length() - 7));
742  Ssiz_t last_ = struc_name.Last('_'); // find last '_' in structure name
743  TString type = struc_name(0, last_);
744  TString nums = struc_name(last_ + 1, struc_name.Length() - last_ - 1);
745  Int_t number = nums.Atoi();
746  KVString name;
747  FormatStructureName(type, number, name);
748  gel->SetNameTitle(name, type);
749  gel->SetNumber(number);
750  }
751  else if (elem.BeginsWith("DET_")) {
752  // detector name. strip off "DET_" and use rest as basename
753  KVString basename(elem(4, elem.Length() - 4));
754  FormatDetectorName(basename, detname);
755  }
756  }
757 }
758 
759 
760 
767 
769 {
770  // Propagate a particle through the geometry in the direction of its momentum,
771  // until we reach the boundary of the geometry, or until fStopPropagation is set to kFALSE.
772  //
773  // Propagation will also stop if we encounter a volume whose name begins with "DEADZONE"
774 
775  // Define point of origin of particles
776  if (TheOrigin) fGeometry->SetCurrentPoint(TheOrigin->X(), TheOrigin->Y(), TheOrigin->Z());
777  else fGeometry->SetCurrentPoint(0., 0., 0.);
778 
779  // unit vector in direction of particle's momentum
780  TVector3 v = part->GetMomentum().Unit();
781  // use particle's momentum direction
782  fGeometry->SetCurrentDirection(v.x(), v.y(), v.z());
783  fGeometry->FindNode();
784 
790  // move along trajectory until we hit a new volume
794  TGeoNode* newNod = fGeometry->GetCurrentNode();
795  TGeoNode* newMom = fGeometry->GetMother();
796  TGeoHMatrix* newMatx = fGeometry->GetCurrentMatrix();
797  TString newPath = fGeometry->GetPath();
798 
799  Double_t XX, YY, ZZ;
800  XX = YY = ZZ = 0.;
801 
802  // reset user flag for stopping propagation of particle
804 
805 // if(IsTracking()) Info("PropagateParticle","Beginning: i am in %s on node %s with path %s",
806 // fCurrentVolume->GetName(),fCurrentNode->GetName(),fCurrentPath.Data());
807 
808  if (IsTracking() && fGeometry->IsOutside()) {
809  const Double_t* posi = fGeometry->GetCurrentPoint();
810  AddPointToCurrentTrack(posi[0], posi[1], posi[2]);
811  return;
812  }
813 
814  // track particle until we leave the geometry or until fStopPropagation
815  // becomes kTRUE
816  while (!fGeometry->IsOutside()) {
817 
818  const Double_t* posi = fGeometry->GetCurrentPoint();
819  fEntryPoint.SetXYZ(XX, YY, ZZ);
820  XX = posi[0];
821  YY = posi[1];
822  ZZ = posi[2];
823  fExitPoint.SetXYZ(XX, YY, ZZ);
824 
825  TString vn = GetCurrentVolume()->GetName();
826  if (vn.BeginsWith("DEADZONE")) {
827  part->GetParameters()->SetValue("DEADZONE", Form("%s/%s", GetCurrentVolume()->GetName(), GetCurrentNode()->GetName()));
828  break;
829  }
830 
831 // if(IsTracking()) Info("PropagateParticle","just before ParticleEntersNewVolume\nnow i am in %s on node %s with path %s",
832 // fCurrentVolume->GetName(),fCurrentNode->GetName(),fCurrentPath.Data());
833 
835 
836  if (StopPropagation()) break;
837 
838  fCurrentVolume = newVol;
839  fCurrentNode = newNod;
840  fMotherNode = newMom;
841  fCurrentMatrix = *newMatx;
842  fCurrentPath = newPath;
843 
844 // if(IsTracking()) Info("PropagateParticle","after ParticleEntersNewVolume\nnow i am in %s on node %s with path %s",
845 // fCurrentVolume->GetName(),fCurrentNode->GetName(),fCurrentPath.Data());
846 
847  // move on to next volume crossed by trajectory
850  newVol = fGeometry->GetCurrentVolume();
851  newNod = fGeometry->GetCurrentNode();
852  newMom = fGeometry->GetMother();
853  newMatx = fGeometry->GetCurrentMatrix();
854  newPath = fGeometry->GetPath();
855  }
856  if (IsTracking() && fGeometry->IsOutside()) {
857  const Double_t* posi = fGeometry->GetCurrentPoint();
858  AddPointToCurrentTrack(posi[0], posi[1], posi[2]);
859  }
860 }
861 
862 
863 
870 
872 {
873  // When using ROOT geometry, after calling PropagateEvent() to simulate detection of some particles,
874  // you can call this method to overlay the tracks of the corresponding particles on the 3D
875  // geometry of the array
876  //
877  // If KVNumberList pointer is given, use it to limit Z of drawn tracks
878 
879  TIter next_track(fGeometry->GetListOfTracks());
880  TVirtualGeoTrack* track;
881  bool first = true;
882  while ((track = (TVirtualGeoTrack*)next_track())) {
883  KVNucleus nuc(track->GetName());
884  if (!zlist || zlist->Contains(nuc.GetZ())) {
885  KV3DGeoTrack* gtrack = new KV3DGeoTrack(track);
886  if (first) {
887  if (gPad) gtrack->Draw("same");
888  else gtrack->Draw("ogl");
889  first = false;
890  }
891  else gtrack->Draw("same");
892  }
893  }
894 }
895 
896 
int Int_t
#define SafeDelete(p)
bool Bool_t
int Ssiz_t
char Char_t
constexpr Bool_t kFALSE
double Double_t
constexpr Bool_t kTRUE
kEnvUser
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 name[80]
char * Form(const char *fmt,...)
#define gPad
Class for iterating over nuclei in events accessed through base pointer/reference.
Visualise particle trajectories through array geometry.
Definition: KV3DGeoTrack.h:15
void Draw(Option_t *option="") override
Override Draw to add a TPolyMarker3D at the end of the track.
virtual const Char_t * GetType() const
Definition: KVBase.h:176
virtual Bool_t IsType(const Char_t *typ) const
Definition: KVBase.h:184
virtual void SetNumber(UInt_t num)
Definition: KVBase.h:215
static Bool_t SearchKVFile(const Char_t *name, TString &fullpath, const Char_t *kvsubdir="")
Definition: KVBase.cpp:517
UInt_t GetNumber() const
Definition: KVBase.h:219
Abstract base class container for multi-particle events.
Definition: KVEvent.h:67
Base class for propagation of particles through array geometry.
virtual void AddPointToCurrentTrack(Double_t, Double_t, Double_t)
void FormatStructureName(const Char_t *type, Int_t number, KVString &name)
Bool_t IsTracking() const
TGeoHMatrix fCurrentMatrix
current global transformation matrix
void PropagateEvent(KVEvent *, TVector3 *TheOrigin=0)
const TGeoHMatrix * GetCurrentMatrix() const
Returns pointer to internal copy of current global transformation matrix.
TClonesArray fCurrentStructures
list of current structures deduced from path
TString fCurrentPath
current full path to physical node
void FormatDetectorName(const Char_t *basename, KVString &name)
TGeoNode * fCurrentDetectorNode
node for current detector
void ExtractDetectorNameFromPath(KVString &)
KVUniqueNameList fDetectorPaths
correspondance between physical node and detector objects
TGeoNode * GetCurrentNode() const
TGeoNode * fMotherNode
mother node of current node
void SetTracking(Bool_t on=kTRUE)
KVGeoNavigator(TGeoManager *)
Constructor. Call with pointer to geometry.
KVNameValueList fStrucNameFmt
list of user-defined formats for structure names
void SetNameCorrespondanceList(const Char_t *)
TVector3 fExitPoint
position of particle on exiting volume
TEnv * fDetStrucNameCorrespList
list(s) of correspondance for renaming structures/detectors
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 &)
Double_t fStepSize
distance to travel in volume
TGeoManager * fGeometry
geometry to navigate
Bool_t StopPropagation() const
TGeoNode * fCurrentNode
current node
virtual ~KVGeoNavigator()
Destructor.
TVector3 fEntryPoint
position of particle on entering volume
KVString fDetNameFmt
user-defined format for detector names
Int_t fCurStrucNumber
number of current parent structures
void ResetTrackID(Int_t id=0)
TGeoVolume * fCurrentVolume
current volume
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)
Description of properties and kinematics of atomic nuclei.
Definition: KVNucleus.h:123
Int_t GetZ() const
Return the number of proton / atomic number.
Definition: KVNucleus.cpp:763
Strings used to represent a set of ranges of values.
Definition: KVNumberList.h:85
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
Definition: KVParticle.h:607
KVNameValueList * GetParameters() const
Definition: KVParticle.h:818
void SetOwner(Bool_t enable=kTRUE) override
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:73
void Begin(TString delim) const
Definition: KVString.cpp:565
Bool_t End() const
Definition: KVString.cpp:634
KVString Next(Bool_t strip_whitespace=kFALSE) const
Definition: KVString.cpp:695
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
Bool_t IsOutside() const
Double_t GetStep() 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
virtual void Warning(const char *method, const char *msgfmt,...) const
Ssiz_t Length() const
Int_t Atoi() 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
Double_t Z() const
void SetXYZ(Double_t x, Double_t y, Double_t z)
Double_t Y() const
Double_t X() const
TVector3 Unit() const
const char * GetName() const override
v
ClassImp(TPyArg)