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
92
93////////////////////////////////////////////////////////////////////////////////
94/// Default constructor
95
97{
98 fVolume = nullptr;
99 fMother = nullptr;
100 fNumber = 0;
101 fNovlp = 0;
102 fOverlaps = nullptr;
103 fUserExtension = nullptr;
104 fFWExtension = nullptr;
105}
106
107////////////////////////////////////////////////////////////////////////////////
108/// Constructor
109
111{
112 if (!vol) {
113 Error("ctor", "volume not specified");
114 return;
115 }
116 fVolume = (TGeoVolume *)vol;
117 if (fVolume->IsAdded())
119 fVolume->SetAdded();
120 fMother = nullptr;
121 fNumber = 0;
122 fNovlp = 0;
123 fOverlaps = nullptr;
124 fUserExtension = nullptr;
125 fFWExtension = nullptr;
126}
127
128////////////////////////////////////////////////////////////////////////////////
129/// Destructor
130
132{
133 if (fOverlaps)
134 delete[] fOverlaps;
135 if (fUserExtension) {
137 fUserExtension = nullptr;
138 }
139 if (fFWExtension) {
141 fFWExtension = nullptr;
142 }
143}
144
145////////////////////////////////////////////////////////////////////////////////
146/// How-to-browse for a node.
147
149{
150 if (!b)
151 return;
152 if (!GetNdaughters())
153 return;
155 TString title;
156 for (Int_t i = 0; i < GetNdaughters(); i++) {
158 b->Add(daughter, daughter->GetName(), daughter->IsVisible());
159 }
160}
161
162////////////////////////////////////////////////////////////////////////////////
163/// Returns the number of daughters. Nodes pointing to same volume counted
164/// once if unique_volumes is set.
165
167{
168 static Int_t icall = 0;
169 Int_t counter = 0;
170 // Count this node
171 if (unique_volumes) {
172 if (!fVolume->IsSelected()) {
173 counter++;
175 }
176 } else
177 counter++;
178 icall++;
180 // Count daughters recursively
181 for (Int_t i = 0; i < nd; i++)
183 icall--;
184 // Un-mark volumes
185 if (icall == 0)
187 return counter;
188}
189
190////////////////////////////////////////////////////////////////////////////////
191/// Check overlaps bigger than OVLP hierarchically, starting with this node.
192
194{
195 Int_t icheck = 0;
196 Int_t ncheck = 0;
198 Int_t i;
200 TString opt(option);
201 opt.ToLower();
202 if (opt.Contains("s"))
203 sampling = kTRUE;
204
207 timer = new TStopwatch();
208 geom->ClearOverlaps();
209 geom->SetCheckingOverlaps(kTRUE);
210 Info("CheckOverlaps", "Checking overlaps for %s and daughters within %g", fVolume->GetName(), ovlp);
211 if (sampling) {
212 Info("CheckOverlaps", "Checking overlaps by sampling <%s> for %s and daughters", option, fVolume->GetName());
213 Info("CheckOverlaps", "=== NOTE: Extrusions NOT checked with sampling option ! ===");
214 }
215 timer->Start();
216 geom->GetGeomChecker()->OpProgress(fVolume->GetName(), icheck, ncheck, timer, kFALSE);
218 icheck++;
219 TGeoIterator next(fVolume);
220 TGeoNode *node;
221 TString path;
222 TObjArray *overlaps = geom->GetListOfOverlaps();
224 TString msg;
225 while ((node = next())) {
226 next.GetPath(path);
227 icheck++;
228 if (!node->GetVolume()->IsSelected()) {
229 msg = TString::Format("found %d overlaps", overlaps->GetEntriesFast());
230 geom->GetGeomChecker()->OpProgress(node->GetVolume()->GetName(), icheck, ncheck, timer, kFALSE, msg);
231 node->GetVolume()->SelectVolume(kFALSE);
233 }
234 }
236 geom->SetCheckingOverlaps(kFALSE);
237 geom->SortOverlaps();
238 novlps = overlaps->GetEntriesFast();
239 TNamed *obj;
240 for (i = 0; i < novlps; i++) {
241 obj = (TNamed *)overlaps->At(i);
242 obj->SetName(TString::Format("ov%05d", i));
243 }
244 geom->GetGeomChecker()->OpProgress("Check overlaps:", icheck, ncheck, timer, kTRUE);
245 Info("CheckOverlaps", "Number of illegal overlaps/extrusions : %d\n", novlps);
246 delete timer;
247}
248
249////////////////////////////////////////////////////////////////////////////////
250/// compute the closest distance of approach from point px,py to this node
251
253{
254 Int_t dist = 9999;
255 if (!fVolume)
256 return dist;
260 if (!painter)
261 return dist;
262 dist = painter->DistanceToPrimitiveVol(fVolume, px, py);
263 return dist;
264}
265
266////////////////////////////////////////////////////////////////////////////////
267/// Execute mouse actions on this volume.
268
270{
271 if (!fVolume)
272 return;
274 if (!painter)
275 return;
276 painter->ExecuteVolumeEvent(fVolume, event, px, py);
277}
278
279////////////////////////////////////////////////////////////////////////////////
280/// Get node info for the browser.
281
283{
284 if (!fVolume)
285 return nullptr;
287 if (!painter)
288 return nullptr;
289 return (char *)painter->GetVolumeInfo(fVolume, px, py);
290}
291
292////////////////////////////////////////////////////////////////////////////////
293/// check if this node is drawn. Assumes that this node is current
294
296{
298 return kTRUE;
299 return kFALSE;
300}
301
302////////////////////////////////////////////////////////////////////////////////
303/// Inspect this node.
304
306{
307 printf("== Inspecting node %s ", GetName());
308 if (fMother)
309 printf("mother volume %s. ", fMother->GetName());
310 if (IsOverlapping())
311 printf("(Node is MANY)\n");
312 else
313 printf("\n");
314 if (fOverlaps && fMother) {
315 printf(" possibly overlapping with : ");
316 for (Int_t i = 0; i < fNovlp; i++)
317 printf(" %s ", fMother->GetNode(fOverlaps[i])->GetName());
318 printf("\n");
319 }
320 printf("Transformation matrix:\n");
322 if (GetMatrix())
323 matrix->Print();
324 fVolume->Print();
325}
326
327////////////////////////////////////////////////////////////////////////////////
328/// check for wrong parameters in shapes
329
331{
333 Int_t nd = GetNdaughters();
334 if (!nd)
335 return;
336 for (Int_t i = 0; i < nd; i++)
338}
339
340////////////////////////////////////////////////////////////////////////////////
341/// draw only this node independently of its vis options
342
347
348////////////////////////////////////////////////////////////////////////////////
349/// draw current node according to option
350
360
361////////////////////////////////////////////////////////////////////////////////
362/// Method drawing the overlap candidates with this node.
363
365{
366 if (!fNovlp) {
367 printf("node %s is ONLY\n", GetName());
368 return;
369 }
370 if (!fOverlaps) {
371 printf("node %s no overlaps\n", GetName());
372 return;
373 }
374 TGeoNode *node;
375 Int_t i;
377 for (i = 0; i < nd; i++) {
378 node = fMother->GetNode(i);
380 }
382 for (i = 0; i < fNovlp; i++) {
383 node = fMother->GetNode(fOverlaps[i]);
384 node->GetVolume()->SetVisibility(kTRUE);
385 }
387 fMother->Draw();
388}
389
390////////////////////////////////////////////////////////////////////////////////
391/// Fill array with node id. Recursive on node branch.
392
393void TGeoNode::FillIdArray(Int_t &ifree, Int_t &nodeid, Int_t *array) const
394{
395 Int_t nd = GetNdaughters();
396 if (!nd)
397 return;
399 Int_t istart = ifree; // start index for daughters
400 ifree += nd;
401 for (Int_t id = 0; id < nd; id++) {
402 daughter = GetDaughter(id);
403 array[istart + id] = ifree;
404 array[ifree++] = ++nodeid;
405 daughter->FillIdArray(ifree, nodeid, array);
406 }
407}
408
409////////////////////////////////////////////////////////////////////////////////
410/// Search for a node within the branch of this one.
411
413{
414 Int_t nd = GetNdaughters();
415 if (!nd)
416 return -1;
417 TIter next(fVolume->GetNodes());
419 while ((daughter = (TGeoNode *)next())) {
420 if (daughter == node) {
422 return (level + 1);
423 }
424 }
425 next.Reset();
427 while ((daughter = (TGeoNode *)next())) {
428 new_level = daughter->FindNode(node, level + 1);
429 if (new_level >= 0) {
431 return new_level;
432 }
433 }
434 return -1;
435}
436
437////////////////////////////////////////////////////////////////////////////////
438/// save attributes for this node
439
440void TGeoNode::SaveAttributes(std::ostream &out)
441{
442 if (IsVisStreamed())
443 return;
445 char quote = '"';
447 if ((fVolume->IsVisTouched()) && (!fVolume->IsVisStreamed())) {
449 out << " vol = gGeoManager->GetVolume(" << quote << fVolume->GetName() << quote << ");" << std::endl;
450 voldef = kTRUE;
451 if (!fVolume->IsVisDaughters())
452 out << " vol->SetVisDaughters(kFALSE);" << std::endl;
453 if (fVolume->IsVisible()) {
454 /*
455 if (fVolume->GetLineColor() != gStyle->GetLineColor())
456 out<<" vol->SetLineColor("<<fVolume->GetLineColor()<<");"<<std::endl;
457 if (fVolume->GetLineStyle() != gStyle->GetLineStyle())
458 out<<" vol->SetLineStyle("<<fVolume->GetLineStyle()<<");"<<std::endl;
459 if (fVolume->GetLineWidth() != gStyle->GetLineWidth())
460 out<<" vol->SetLineWidth("<<fVolume->GetLineWidth()<<");"<<std::endl;
461 */
462 } else {
463 out << " vol->SetVisibility(kFALSE);" << std::endl;
464 }
465 }
466 if (!IsVisDaughters())
467 return;
468 Int_t nd = GetNdaughters();
469 if (!nd)
470 return;
471 TGeoNode *node;
472 for (Int_t i = 0; i < nd; i++) {
473 node = GetDaughter(i);
474 if (node->IsVisStreamed())
475 continue;
476 if (node->IsVisTouched()) {
477 if (!voldef)
478 out << " vol = gGeoManager->GetVolume(" << quote << fVolume->GetName() << quote << ");" << std::endl;
479 out << " node = vol->GetNode(" << i << ");" << std::endl;
480 if (!node->IsVisDaughters()) {
481 out << " node->VisibleDaughters(kFALSE);" << std::endl;
482 node->SetVisStreamed(kTRUE);
483 continue;
484 }
485 if (!node->IsVisible())
486 out << " node->SetVisibility(kFALSE);" << std::endl;
487 }
488 node->SaveAttributes(out);
489 node->SetVisStreamed(kTRUE);
490 }
491}
492
493////////////////////////////////////////////////////////////////////////////////
494/// Connect user-defined extension to the node. The node "grabs" a copy, so
495/// the original object can be released by the producer. Release the previously
496/// connected extension if any.
497///
498/// NOTE: This interface is intended for user extensions and is guaranteed not
499/// to be used by TGeo
500
502{
504 fUserExtension = nullptr;
505 if (ext)
506 fUserExtension = ext->Grab();
507 if (tmp)
508 tmp->Release();
509}
510
511////////////////////////////////////////////////////////////////////////////////
512/// Connect framework defined extension to the node. The node "grabs" a copy,
513/// so the original object can be released by the producer. Release the previously
514/// connected extension if any.
515///
516/// NOTE: This interface is intended for the use by TGeo and the users should
517/// NOT connect extensions using this method
518
520{
522 fFWExtension = nullptr;
523 if (ext)
524 fFWExtension = ext->Grab();
525 if (tmp)
526 tmp->Release();
527}
528
529////////////////////////////////////////////////////////////////////////////////
530/// Get a copy of the user extension pointer. The user must call Release() on
531/// the copy pointer once this pointer is not needed anymore (equivalent to
532/// delete() after calling new())
533
535{
536 if (fUserExtension)
537 return fUserExtension->Grab();
538 return nullptr;
539}
540
541////////////////////////////////////////////////////////////////////////////////
542/// Get a copy of the framework extension pointer. The user must call Release() on
543/// the copy pointer once this pointer is not needed anymore (equivalent to
544/// delete() after calling new())
545
547{
548 if (fFWExtension)
549 return fFWExtension->Grab();
550 return nullptr;
551}
552////////////////////////////////////////////////////////////////////////////////
553/// Check the overlab between the bounding box of the node overlaps with the one
554/// the brother with index IOTHER.
555
557{
558 if (!fOverlaps)
559 return kFALSE;
560 for (Int_t i = 0; i < fNovlp; i++)
561 if (fOverlaps[i] == iother)
562 return kTRUE;
563 return kFALSE;
564}
565
566////////////////////////////////////////////////////////////////////////////////
567/// Convert the point coordinates from mother reference to local reference system
568
570{
571 GetMatrix()->MasterToLocal(master, local);
572}
573
574////////////////////////////////////////////////////////////////////////////////
575/// Convert a vector from mother reference to local reference system
576
578{
579 GetMatrix()->MasterToLocalVect(master, local);
580}
581
582////////////////////////////////////////////////////////////////////////////////
583/// Convert the point coordinates from local reference system to mother reference
584
586{
587 GetMatrix()->LocalToMaster(local, master);
588}
589
590////////////////////////////////////////////////////////////////////////////////
591/// Convert a vector from local reference system to mother reference
592
594{
595 GetMatrix()->LocalToMasterVect(local, master);
596}
597
598////////////////////////////////////////////////////////////////////////////////
599/// Print the path (A/B/C/...) to this node on stdout
600
601void TGeoNode::ls(Option_t * /*option*/) const {}
602
603////////////////////////////////////////////////////////////////////////////////
604/// Paint this node and its content according to visualization settings.
605
607{
609 if (!painter)
610 return;
611 painter->PaintNode(this, option);
612}
613
614////////////////////////////////////////////////////////////////////////////////
615/// print daughters candidates for containing current point
616
618{
619 Double_t point[3];
621 printf(" Local : %g, %g, %g\n", point[0], point[1], point[2]);
622 if (!fVolume->Contains(&point[0])) {
623 printf("current point not inside this\n");
624 return;
625 }
627 TGeoNode *node;
628 if (finder) {
629 printf("current node divided\n");
630 node = finder->FindNode(&point[0]);
631 if (!node) {
632 printf("point not inside division element\n");
633 return;
634 }
635 printf("inside division element %s\n", node->GetName());
636 return;
637 }
639 if (!voxels) {
640 printf("volume not voxelized\n");
641 return;
642 }
643 Int_t ncheck = 0;
645 TGeoStateInfo &info = *nav->GetCache()->GetInfo();
646 Int_t *check_list = voxels->GetCheckList(&point[0], ncheck, info);
647 nav->GetCache()->ReleaseInfo();
648 voxels->PrintVoxelLimits(&point[0]);
649 if (!check_list) {
650 printf("no candidates for current point\n");
651 return;
652 }
653 TString overlap = "ONLY";
654 for (Int_t id = 0; id < ncheck; id++) {
655 node = fVolume->GetNode(check_list[id]);
656 if (node->IsOverlapping())
657 overlap = "MANY";
658 else
659 overlap = "ONLY";
660 printf("%i %s %s\n", check_list[id], node->GetName(), overlap.Data());
661 }
663}
664
665////////////////////////////////////////////////////////////////////////////////
666/// print possible overlapping nodes
667
669{
670 if (!fOverlaps) {
671 printf("node %s no overlaps\n", GetName());
672 return;
673 }
674 printf("Overlaps for node %s :\n", GetName());
675 TGeoNode *node;
676 for (Int_t i = 0; i < fNovlp; i++) {
677 node = fMother->GetNode(fOverlaps[i]);
678 printf(" %s\n", node->GetName());
679 }
680}
681
682////////////////////////////////////////////////////////////////////////////////
683/// computes the closest distance from given point to this shape
684
686{
687 Double_t local[3];
688 GetMatrix()->MasterToLocal(point, local);
689 return fVolume->GetShape()->Safety(local, in);
690}
691
692////////////////////////////////////////////////////////////////////////////////
693/// Copy content of lst of overlaps from source array
694
696{
697 Int_t *ovlps = nullptr;
698 if (src && (novlp > 0)) {
699 ovlps = new Int_t[novlp];
700 memcpy(ovlps, src, novlp * sizeof(Int_t));
701 }
703}
704
705////////////////////////////////////////////////////////////////////////////////
706/// set the list of overlaps for this node (ovlp must be created with operator new)
707
709{
710 if (fOverlaps)
711 delete[] fOverlaps;
712 fOverlaps = ovlp;
713 fNovlp = novlp;
714}
715
716////////////////////////////////////////////////////////////////////////////////
717/// Set visibility of the node (obsolete).
718
720{
721 if (gGeoManager->IsClosed())
724 if (vis && !fVolume->IsVisible())
727}
728
729////////////////////////////////////////////////////////////////////////////////
730/// Set visibility of the daughters (obsolete).
731
739
740/** \class TGeoNodeMatrix
741\ingroup Geometry_classes
742A node containing local transformation.
743*/
744
746
747////////////////////////////////////////////////////////////////////////////////
748/// Default constructor
749
751{
752 fMatrix = nullptr;
753}
754
755////////////////////////////////////////////////////////////////////////////////
756/// Constructor.
757
764
765////////////////////////////////////////////////////////////////////////////////
766/// Destructor
767
769
770////////////////////////////////////////////////////////////////////////////////
771/// return the total size in bytes of this node
772
774{
775 Int_t count = 40 + 4; // TGeoNode + fMatrix
776 // if (fMatrix) count += fMatrix->GetByteCount();
777 return count;
778}
779
780////////////////////////////////////////////////////////////////////////////////
781/// Returns type of optimal voxelization for this node.
782/// - type = 0 -> cartesian
783/// - type = 1 -> cylindrical
784
786{
788 if (!type)
789 return 0;
790 if (!fMatrix->IsRotAboutZ())
791 return 0;
793 if (TMath::Abs(transl[0]) > 1E-10)
794 return 0;
795 if (TMath::Abs(transl[1]) > 1E-10)
796 return 0;
797 return 1;
798}
799
800////////////////////////////////////////////////////////////////////////////////
801/// Make a copy of this node.
802
804{
806 node->SetName(GetName());
807 node->SetTitle(GetTitle());
808 // set the mother
810 // set the copy number
811 node->SetNumber(fNumber);
812 // copy overlaps
814
815 // copy VC
816 if (IsVirtual())
817 node->SetVirtual();
818 if (IsOverlapping())
819 node->SetOverlapping(); // <--- ADDED
820 // Copy extensions
823 node->SetCloned();
824 return node;
825}
826
827////////////////////////////////////////////////////////////////////////////////
828/// Matrix setter.
829
836
837/** \class TGeoNodeOffset
838\ingroup Geometry_classes
839Node containing an offset.
840*/
841
843
844////////////////////////////////////////////////////////////////////////////////
845/// Default constructor
846
848{
850 fOffset = 0;
851 fIndex = 0;
852 fFinder = nullptr;
853}
854
855////////////////////////////////////////////////////////////////////////////////
856/// Constructor. Null pointer to matrix means identity transformation
857
865
866////////////////////////////////////////////////////////////////////////////////
867/// Destructor
868
870
871////////////////////////////////////////////////////////////////////////////////
872/// Get the index of this offset.
873
875{
876 return (fIndex + fFinder->GetDivIndex());
877}
878
879////////////////////////////////////////////////////////////////////////////////
880/// Make a copy of this node
881
883{
885 node->SetName(GetName());
886 node->SetTitle(GetTitle());
887 // set the mother
889 // set the copy number
890 node->SetNumber(fNumber);
891 if (IsVirtual())
892 node->SetVirtual();
893 // set the finder
894 node->SetFinder(GetFinder());
895 // set extensions
898 return node;
899}
900
901/** \class TGeoIterator
902\ingroup Geometry_classes
903A geometry iterator.
904
905A geometry iterator that sequentially follows all nodes of the geometrical
906hierarchy of a volume. The iterator has to be initiated with a top volume
907pointer:
908
909~~~ {.cpp}
910 TGeoIterator next(myVolume);
911~~~
912
913One can use the iterator as any other in ROOT:
914
915~~~ {.cpp}
916 TGeoNode *node;
917 while ((node=next())) {
918 ...
919 }
920~~~
921
922The iterator can perform 2 types of iterations that can be selected via:
923
924~~~ {.cpp}
925 next.SetType(Int_t type);
926~~~
927
928Here TYPE can be:
929 - 0 (default) - 'first daughter next' behavior
930 - 1 - iteration at the current level only
931
932Supposing the tree structure looks like:
933
934~~~ {.cpp}
935TOP ___ A_1 ___ A1_1 ___ A11_1
936 | | |___ A12_1
937 | |_____A2_1 ___ A21_1
938 | |___ A21_2
939 |___ B_1 ...
940~~~
941
942The order of iteration for TYPE=0 is: A_1, A1_1, A11_1, A12_1, A2_1, A21_1,
943A21_2, B_1, ...
944
945The order of iteration for TYPE=1 is: A_1, B_1, ...
946At any moment during iteration, TYPE can be changed. If the last iterated node
947is for instance A1_1 and the iteration type was 0, one can do:
948
949~~~ {.cpp}
950 next.SetType(1);
951~~~
952
953The next iterated nodes will be the rest of A daughters: A2,A3,... The iterator
954will return 0 after finishing all daughters of A.
955
956During iteration, the following can be retrieved:
957 - Top volume where iteration started: TGeoIterator::GetTopVolume()
958 - Node at level I in the current branch: TGeoIterator::GetNode(Int_t i)
959 - Iteration type: TGeoIterator::GetType()
960 - Global matrix of the current node with respect to the top volume:
961 TGeoIterator::GetCurrentMatrix()
962
963The iterator can be reset by changing (or not) the top volume:
964
965~~~ {.cpp}
966 TGeoIterator::Reset(TGeoVolume *top);
967~~~
968
969### Example:
970
971We want to find out a volume named "MyVol" in the hierarchy of TOP volume.
972
973~~~ {.cpp}
974 TIter next(TOP);
975 TGeoNode *node;
976 TString name("MyVol");
977 while ((node=next()))
978 if (name == node->GetVolume()->GetName()) return node->GetVolume();
979~~~
980*/
981
982/** \class TGeoIteratorPlugin
983\ingroup Geometry_classes
984*/
985
988
989////////////////////////////////////////////////////////////////////////////////
990/// Geometry iterator for a branch starting with a TOP node.
991
993{
994 fTop = top;
995 fLevel = 0;
998 fType = 0;
999 fArray = new Int_t[30];
1000 fMatrix = new TGeoHMatrix();
1001 fTopName = fTop->GetName();
1002 fPlugin = nullptr;
1004}
1005
1006////////////////////////////////////////////////////////////////////////////////
1007/// Copy ctor.
1008
1010{
1011 fTop = iter.GetTopVolume();
1012 fLevel = iter.GetLevel();
1014 fMustStop = kFALSE;
1015 fType = iter.GetType();
1016 fArray = new Int_t[30 + 30 * Int_t(fLevel / 30)];
1017 for (Int_t i = 0; i < fLevel + 1; i++)
1018 fArray[i] = iter.GetIndex(i);
1019 fMatrix = new TGeoHMatrix(*iter.GetCurrentMatrix());
1020 fTopName = fTop->GetName();
1021 fPlugin = iter.fPlugin;
1023 ;
1024}
1025
1026////////////////////////////////////////////////////////////////////////////////
1027/// Destructor.
1028
1030{
1031 if (fArray)
1032 delete[] fArray;
1033 delete fMatrix;
1034}
1035
1036////////////////////////////////////////////////////////////////////////////////
1037/// Assignment.
1038
1040{
1041 if (&iter == this)
1042 return *this;
1043 fTop = iter.GetTopVolume();
1044 fLevel = iter.GetLevel();
1046 fMustStop = kFALSE;
1047 fType = iter.GetType();
1048 if (fArray)
1049 delete[] fArray;
1050 fArray = new Int_t[30 + 30 * Int_t(fLevel / 30)];
1051 for (Int_t i = 0; i < fLevel + 1; i++)
1052 fArray[i] = iter.GetIndex(i);
1053 if (!fMatrix)
1054 fMatrix = new TGeoHMatrix();
1055 *fMatrix = *iter.GetCurrentMatrix();
1056 fTopName = fTop->GetName();
1057 fPlugin = iter.fPlugin;
1059 ;
1060 return *this;
1061}
1062
1063////////////////////////////////////////////////////////////////////////////////
1064/// Returns next node.
1065
1067{
1068 if (fMustStop)
1069 return nullptr;
1070 TGeoNode *mother = nullptr;
1071 TGeoNode *next = nullptr;
1072 Int_t i;
1073 Int_t nd = fTop->GetNdaughters();
1074 if (!nd) {
1075 fMustStop = kTRUE;
1076 return nullptr;
1077 }
1078 if (!fLevel) {
1079 fArray[++fLevel] = 0;
1080 next = fTop->GetNode(0);
1081 if (fPlugin && fPluginAutoexec)
1083 return next;
1084 }
1085 next = fTop->GetNode(fArray[1]);
1086 // Move to current node
1087 for (i = 2; i < fLevel + 1; i++) {
1088 mother = next;
1089 next = mother->GetDaughter(fArray[i]);
1090 }
1091 if (fMustResume) {
1093 if (fPlugin && fPluginAutoexec)
1095 return next;
1096 }
1097
1098 switch (fType) {
1099 case 0: // default next daughter behavior
1100 nd = next->GetNdaughters();
1101 if (nd) {
1102 // First daughter next
1103 fLevel++;
1104 if ((fLevel % 30) == 0)
1105 IncreaseArray();
1106 fArray[fLevel] = 0;
1107 if (fPlugin && fPluginAutoexec)
1109 return next->GetDaughter(0);
1110 }
1111 // cd up and pick next
1112 while (next) {
1113 next = GetNode(fLevel - 1);
1114 if (!next) {
1115 nd = fTop->GetNdaughters();
1116 if (fArray[fLevel] < nd - 1) {
1117 fArray[fLevel]++;
1118 if (fPlugin && fPluginAutoexec)
1120 return fTop->GetNode(fArray[fLevel]);
1121 }
1122 fMustStop = kTRUE;
1123 return nullptr;
1124 } else {
1125 nd = next->GetNdaughters();
1126 if (fArray[fLevel] < nd - 1) {
1127 fArray[fLevel]++;
1128 if (fPlugin && fPluginAutoexec)
1130 return next->GetDaughter(fArray[fLevel]);
1131 }
1132 }
1133 fLevel--;
1134 }
1135 break;
1136 case 1: // one level search
1137 if (mother)
1138 nd = mother->GetNdaughters();
1139 if (fArray[fLevel] < nd - 1) {
1140 fArray[fLevel]++;
1141 if (fPlugin && fPluginAutoexec)
1143 if (!mother)
1144 return fTop->GetNode(fArray[fLevel]);
1145 else
1146 return mother->GetDaughter(fArray[fLevel]);
1147 }
1148 }
1149 fMustStop = kTRUE;
1150 return nullptr;
1151}
1152
1153////////////////////////////////////////////////////////////////////////////////
1154/// Returns next node.
1155
1157{
1158 return Next();
1159}
1160
1161////////////////////////////////////////////////////////////////////////////////
1162/// Returns global matrix for current node.
1163
1165{
1166 fMatrix->Clear();
1167 if (!fLevel)
1168 return fMatrix;
1169 TGeoNode *node = fTop->GetNode(fArray[1]);
1170 fMatrix->Multiply(node->GetMatrix());
1171 for (Int_t i = 2; i < fLevel + 1; i++) {
1172 node = node->GetDaughter(fArray[i]);
1173 fMatrix->Multiply(node->GetMatrix());
1174 }
1175 return fMatrix;
1176}
1177
1178////////////////////////////////////////////////////////////////////////////////
1179/// Returns current node at a given level.
1180
1182{
1183 if (!level || level > fLevel)
1184 return nullptr;
1185 TGeoNode *node = fTop->GetNode(fArray[1]);
1186 for (Int_t i = 2; i < level + 1; i++)
1187 node = node->GetDaughter(fArray[i]);
1188 return node;
1189}
1190
1191////////////////////////////////////////////////////////////////////////////////
1192/// Returns the path for the current node.
1193
1195{
1196 path = fTopName;
1197 if (!fLevel)
1198 return;
1199 TGeoNode *node = fTop->GetNode(fArray[1]);
1200 path += "/";
1201 path += node->GetName();
1202 for (Int_t i = 2; i < fLevel + 1; i++) {
1203 node = node->GetDaughter(fArray[i]);
1204 path += "/";
1205 path += node->GetName();
1206 }
1207}
1208
1209////////////////////////////////////////////////////////////////////////////////
1210/// Increase by 30 the size of the array.
1211
1213{
1214 Int_t *array = new Int_t[fLevel + 30];
1215 memcpy(array, fArray, fLevel * sizeof(Int_t));
1216 delete[] fArray;
1217 fArray = array;
1218}
1219
1220////////////////////////////////////////////////////////////////////////////////
1221/// Resets the iterator for volume TOP.
1222
1224{
1225 if (top)
1226 fTop = top;
1227 fLevel = 0;
1229 fMustStop = kFALSE;
1230}
1231
1232////////////////////////////////////////////////////////////////////////////////
1233/// Set the top name for path
1234
1236{
1237 fTopName = name;
1238}
1239
1240////////////////////////////////////////////////////////////////////////////////
1241/// Stop iterating the current branch. The iteration of the next node will
1242/// behave as if the branch starting from the current node (included) is not existing.
1243
1245{
1247 TGeoNode *next = GetNode(fLevel);
1248 if (!next)
1249 return;
1250 Int_t nd;
1251 switch (fType) {
1252 case 0: // default next daughter behavior
1253 // cd up and pick next
1254 while (next) {
1255 next = GetNode(fLevel - 1);
1256 nd = (next == nullptr) ? fTop->GetNdaughters() : next->GetNdaughters();
1257 if (fArray[fLevel] < nd - 1) {
1258 ++fArray[fLevel];
1259 return;
1260 }
1261 fLevel--;
1262 if (!fLevel) {
1263 fMustStop = kTRUE;
1264 return;
1265 }
1266 }
1267 break;
1268 case 1: // one level search
1269 next = GetNode(fLevel - 1);
1270 nd = (next == nullptr) ? fTop->GetNdaughters() : next->GetNdaughters();
1271 if (fArray[fLevel] < nd - 1) {
1272 ++fArray[fLevel];
1273 return;
1274 }
1275 fMustStop = kTRUE;
1276 break;
1277 }
1278}
1279
1280////////////////////////////////////////////////////////////////////////////////
1281/// Set a plugin.
1282
1284{
1285 fPlugin = plugin;
1286 if (plugin)
1287 plugin->SetIterator(this);
1288}
#define b(i)
Definition RSha256.hxx:100
int Int_t
Definition RtypesCore.h:45
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:374
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:128
void SetVisDaughters(Bool_t vis=kTRUE)
Set visibility for the daughters.
Definition TGeoAtt.cxx:116
@ 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:104
void SetVisTouched(Bool_t vis=kTRUE)
Mark visualization attributes as "modified".
Definition TGeoAtt.cxx:138
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:830
TGeoNode * MakeCopyNode() const override
Make a copy of this node.
Definition TGeoNode.cxx:803
Int_t GetByteCount() const override
return the total size in bytes of this node
Definition TGeoNode.cxx:773
TGeoNodeMatrix()
Default constructor.
Definition TGeoNode.cxx:750
TGeoMatrix * fMatrix
Definition TGeoNode.h:156
~TGeoNodeMatrix() override
Destructor.
Definition TGeoNode.cxx:768
Int_t GetOptimalVoxels() const override
Returns type of optimal voxelization for this node.
Definition TGeoNode.cxx:785
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:869
TGeoNodeOffset()
Default constructor.
Definition TGeoNode.cxx:847
Int_t GetIndex() const override
Get the index of this offset.
Definition TGeoNode.cxx:874
TGeoNode * MakeCopyNode() const override
Make a copy of this node.
Definition TGeoNode.cxx:882
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:519
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:295
TGeoVolume * GetVolume() const
Definition TGeoNode.h:99
void SaveAttributes(std::ostream &out)
save attributes for this node
Definition TGeoNode.cxx:440
TGeoVolume * fVolume
Definition TGeoNode.h:41
void CheckShapes()
check for wrong parameters in shapes
Definition TGeoNode.cxx:330
void PrintOverlaps() const
print possible overlapping nodes
Definition TGeoNode.cxx:668
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:252
TGeoNode()
Default constructor.
Definition TGeoNode.cxx:96
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:546
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:708
void PrintCandidates() const
print daughters candidates for containing current point
Definition TGeoNode.cxx:617
void ls(Option_t *option="") const override
Print the path (A/B/C/...) to this node on stdout.
Definition TGeoNode.cxx:601
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:719
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:556
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:695
void SetMotherVolume(TGeoVolume *mother)
Definition TGeoNode.h:125
void SetUserExtension(TGeoExtension *ext)
Connect user-defined extension to the node.
Definition TGeoNode.cxx:501
virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const
Convert a vector from local reference system to mother reference.
Definition TGeoNode.cxx:593
void Browse(TBrowser *b) override
How-to-browse for a node.
Definition TGeoNode.cxx:148
void Paint(Option_t *option="") override
Paint this node and its content according to visualization settings.
Definition TGeoNode.cxx:606
void DrawOverlaps()
Method drawing the overlap candidates with this node.
Definition TGeoNode.cxx:364
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:585
Int_t CountDaughters(Bool_t unique_volumes=kFALSE)
Returns the number of daughters.
Definition TGeoNode.cxx:166
void DrawOnly(Option_t *option="")
draw only this node independently of its vis options
Definition TGeoNode.cxx:343
@ 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:351
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:569
TGeoExtension * GrabUserExtension() const
Get a copy of the user extension pointer.
Definition TGeoNode.cxx:534
Int_t FindNode(const TGeoNode *node, Int_t level)
Search for a node within the branch of this one.
Definition TGeoNode.cxx:412
void VisibleDaughters(Bool_t vis=kTRUE)
Set visibility of the daughters (obsolete).
Definition TGeoNode.cxx:732
void FillIdArray(Int_t &ifree, Int_t &nodeid, Int_t *array) const
Fill array with node id. Recursive on node branch.
Definition TGeoNode.cxx:393
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:577
char * GetObjectInfo(Int_t px, Int_t py) const override
Get node info for the browser.
Definition TGeoNode.cxx:282
Bool_t IsVirtual() const
Definition TGeoNode.h:108
~TGeoNode() override
Destructor.
Definition TGeoNode.cxx:131
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:193
void InspectNode() const
Inspect this node.
Definition TGeoNode.cxx:305
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute mouse actions on this volume.
Definition TGeoNode.cxx:269
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:685
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:174
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:150
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
Stopwatch class.
Definition TStopwatch.h:28
Basic string class.
Definition TString.h:139
void ToLower()
Change string to lower-case.
Definition TString.cxx:1182
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:2378
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:632
Abstract class for geometry painters.
std::ostream & Info()
Definition hadd.cxx:177
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:123
Statefull info for the current geometry level.