Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGeoNode.cxx
Go to the documentation of this file.
1// @(#)root/geom:$Id$
2// Author: Andrei Gheata 24/10/01
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12/** \class TGeoNode
13\ingroup Geometry_classes
14
15 A node represent a volume positioned inside another.They store links to both
16volumes and to the TGeoMatrix representing the relative positioning. Node are
17never instantiated directly by users, but created as a result of volume operations.
18Adding a volume named A with a given user ID inside a volume B will create a node
19node named A_ID. This will be added to the list of nodes stored by B. Also,
20when applying a division operation in N slices to a volume A, a list of nodes
21B_1, B_2, ..., B_N is also created. A node B_i does not represent a unique
22object in the geometry because its container A might be at its turn positioned
23as node inside several other volumes. Only when a complete branch of nodes
24is fully defined up to the top node in the geometry, a given path like:
25
26 /TOP_1/.../A_3/B_7 will represent an unique object.
27
28Its global transformation matrix can be computed as the pile-up of all local
29transformations in its branch. We will therefore call "logical graph" the
30hierarchy defined by nodes and volumes. The expansion of the logical graph by
31all possible paths defines a tree structure where all nodes are unique
32"touchable" objects. We will call this the "physical tree". Unlike the logical
33graph, the physical tree can become a huge structure with several milions of nodes
34in case of complex geometries, therefore it is not always a good idea to keep it
35transient in memory. Since a the logical and physical structures are correlated, the
36modeller rather keeps track only of the current branch, updating the current
37global matrix at each change of the level in geometry. The current physical node
38is not an object that can be asked for at a given moment, but rather represented
39by the combination: current node + current global matrix. However, physical nodes
40have unique ID's that can be retrieved for a given modeler state. These can be
41fed back to the modeler in order to force a physical node to become current.
42The advantage of this comes from the fact that all navigation queries check
43first the current node, therefore knowing the location of a point in the
44geometry can be saved as a starting state for later use.
45
46 Nodes can be declared as "overlapping" in case they do overlap with other
47nodes inside the same container or extrude this container. Non-overlapping
48nodes can be created with:
49
50~~~ {.cpp}
51 TGeoVolume::AddNode(TGeoVolume *daughter, Int_t copy_No, TGeoMatrix *matr);
52~~~
53
54The creation of overlapping nodes can be done with a similar prototype:
55
56~~~ {.cpp}
57 TGeoVolume::AddNodeOverlap(same arguments);
58~~~
59
60When closing the geometry, overlapping nodes perform a check of possible
61overlaps with their neighbours. These are stored and checked all the time
62during navigation, therefore navigation is slower when embedding such nodes
63into geometry.
64
65 Node have visualization attributes as volume have. When undefined by users,
66painting a node on a pad will take the corresponding volume attributes.
67
68\image html geom_t_node.png
69*/
70
71#include <iostream>
72
73#include "TBrowser.h"
74#include "TObjArray.h"
75#include "TStyle.h"
76
77#include "TGeoManager.h"
78#include "TGeoMatrix.h"
79#include "TGeoShape.h"
80#include "TGeoVolume.h"
81#include "TVirtualGeoPainter.h"
82#include "TVirtualGeoChecker.h"
83#include "TGeoVoxelFinder.h"
84#include "TGeoNode.h"
85#include "TMath.h"
86#include "TStopwatch.h"
87#include "TGeoExtension.h"
88
89// statics and globals
90
91
92////////////////////////////////////////////////////////////////////////////////
93/// Default constructor
94
96{
97 fVolume = nullptr;
98 fMother = nullptr;
99 fNumber = 0;
100 fNovlp = 0;
101 fOverlaps = nullptr;
102 fUserExtension = nullptr;
103 fFWExtension = nullptr;
104}
105
106////////////////////////////////////////////////////////////////////////////////
107/// Constructor
108
110{
111 if (!vol) {
112 Error("ctor", "volume not specified");
113 return;
114 }
115 fVolume = (TGeoVolume *)vol;
116 if (fVolume->IsAdded())
118 fVolume->SetAdded();
119 fMother = nullptr;
120 fNumber = 0;
121 fNovlp = 0;
122 fOverlaps = nullptr;
123 fUserExtension = nullptr;
124 fFWExtension = nullptr;
125}
126
127////////////////////////////////////////////////////////////////////////////////
128/// Destructor
129
131{
132 if (fOverlaps)
133 delete[] fOverlaps;
134 if (fUserExtension) {
136 fUserExtension = nullptr;
137 }
138 if (fFWExtension) {
140 fFWExtension = nullptr;
141 }
142}
143
144////////////////////////////////////////////////////////////////////////////////
145/// How-to-browse for a node.
146
148{
149 if (!b)
150 return;
151 if (!GetNdaughters())
152 return;
154 TString title;
155 for (Int_t i = 0; i < GetNdaughters(); i++) {
157 b->Add(daughter, daughter->GetName(), daughter->IsVisible());
158 }
159}
160
161////////////////////////////////////////////////////////////////////////////////
162/// Returns the number of daughters. Nodes pointing to same volume counted
163/// once if unique_volumes is set.
164
166{
167 static Int_t icall = 0;
168 Int_t counter = 0;
169 // Count this node
170 if (unique_volumes) {
171 if (!fVolume->IsSelected()) {
172 counter++;
174 }
175 } else
176 counter++;
177 icall++;
179 // Count daughters recursively
180 for (Int_t i = 0; i < nd; i++)
182 icall--;
183 // Un-mark volumes
184 if (icall == 0)
186 return counter;
187}
188
189////////////////////////////////////////////////////////////////////////////////
190/// Check overlaps bigger than OVLP hierarchically, starting with this node.
191
193{
194 Int_t icheck = 0;
195 Int_t ncheck = 0;
197 Int_t i;
199 TString opt(option);
200 opt.ToLower();
201 if (opt.Contains("s"))
202 sampling = kTRUE;
203
206 timer = new TStopwatch();
207 geom->ClearOverlaps();
208 geom->SetCheckingOverlaps(kTRUE);
209 Info("CheckOverlaps", "Checking overlaps for %s and daughters within %g", fVolume->GetName(), ovlp);
210 if (sampling) {
211 Info("CheckOverlaps", "Checking overlaps by sampling <%s> for %s and daughters", option, fVolume->GetName());
212 Info("CheckOverlaps", "=== NOTE: Extrusions NOT checked with sampling option ! ===");
213 }
214 timer->Start();
215 geom->GetGeomChecker()->OpProgress(fVolume->GetName(), icheck, ncheck, timer, kFALSE);
217 icheck++;
218 TGeoIterator next(fVolume);
219 TGeoNode *node;
220 TString path;
221 TObjArray *overlaps = geom->GetListOfOverlaps();
223 TString msg;
224 while ((node = next())) {
225 next.GetPath(path);
226 icheck++;
227 if (!node->GetVolume()->IsSelected()) {
228 msg = TString::Format("found %d overlaps", overlaps->GetEntriesFast());
229 geom->GetGeomChecker()->OpProgress(node->GetVolume()->GetName(), icheck, ncheck, timer, kFALSE, msg);
230 node->GetVolume()->SelectVolume(kFALSE);
232 }
233 }
235 geom->SetCheckingOverlaps(kFALSE);
236 geom->SortOverlaps();
237 novlps = overlaps->GetEntriesFast();
238 TNamed *obj;
239 for (i = 0; i < novlps; i++) {
240 obj = (TNamed *)overlaps->At(i);
241 obj->SetName(TString::Format("ov%05d", i));
242 }
243 geom->GetGeomChecker()->OpProgress("Check overlaps:", icheck, ncheck, timer, kTRUE);
244 Info("CheckOverlaps", "Number of illegal overlaps/extrusions : %d\n", novlps);
245 delete timer;
246}
247
248////////////////////////////////////////////////////////////////////////////////
249/// compute the closest distance of approach from point px,py to this node
250
252{
253 Int_t dist = 9999;
254 if (!fVolume)
255 return dist;
259 if (!painter)
260 return dist;
261 dist = painter->DistanceToPrimitiveVol(fVolume, px, py);
262 return dist;
263}
264
265////////////////////////////////////////////////////////////////////////////////
266/// Execute mouse actions on this volume.
267
269{
270 if (!fVolume)
271 return;
273 if (!painter)
274 return;
275 painter->ExecuteVolumeEvent(fVolume, event, px, py);
276}
277
278////////////////////////////////////////////////////////////////////////////////
279/// Get node info for the browser.
280
282{
283 if (!fVolume)
284 return nullptr;
286 if (!painter)
287 return nullptr;
288 return (char *)painter->GetVolumeInfo(fVolume, px, py);
289}
290
291////////////////////////////////////////////////////////////////////////////////
292/// check if this node is drawn. Assumes that this node is current
293
295{
297 return kTRUE;
298 return kFALSE;
299}
300
301////////////////////////////////////////////////////////////////////////////////
302/// Inspect this node.
303
305{
306 printf("== Inspecting node %s ", GetName());
307 if (fMother)
308 printf("mother volume %s. ", fMother->GetName());
309 if (IsOverlapping())
310 printf("(Node is MANY)\n");
311 else
312 printf("\n");
313 if (fOverlaps && fMother) {
314 printf(" possibly overlapping with : ");
315 for (Int_t i = 0; i < fNovlp; i++)
316 printf(" %s ", fMother->GetNode(fOverlaps[i])->GetName());
317 printf("\n");
318 }
319 printf("Transformation matrix:\n");
321 if (GetMatrix())
322 matrix->Print();
323 fVolume->Print();
324}
325
326////////////////////////////////////////////////////////////////////////////////
327/// check for wrong parameters in shapes
328
330{
332 Int_t nd = GetNdaughters();
333 if (!nd)
334 return;
335 for (Int_t i = 0; i < nd; i++)
337}
338
339////////////////////////////////////////////////////////////////////////////////
340/// draw only this node independently of its vis options
341
346
347////////////////////////////////////////////////////////////////////////////////
348/// draw current node according to option
349
359
360////////////////////////////////////////////////////////////////////////////////
361/// Method drawing the overlap candidates with this node.
362
364{
365 if (!fNovlp) {
366 printf("node %s is ONLY\n", GetName());
367 return;
368 }
369 if (!fOverlaps) {
370 printf("node %s no overlaps\n", GetName());
371 return;
372 }
373 TGeoNode *node;
374 Int_t i;
376 for (i = 0; i < nd; i++) {
377 node = fMother->GetNode(i);
379 }
381 for (i = 0; i < fNovlp; i++) {
382 node = fMother->GetNode(fOverlaps[i]);
383 node->GetVolume()->SetVisibility(kTRUE);
384 }
386 fMother->Draw();
387}
388
389////////////////////////////////////////////////////////////////////////////////
390/// Fill array with node id. Recursive on node branch.
391
392void TGeoNode::FillIdArray(Int_t &ifree, Int_t &nodeid, Int_t *array) const
393{
394 Int_t nd = GetNdaughters();
395 if (!nd)
396 return;
398 Int_t istart = ifree; // start index for daughters
399 ifree += nd;
400 for (Int_t id = 0; id < nd; id++) {
401 daughter = GetDaughter(id);
402 array[istart + id] = ifree;
403 array[ifree++] = ++nodeid;
404 daughter->FillIdArray(ifree, nodeid, array);
405 }
406}
407
408////////////////////////////////////////////////////////////////////////////////
409/// Search for a node within the branch of this one.
410
412{
413 Int_t nd = GetNdaughters();
414 if (!nd)
415 return -1;
416 TIter next(fVolume->GetNodes());
418 while ((daughter = (TGeoNode *)next())) {
419 if (daughter == node) {
421 return (level + 1);
422 }
423 }
424 next.Reset();
426 while ((daughter = (TGeoNode *)next())) {
427 new_level = daughter->FindNode(node, level + 1);
428 if (new_level >= 0) {
430 return new_level;
431 }
432 }
433 return -1;
434}
435
436////////////////////////////////////////////////////////////////////////////////
437/// save attributes for this node
438
439void TGeoNode::SaveAttributes(std::ostream &out)
440{
441 if (IsVisStreamed())
442 return;
444 char quote = '"';
446 if ((fVolume->IsVisTouched()) && (!fVolume->IsVisStreamed())) {
448 out << " vol = gGeoManager->GetVolume(" << quote << fVolume->GetName() << quote << ");" << std::endl;
449 voldef = kTRUE;
450 if (!fVolume->IsVisDaughters())
451 out << " vol->SetVisDaughters(kFALSE);" << std::endl;
452 if (fVolume->IsVisible()) {
453 /*
454 if (fVolume->GetLineColor() != gStyle->GetLineColor())
455 out<<" vol->SetLineColor("<<fVolume->GetLineColor()<<");"<<std::endl;
456 if (fVolume->GetLineStyle() != gStyle->GetLineStyle())
457 out<<" vol->SetLineStyle("<<fVolume->GetLineStyle()<<");"<<std::endl;
458 if (fVolume->GetLineWidth() != gStyle->GetLineWidth())
459 out<<" vol->SetLineWidth("<<fVolume->GetLineWidth()<<");"<<std::endl;
460 */
461 } else {
462 out << " vol->SetVisibility(kFALSE);" << std::endl;
463 }
464 }
465 if (!IsVisDaughters())
466 return;
467 Int_t nd = GetNdaughters();
468 if (!nd)
469 return;
470 TGeoNode *node;
471 for (Int_t i = 0; i < nd; i++) {
472 node = GetDaughter(i);
473 if (node->IsVisStreamed())
474 continue;
475 if (node->IsVisTouched()) {
476 if (!voldef)
477 out << " vol = gGeoManager->GetVolume(" << quote << fVolume->GetName() << quote << ");" << std::endl;
478 out << " node = vol->GetNode(" << i << ");" << std::endl;
479 if (!node->IsVisDaughters()) {
480 out << " node->VisibleDaughters(kFALSE);" << std::endl;
481 node->SetVisStreamed(kTRUE);
482 continue;
483 }
484 if (!node->IsVisible())
485 out << " node->SetVisibility(kFALSE);" << std::endl;
486 }
487 node->SaveAttributes(out);
488 node->SetVisStreamed(kTRUE);
489 }
490}
491
492////////////////////////////////////////////////////////////////////////////////
493/// Connect user-defined extension to the node. The node "grabs" a copy, so
494/// the original object can be released by the producer. Release the previously
495/// connected extension if any.
496///
497/// NOTE: This interface is intended for user extensions and is guaranteed not
498/// to be used by TGeo
499
501{
503 fUserExtension = nullptr;
504 if (ext)
505 fUserExtension = ext->Grab();
506 if (tmp)
507 tmp->Release();
508}
509
510////////////////////////////////////////////////////////////////////////////////
511/// Connect framework defined extension to the node. The node "grabs" a copy,
512/// so the original object can be released by the producer. Release the previously
513/// connected extension if any.
514///
515/// NOTE: This interface is intended for the use by TGeo and the users should
516/// NOT connect extensions using this method
517
519{
521 fFWExtension = nullptr;
522 if (ext)
523 fFWExtension = ext->Grab();
524 if (tmp)
525 tmp->Release();
526}
527
528////////////////////////////////////////////////////////////////////////////////
529/// Get a copy of the user extension pointer. The user must call Release() on
530/// the copy pointer once this pointer is not needed anymore (equivalent to
531/// delete() after calling new())
532
534{
535 if (fUserExtension)
536 return fUserExtension->Grab();
537 return nullptr;
538}
539
540////////////////////////////////////////////////////////////////////////////////
541/// Get a copy of the framework extension pointer. The user must call Release() on
542/// the copy pointer once this pointer is not needed anymore (equivalent to
543/// delete() after calling new())
544
546{
547 if (fFWExtension)
548 return fFWExtension->Grab();
549 return nullptr;
550}
551////////////////////////////////////////////////////////////////////////////////
552/// Check the overlab between the bounding box of the node overlaps with the one
553/// the brother with index IOTHER.
554
556{
557 if (!fOverlaps)
558 return kFALSE;
559 for (Int_t i = 0; i < fNovlp; i++)
560 if (fOverlaps[i] == iother)
561 return kTRUE;
562 return kFALSE;
563}
564
565////////////////////////////////////////////////////////////////////////////////
566/// Convert the point coordinates from mother reference to local reference system
567
569{
570 GetMatrix()->MasterToLocal(master, local);
571}
572
573////////////////////////////////////////////////////////////////////////////////
574/// Convert a vector from mother reference to local reference system
575
577{
578 GetMatrix()->MasterToLocalVect(master, local);
579}
580
581////////////////////////////////////////////////////////////////////////////////
582/// Convert the point coordinates from local reference system to mother reference
583
585{
586 GetMatrix()->LocalToMaster(local, master);
587}
588
589////////////////////////////////////////////////////////////////////////////////
590/// Convert a vector from local reference system to mother reference
591
593{
594 GetMatrix()->LocalToMasterVect(local, master);
595}
596
597////////////////////////////////////////////////////////////////////////////////
598/// Print the path (A/B/C/...) to this node on stdout
599
600void TGeoNode::ls(Option_t * /*option*/) const {}
601
602////////////////////////////////////////////////////////////////////////////////
603/// Paint this node and its content according to visualization settings.
604
606{
608 if (!painter)
609 return;
610 painter->PaintNode(this, option);
611}
612
613////////////////////////////////////////////////////////////////////////////////
614/// print daughters candidates for containing current point
615
617{
618 Double_t point[3];
620 printf(" Local : %g, %g, %g\n", point[0], point[1], point[2]);
621 if (!fVolume->Contains(&point[0])) {
622 printf("current point not inside this\n");
623 return;
624 }
626 TGeoNode *node;
627 if (finder) {
628 printf("current node divided\n");
629 node = finder->FindNode(&point[0]);
630 if (!node) {
631 printf("point not inside division element\n");
632 return;
633 }
634 printf("inside division element %s\n", node->GetName());
635 return;
636 }
638 if (!voxels) {
639 printf("volume not voxelized\n");
640 return;
641 }
642 Int_t ncheck = 0;
644 TGeoStateInfo &info = *nav->GetCache()->GetInfo();
645 Int_t *check_list = voxels->GetCheckList(&point[0], ncheck, info);
646 nav->GetCache()->ReleaseInfo();
647 voxels->PrintVoxelLimits(&point[0]);
648 if (!check_list) {
649 printf("no candidates for current point\n");
650 return;
651 }
652 TString overlap = "ONLY";
653 for (Int_t id = 0; id < ncheck; id++) {
654 node = fVolume->GetNode(check_list[id]);
655 if (node->IsOverlapping())
656 overlap = "MANY";
657 else
658 overlap = "ONLY";
659 printf("%i %s %s\n", check_list[id], node->GetName(), overlap.Data());
660 }
662}
663
664////////////////////////////////////////////////////////////////////////////////
665/// print possible overlapping nodes
666
668{
669 if (!fOverlaps) {
670 printf("node %s no overlaps\n", GetName());
671 return;
672 }
673 printf("Overlaps for node %s :\n", GetName());
674 TGeoNode *node;
675 for (Int_t i = 0; i < fNovlp; i++) {
676 node = fMother->GetNode(fOverlaps[i]);
677 printf(" %s\n", node->GetName());
678 }
679}
680
681////////////////////////////////////////////////////////////////////////////////
682/// computes the closest distance from given point to this shape
683
685{
686 Double_t local[3];
687 GetMatrix()->MasterToLocal(point, local);
688 return fVolume->GetShape()->Safety(local, in);
689}
690
691////////////////////////////////////////////////////////////////////////////////
692/// Copy content of lst of overlaps from source array
693
695{
696 Int_t *ovlps = nullptr;
697 if (src && (novlp > 0)) {
698 ovlps = new Int_t[novlp];
699 memcpy(ovlps, src, novlp * sizeof(Int_t));
700 }
702}
703
704////////////////////////////////////////////////////////////////////////////////
705/// set the list of overlaps for this node (ovlp must be created with operator new)
706
708{
709 if (fOverlaps)
710 delete[] fOverlaps;
711 fOverlaps = ovlp;
712 fNovlp = novlp;
713}
714
715////////////////////////////////////////////////////////////////////////////////
716/// Set visibility of the node (obsolete).
717
719{
720 if (gGeoManager->IsClosed())
723 if (vis && !fVolume->IsVisible())
726}
727
728////////////////////////////////////////////////////////////////////////////////
729/// Set visibility of the daughters (obsolete).
730
738
739/** \class TGeoNodeMatrix
740\ingroup Geometry_classes
741A node containing local transformation.
742*/
743
744
745////////////////////////////////////////////////////////////////////////////////
746/// Default constructor
747
749{
750 fMatrix = nullptr;
751}
752
753////////////////////////////////////////////////////////////////////////////////
754/// Constructor.
755
762
763////////////////////////////////////////////////////////////////////////////////
764/// Destructor
765
767
768////////////////////////////////////////////////////////////////////////////////
769/// return the total size in bytes of this node
770
772{
773 Int_t count = 40 + 4; // TGeoNode + fMatrix
774 // if (fMatrix) count += fMatrix->GetByteCount();
775 return count;
776}
777
778////////////////////////////////////////////////////////////////////////////////
779/// Returns type of optimal voxelization for this node.
780/// - type = 0 -> cartesian
781/// - type = 1 -> cylindrical
782
784{
786 if (!type)
787 return 0;
788 if (!fMatrix->IsRotAboutZ())
789 return 0;
791 if (TMath::Abs(transl[0]) > 1E-10)
792 return 0;
793 if (TMath::Abs(transl[1]) > 1E-10)
794 return 0;
795 return 1;
796}
797
798////////////////////////////////////////////////////////////////////////////////
799/// Make a copy of this node.
800
802{
804 node->SetName(GetName());
805 node->SetTitle(GetTitle());
806 // set the mother
808 // set the copy number
809 node->SetNumber(fNumber);
810 // copy overlaps
812
813 // copy VC
814 if (IsVirtual())
815 node->SetVirtual();
816 if (IsOverlapping())
817 node->SetOverlapping(); // <--- ADDED
818 // Copy extensions
821 node->SetCloned();
822 return node;
823}
824
825////////////////////////////////////////////////////////////////////////////////
826/// Matrix setter.
827
834
835/** \class TGeoNodeOffset
836\ingroup Geometry_classes
837Node containing an offset.
838*/
839
840
841////////////////////////////////////////////////////////////////////////////////
842/// Default constructor
843
845{
847 fOffset = 0;
848 fIndex = 0;
849 fFinder = nullptr;
850}
851
852////////////////////////////////////////////////////////////////////////////////
853/// Constructor. Null pointer to matrix means identity transformation
854
862
863////////////////////////////////////////////////////////////////////////////////
864/// Destructor
865
867
868////////////////////////////////////////////////////////////////////////////////
869/// Get the index of this offset.
870
872{
873 return (fIndex + fFinder->GetDivIndex());
874}
875
876////////////////////////////////////////////////////////////////////////////////
877/// Make a copy of this node
878
880{
882 node->SetName(GetName());
883 node->SetTitle(GetTitle());
884 // set the mother
886 // set the copy number
887 node->SetNumber(fNumber);
888 if (IsVirtual())
889 node->SetVirtual();
890 // set the finder
891 node->SetFinder(GetFinder());
892 // set extensions
895 return node;
896}
897
898/** \class TGeoIterator
899\ingroup Geometry_classes
900A geometry iterator.
901
902A geometry iterator that sequentially follows all nodes of the geometrical
903hierarchy of a volume. The iterator has to be initiated with a top volume
904pointer:
905
906~~~ {.cpp}
907 TGeoIterator next(myVolume);
908~~~
909
910One can use the iterator as any other in ROOT:
911
912~~~ {.cpp}
913 TGeoNode *node;
914 while ((node=next())) {
915 ...
916 }
917~~~
918
919The iterator can perform 2 types of iterations that can be selected via:
920
921~~~ {.cpp}
922 next.SetType(Int_t type);
923~~~
924
925Here TYPE can be:
926 - 0 (default) - 'first daughter next' behavior
927 - 1 - iteration at the current level only
928
929Supposing the tree structure looks like:
930
931~~~ {.cpp}
932TOP ___ A_1 ___ A1_1 ___ A11_1
933 | | |___ A12_1
934 | |_____A2_1 ___ A21_1
935 | |___ A21_2
936 |___ B_1 ...
937~~~
938
939The order of iteration for TYPE=0 is: A_1, A1_1, A11_1, A12_1, A2_1, A21_1,
940A21_2, B_1, ...
941
942The order of iteration for TYPE=1 is: A_1, B_1, ...
943At any moment during iteration, TYPE can be changed. If the last iterated node
944is for instance A1_1 and the iteration type was 0, one can do:
945
946~~~ {.cpp}
947 next.SetType(1);
948~~~
949
950The next iterated nodes will be the rest of A daughters: A2,A3,... The iterator
951will return 0 after finishing all daughters of A.
952
953During iteration, the following can be retrieved:
954 - Top volume where iteration started: TGeoIterator::GetTopVolume()
955 - Node at level I in the current branch: TGeoIterator::GetNode(Int_t i)
956 - Iteration type: TGeoIterator::GetType()
957 - Global matrix of the current node with respect to the top volume:
958 TGeoIterator::GetCurrentMatrix()
959
960The iterator can be reset by changing (or not) the top volume:
961
962~~~ {.cpp}
963 TGeoIterator::Reset(TGeoVolume *top);
964~~~
965
966### Example:
967
968We want to find out a volume named "MyVol" in the hierarchy of TOP volume.
969
970~~~ {.cpp}
971 TIter next(TOP);
972 TGeoNode *node;
973 TString name("MyVol");
974 while ((node=next()))
975 if (name == node->GetVolume()->GetName()) return node->GetVolume();
976~~~
977*/
978
979/** \class TGeoIteratorPlugin
980\ingroup Geometry_classes
981*/
982
983
984////////////////////////////////////////////////////////////////////////////////
985/// Geometry iterator for a branch starting with a TOP node.
986
988{
989 fTop = top;
990 fLevel = 0;
993 fType = 0;
994 fArray = new Int_t[30];
995 fMatrix = new TGeoHMatrix();
996 fTopName = fTop->GetName();
997 fPlugin = nullptr;
999}
1000
1001////////////////////////////////////////////////////////////////////////////////
1002/// Copy ctor.
1003
1005{
1006 fTop = iter.GetTopVolume();
1007 fLevel = iter.GetLevel();
1009 fMustStop = kFALSE;
1010 fType = iter.GetType();
1011 fArray = new Int_t[30 + 30 * Int_t(fLevel / 30)];
1012 for (Int_t i = 0; i < fLevel + 1; i++)
1013 fArray[i] = iter.GetIndex(i);
1014 fMatrix = new TGeoHMatrix(*iter.GetCurrentMatrix());
1015 fTopName = fTop->GetName();
1016 fPlugin = iter.fPlugin;
1018 ;
1019}
1020
1021////////////////////////////////////////////////////////////////////////////////
1022/// Destructor.
1023
1025{
1026 if (fArray)
1027 delete[] fArray;
1028 delete fMatrix;
1029}
1030
1031////////////////////////////////////////////////////////////////////////////////
1032/// Assignment.
1033
1035{
1036 if (&iter == this)
1037 return *this;
1038 fTop = iter.GetTopVolume();
1039 fLevel = iter.GetLevel();
1041 fMustStop = kFALSE;
1042 fType = iter.GetType();
1043 if (fArray)
1044 delete[] fArray;
1045 fArray = new Int_t[30 + 30 * Int_t(fLevel / 30)];
1046 for (Int_t i = 0; i < fLevel + 1; i++)
1047 fArray[i] = iter.GetIndex(i);
1048 if (!fMatrix)
1049 fMatrix = new TGeoHMatrix();
1050 *fMatrix = *iter.GetCurrentMatrix();
1051 fTopName = fTop->GetName();
1052 fPlugin = iter.fPlugin;
1054 ;
1055 return *this;
1056}
1057
1058////////////////////////////////////////////////////////////////////////////////
1059/// Returns next node.
1060
1062{
1063 if (fMustStop)
1064 return nullptr;
1065 TGeoNode *mother = nullptr;
1066 TGeoNode *next = nullptr;
1067 Int_t i;
1068 Int_t nd = fTop->GetNdaughters();
1069 if (!nd) {
1070 fMustStop = kTRUE;
1071 return nullptr;
1072 }
1073 if (!fLevel) {
1074 fArray[++fLevel] = 0;
1075 next = fTop->GetNode(0);
1076 if (fPlugin && fPluginAutoexec)
1078 return next;
1079 }
1080 next = fTop->GetNode(fArray[1]);
1081 // Move to current node
1082 for (i = 2; i < fLevel + 1; i++) {
1083 mother = next;
1084 next = mother->GetDaughter(fArray[i]);
1085 }
1086 if (fMustResume) {
1088 if (fPlugin && fPluginAutoexec)
1090 return next;
1091 }
1092
1093 switch (fType) {
1094 case 0: // default next daughter behavior
1095 nd = next->GetNdaughters();
1096 if (nd) {
1097 // First daughter next
1098 fLevel++;
1099 if ((fLevel % 30) == 0)
1100 IncreaseArray();
1101 fArray[fLevel] = 0;
1102 if (fPlugin && fPluginAutoexec)
1104 return next->GetDaughter(0);
1105 }
1106 // cd up and pick next
1107 while (next) {
1108 next = GetNode(fLevel - 1);
1109 if (!next) {
1110 nd = fTop->GetNdaughters();
1111 if (fArray[fLevel] < nd - 1) {
1112 fArray[fLevel]++;
1113 if (fPlugin && fPluginAutoexec)
1115 return fTop->GetNode(fArray[fLevel]);
1116 }
1117 fMustStop = kTRUE;
1118 return nullptr;
1119 } else {
1120 nd = next->GetNdaughters();
1121 if (fArray[fLevel] < nd - 1) {
1122 fArray[fLevel]++;
1123 if (fPlugin && fPluginAutoexec)
1125 return next->GetDaughter(fArray[fLevel]);
1126 }
1127 }
1128 fLevel--;
1129 }
1130 break;
1131 case 1: // one level search
1132 if (mother)
1133 nd = mother->GetNdaughters();
1134 if (fArray[fLevel] < nd - 1) {
1135 fArray[fLevel]++;
1136 if (fPlugin && fPluginAutoexec)
1138 if (!mother)
1139 return fTop->GetNode(fArray[fLevel]);
1140 else
1141 return mother->GetDaughter(fArray[fLevel]);
1142 }
1143 }
1144 fMustStop = kTRUE;
1145 return nullptr;
1146}
1147
1148////////////////////////////////////////////////////////////////////////////////
1149/// Returns next node.
1150
1152{
1153 return Next();
1154}
1155
1156////////////////////////////////////////////////////////////////////////////////
1157/// Returns global matrix for current node.
1158
1160{
1161 fMatrix->Clear();
1162 if (!fLevel)
1163 return fMatrix;
1164 TGeoNode *node = fTop->GetNode(fArray[1]);
1165 fMatrix->Multiply(node->GetMatrix());
1166 for (Int_t i = 2; i < fLevel + 1; i++) {
1167 node = node->GetDaughter(fArray[i]);
1168 fMatrix->Multiply(node->GetMatrix());
1169 }
1170 return fMatrix;
1171}
1172
1173////////////////////////////////////////////////////////////////////////////////
1174/// Returns current node at a given level.
1175
1177{
1178 if (!level || level > fLevel)
1179 return nullptr;
1180 TGeoNode *node = fTop->GetNode(fArray[1]);
1181 for (Int_t i = 2; i < level + 1; i++)
1182 node = node->GetDaughter(fArray[i]);
1183 return node;
1184}
1185
1186////////////////////////////////////////////////////////////////////////////////
1187/// Returns the path for the current node.
1188
1190{
1191 path = fTopName;
1192 if (!fLevel)
1193 return;
1194 TGeoNode *node = fTop->GetNode(fArray[1]);
1195 path += "/";
1196 path += node->GetName();
1197 for (Int_t i = 2; i < fLevel + 1; i++) {
1198 node = node->GetDaughter(fArray[i]);
1199 path += "/";
1200 path += node->GetName();
1201 }
1202}
1203
1204////////////////////////////////////////////////////////////////////////////////
1205/// Increase by 30 the size of the array.
1206
1208{
1209 Int_t *array = new Int_t[fLevel + 30];
1210 memcpy(array, fArray, fLevel * sizeof(Int_t));
1211 delete[] fArray;
1212 fArray = array;
1213}
1214
1215////////////////////////////////////////////////////////////////////////////////
1216/// Resets the iterator for volume TOP.
1217
1219{
1220 if (top)
1221 fTop = top;
1222 fLevel = 0;
1224 fMustStop = kFALSE;
1225}
1226
1227////////////////////////////////////////////////////////////////////////////////
1228/// Set the top name for path
1229
1231{
1232 fTopName = name;
1233}
1234
1235////////////////////////////////////////////////////////////////////////////////
1236/// Stop iterating the current branch. The iteration of the next node will
1237/// behave as if the branch starting from the current node (included) is not existing.
1238
1240{
1242 TGeoNode *next = GetNode(fLevel);
1243 if (!next)
1244 return;
1245 Int_t nd;
1246 switch (fType) {
1247 case 0: // default next daughter behavior
1248 // cd up and pick next
1249 while (next) {
1250 next = GetNode(fLevel - 1);
1251 nd = (next == nullptr) ? fTop->GetNdaughters() : next->GetNdaughters();
1252 if (fArray[fLevel] < nd - 1) {
1253 ++fArray[fLevel];
1254 return;
1255 }
1256 fLevel--;
1257 if (!fLevel) {
1258 fMustStop = kTRUE;
1259 return;
1260 }
1261 }
1262 break;
1263 case 1: // one level search
1264 next = GetNode(fLevel - 1);
1265 nd = (next == nullptr) ? fTop->GetNdaughters() : next->GetNdaughters();
1266 if (fArray[fLevel] < nd - 1) {
1267 ++fArray[fLevel];
1268 return;
1269 }
1270 fMustStop = kTRUE;
1271 break;
1272 }
1273}
1274
1275////////////////////////////////////////////////////////////////////////////////
1276/// Set a plugin.
1277
1279{
1280 fPlugin = plugin;
1281 if (plugin)
1282 plugin->SetIterator(this);
1283}
#define b(i)
Definition RSha256.hxx:100
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t option
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 offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
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]
Definition TGX11.cxx:110
R__EXTERN TGeoManager * gGeoManager
R__EXTERN TGeoIdentity * gGeoIdentity
Definition TGeoMatrix.h:537
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
Bool_t IsVisStreamed() const
Definition TGeoAtt.h:90
Bool_t TestAttBit(UInt_t f) const
Definition TGeoAtt.h:64
Bool_t IsVisTouched() const
Definition TGeoAtt.h:91
void SetVisStreamed(Bool_t vis=kTRUE)
Mark attributes as "streamed to file".
Definition TGeoAtt.cxx:127
void SetVisDaughters(Bool_t vis=kTRUE)
Set visibility for the daughters.
Definition TGeoAtt.cxx:115
@ kVisOnScreen
Definition TGeoAtt.h:31
Bool_t IsVisDaughters() const
Definition TGeoAtt.h:84
virtual void SetVisibility(Bool_t vis=kTRUE)
Set visibility for this object.
Definition TGeoAtt.cxx:103
void SetVisTouched(Bool_t vis=kTRUE)
Mark visualization attributes as "modified".
Definition TGeoAtt.cxx:137
ABC for user objects attached to TGeoVolume or TGeoNode.
virtual TGeoExtension * Grab()=0
virtual void Release() const =0
Matrix class used for computing global transformations Should NOT be used for node definition.
Definition TGeoMatrix.h:458
void Clear(Option_t *option="") override
clear the data for this matrix
void Multiply(const TGeoMatrix *right)
multiply to the right with an other transformation if right is identity matrix, just return
virtual void ProcessNode()=0
A geometry iterator.
Definition TGeoNode.h:248
Int_t GetType() const
Definition TGeoNode.h:300
TGeoIterator & operator=(const TGeoIterator &iter)
Assignment.
void Reset(TGeoVolume *top=nullptr)
Resets the iterator for volume TOP.
TGeoIteratorPlugin * fPlugin
Definition TGeoNode.h:258
virtual ~TGeoIterator()
Destructor.
const TGeoMatrix * GetCurrentMatrix() const
Returns global matrix for current node.
Bool_t fMustStop
Definition TGeoNode.h:252
void SetTopName(const char *name)
Set the top name for path.
Bool_t fMustResume
Definition TGeoNode.h:251
Int_t fLevel
Definition TGeoNode.h:253
Bool_t fPluginAutoexec
Definition TGeoNode.h:259
Int_t fType
Definition TGeoNode.h:254
Int_t GetLevel() const
Definition TGeoNode.h:294
void GetPath(TString &path) const
Returns the path for the current node.
void IncreaseArray()
Increase by 30 the size of the array.
TGeoNode * GetNode(Int_t level) const
Returns current node at a given level.
TGeoNode * operator()()
Returns next node.
TGeoHMatrix * fMatrix
Definition TGeoNode.h:256
Int_t GetIndex(Int_t i) const
Definition TGeoNode.h:293
TGeoVolume * fTop
Definition TGeoNode.h:250
TGeoNode * Next()
Returns next node.
void SetUserPlugin(TGeoIteratorPlugin *plugin)
Set a plugin.
void Skip()
Stop iterating the current branch.
Int_t * fArray
Definition TGeoNode.h:255
TString fTopName
Definition TGeoNode.h:257
TGeoVolume * GetTopVolume() const
Definition TGeoNode.h:299
The manager class for any TGeo geometry.
Definition TGeoManager.h:45
void CdUp()
Go one level up in geometry.
TGeoNavigator * GetCurrentNavigator() const
Returns current navigator for the calling thread.
Bool_t IsClosed() const
TVirtualGeoPainter * GetGeomPainter()
Make a default painter if none present. Returns pointer to it.
TObjArray * GetListOfNodes()
void SetVisLevel(Int_t level=3)
set default level down to which visualization is performed
void SetCurrentPoint(Double_t *point)
TGeoNode * FindNode(Bool_t safe_start=kTRUE)
Returns deepest node containing current point.
const Double_t * GetCurrentPoint() const
void ModifiedPad() const
Send "Modified" signal to painter.
TGeoVolume * GetCurrentVolume() const
TVirtualGeoPainter * GetPainter() const
void MasterToLocal(const Double_t *master, Double_t *local) const
Geometrical transformation package.
Definition TGeoMatrix.h:38
virtual const Double_t * GetTranslation() const =0
Bool_t IsRotAboutZ() const
Returns true if no rotation or the rotation is about Z axis.
Class providing navigation API for TGeo geometries.
A node containing local transformation.
Definition TGeoNode.h:154
void SetMatrix(const TGeoMatrix *matrix)
Matrix setter.
Definition TGeoNode.cxx:828
TGeoNode * MakeCopyNode() const override
Make a copy of this node.
Definition TGeoNode.cxx:801
Int_t GetByteCount() const override
return the total size in bytes of this node
Definition TGeoNode.cxx:771
TGeoNodeMatrix()
Default constructor.
Definition TGeoNode.cxx:748
TGeoMatrix * fMatrix
Definition TGeoNode.h:156
~TGeoNodeMatrix() override
Destructor.
Definition TGeoNode.cxx:766
Int_t GetOptimalVoxels() const override
Returns type of optimal voxelization for this node.
Definition TGeoNode.cxx:783
Node containing an offset.
Definition TGeoNode.h:184
Double_t fOffset
Definition TGeoNode.h:186
void SetFinder(TGeoPatternFinder *finder)
Definition TGeoNode.h:210
TGeoPatternFinder * fFinder
Definition TGeoNode.h:188
TGeoPatternFinder * GetFinder() const override
Definition TGeoNode.h:203
~TGeoNodeOffset() override
Destructor.
Definition TGeoNode.cxx:866
TGeoNodeOffset()
Default constructor.
Definition TGeoNode.cxx:844
Int_t GetIndex() const override
Get the index of this offset.
Definition TGeoNode.cxx:871
TGeoNode * MakeCopyNode() const override
Make a copy of this node.
Definition TGeoNode.cxx:879
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
Definition TGeoNode.h:39
Bool_t IsOverlapping() const
Definition TGeoNode.h:107
void SetFWExtension(TGeoExtension *ext)
Connect framework defined extension to the node.
Definition TGeoNode.cxx:518
Bool_t IsVisDaughters() const
Definition TGeoNode.h:110
Bool_t IsOnScreen() const
check if this node is drawn. Assumes that this node is current
Definition TGeoNode.cxx:294
TGeoVolume * GetVolume() const
Definition TGeoNode.h:99
void SaveAttributes(std::ostream &out)
save attributes for this node
Definition TGeoNode.cxx:439
TGeoVolume * fVolume
Definition TGeoNode.h:41
void CheckShapes()
check for wrong parameters in shapes
Definition TGeoNode.cxx:329
void PrintOverlaps() const
print possible overlapping nodes
Definition TGeoNode.cxx:667
TGeoExtension * fFWExtension
Transient user-defined extension to volumes.
Definition TGeoNode.h:47
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
compute the closest distance of approach from point px,py to this node
Definition TGeoNode.cxx:251
TGeoNode()
Default constructor.
Definition TGeoNode.cxx:95
TGeoExtension * fUserExtension
Definition TGeoNode.h:46
Int_t * fOverlaps
Definition TGeoNode.h:45
Int_t fNovlp
Definition TGeoNode.h:44
void SetOverlapping(Bool_t flag=kTRUE)
Definition TGeoNode.h:120
TGeoExtension * GrabFWExtension() const
Get a copy of the framework extension pointer.
Definition TGeoNode.cxx:545
void SetOverlaps(Int_t *ovlp, Int_t novlp)
set the list of overlaps for this node (ovlp must be created with operator new)
Definition TGeoNode.cxx:707
void PrintCandidates() const
print daughters candidates for containing current point
Definition TGeoNode.cxx:616
void ls(Option_t *option="") const override
Print the path (A/B/C/...) to this node on stdout.
Definition TGeoNode.cxx:600
Int_t GetNdaughters() const
Definition TGeoNode.h:91
TGeoNode * GetDaughter(Int_t ind) const
Definition TGeoNode.h:83
virtual TGeoMatrix * GetMatrix() const =0
void SetVisibility(Bool_t vis=kTRUE) override
Set visibility of the node (obsolete).
Definition TGeoNode.cxx:718
Bool_t MayOverlap(Int_t iother) const
Check the overlab between the bounding box of the node overlaps with the one the brother with index I...
Definition TGeoNode.cxx:555
Bool_t IsVisible() const
Definition TGeoNode.h:109
void CopyOverlaps(Int_t *ovlp, Int_t novlp)
Transient framework-defined extension to volumes.
Definition TGeoNode.cxx:694
void SetMotherVolume(TGeoVolume *mother)
Definition TGeoNode.h:125
void SetUserExtension(TGeoExtension *ext)
Connect user-defined extension to the node.
Definition TGeoNode.cxx:500
virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const
Convert a vector from local reference system to mother reference.
Definition TGeoNode.cxx:592
void Browse(TBrowser *b) override
How-to-browse for a node.
Definition TGeoNode.cxx:147
void Paint(Option_t *option="") override
Paint this node and its content according to visualization settings.
Definition TGeoNode.cxx:605
void DrawOverlaps()
Method drawing the overlap candidates with this node.
Definition TGeoNode.cxx:363
virtual void LocalToMaster(const Double_t *local, Double_t *master) const
Convert the point coordinates from local reference system to mother reference.
Definition TGeoNode.cxx:584
Int_t CountDaughters(Bool_t unique_volumes=kFALSE)
Returns the number of daughters.
Definition TGeoNode.cxx:165
void DrawOnly(Option_t *option="")
draw only this node independently of its vis options
Definition TGeoNode.cxx:342
@ kGeoNodeOffset
Definition TGeoNode.h:58
void SetVirtual()
Definition TGeoNode.h:121
void Draw(Option_t *option="") override
draw current node according to option
Definition TGeoNode.cxx:350
void SetNumber(Int_t number)
Definition TGeoNode.h:118
virtual void MasterToLocal(const Double_t *master, Double_t *local) const
Convert the point coordinates from mother reference to local reference system.
Definition TGeoNode.cxx:568
TGeoExtension * GrabUserExtension() const
Get a copy of the user extension pointer.
Definition TGeoNode.cxx:533
Int_t FindNode(const TGeoNode *node, Int_t level)
Search for a node within the branch of this one.
Definition TGeoNode.cxx:411
void VisibleDaughters(Bool_t vis=kTRUE)
Set visibility of the daughters (obsolete).
Definition TGeoNode.cxx:731
void FillIdArray(Int_t &ifree, Int_t &nodeid, Int_t *array) const
Fill array with node id. Recursive on node branch.
Definition TGeoNode.cxx:392
Int_t fNumber
Definition TGeoNode.h:43
virtual void MasterToLocalVect(const Double_t *master, Double_t *local) const
Convert a vector from mother reference to local reference system.
Definition TGeoNode.cxx:576
char * GetObjectInfo(Int_t px, Int_t py) const override
Get node info for the browser.
Definition TGeoNode.cxx:281
Bool_t IsVirtual() const
Definition TGeoNode.h:108
~TGeoNode() override
Destructor.
Definition TGeoNode.cxx:130
void SetCloned(Bool_t flag=kTRUE)
Definition TGeoNode.h:119
void CheckOverlaps(Double_t ovlp=0.1, Option_t *option="")
Check overlaps bigger than OVLP hierarchically, starting with this node.
Definition TGeoNode.cxx:192
void InspectNode() const
Inspect this node.
Definition TGeoNode.cxx:304
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute mouse actions on this volume.
Definition TGeoNode.cxx:268
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const
computes the closest distance from given point to this shape
Definition TGeoNode.cxx:684
TGeoVolume * fMother
Definition TGeoNode.h:42
base finder class for patterns. A pattern is specifying a division type
virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const =0
virtual Bool_t IsCylType() const =0
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:43
void SetVisibility(Bool_t vis=kTRUE) override
set visibility of this volume
void Print(Option_t *option="") const override
Print volume info.
Bool_t IsSelected() const
Definition TGeoVolume.h:150
TGeoManager * GetGeoManager() const
Definition TGeoVolume.h:173
Bool_t Contains(const Double_t *point) const
Definition TGeoVolume.h:104
void Draw(Option_t *option="") override
draw top volume according to option
Int_t GetNdaughters() const
Definition TGeoVolume.h:362
void SelectVolume(Bool_t clear=kFALSE)
Select this volume as matching an arbitrary criteria.
TObjArray * GetNodes()
Definition TGeoVolume.h:169
TGeoNode * GetNode(const char *name) const
get the pointer to a daughter node
void CheckShapes()
check for negative parameters in shapes.
TGeoPatternFinder * GetFinder() const
Definition TGeoVolume.h:177
TGeoVoxelFinder * GetVoxels() const
Getter for optimization structure.
TGeoShape * GetShape() const
Definition TGeoVolume.h:190
void SetAdded()
Definition TGeoVolume.h:215
void SetReplicated()
Definition TGeoVolume.h:216
virtual void DrawOnly(Option_t *option="")
draw only this volume
virtual Bool_t IsVisible() const
Definition TGeoVolume.h:155
Bool_t IsAdded() const
Definition TGeoVolume.h:147
void CheckOverlaps(Double_t ovlp=0.1, Option_t *option="") const
Overlap checking tool.
Finder class handling voxels.
void Reset()
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition TNamed.cxx:173
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:50
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition TNamed.cxx:149
An array of TObjects.
Definition TObjArray.h:31
Int_t GetEntriesFast() const
Definition TObjArray.h:58
void AddAt(TObject *obj, Int_t idx) override
Add object at position ids.
TObject * At(Int_t idx) const override
Definition TObjArray.h:164
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:864
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1071
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition TObject.cxx:1045
Stopwatch class.
Definition TStopwatch.h:28
Basic string class.
Definition TString.h:138
void ToLower()
Change string to lower-case.
Definition TString.cxx:1189
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2384
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:640
Abstract class for geometry painters.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:124
Statefull info for the current geometry level.