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 "TGeoVoxelFinder.h"
83#include "TGeoNode.h"
84#include "TMath.h"
85#include "TStopwatch.h"
86#include "TGeoExtension.h"
87
88// statics and globals
89
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;
153 TGeoNode *daughter;
154 TString title;
155 for (Int_t i = 0; i < GetNdaughters(); i++) {
156 daughter = GetDaughter(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++)
181 counter += GetDaughter(i)->CountDaughters(unique_volumes);
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;
196 TStopwatch *timer;
197 Int_t i;
198 Bool_t sampling = kFALSE;
199 TString opt(option);
200 opt.ToLower();
201 if (opt.Contains("s"))
202 sampling = kTRUE;
203
205 ncheck = CountDaughters(kFALSE);
206 timer = new TStopwatch();
207 geom->ClearOverlaps();
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->GetGeomPainter()->OpProgress(fVolume->GetName(), icheck, ncheck, timer, kFALSE);
217 icheck++;
218 TGeoIterator next(fVolume);
219 TGeoNode *node;
220 TString path;
221 TObjArray *overlaps = geom->GetListOfOverlaps();
222 Int_t novlps;
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->GetGeomPainter()->OpProgress(node->GetVolume()->GetName(), icheck, ncheck, timer, kFALSE, msg);
230 node->GetVolume()->SelectVolume(kFALSE);
231 node->GetVolume()->CheckOverlaps(ovlp, option);
232 }
233 }
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->GetGeomPainter()->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");
320 TGeoMatrix *matrix = GetMatrix();
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
343{
345}
346
347////////////////////////////////////////////////////////////////////////////////
348/// draw current node according to option
349
351{
353 gGeoManager->CdUp();
354 Double_t point[3];
356 gGeoManager->SetCurrentPoint(&point[0]);
358}
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;
397 TGeoNode *daughter;
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());
417 TGeoNode *daughter;
418 while ((daughter = (TGeoNode *)next())) {
419 if (daughter == node) {
420 gGeoManager->GetListOfNodes()->AddAt(daughter, level + 1);
421 return (level + 1);
422 }
423 }
424 next.Reset();
425 Int_t new_level;
426 while ((daughter = (TGeoNode *)next())) {
427 new_level = daughter->FindNode(node, level + 1);
428 if (new_level >= 0) {
429 gGeoManager->GetListOfNodes()->AddAt(daughter, level + 1);
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 = '"';
445 Bool_t voldef = kFALSE;
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{
502 if (fUserExtension)
504 fUserExtension = nullptr;
505 if (ext)
506 fUserExtension = ext->Grab();
507}
508
509////////////////////////////////////////////////////////////////////////////////
510/// Connect framework defined extension to the node. The node "grabs" a copy,
511/// so the original object can be released by the producer. Release the previously
512/// connected extension if any.
513///
514/// NOTE: This interface is intended for the use by TGeo and the users should
515/// NOT connect extensions using this method
516
518{
519 if (fFWExtension)
521 fFWExtension = nullptr;
522 if (ext)
523 fFWExtension = ext->Grab();
524}
525
526////////////////////////////////////////////////////////////////////////////////
527/// Get a copy of the user extension pointer. The user must call Release() on
528/// the copy pointer once this pointer is not needed anymore (equivalent to
529/// delete() after calling new())
530
532{
533 if (fUserExtension)
534 return fUserExtension->Grab();
535 return nullptr;
536}
537
538////////////////////////////////////////////////////////////////////////////////
539/// Get a copy of the framework extension pointer. The user must call Release() on
540/// the copy pointer once this pointer is not needed anymore (equivalent to
541/// delete() after calling new())
542
544{
545 if (fFWExtension)
546 return fFWExtension->Grab();
547 return nullptr;
548}
549////////////////////////////////////////////////////////////////////////////////
550/// Check the overlab between the bounding box of the node overlaps with the one
551/// the brother with index IOTHER.
552
554{
555 if (!fOverlaps)
556 return kFALSE;
557 for (Int_t i = 0; i < fNovlp; i++)
558 if (fOverlaps[i] == iother)
559 return kTRUE;
560 return kFALSE;
561}
562
563////////////////////////////////////////////////////////////////////////////////
564/// Convert the point coordinates from mother reference to local reference system
565
566void TGeoNode::MasterToLocal(const Double_t *master, Double_t *local) const
567{
568 GetMatrix()->MasterToLocal(master, local);
569}
570
571////////////////////////////////////////////////////////////////////////////////
572/// Convert a vector from mother reference to local reference system
573
574void TGeoNode::MasterToLocalVect(const Double_t *master, Double_t *local) const
575{
576 GetMatrix()->MasterToLocalVect(master, local);
577}
578
579////////////////////////////////////////////////////////////////////////////////
580/// Convert the point coordinates from local reference system to mother reference
581
582void TGeoNode::LocalToMaster(const Double_t *local, Double_t *master) const
583{
584 GetMatrix()->LocalToMaster(local, master);
585}
586
587////////////////////////////////////////////////////////////////////////////////
588/// Convert a vector from local reference system to mother reference
589
590void TGeoNode::LocalToMasterVect(const Double_t *local, Double_t *master) const
591{
592 GetMatrix()->LocalToMasterVect(local, master);
593}
594
595////////////////////////////////////////////////////////////////////////////////
596/// Print the path (A/B/C/...) to this node on stdout
597
598void TGeoNode::ls(Option_t * /*option*/) const {}
599
600////////////////////////////////////////////////////////////////////////////////
601/// Paint this node and its content according to visualization settings.
602
604{
606 if (!painter)
607 return;
608 painter->PaintNode(this, option);
609}
610
611////////////////////////////////////////////////////////////////////////////////
612/// print daughters candidates for containing current point
613
615{
616 Double_t point[3];
618 printf(" Local : %g, %g, %g\n", point[0], point[1], point[2]);
619 if (!fVolume->Contains(&point[0])) {
620 printf("current point not inside this\n");
621 return;
622 }
624 TGeoNode *node;
625 if (finder) {
626 printf("current node divided\n");
627 node = finder->FindNode(&point[0]);
628 if (!node) {
629 printf("point not inside division element\n");
630 return;
631 }
632 printf("inside division element %s\n", node->GetName());
633 return;
634 }
635 TGeoVoxelFinder *voxels = fVolume->GetVoxels();
636 if (!voxels) {
637 printf("volume not voxelized\n");
638 return;
639 }
640 Int_t ncheck = 0;
642 TGeoStateInfo &info = *nav->GetCache()->GetInfo();
643 Int_t *check_list = voxels->GetCheckList(&point[0], ncheck, info);
644 nav->GetCache()->ReleaseInfo();
645 voxels->PrintVoxelLimits(&point[0]);
646 if (!check_list) {
647 printf("no candidates for current point\n");
648 return;
649 }
650 TString overlap = "ONLY";
651 for (Int_t id = 0; id < ncheck; id++) {
652 node = fVolume->GetNode(check_list[id]);
653 if (node->IsOverlapping())
654 overlap = "MANY";
655 else
656 overlap = "ONLY";
657 printf("%i %s %s\n", check_list[id], node->GetName(), overlap.Data());
658 }
660}
661
662////////////////////////////////////////////////////////////////////////////////
663/// print possible overlapping nodes
664
666{
667 if (!fOverlaps) {
668 printf("node %s no overlaps\n", GetName());
669 return;
670 }
671 printf("Overlaps for node %s :\n", GetName());
672 TGeoNode *node;
673 for (Int_t i = 0; i < fNovlp; i++) {
674 node = fMother->GetNode(fOverlaps[i]);
675 printf(" %s\n", node->GetName());
676 }
677}
678
679////////////////////////////////////////////////////////////////////////////////
680/// computes the closest distance from given point to this shape
681
683{
684 Double_t local[3];
685 GetMatrix()->MasterToLocal(point, local);
686 return fVolume->GetShape()->Safety(local, in);
687}
688
689////////////////////////////////////////////////////////////////////////////////
690/// Copy content of lst of overlaps from source array
691
693{
694 Int_t *ovlps = nullptr;
695 if (src && (novlp > 0)) {
696 ovlps = new Int_t[novlp];
697 memcpy(ovlps, src, novlp * sizeof(Int_t));
698 }
699 SetOverlaps(ovlps, novlp);
700}
701
702////////////////////////////////////////////////////////////////////////////////
703/// set the list of overlaps for this node (ovlp must be created with operator new)
704
706{
707 if (fOverlaps)
708 delete[] fOverlaps;
709 fOverlaps = ovlp;
710 fNovlp = novlp;
711}
712
713////////////////////////////////////////////////////////////////////////////////
714/// Set visibility of the node (obsolete).
715
717{
718 if (gGeoManager->IsClosed())
721 if (vis && !fVolume->IsVisible())
724}
725
726////////////////////////////////////////////////////////////////////////////////
727/// Set visibility of the daughters (obsolete).
728
730{
731 if (gGeoManager->IsClosed())
733 SetVisDaughters(vis);
735}
736
737/** \class TGeoNodeMatrix
738\ingroup Geometry_classes
739A node containing local transformation.
740*/
741
743
744////////////////////////////////////////////////////////////////////////////////
745/// Default constructor
746
748{
749 fMatrix = nullptr;
750}
751
752////////////////////////////////////////////////////////////////////////////////
753/// Constructor.
754
756{
757 fMatrix = (TGeoMatrix *)matrix;
758 if (!fMatrix)
760}
761
762////////////////////////////////////////////////////////////////////////////////
763/// Destructor
764
766
767////////////////////////////////////////////////////////////////////////////////
768/// return the total size in bytes of this node
769
771{
772 Int_t count = 40 + 4; // TGeoNode + fMatrix
773 // if (fMatrix) count += fMatrix->GetByteCount();
774 return count;
775}
776
777////////////////////////////////////////////////////////////////////////////////
778/// Returns type of optimal voxelization for this node.
779/// - type = 0 -> cartesian
780/// - type = 1 -> cylindrical
781
783{
785 if (!type)
786 return 0;
787 if (!fMatrix->IsRotAboutZ())
788 return 0;
789 const Double_t *transl = fMatrix->GetTranslation();
790 if (TMath::Abs(transl[0]) > 1E-10)
791 return 0;
792 if (TMath::Abs(transl[1]) > 1E-10)
793 return 0;
794 return 1;
795}
796
797////////////////////////////////////////////////////////////////////////////////
798/// Make a copy of this node.
799
801{
803 node->SetName(GetName());
804 node->SetTitle(GetTitle());
805 // set the mother
807 // set the copy number
808 node->SetNumber(fNumber);
809 // copy overlaps
811
812 // copy VC
813 if (IsVirtual())
814 node->SetVirtual();
815 if (IsOverlapping())
816 node->SetOverlapping(); // <--- ADDED
817 // Copy extensions
820 node->SetCloned();
821 return node;
822}
823
824////////////////////////////////////////////////////////////////////////////////
825/// Matrix setter.
826
828{
829 fMatrix = (TGeoMatrix *)matrix;
830 if (!fMatrix)
832}
833
834/** \class TGeoNodeOffset
835\ingroup Geometry_classes
836Node containing an offset.
837*/
838
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
856{
858 fOffset = offset;
859 fIndex = index;
860 fFinder = nullptr;
861}
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
985
986////////////////////////////////////////////////////////////////////////////////
987/// Geometry iterator for a branch starting with a TOP node.
988
990{
991 fTop = top;
992 fLevel = 0;
995 fType = 0;
996 fArray = new Int_t[30];
997 fMatrix = new TGeoHMatrix();
998 fTopName = fTop->GetName();
999 fPlugin = nullptr;
1001}
1002
1003////////////////////////////////////////////////////////////////////////////////
1004/// Copy ctor.
1005
1007{
1008 fTop = iter.GetTopVolume();
1009 fLevel = iter.GetLevel();
1011 fMustStop = kFALSE;
1012 fType = iter.GetType();
1013 fArray = new Int_t[30 + 30 * Int_t(fLevel / 30)];
1014 for (Int_t i = 0; i < fLevel + 1; i++)
1015 fArray[i] = iter.GetIndex(i);
1016 fMatrix = new TGeoHMatrix(*iter.GetCurrentMatrix());
1017 fTopName = fTop->GetName();
1018 fPlugin = iter.fPlugin;
1020 ;
1021}
1022
1023////////////////////////////////////////////////////////////////////////////////
1024/// Destructor.
1025
1027{
1028 if (fArray)
1029 delete[] fArray;
1030 delete fMatrix;
1031}
1032
1033////////////////////////////////////////////////////////////////////////////////
1034/// Assignment.
1035
1037{
1038 if (&iter == this)
1039 return *this;
1040 fTop = iter.GetTopVolume();
1041 fLevel = iter.GetLevel();
1043 fMustStop = kFALSE;
1044 fType = iter.GetType();
1045 if (fArray)
1046 delete[] fArray;
1047 fArray = new Int_t[30 + 30 * Int_t(fLevel / 30)];
1048 for (Int_t i = 0; i < fLevel + 1; i++)
1049 fArray[i] = iter.GetIndex(i);
1050 if (!fMatrix)
1051 fMatrix = new TGeoHMatrix();
1052 *fMatrix = *iter.GetCurrentMatrix();
1053 fTopName = fTop->GetName();
1054 fPlugin = iter.fPlugin;
1056 ;
1057 return *this;
1058}
1059
1060////////////////////////////////////////////////////////////////////////////////
1061/// Returns next node.
1062
1064{
1065 if (fMustStop)
1066 return nullptr;
1067 TGeoNode *mother = nullptr;
1068 TGeoNode *next = nullptr;
1069 Int_t i;
1070 Int_t nd = fTop->GetNdaughters();
1071 if (!nd) {
1072 fMustStop = kTRUE;
1073 return nullptr;
1074 }
1075 if (!fLevel) {
1076 fArray[++fLevel] = 0;
1077 next = fTop->GetNode(0);
1078 if (fPlugin && fPluginAutoexec)
1080 return next;
1081 }
1082 next = fTop->GetNode(fArray[1]);
1083 // Move to current node
1084 for (i = 2; i < fLevel + 1; i++) {
1085 mother = next;
1086 next = mother->GetDaughter(fArray[i]);
1087 }
1088 if (fMustResume) {
1090 if (fPlugin && fPluginAutoexec)
1092 return next;
1093 }
1094
1095 switch (fType) {
1096 case 0: // default next daughter behavior
1097 nd = next->GetNdaughters();
1098 if (nd) {
1099 // First daughter next
1100 fLevel++;
1101 if ((fLevel % 30) == 0)
1102 IncreaseArray();
1103 fArray[fLevel] = 0;
1104 if (fPlugin && fPluginAutoexec)
1106 return next->GetDaughter(0);
1107 }
1108 // cd up and pick next
1109 while (next) {
1110 next = GetNode(fLevel - 1);
1111 if (!next) {
1112 nd = fTop->GetNdaughters();
1113 if (fArray[fLevel] < nd - 1) {
1114 fArray[fLevel]++;
1115 if (fPlugin && fPluginAutoexec)
1117 return fTop->GetNode(fArray[fLevel]);
1118 }
1119 fMustStop = kTRUE;
1120 return nullptr;
1121 } else {
1122 nd = next->GetNdaughters();
1123 if (fArray[fLevel] < nd - 1) {
1124 fArray[fLevel]++;
1125 if (fPlugin && fPluginAutoexec)
1127 return next->GetDaughter(fArray[fLevel]);
1128 }
1129 }
1130 fLevel--;
1131 }
1132 break;
1133 case 1: // one level search
1134 if (mother)
1135 nd = mother->GetNdaughters();
1136 if (fArray[fLevel] < nd - 1) {
1137 fArray[fLevel]++;
1138 if (fPlugin && fPluginAutoexec)
1140 if (!mother)
1141 return fTop->GetNode(fArray[fLevel]);
1142 else
1143 return mother->GetDaughter(fArray[fLevel]);
1144 }
1145 }
1146 fMustStop = kTRUE;
1147 return nullptr;
1148}
1149
1150////////////////////////////////////////////////////////////////////////////////
1151/// Returns next node.
1152
1154{
1155 return Next();
1156}
1157
1158////////////////////////////////////////////////////////////////////////////////
1159/// Returns global matrix for current node.
1160
1162{
1163 fMatrix->Clear();
1164 if (!fLevel)
1165 return fMatrix;
1166 TGeoNode *node = fTop->GetNode(fArray[1]);
1167 fMatrix->Multiply(node->GetMatrix());
1168 for (Int_t i = 2; i < fLevel + 1; i++) {
1169 node = node->GetDaughter(fArray[i]);
1170 fMatrix->Multiply(node->GetMatrix());
1171 }
1172 return fMatrix;
1173}
1174
1175////////////////////////////////////////////////////////////////////////////////
1176/// Returns current node at a given level.
1177
1179{
1180 if (!level || level > fLevel)
1181 return nullptr;
1182 TGeoNode *node = fTop->GetNode(fArray[1]);
1183 for (Int_t i = 2; i < level + 1; i++)
1184 node = node->GetDaughter(fArray[i]);
1185 return node;
1186}
1187
1188////////////////////////////////////////////////////////////////////////////////
1189/// Returns the path for the current node.
1190
1192{
1193 path = fTopName;
1194 if (!fLevel)
1195 return;
1196 TGeoNode *node = fTop->GetNode(fArray[1]);
1197 path += "/";
1198 path += node->GetName();
1199 for (Int_t i = 2; i < fLevel + 1; i++) {
1200 node = node->GetDaughter(fArray[i]);
1201 path += "/";
1202 path += node->GetName();
1203 }
1204}
1205
1206////////////////////////////////////////////////////////////////////////////////
1207/// Increase by 30 the size of the array.
1208
1210{
1211 Int_t *array = new Int_t[fLevel + 30];
1212 memcpy(array, fArray, fLevel * sizeof(Int_t));
1213 delete[] fArray;
1214 fArray = array;
1215}
1216
1217////////////////////////////////////////////////////////////////////////////////
1218/// Resets the iterator for volume TOP.
1219
1221{
1222 if (top)
1223 fTop = top;
1224 fLevel = 0;
1226 fMustStop = kFALSE;
1227}
1228
1229////////////////////////////////////////////////////////////////////////////////
1230/// Set the top name for path
1231
1233{
1234 fTopName = name;
1235}
1236
1237////////////////////////////////////////////////////////////////////////////////
1238/// Stop iterating the current branch. The iteration of the next node will
1239/// behave as if the branch starting from the current node (included) is not existing.
1240
1242{
1244 TGeoNode *next = GetNode(fLevel);
1245 if (!next)
1246 return;
1247 Int_t nd;
1248 switch (fType) {
1249 case 0: // default next daughter behavior
1250 // cd up and pick next
1251 while (next) {
1252 next = GetNode(fLevel - 1);
1253 nd = (next == nullptr) ? fTop->GetNdaughters() : next->GetNdaughters();
1254 if (fArray[fLevel] < nd - 1) {
1255 ++fArray[fLevel];
1256 return;
1257 }
1258 fLevel--;
1259 if (!fLevel) {
1260 fMustStop = kTRUE;
1261 return;
1262 }
1263 }
1264 break;
1265 case 1: // one level search
1266 next = GetNode(fLevel - 1);
1267 nd = (next == nullptr) ? fTop->GetNdaughters() : next->GetNdaughters();
1268 if (fArray[fLevel] < nd - 1) {
1269 ++fArray[fLevel];
1270 return;
1271 }
1272 fMustStop = kTRUE;
1273 break;
1274 }
1275}
1276
1277////////////////////////////////////////////////////////////////////////////////
1278/// Set a plugin.
1279
1281{
1282 fPlugin = plugin;
1283 if (plugin)
1284 plugin->SetIterator(this);
1285}
#define b(i)
Definition RSha256.hxx:100
int Int_t
Definition RtypesCore.h:45
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:377
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
void SetIterator(const TGeoIterator *iter)
Definition TGeoNode.h:237
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:44
TObjArray * GetListOfOverlaps()
void CdUp()
Go one level up in geometry.
void ClearOverlaps()
Clear the list of overlaps.
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 SetCheckingOverlaps(Bool_t flag=kTRUE)
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
void SortOverlaps()
Sort overlaps by decreasing overlap distance. Extrusions comes first.
Geometrical transformation package.
Definition TGeoMatrix.h:38
virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const
convert a vector by multiplying its column vector (x, y, z, 1) to matrix inverse
void Print(Option_t *option="") const override
print the matrix in 4x4 format
virtual void MasterToLocal(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
virtual void MasterToLocalVect(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
virtual const Double_t * GetTranslation() const =0
virtual void LocalToMaster(const Double_t *local, Double_t *master) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix inverse
Bool_t IsRotAboutZ() const
Returns true if no rotation or the rotation is about Z axis.
Class providing navigation API for TGeo geometries.
TGeoNodeCache * GetCache() const
TGeoStateInfo * GetInfo()
Get next state info pointer.
void ReleaseInfo()
Release last used state info pointer.
A node containing local transformation.
Definition TGeoNode.h:154
void SetMatrix(const TGeoMatrix *matrix)
Matrix setter.
Definition TGeoNode.cxx:827
TGeoNode * MakeCopyNode() const override
Make a copy of this node.
Definition TGeoNode.cxx:800
Int_t GetByteCount() const override
return the total size in bytes of this node
Definition TGeoNode.cxx:770
TGeoNodeMatrix()
Default constructor.
Definition TGeoNode.cxx:747
TGeoMatrix * fMatrix
Definition TGeoNode.h:156
~TGeoNodeMatrix() override
Destructor.
Definition TGeoNode.cxx:765
Int_t GetOptimalVoxels() const override
Returns type of optimal voxelization for this node.
Definition TGeoNode.cxx:782
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:517
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:665
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:543
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:705
void PrintCandidates() const
print daughters candidates for containing current point
Definition TGeoNode.cxx:614
void ls(Option_t *option="") const override
Print the path (A/B/C/...) to this node on stdout.
Definition TGeoNode.cxx:598
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:716
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:553
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:692
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:590
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:603
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:582
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:566
TGeoExtension * GrabUserExtension() const
Get a copy of the user extension pointer.
Definition TGeoNode.cxx:531
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:729
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:574
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:682
TGeoVolume * fMother
Definition TGeoNode.h:42
Base finder class for patterns.
virtual TGeoNode * FindNode(Double_t *, const Double_t *=nullptr)
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.
virtual Int_t * GetCheckList(const Double_t *point, Int_t &nelem, TGeoStateInfo &td)
get the list of daughter indices for which point is inside their bbox
void PrintVoxelLimits(const Double_t *point) const
print the voxel containing point
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:164
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:48
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition TNamed.cxx:140
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:780
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:976
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition TObject.cxx:950
Stopwatch class.
Definition TStopwatch.h:28
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
Basic string class.
Definition TString.h:139
void ToLower()
Change string to lower-case.
Definition TString.cxx:1182
const char * Data() const
Definition TString.h:378
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:634
Abstract class for geometry painters.
virtual void OpProgress(const char *opname, Long64_t current, Long64_t size, TStopwatch *watch=nullptr, Bool_t last=kFALSE, Bool_t refresh=kFALSE, const char *msg="")=0
virtual Int_t DistanceToPrimitiveVol(TGeoVolume *vol, Int_t px, Int_t py)=0
virtual const char * GetVolumeInfo(const TGeoVolume *volume, Int_t px, Int_t py) const =0
virtual void ExecuteVolumeEvent(TGeoVolume *volume, Int_t event, Int_t px, Int_t py)=0
virtual void PaintNode(TGeoNode *node, Option_t *option="", TGeoMatrix *global=nullptr)=0
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.