Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGeoVolume.h
Go to the documentation of this file.
1// @(#)root/geom:$Id$
2// Author: Andrei Gheata 30/05/02
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// Author : date : Wed 24 Oct 2001 01:39:36 PM CEST
12
13#ifndef ROOT_TGeoVolume
14#define ROOT_TGeoVolume
15
16#include "TNamed.h"
17#include "TGeoAtt.h"
18#include "TAttLine.h"
19#include "TAttFill.h"
20#include "TAtt3D.h"
21#include "TObjArray.h"
22#include "TGeoMedium.h"
23#include "TGeoShape.h"
24#include <algorithm>
25#include <atomic>
26#include <mutex>
27#include <vector>
28
29// forward declarations
30class TH2F;
31class TGeoNode;
32class TGeoMatrix;
34class TGeoVoxelFinder;
35class TGeoManager;
36class TGeoExtension;
37
38////////////////////////////////////////////////////////////////////////////
39// //
40// TGeoVolume - base class representing a single volume having a shape //
41// and a medium. //
42// //
43////////////////////////////////////////////////////////////////////////////
44
45class TGeoVolume : public TNamed, public TGeoAtt, public TAttLine, public TAttFill, public TAtt3D {
46protected:
47 TObjArray *fNodes; // array of nodes inside this volume
48 TGeoShape *fShape; // shape
49 TGeoMedium *fMedium; // tracking medium
50 static TGeoMedium *fgDummyMedium; ///<! dummy medium
51 TGeoPatternFinder *fFinder; // finder object for divisions
52 TGeoVoxelFinder *fVoxels; // finder object for bounding boxes
53 TGeoManager *fGeoManager; ///<! pointer to TGeoManager owning this volume
54
55 TObject *fField; ///<! just a hook for now
56 TString fOption; ///<! option - if any
57 Int_t fNumber; // volume serial number in the list of volumes
58 Int_t fNtotal; // total number of physical nodes
59 Int_t fRefCount; // reference counter
60 Char_t fTransparency; // transparency setting
61 TGeoExtension *fUserExtension; ///<! Transient user-defined extension to volumes
62 TGeoExtension *fFWExtension; ///<! Transient framework-defined extension to volumes
63
64private:
65 TGeoVolume(const TGeoVolume &) = delete;
66 TGeoVolume &operator=(const TGeoVolume &) = delete;
67
68public:
69 virtual void ClearThreadData() const;
70 virtual void CreateThreadData(Int_t nthreads);
71
72public:
80 kVoxelsXYZ = BIT(20), // not used
81 kVoxelsCyl = BIT(21), // not used
84 kVolumeOC = BIT(21) // overlapping candidates
85 };
86 // constructors
87 TGeoVolume();
88 TGeoVolume(const char *name, const TGeoShape *shape, const TGeoMedium *med = nullptr);
89
90 // destructor
91 ~TGeoVolume() override;
92 // methods
93 virtual void cd(Int_t inode) const;
94 void Browse(TBrowser *b) override;
95 Double_t Capacity() const;
96 void CheckShapes();
97 void ClearNodes() { fNodes = nullptr; }
98 void ClearShape();
99 void CleanAll();
100 virtual TGeoVolume *CloneVolume() const;
102 void CheckGeometry(Int_t nrays = 1, Double_t startx = 0, Double_t starty = 0, Double_t startz = 0) const;
103 void CheckOverlaps(Double_t ovlp = 0.1, Option_t *option = ""); // *MENU*
104 void CheckOverlapsBySampling(Double_t ovlp = 0.1, Int_t npoints = 1000000); // *MENU*
105 void CheckShape(Int_t testNo, Int_t nsamples = 10000, Option_t *option = ""); // *MENU*
107 Bool_t Contains(const Double_t *point) const { return fShape->Contains(point); }
108 static void CreateDummyMedium();
109 static TGeoMedium *DummyMedium();
110 virtual Bool_t IsAssembly() const;
111 Bool_t IsFolder() const override;
112 Bool_t IsRunTime() const { return fShape->IsRunTimeShape(); }
113 virtual Bool_t IsVolumeMulti() const { return kFALSE; }
114 virtual TGeoNode *
115 AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat = nullptr, Option_t *option = ""); // most general case
117 virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat = nullptr, Option_t *option = "");
118
119 virtual TGeoVolume *Divide(const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step,
120 Int_t numed = 0, Option_t *option = "");
121 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
122 void Draw(Option_t *option = "") override; // *MENU*
123 virtual void DrawOnly(Option_t *option = ""); // *MENU*
124 TH2F *LegoPlot(Int_t ntheta = 20, Double_t themin = 0., Double_t themax = 180., Int_t nphi = 60,
125 Double_t phimin = 0., Double_t phimax = 360., Double_t rmin = 0., Double_t rmax = 9999999,
126 Option_t *option = ""); // *MENU*
127 void Paint(Option_t *option = "") override;
128 void Print(Option_t *option = "") const override; // *MENU*
129 void PrintNodes() const;
130 void PrintVoxels() const; // *MENU*
131 void ReplayCreation(const TGeoVolume *other);
134 Int_t GetRefCount() const { return fRefCount; }
139 void Grab() { fRefCount++; }
140 void Release()
141 {
142 fRefCount--;
143 if (fRefCount == 0)
144 delete this;
145 }
146 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
147
148 Bool_t IsActive() const { return TGeoAtt::IsActive(); }
156 Bool_t IsTopVolume() const;
157 Bool_t IsValid() const { return fShape->IsValid(); }
158 virtual Bool_t IsVisible() const { return TGeoAtt::IsVisible(); }
162 Bool_t IsVisOnly() const { return TGeoAtt::IsVisOnly(); }
163 Bool_t IsAllInvisible() const;
164 Bool_t IsRaytracing() const;
165 static TGeoVolume *Import(const char *filename, const char *name = "", Option_t *option = "");
166 Int_t Export(const char *filename, const char *name = "", Option_t *option = "");
167 TGeoNode *FindNode(const char *name) const;
168 void FindOverlaps() const;
170 virtual Int_t GetCurrentNodeIndex() const { return -1; }
171 virtual Int_t GetNextNodeIndex() const { return -1; }
172 TObjArray *GetNodes() { return fNodes; }
173 Int_t GetNdaughters() const;
174 Int_t GetNtotal() const { return fNtotal; }
175 virtual Int_t GetByteCount() const;
178 TGeoMedium *GetMedium() const { return (fMedium) ? fMedium : DummyMedium(); }
179 TObject *GetField() const { return fField; }
181 TGeoVoxelFinder *GetVoxels() const;
182 const char *GetIconName() const override { return fShape->GetName(); }
183 Int_t GetIndex(const TGeoNode *node) const;
184 TGeoNode *GetNode(const char *name) const;
185 TGeoNode *GetNode(Int_t i) const { return (TGeoNode *)fNodes->UncheckedAt(i); }
186 Int_t GetNodeIndex(const TGeoNode *node, Int_t *check_list, Int_t ncheck) const;
187 Int_t GetNumber() const { return fNumber; }
188 char *GetObjectInfo(Int_t px, Int_t py) const override;
189 Bool_t GetOptimalVoxels() const;
190 Option_t *GetOption() const override { return fOption.Data(); }
191 const char *GetPointerName() const;
192 Char_t GetTransparency() const;
193 TGeoShape *GetShape() const { return fShape; }
194 void GrabFocus(); // *MENU*
195 void Gsord(Int_t /*iaxis*/) {}
196 Bool_t IsStyleDefault() const;
197 void InspectMaterial() const; // *MENU*
198 void InspectShape() const { fShape->InspectShape(); } // *MENU*
200 void MakeCopyNodes(const TGeoVolume *other);
201 TGeoVolume *MakeReflectedVolume(const char *newname = "") const;
202 Bool_t OptimizeVoxels(); // *MENU*
203 void RandomPoints(Int_t npoints = 1000000, Option_t *option = ""); // *MENU*
204 void RandomRays(Int_t nrays = 10000, Double_t startx = 0, Double_t starty = 0, Double_t startz = 0,
205 const char *target_vol = nullptr, Bool_t check_norm = kFALSE); // *MENU*
206 void Raytrace(Bool_t flag = kTRUE); // *TOGGLE* *GETTER=IsRaytracing
207 void RegisterYourself(Option_t *option = "");
208 void RemoveNode(TGeoNode *node);
210 TGeoMedium *newmed = nullptr);
211 void ResetTransparency(Char_t transparency = -1); // *MENU*
212 void SaveAs(const char *filename = "", Option_t *option = "") const override; // *MENU*
213 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
214 void SelectVolume(Bool_t clear = kFALSE);
217 void SetAsTopVolume(); // *TOGGLE* *GETTER=IsTopVolume
226 void SetNodes(TObjArray *nodes)
227 {
228 fNodes = nodes;
230 }
232 void SetShape(const TGeoShape *shape);
233 void SetTransparency(Char_t transparency = 0); // *MENU*
235 void SetOption(const char *option);
237 void SetVisibility(Bool_t vis = kTRUE) override; // *TOGGLE* *GETTER=IsVisible
238 void SetVisContainers(Bool_t flag = kTRUE) override; // *TOGGLE* *GETTER=IsVisContainers
239 void SetVisLeaves(Bool_t flag = kTRUE) override; // *TOGGLE* *GETTER=IsVisLeaves
240 void SetVisOnly(Bool_t flag = kTRUE) override; // *TOGGLE* *GETTER=IsVisOnly
241 void SetLineColor(Color_t lcolor) override;
242 void SetLineStyle(Style_t lstyle) override;
243 void SetLineWidth(Width_t lwidth) override;
248 void SetNumber(Int_t number) { fNumber = number; }
250 void SortNodes();
251 void UnmarkSaved();
252 Bool_t Valid() const;
253 void VisibleDaughters(Bool_t vis = kTRUE); // *TOGGLE* *GETTER=IsVisibleDaughters
254 void InvisibleAll(Bool_t flag = kTRUE); // *TOGGLE* *GETTER=IsAllInvisible
255 void Voxelize(Option_t *option);
256 Double_t Weight(Double_t precision = 0.01, Option_t *option = "va"); // *MENU*
257 Double_t WeightA() const;
258
259 ClassDefOverride(TGeoVolume, 7) // geometry volume descriptor
260};
261
262////////////////////////////////////////////////////////////////////////////
263// //
264// TGeoVolumeMulti - class storing a list of volumes that have to //
265// be handled together at build time //
266// //
267////////////////////////////////////////////////////////////////////////////
268
270private:
271 TObjArray *fVolumes; // list of volumes
272 TGeoVolumeMulti *fDivision; // division of this volume
273 Int_t fNumed; // medium number for divisions
274 Int_t fNdiv; // number of divisions
275 Int_t fAxis; // axis of division
276 Double_t fStart; // division start offset
277 Double_t fStep; // division step
278 Bool_t fAttSet; // flag attributes set
279
282
283public:
285 TGeoVolumeMulti(const char *name, TGeoMedium *med = nullptr);
286 ~TGeoVolumeMulti() override;
287
288 void AddVolume(TGeoVolume *vol);
289 TGeoVolume *GetVolume(Int_t id) const { return (TGeoVolume *)fVolumes->At(id); }
290 TGeoNode *
291 AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option = "") override; // most general case
292 void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option = "") override;
293 TGeoVolume *Divide(const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed = 0,
294 Option_t *option = "") override;
295 TGeoShape *GetLastShape() const;
297 Int_t GetAxis() const { return fNdiv; }
298 Int_t GetNdiv() const { return fNdiv; }
299 Double_t GetStart() const { return fStart; }
300 Double_t GetStep() const { return fStep; }
301 Bool_t IsVolumeMulti() const override { return kTRUE; }
303 void SetLineColor(Color_t lcolor) override;
304 void SetLineStyle(Style_t lstyle) override;
305 void SetLineWidth(Width_t lwidth) override;
306 void SetMedium(TGeoMedium *medium) override;
307 void SetVisibility(Bool_t vis = kTRUE) override;
308
309 ClassDefOverride(TGeoVolumeMulti, 3) // class to handle multiple volumes in one step
310};
311
312////////////////////////////////////////////////////////////////////////////
313// //
314// TGeoVolumeAssembly - special assembly of volumes. The assembly has no //
315// medium and its shape is the union of all component shapes //
316// //
317////////////////////////////////////////////////////////////////////////////
318
320 static std::atomic<UInt_t> fgInstanceCount; //! source of monotonic per-object indices
321 UInt_t fIndex{fgInstanceCount++}; //! non-reused index of this assembly into the per-thread vector
322
323public:
325 Int_t fCurrent{-1}; //! index of current selected node
326 Int_t fNext{-1}; //! index of next node to be entered
327 };
328
329 /// Per-thread scratch state, owned by the calling thread and indexed by this assembly.
330 /// Each thread owns its whole vector, so no two threads ever write the same cache line.
331 /// The vector retains its high-water size until the owning thread exits.
333 {
334 thread_local std::vector<ThreadData_t> tdata;
335 if (tdata.size() <= fIndex)
336 tdata.resize(std::max<size_t>(fgInstanceCount.load(std::memory_order_relaxed), fIndex + 1));
337 return tdata[fIndex];
338 }
339 // ClearThreadData()/CreateThreadData() are deliberately not overridden: the assembly's own
340 // per-thread state is allocated lazily, and TGeoVolume's implementation still has to run so
341 // the shape and the division finder get their generation bumped.
342
343 Int_t GetCurrentNodeIndex() const override { return GetThreadData().fCurrent; }
344 Int_t GetNextNodeIndex() const override { return GetThreadData().fNext; }
347
348private:
351
352public:
354 TGeoVolumeAssembly(const char *name);
355 ~TGeoVolumeAssembly() override;
356
357 TGeoNode *AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat = nullptr, Option_t *option = "") override;
359 TGeoVolume *CloneVolume() const override;
360 TGeoVolume *Divide(const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed = 0,
361 Option_t *option = "") override;
362 TGeoVolume *Divide(TGeoVolume *cell, TGeoPatternFinder *pattern, Option_t *option = "spacedout");
363 void DrawOnly(Option_t *) override {}
364 Bool_t IsAssembly() const override { return kTRUE; }
365 Bool_t IsVisible() const override { return kFALSE; }
367
368 ClassDefOverride(TGeoVolumeAssembly, 2) // an assembly of volumes
369};
370
372{
373 if (!fNodes)
374 return 0;
375 return (fNodes->GetEntriesFast());
376}
377
379{
380 // If the transparency is (-1), the old default handling is applied
381 if (fTransparency >= 0)
382 return fTransparency;
383 return !fMedium ? 0 : fMedium->GetMaterial()->GetTransparency();
384}
385
392
397
398#endif
#define b(i)
Definition RSha256.hxx:100
cudaEvent_t event
short Style_t
Style number (short)
Definition RtypesCore.h:97
bool Bool_t
Boolean (0=false, 1=true) (bool)
Definition RtypesCore.h:78
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:60
short Color_t
Color number (short)
Definition RtypesCore.h:100
char Char_t
Character 1 byte (char)
Definition RtypesCore.h:52
short Width_t
Line width (short)
Definition RtypesCore.h:99
constexpr Bool_t kFALSE
Definition RtypesCore.h:109
double Double_t
Double 8 bytes.
Definition RtypesCore.h:74
constexpr Bool_t kTRUE
Definition RtypesCore.h:108
const char Option_t
Option string (const char)
Definition RtypesCore.h:81
#define BIT(n)
Definition Rtypes.h:91
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
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 SetLineWidth
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 filename
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 SetLineColor
char name[80]
Definition TGX11.cxx:142
Use this attribute class when an object should have 3D capabilities.
Definition TAtt3D.h:19
Fill Area Attributes class.
Definition TAttFill.h:21
Line Attributes class.
Definition TAttLine.h:21
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
Visualization and tracking attributes for volumes and nodes.
Definition TGeoAtt.h:17
Bool_t IsActive() const
Definition TGeoAtt.h:80
void SetActivity(Bool_t flag=kTRUE)
Definition TGeoAtt.h:75
Bool_t IsActiveDaughters() const
Definition TGeoAtt.h:81
Bool_t IsVisible() const
Definition TGeoAtt.h:83
Bool_t IsVisOnly() const
Definition TGeoAtt.h:88
Bool_t IsVisLeaves() const
Definition TGeoAtt.h:87
void SetActiveDaughters(Bool_t flag=kTRUE)
Definition TGeoAtt.h:76
Bool_t IsVisDaughters() const
Definition TGeoAtt.h:84
Bool_t IsVisContainers() const
Definition TGeoAtt.h:86
virtual void SetVisibility(Bool_t vis=kTRUE)
Set visibility for this object.
Definition TGeoAtt.cxx:103
ABC for user objects attached to TGeoVolume or TGeoNode.
The manager class for any TGeo geometry.
Definition TGeoManager.h:46
Base class describing materials.
Char_t GetTransparency() const
void SetTransparency(Char_t transparency=0)
Geometrical transformation package.
Definition TGeoMatrix.h:39
Media are used to store properties related to tracking and which are useful only when using geometry ...
Definition TGeoMedium.h:23
TGeoMaterial * GetMaterial() const
Definition TGeoMedium.h:49
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
Definition TGeoNode.h:39
base finder class for patterns. A pattern is specifying a division type
Base abstract class for all shapes.
Definition TGeoShape.h:25
Bool_t IsValid() const
Definition TGeoShape.h:153
Bool_t IsRunTimeShape() const
Definition TGeoShape.h:152
virtual void InspectShape() const =0
const char * GetName() const override
Get the shape name.
virtual Bool_t Contains(const Double_t *point) const =0
Volume assemblies.
Definition TGeoVolume.h:319
static TGeoVolumeAssembly * MakeAssemblyFromVolume(TGeoVolume *vol)
Make a clone of volume VOL but which is an assembly.
ThreadData_t & GetThreadData() const
Per-thread scratch state, owned by the calling thread and indexed by this assembly.
Definition TGeoVolume.h:332
TGeoVolumeAssembly & operator=(const TGeoVolumeAssembly &)=delete
~TGeoVolumeAssembly() override
Destructor. The assembly is owner of its "shape".
Int_t GetNextNodeIndex() const override
Definition TGeoVolume.h:344
Bool_t IsVisible() const override
Definition TGeoVolume.h:365
TGeoVolumeAssembly(const TGeoVolumeAssembly &)=delete
TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="") override
Add a component to the assembly.
TGeoVolume * CloneVolume() const override
Clone this volume.
static std::atomic< UInt_t > fgInstanceCount
void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option) override
Add an overlapping node - not allowed for assemblies.
UInt_t fIndex
source of monotonic per-object indices
Definition TGeoVolume.h:321
void DrawOnly(Option_t *) override
draw only this volume
Definition TGeoVolume.h:363
void SetNextNodeIndex(Int_t index)
Definition TGeoVolume.h:346
Int_t GetCurrentNodeIndex() const override
Definition TGeoVolume.h:343
void SetCurrentNodeIndex(Int_t index)
Definition TGeoVolume.h:345
TGeoVolumeAssembly()
Default constructor.
Bool_t IsAssembly() const override
Returns true if the volume is an assembly or a scaled assembly.
Definition TGeoVolume.h:364
TGeoVolume * Divide(const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed=0, Option_t *option="") override
Division makes no sense for assemblies.
Volume families.
Definition TGeoVolume.h:269
TGeoVolume * Divide(const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed=0, Option_t *option="") override
division of multiple volumes
Double_t fStart
Definition TGeoVolume.h:276
void AddVolume(TGeoVolume *vol)
Add a volume with valid shape to the list of volumes.
TGeoVolume * MakeCopyVolume(TGeoShape *newshape) override
Make a copy of this volume build a volume with same name, shape and medium.
void SetMedium(TGeoMedium *medium) override
Set medium for a multiple volume.
TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option="") override
Add a new node to the list of nodes.
Int_t GetAxis() const
Definition TGeoVolume.h:297
TGeoVolume * GetVolume(Int_t id) const
Definition TGeoVolume.h:289
void SetVisibility(Bool_t vis=kTRUE) override
Set visibility for all components.
TGeoVolumeMulti & operator=(const TGeoVolumeMulti &)=delete
~TGeoVolumeMulti() override
Destructor.
Double_t GetStart() const
Definition TGeoVolume.h:299
TGeoVolumeMulti * fDivision
Definition TGeoVolume.h:272
TGeoVolumeMulti()
dummy constructor
TGeoVolumeMulti(const TGeoVolumeMulti &)=delete
TGeoShape * GetLastShape() const
Returns the last shape.
void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option="") override
Add a new node to the list of nodes, This node is possibly overlapping with other daughters of the vo...
void SetLineStyle(Style_t lstyle) override
Set the line style for all components.
Double_t GetStep() const
Definition TGeoVolume.h:300
Int_t GetNvolumes() const
Definition TGeoVolume.h:296
Bool_t IsVolumeMulti() const override
Definition TGeoVolume.h:301
TObjArray * fVolumes
Definition TGeoVolume.h:271
Int_t GetNdiv() const
Definition TGeoVolume.h:298
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:45
virtual Int_t GetNextNodeIndex() const
Definition TGeoVolume.h:171
Double_t WeightA() const
Analytical computation of the weight.
Bool_t IsCylVoxels() const
Definition TGeoVolume.h:154
void AddNodeOffset(TGeoVolume *vol, Int_t copy_no, Double_t offset=0, Option_t *option="")
Add a division node to the list of nodes.
void SetVisContainers(Bool_t flag=kTRUE) override
Set visibility for containers.
virtual void cd(Int_t inode) const
Actualize matrix of node indexed <inode>
virtual void ClearThreadData() const
void SetVisibility(Bool_t vis=kTRUE) override
set visibility of this volume
Bool_t IsVisContainers() const
Definition TGeoVolume.h:160
void SetVoxelFinder(TGeoVoxelFinder *finder)
Definition TGeoVolume.h:246
void RemoveNode(TGeoNode *node)
Remove an existing daughter.
Int_t GetNodeIndex(const TGeoNode *node, Int_t *check_list, Int_t ncheck) const
Get the index of a daughter within check_list by providing the node pointer.
Bool_t Valid() const
Check if the shape of this volume is valid.
TGeoNode * GetNode(Int_t i) const
Definition TGeoVolume.h:185
void CheckOverlapsBySampling(Double_t ovlp=0.1, Int_t npoints=1000000)
Overlap by sampling legacy checking tool. Check for illegal overlaps within a limit OVLP.
TGeoExtension * GetUserExtension() const
Definition TGeoVolume.h:135
Bool_t IsAllInvisible() const
Return TRUE if volume and all daughters are invisible.
Bool_t IsXYZVoxels() const
Definition TGeoVolume.h:155
Int_t fNtotal
Definition TGeoVolume.h:58
void MakeCopyNodes(const TGeoVolume *other)
make a new list of nodes and copy all nodes of other volume inside
void SetUserExtension(TGeoExtension *ext)
Connect user-defined extension to the volume.
TGeoExtension * GrabFWExtension() const
Get a copy of the framework extension pointer.
void SetNumber(Int_t number)
Definition TGeoVolume.h:248
void ClearNodes()
Definition TGeoVolume.h:97
void Raytrace(Bool_t flag=kTRUE)
Draw this volume with current settings and perform raytracing in the pad.
void RandomRays(Int_t nrays=10000, Double_t startx=0, Double_t starty=0, Double_t startz=0, const char *target_vol=nullptr, Bool_t check_norm=kFALSE)
Random raytracing method.
TGeoVolume()
dummy constructor
TGeoMedium * GetMedium() const
Definition TGeoVolume.h:178
char * GetObjectInfo(Int_t px, Int_t py) const override
Get volume info for the browser.
void Print(Option_t *option="") const override
Print volume info.
void CloneNodesAndConnect(TGeoVolume *newmother) const
Clone the array of nodes.
Int_t GetRefCount() const
Definition TGeoVolume.h:134
Bool_t IsActiveDaughters() const
Definition TGeoVolume.h:149
Bool_t IsSelected() const
Definition TGeoVolume.h:153
void SortNodes()
sort nodes by decreasing volume of the bounding box.
Bool_t FindMatrixOfDaughterVolume(TGeoVolume *vol) const
Find a daughter node having VOL as volume and fill TGeoManager::fHMatrix with its global matrix.
void Voxelize(Option_t *option)
build the voxels for this volume
void Gsord(Int_t)
Definition TGeoVolume.h:195
TGeoManager * GetGeoManager() const
Definition TGeoVolume.h:176
Double_t Capacity() const
Computes the capacity of this [cm^3] as the capacity of its shape.
Bool_t IsRunTime() const
Definition TGeoVolume.h:112
virtual TGeoVolume * MakeCopyVolume(TGeoShape *newshape)
make a copy of this volume build a volume with same name, shape and medium
Bool_t IsReplicated() const
Definition TGeoVolume.h:152
void ReplayCreation(const TGeoVolume *other)
Recreate the content of the other volume without pointer copying.
Double_t Weight(Double_t precision=0.01, Option_t *option="va")
Estimate the weight of a volume (in kg) with SIGMA(M)/M better than PRECISION.
Int_t fNumber
Definition TGeoVolume.h:57
virtual void CreateThreadData(Int_t nthreads)
virtual Int_t GetByteCount() const
get the total size in bytes for this volume
Bool_t Contains(const Double_t *point) const
Definition TGeoVolume.h:107
virtual TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
Add a TGeoNode to the list of nodes.
Bool_t OptimizeVoxels()
Perform an extensive sampling to find which type of voxelization is most efficient.
void Browse(TBrowser *b) override
How to browse a volume.
void SetCylVoxels(Bool_t flag=kTRUE)
Definition TGeoVolume.h:221
void SetCurrentPoint(Double_t x, Double_t y, Double_t z)
Set the current tracking point.
void Paint(Option_t *option="") override
paint volume
void SetVisOnly(Bool_t flag=kTRUE) override
Set visibility for leaves.
TGeoManager * fGeoManager
! pointer to TGeoManager owning this volume
Definition TGeoVolume.h:53
TH2F * LegoPlot(Int_t ntheta=20, Double_t themin=0., Double_t themax=180., Int_t nphi=60, Double_t phimin=0., Double_t phimax=360., Double_t rmin=0., Double_t rmax=9999999, Option_t *option="")
Generate a lego plot fot the top volume, according to option.
TGeoExtension * GetFWExtension() const
Definition TGeoVolume.h:136
void SetActivity(Bool_t flag=kTRUE)
Definition TGeoVolume.h:215
TGeoVoxelFinder * fVoxels
Definition TGeoVolume.h:52
TGeoMaterial * GetMaterial() const
Definition TGeoVolume.h:177
virtual Bool_t IsVolumeMulti() const
Definition TGeoVolume.h:113
TGeoExtension * GrabUserExtension() const
Get a copy of the user extension pointer.
@ kVolumeReplicated
Definition TGeoVolume.h:74
@ kVolumeSelected
Definition TGeoVolume.h:75
@ kVolumeImportNodes
Definition TGeoVolume.h:78
Int_t CountNodes(Int_t nlevels=1000, Int_t option=0)
Count total number of subnodes starting from this volume, nlevels down.
void GrabFocus()
Move perspective view focus to this volume.
void UnmarkSaved()
Reset SavePrimitive bits.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute mouse actions on this volume.
virtual TGeoVolume * CloneVolume() const
Clone this volume.
void SetFinder(TGeoPatternFinder *finder)
Definition TGeoVolume.h:247
Int_t GetNdaughters() const
Definition TGeoVolume.h:371
Bool_t IsValid() const
Definition TGeoVolume.h:157
void Grab()
Definition TGeoVolume.h:139
void CheckGeometry(Int_t nrays=1, Double_t startx=0, Double_t starty=0, Double_t startz=0) const
Shoot nrays with random directions from starting point (startx, starty, startz) in the reference fram...
void SelectVolume(Bool_t clear=kFALSE)
Select this volume as matching an arbitrary criteria.
const char * GetPointerName() const
Provide a pointer name containing uid.
TObjArray * GetNodes()
Definition TGeoVolume.h:172
void SetTransparency(Char_t transparency=0)
Definition TGeoVolume.h:386
void ClearShape()
Clear the shape of this volume from the list held by the current manager.
void SetFWExtension(TGeoExtension *ext)
Connect framework defined extension to the volume.
void VisibleDaughters(Bool_t vis=kTRUE)
set visibility for daughters
void Release()
Definition TGeoVolume.h:140
void FindOverlaps() const
loop all nodes marked as overlaps and find overlapping brothers
virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
Add a TGeoNode to the list of nodes.
TGeoNode * GetNode(const char *name) const
get the pointer to a daughter node
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
compute the closest distance of approach from point px,py to this volume
void RandomPoints(Int_t npoints=1000000, Option_t *option="")
Draw random points in the bounding box of this volume.
void CheckShapes()
check for negative parameters in shapes.
void SetNtotal(Int_t ntotal)
Definition TGeoVolume.h:249
Bool_t GetOptimalVoxels() const
Returns true if cylindrical voxelization is optimal.
TGeoNode * ReplaceNode(TGeoNode *nodeorig, TGeoShape *newshape=nullptr, TGeoMatrix *newpos=nullptr, TGeoMedium *newmed=nullptr)
Replace an existing daughter with a new volume having the same name but possibly a new shape,...
void InvisibleAll(Bool_t flag=kTRUE)
Make volume and each of it daughters (in)visible.
Bool_t IsVisibleDaughters() const
Definition TGeoVolume.h:159
TString fOption
! option - if any
Definition TGeoVolume.h:56
Int_t GetIndex(const TGeoNode *node) const
get index number for a given daughter
void SetNodes(TObjArray *nodes)
Definition TGeoVolume.h:226
TGeoPatternFinder * GetFinder() const
Definition TGeoVolume.h:180
void PrintVoxels() const
Print the voxels for this volume.
TGeoExtension * fUserExtension
! Transient user-defined extension to volumes
Definition TGeoVolume.h:61
virtual void SetMedium(TGeoMedium *medium)
Definition TGeoVolume.h:245
TGeoVoxelFinder * GetVoxels() const
Getter for optimization structure.
void SetAttVisibility(Bool_t vis)
Definition TGeoVolume.h:236
~TGeoVolume() override
Destructor.
void SetShape(const TGeoShape *shape)
set the shape associated with this volume
static TGeoMedium * DummyMedium()
TObject * fField
! just a hook for now
Definition TGeoVolume.h:55
Int_t GetNumber() const
Definition TGeoVolume.h:187
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
void CleanAll()
Clean data of the volume.
void SetActiveDaughters(Bool_t flag=kTRUE)
Definition TGeoVolume.h:216
Bool_t IsTopVolume() const
True if this is the top volume of the geometry.
TGeoMedium * fMedium
Definition TGeoVolume.h:49
TGeoShape * GetShape() const
Definition TGeoVolume.h:193
void SetInvisible()
Definition TGeoVolume.h:244
void InspectMaterial() const
Inspect the material for this volume.
void PrintNodes() const
print nodes
static TGeoMedium * fgDummyMedium
! dummy medium
Definition TGeoVolume.h:50
void RegisterYourself(Option_t *option="")
Register the volume and all materials/media/matrices/shapes to the manager.
TGeoVolume & operator=(const TGeoVolume &)=delete
void CheckOverlaps(Double_t ovlp=0.1, Option_t *option="")
Overlap checking tool. Check for illegal overlaps within a limit OVLP.
TGeoVolume(const TGeoVolume &)=delete
virtual TGeoVolume * Divide(const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed=0, Option_t *option="")
Division a la G3.
Bool_t IsRaytracing() const
Check if the painter is currently ray-tracing the content of this volume.
void SaveAs(const char *filename="", Option_t *option="") const override
Save geometry having this as top volume as a C++ macro.
virtual Int_t GetCurrentNodeIndex() const
Definition TGeoVolume.h:170
TGeoShape * fShape
Definition TGeoVolume.h:48
void SetField(TObject *field)
Definition TGeoVolume.h:234
static TGeoVolume * Import(const char *filename, const char *name="", Option_t *option="")
Import a volume from a file.
Bool_t IsStyleDefault() const
check if the visibility and attributes are the default ones
Char_t fTransparency
Definition TGeoVolume.h:60
static void CreateDummyMedium()
Create a dummy medium.
TGeoExtension * fFWExtension
! Transient framework-defined extension to volumes
Definition TGeoVolume.h:62
void SetAsTopVolume()
Set this volume as the TOP one (the whole geometry starts from here)
void SetAdded()
Definition TGeoVolume.h:218
Bool_t IsVisLeaves() const
Definition TGeoVolume.h:161
Option_t * GetOption() const override
Definition TGeoVolume.h:190
void SetReplicated()
Definition TGeoVolume.h:219
TObject * GetField() const
Definition TGeoVolume.h:179
TGeoPatternFinder * fFinder
Definition TGeoVolume.h:51
Int_t Export(const char *filename, const char *name="", Option_t *option="")
Export this volume to a file.
const char * GetIconName() const override
Returns mime type name of object.
Definition TGeoVolume.h:182
virtual void DrawOnly(Option_t *option="")
draw only this volume
void SetLineStyle(Style_t lstyle) override
Set the line style.
void SetOption(const char *option)
Set the current options (none implemented)
Bool_t IsVisOnly() const
Definition TGeoVolume.h:162
virtual Bool_t IsAssembly() const
Returns true if the volume is an assembly or a scaled assembly.
TGeoVolume * MakeReflectedVolume(const char *newname="") const
Make a copy of this volume which is reflected with respect to XY plane.
Char_t GetTransparency() const
Definition TGeoVolume.h:378
Bool_t IsActive() const
Definition TGeoVolume.h:148
TObjArray * fNodes
Definition TGeoVolume.h:47
virtual Bool_t IsVisible() const
Definition TGeoVolume.h:158
Bool_t IsAdded() const
Definition TGeoVolume.h:150
Int_t GetNtotal() const
Definition TGeoVolume.h:174
void SetVisLeaves(Bool_t flag=kTRUE) override
Set visibility for leaves.
void InspectShape() const
Definition TGeoVolume.h:198
Bool_t IsFolder() const override
Return TRUE if volume contains nodes.
TGeoNode * FindNode(const char *name) const
search a daughter inside the list of nodes
void SetOverlappingCandidate(Bool_t flag)
Definition TGeoVolume.h:231
Bool_t IsOverlappingCandidate() const
Definition TGeoVolume.h:151
Int_t fRefCount
Definition TGeoVolume.h:59
void ResetTransparency(Char_t transparency=-1)
Definition TGeoVolume.h:393
void CheckShape(Int_t testNo, Int_t nsamples=10000, Option_t *option="")
Tests for checking the shape navigation algorithms. See TGeoShape::CheckShape()
Finder class handling voxels.
2-D histogram with a float per channel (see TH1 documentation)
Definition TH2.h:345
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
An array of TObjects.
Definition TObjArray.h:31
Int_t GetEntriesFast() const
Definition TObjArray.h:58
TObject * At(Int_t idx) const override
Definition TObjArray.h:170
TObject * UncheckedAt(Int_t i) const
Definition TObjArray.h:90
Mother of all ROOT objects.
Definition TObject.h:42
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:204
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:886
Basic string class.
Definition TString.h:138
const char * Data() const
Definition TString.h:386
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
non-reused index of this assembly into the per-thread vector
Definition TGeoVolume.h:324
Int_t fNext
index of current selected node
Definition TGeoVolume.h:326
th1 Draw()