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 <mutex>
25#include <vector>
26
27// forward declarations
28class TH2F;
29class TGeoNode;
30class TGeoMatrix;
32class TGeoVoxelFinder;
33class TGeoManager;
34class TGeoExtension;
35
36////////////////////////////////////////////////////////////////////////////
37// //
38// TGeoVolume - base class representing a single volume having a shape //
39// and a medium. //
40// //
41////////////////////////////////////////////////////////////////////////////
42
43class TGeoVolume : public TNamed, public TGeoAtt, public TAttLine, public TAttFill, public TAtt3D {
44protected:
45 TObjArray *fNodes; // array of nodes inside this volume
46 TGeoShape *fShape; // shape
47 TGeoMedium *fMedium; // tracking medium
48 static TGeoMedium *fgDummyMedium; //! dummy medium
49 TGeoPatternFinder *fFinder; // finder object for divisions
50 TGeoVoxelFinder *fVoxels; // finder object for bounding boxes
51 TGeoManager *fGeoManager; //! pointer to TGeoManager owning this volume
52
53 TObject *fField; //! just a hook for now
54 TString fOption; //! option - if any
55 Int_t fNumber; // volume serial number in the list of volumes
56 Int_t fNtotal; // total number of physical nodes
57 Int_t fRefCount; // reference counter
58 Char_t fTransparency; // transparency setting
59 TGeoExtension *fUserExtension; //! Transient user-defined extension to volumes
60 TGeoExtension *fFWExtension; //! Transient framework-defined extension to volumes
61
62private:
63 TGeoVolume(const TGeoVolume &) = delete;
64 TGeoVolume &operator=(const TGeoVolume &) = delete;
65
66public:
67 virtual void ClearThreadData() const;
68 virtual void CreateThreadData(Int_t nthreads);
69
70public:
78 kVoxelsXYZ = BIT(20), // not used
79 kVoxelsCyl = BIT(21), // not used
82 kVolumeOC = BIT(21) // overlapping candidates
83 };
84 // constructors
85 TGeoVolume();
86 TGeoVolume(const char *name, const TGeoShape *shape, const TGeoMedium *med = nullptr);
87
88 // destructor
89 ~TGeoVolume() override;
90 // methods
91 virtual void cd(Int_t inode) const;
92 void Browse(TBrowser *b) override;
93 Double_t Capacity() const;
94 void CheckShapes();
95 void ClearNodes() { fNodes = nullptr; }
96 void ClearShape();
97 void CleanAll();
98 virtual TGeoVolume *CloneVolume() const;
99 void CloneNodesAndConnect(TGeoVolume *newmother) const;
100 void CheckGeometry(Int_t nrays = 1, Double_t startx = 0, Double_t starty = 0, Double_t startz = 0) const;
101 void CheckOverlaps(Double_t ovlp = 0.1, Option_t *option = "") const; // *MENU*
102 void CheckShape(Int_t testNo, Int_t nsamples = 10000, Option_t *option = ""); // *MENU*
103 Int_t CountNodes(Int_t nlevels = 1000, Int_t option = 0);
104 Bool_t Contains(const Double_t *point) const { return fShape->Contains(point); }
105 static void CreateDummyMedium();
106 static TGeoMedium *DummyMedium();
107 virtual Bool_t IsAssembly() const;
108 Bool_t IsFolder() const override;
109 Bool_t IsRunTime() const { return fShape->IsRunTimeShape(); }
110 virtual Bool_t IsVolumeMulti() const { return kFALSE; }
111 virtual TGeoNode *
112 AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat = nullptr, Option_t *option = ""); // most general case
113 void AddNodeOffset(TGeoVolume *vol, Int_t copy_no, Double_t offset = 0, Option_t *option = "");
114 virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat = nullptr, Option_t *option = "");
115
116 virtual TGeoVolume *Divide(const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step,
117 Int_t numed = 0, Option_t *option = "");
118 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
119 void Draw(Option_t *option = "") override; // *MENU*
120 virtual void DrawOnly(Option_t *option = ""); // *MENU*
121 TH2F *LegoPlot(Int_t ntheta = 20, Double_t themin = 0., Double_t themax = 180., Int_t nphi = 60,
122 Double_t phimin = 0., Double_t phimax = 360., Double_t rmin = 0., Double_t rmax = 9999999,
123 Option_t *option = ""); // *MENU*
124 void Paint(Option_t *option = "") override;
125 void Print(Option_t *option = "") const override; // *MENU*
126 void PrintNodes() const;
127 void PrintVoxels() const; // *MENU*
128 void ReplayCreation(const TGeoVolume *other);
130 void SetFWExtension(TGeoExtension *ext);
131 Int_t GetRefCount() const { return fRefCount; }
136 void Grab() { fRefCount++; }
137 void Release()
138 {
139 fRefCount--;
140 if (fRefCount == 0)
141 delete this;
142 }
143 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
144
145 Bool_t IsActive() const { return TGeoAtt::IsActive(); }
153 Bool_t IsTopVolume() const;
154 Bool_t IsValid() const { return fShape->IsValid(); }
155 virtual Bool_t IsVisible() const { return TGeoAtt::IsVisible(); }
159 Bool_t IsVisOnly() const { return TGeoAtt::IsVisOnly(); }
160 Bool_t IsAllInvisible() const;
161 Bool_t IsRaytracing() const;
162 static TGeoVolume *Import(const char *filename, const char *name = "", Option_t *option = "");
163 Int_t Export(const char *filename, const char *name = "", Option_t *option = "");
164 TGeoNode *FindNode(const char *name) const;
165 void FindOverlaps() const;
167 virtual Int_t GetCurrentNodeIndex() const { return -1; }
168 virtual Int_t GetNextNodeIndex() const { return -1; }
169 TObjArray *GetNodes() { return fNodes; }
170 Int_t GetNdaughters() const;
171 Int_t GetNtotal() const { return fNtotal; }
172 virtual Int_t GetByteCount() const;
175 TGeoMedium *GetMedium() const { return (fMedium) ? fMedium : DummyMedium(); }
176 TObject *GetField() const { return fField; }
178 TGeoVoxelFinder *GetVoxels() const;
179 const char *GetIconName() const override { return fShape->GetName(); }
180 Int_t GetIndex(const TGeoNode *node) const;
181 TGeoNode *GetNode(const char *name) const;
182 TGeoNode *GetNode(Int_t i) const { return (TGeoNode *)fNodes->UncheckedAt(i); }
183 Int_t GetNodeIndex(const TGeoNode *node, Int_t *check_list, Int_t ncheck) const;
184 Int_t GetNumber() const { return fNumber; }
185 char *GetObjectInfo(Int_t px, Int_t py) const override;
186 Bool_t GetOptimalVoxels() const;
187 Option_t *GetOption() const override { return fOption.Data(); }
188 const char *GetPointerName() const;
189 Char_t GetTransparency() const;
190 TGeoShape *GetShape() const { return fShape; }
191 void GrabFocus(); // *MENU*
192 void Gsord(Int_t /*iaxis*/) {}
193 Bool_t IsStyleDefault() const;
194 void InspectMaterial() const; // *MENU*
195 void InspectShape() const { fShape->InspectShape(); } // *MENU*
196 virtual TGeoVolume *MakeCopyVolume(TGeoShape *newshape);
197 void MakeCopyNodes(const TGeoVolume *other);
198 TGeoVolume *MakeReflectedVolume(const char *newname = "") const;
199 Bool_t OptimizeVoxels(); // *MENU*
200 void RandomPoints(Int_t npoints = 1000000, Option_t *option = ""); // *MENU*
201 void RandomRays(Int_t nrays = 10000, Double_t startx = 0, Double_t starty = 0, Double_t startz = 0,
202 const char *target_vol = nullptr, Bool_t check_norm = kFALSE); // *MENU*
203 void Raytrace(Bool_t flag = kTRUE); // *TOGGLE* *GETTER=IsRaytracing
204 void RegisterYourself(Option_t *option = "");
205 void RemoveNode(TGeoNode *node);
206 TGeoNode *ReplaceNode(TGeoNode *nodeorig, TGeoShape *newshape = nullptr, TGeoMatrix *newpos = nullptr,
207 TGeoMedium *newmed = nullptr);
208 void ResetTransparency(Char_t transparency = -1); // *MENU*
209 void SaveAs(const char *filename, Option_t *option = "") const override; // *MENU*
210 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
211 void SelectVolume(Bool_t clear = kFALSE);
214 void SetAsTopVolume(); // *TOGGLE* *GETTER=IsTopVolume
219 {
222 }
223 void SetNodes(TObjArray *nodes)
224 {
225 fNodes = nodes;
227 }
229 void SetShape(const TGeoShape *shape);
230 void SetTransparency(Char_t transparency = 0); // *MENU*
231 void SetField(TObject *field) { fField = field; }
232 void SetOption(const char *option);
234 void SetVisibility(Bool_t vis = kTRUE) override; // *TOGGLE* *GETTER=IsVisible
235 void SetVisContainers(Bool_t flag = kTRUE) override; // *TOGGLE* *GETTER=IsVisContainers
236 void SetVisLeaves(Bool_t flag = kTRUE) override; // *TOGGLE* *GETTER=IsVisLeaves
237 void SetVisOnly(Bool_t flag = kTRUE) override; // *TOGGLE* *GETTER=IsVisOnly
238 void SetLineColor(Color_t lcolor) override;
239 void SetLineStyle(Style_t lstyle) override;
240 void SetLineWidth(Width_t lwidth) override;
242 virtual void SetMedium(TGeoMedium *medium) { fMedium = medium; }
243 void SetVoxelFinder(TGeoVoxelFinder *finder) { fVoxels = finder; }
244 void SetFinder(TGeoPatternFinder *finder) { fFinder = finder; }
245 void SetNumber(Int_t number) { fNumber = number; }
246 void SetNtotal(Int_t ntotal) { fNtotal = ntotal; }
247 void SortNodes();
248 void UnmarkSaved();
249 Bool_t Valid() const;
250 void VisibleDaughters(Bool_t vis = kTRUE); // *TOGGLE* *GETTER=IsVisibleDaughters
251 void InvisibleAll(Bool_t flag = kTRUE); // *TOGGLE* *GETTER=IsAllInvisible
252 void Voxelize(Option_t *option);
253 Double_t Weight(Double_t precision = 0.01, Option_t *option = "va"); // *MENU*
254 Double_t WeightA() const;
255
256 ClassDefOverride(TGeoVolume, 7) // geometry volume descriptor
257};
258
259////////////////////////////////////////////////////////////////////////////
260// //
261// TGeoVolumeMulti - class storing a list of volumes that have to //
262// be handled together at build time //
263// //
264////////////////////////////////////////////////////////////////////////////
265
267private:
268 TObjArray *fVolumes; // list of volumes
269 TGeoVolumeMulti *fDivision; // division of this volume
270 Int_t fNumed; // medium number for divisions
271 Int_t fNdiv; // number of divisions
272 Int_t fAxis; // axis of division
273 Double_t fStart; // division start offset
274 Double_t fStep; // division step
275 Bool_t fAttSet; // flag attributes set
276
279
280public:
282 TGeoVolumeMulti(const char *name, TGeoMedium *med = nullptr);
283 ~TGeoVolumeMulti() override;
284
285 void AddVolume(TGeoVolume *vol);
286 TGeoVolume *GetVolume(Int_t id) const { return (TGeoVolume *)fVolumes->At(id); }
287 TGeoNode *
288 AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option = "") override; // most general case
289 void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option = "") override;
290 TGeoVolume *Divide(const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed = 0,
291 Option_t *option = "") override;
292 TGeoShape *GetLastShape() const;
294 Int_t GetAxis() const { return fNdiv; }
295 Int_t GetNdiv() const { return fNdiv; }
296 Double_t GetStart() const { return fStart; }
297 Double_t GetStep() const { return fStep; }
298 Bool_t IsVolumeMulti() const override { return kTRUE; }
299 TGeoVolume *MakeCopyVolume(TGeoShape *newshape) override;
300 void SetLineColor(Color_t lcolor) override;
301 void SetLineStyle(Style_t lstyle) override;
302 void SetLineWidth(Width_t lwidth) override;
303 void SetMedium(TGeoMedium *medium) override;
304 void SetVisibility(Bool_t vis = kTRUE) override;
305
306 ClassDefOverride(TGeoVolumeMulti, 3) // class to handle multiple volumes in one step
307};
308
309////////////////////////////////////////////////////////////////////////////
310// //
311// TGeoVolumeAssembly - special assembly of volumes. The assembly has no //
312// medium and its shape is the union of all component shapes //
313// //
314////////////////////////////////////////////////////////////////////////////
315
317public:
319 Int_t fCurrent; //! index of current selected node
320 Int_t fNext; //! index of next node to be entered
321
322 ThreadData_t();
324 };
325
327 void ClearThreadData() const override;
328 void CreateThreadData(Int_t nthreads) override;
329
330protected:
331 mutable std::vector<ThreadData_t *> fThreadData; //! Thread specific data vector
332 mutable Int_t fThreadSize; //! Thread vector size
333 mutable std::mutex fMutex; //! Mutex for concurrent operations
334
335private:
338
339public:
341 TGeoVolumeAssembly(const char *name);
342 ~TGeoVolumeAssembly() override;
343
344 TGeoNode *AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat = nullptr, Option_t *option = "") override;
345 void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option) override;
346 TGeoVolume *CloneVolume() const override;
347 TGeoVolume *Divide(const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed = 0,
348 Option_t *option = "") override;
349 TGeoVolume *Divide(TGeoVolume *cell, TGeoPatternFinder *pattern, Option_t *option = "spacedout");
350 void DrawOnly(Option_t *) override {}
351 Int_t GetCurrentNodeIndex() const override;
352 Int_t GetNextNodeIndex() const override;
353 Bool_t IsAssembly() const override { return kTRUE; }
354 Bool_t IsVisible() const override { return kFALSE; }
358
359 ClassDefOverride(TGeoVolumeAssembly, 2) // an assembly of volumes
360};
361
363{
364 if (!fNodes)
365 return 0;
366 return (fNodes->GetEntriesFast());
367}
368
370{
371 // If the transparency is (-1), the old default handling is applied
372 if ( fTransparency >= 0 ) return fTransparency;
373 return !fMedium ? 0 : fMedium->GetMaterial()->GetTransparency();
374}
375
376inline void TGeoVolume::SetTransparency(Char_t transparency)
377{
378 if (fMedium) {
379 fMedium->GetMaterial()->SetTransparency(transparency);
380 }
381}
382
383inline void TGeoVolume::ResetTransparency(Char_t transparency)
384{
385 fTransparency = transparency;
386}
387
388#endif
#define b(i)
Definition RSha256.hxx:100
short Style_t
Definition RtypesCore.h:89
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
short Color_t
Definition RtypesCore.h:92
char Char_t
Definition RtypesCore.h:37
short Width_t
Definition RtypesCore.h:91
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
double Double_t
Definition RtypesCore.h:59
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define BIT(n)
Definition Rtypes.h:85
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
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:110
Use this attribute class when an object should have 3D capabilities.
Definition TAtt3D.h:19
Fill Area Attributes class.
Definition TAttFill.h:19
Line Attributes class.
Definition TAttLine.h:18
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:104
ABC for user objects attached to TGeoVolume or TGeoNode.
The manager class for any TGeo geometry.
Definition TGeoManager.h:44
Base class describing materials.
Char_t GetTransparency() const
void SetTransparency(Char_t transparency=0)
Geometrical transformation package.
Definition TGeoMatrix.h:38
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.
Base abstract class for all shapes.
Definition TGeoShape.h:25
Bool_t IsValid() const
Definition TGeoShape.h:143
Bool_t IsRunTimeShape() const
Definition TGeoShape.h:142
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:316
static TGeoVolumeAssembly * MakeAssemblyFromVolume(TGeoVolume *vol)
Make a clone of volume VOL but which is an assembly.
TGeoVolumeAssembly & operator=(const TGeoVolumeAssembly &)=delete
~TGeoVolumeAssembly() override
Destructor. The assembly is owner of its "shape".
Int_t GetNextNodeIndex() const override
Bool_t IsVisible() const override
Definition TGeoVolume.h:354
void CreateThreadData(Int_t nthreads) override
TGeoVolumeAssembly(const TGeoVolumeAssembly &)=delete
Mutex for concurrent operations.
TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="") override
Add a component to the assembly.
void ClearThreadData() const override
TGeoVolume * CloneVolume() const override
Clone this volume.
void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option) override
Add an overlapping node - not allowed for assemblies.
std::vector< ThreadData_t * > fThreadData
Definition TGeoVolume.h:331
std::mutex fMutex
Thread vector size.
Definition TGeoVolume.h:333
void DrawOnly(Option_t *) override
draw only this volume
Definition TGeoVolume.h:350
Int_t fThreadSize
Thread specific data vector.
Definition TGeoVolume.h:332
void SetNextNodeIndex(Int_t index)
Int_t GetCurrentNodeIndex() const override
void SetCurrentNodeIndex(Int_t index)
TGeoVolumeAssembly()
Default constructor.
Bool_t IsAssembly() const override
Returns true if the volume is an assembly or a scaled assembly.
Definition TGeoVolume.h:353
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.
ThreadData_t & GetThreadData() const
Volume families.
Definition TGeoVolume.h:266
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:273
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:294
TGeoVolume * GetVolume(Int_t id) const
Definition TGeoVolume.h:286
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:296
TGeoVolumeMulti * fDivision
Definition TGeoVolume.h:269
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:297
Int_t GetNvolumes() const
Definition TGeoVolume.h:293
Bool_t IsVolumeMulti() const override
Definition TGeoVolume.h:298
TObjArray * fVolumes
Definition TGeoVolume.h:268
Int_t GetNdiv() const
Definition TGeoVolume.h:295
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:43
virtual Int_t GetNextNodeIndex() const
Definition TGeoVolume.h:168
Double_t WeightA() const
Analytical computation of the weight.
Bool_t IsCylVoxels() const
Definition TGeoVolume.h:151
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:157
void SetVoxelFinder(TGeoVoxelFinder *finder)
Definition TGeoVolume.h:243
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:182
TGeoExtension * GetUserExtension() const
Definition TGeoVolume.h:132
Bool_t IsAllInvisible() const
Return TRUE if volume and all daughters are invisible.
Bool_t IsXYZVoxels() const
Definition TGeoVolume.h:152
Int_t fNtotal
Definition TGeoVolume.h:56
void SaveAs(const char *filename, Option_t *option="") const override
Save geometry having this as top volume as a C++ macro.
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:245
void ClearNodes()
Definition TGeoVolume.h:95
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:175
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:131
Bool_t IsActiveDaughters() const
Definition TGeoVolume.h:146
Bool_t IsSelected() const
Definition TGeoVolume.h:150
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:192
TGeoManager * GetGeoManager() const
Definition TGeoVolume.h:173
Double_t Capacity() const
Computes the capacity of this [cm^3] as the capacity of its shape.
Bool_t IsRunTime() const
Definition TGeoVolume.h:109
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:149
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
option - if any
Definition TGeoVolume.h:55
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:104
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:218
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
Definition TGeoVolume.h:51
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:133
void SetActivity(Bool_t flag=kTRUE)
Definition TGeoVolume.h:212
TGeoVoxelFinder * fVoxels
Definition TGeoVolume.h:50
TGeoMaterial * GetMaterial() const
Definition TGeoVolume.h:174
virtual Bool_t IsVolumeMulti() const
Definition TGeoVolume.h:110
TGeoExtension * GrabUserExtension() const
Get a copy of the user extension pointer.
@ kVolumeReplicated
Definition TGeoVolume.h:72
@ kVolumeSelected
Definition TGeoVolume.h:73
@ kVolumeImportNodes
Definition TGeoVolume.h:76
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:244
Int_t GetNdaughters() const
Definition TGeoVolume.h:362
Bool_t IsValid() const
Definition TGeoVolume.h:154
void Grab()
Definition TGeoVolume.h:136
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:169
void SetTransparency(Char_t transparency=0)
Definition TGeoVolume.h:376
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:137
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:246
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:156
TString fOption
just a hook for now
Definition TGeoVolume.h:54
Int_t GetIndex(const TGeoNode *node) const
get index number for a given daughter
void SetNodes(TObjArray *nodes)
Definition TGeoVolume.h:223
TGeoPatternFinder * GetFinder() const
Definition TGeoVolume.h:177
void PrintVoxels() const
Print the voxels for this volume.
TGeoExtension * fUserExtension
Definition TGeoVolume.h:59
virtual void SetMedium(TGeoMedium *medium)
Definition TGeoVolume.h:242
TGeoVoxelFinder * GetVoxels() const
Getter for optimization structure.
void SetAttVisibility(Bool_t vis)
Definition TGeoVolume.h:233
~TGeoVolume() override
Destructor.
void SetShape(const TGeoShape *shape)
set the shape associated with this volume
static TGeoMedium * DummyMedium()
TObject * fField
pointer to TGeoManager owning this volume
Definition TGeoVolume.h:53
Int_t GetNumber() const
Definition TGeoVolume.h:184
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:213
Bool_t IsTopVolume() const
True if this is the top volume of the geometry.
TGeoMedium * fMedium
Definition TGeoVolume.h:47
TGeoShape * GetShape() const
Definition TGeoVolume.h:190
void SetInvisible()
Definition TGeoVolume.h:241
void InspectMaterial() const
Inspect the material for this volume.
void PrintNodes() const
print nodes
static TGeoMedium * fgDummyMedium
Definition TGeoVolume.h:48
void RegisterYourself(Option_t *option="")
Register the volume and all materials/media/matrices/shapes to the manager.
TGeoVolume & operator=(const TGeoVolume &)=delete
TGeoVolume(const TGeoVolume &)=delete
Transient framework-defined extension to volumes.
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.
virtual Int_t GetCurrentNodeIndex() const
Definition TGeoVolume.h:167
TGeoShape * fShape
Definition TGeoVolume.h:46
void SetField(TObject *field)
Definition TGeoVolume.h:231
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:58
static void CreateDummyMedium()
Create a dummy medium.
TGeoExtension * fFWExtension
Transient user-defined extension to volumes.
Definition TGeoVolume.h:60
void SetAsTopVolume()
Set this volume as the TOP one (the whole geometry starts from here)
void SetAdded()
Definition TGeoVolume.h:215
Bool_t IsVisLeaves() const
Definition TGeoVolume.h:158
Option_t * GetOption() const override
Definition TGeoVolume.h:187
void SetReplicated()
Definition TGeoVolume.h:216
TObject * GetField() const
Definition TGeoVolume.h:176
TGeoPatternFinder * fFinder
dummy medium
Definition TGeoVolume.h:49
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:179
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:159
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:369
Bool_t IsActive() const
Definition TGeoVolume.h:145
TObjArray * fNodes
Definition TGeoVolume.h:45
virtual Bool_t IsVisible() const
Definition TGeoVolume.h:155
Bool_t IsAdded() const
Definition TGeoVolume.h:147
Int_t GetNtotal() const
Definition TGeoVolume.h:171
void SetVisLeaves(Bool_t flag=kTRUE) override
Set visibility for leaves.
void InspectShape() const
Definition TGeoVolume.h:195
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 CheckOverlaps(Double_t ovlp=0.1, Option_t *option="") const
Overlap checking tool.
void SetOverlappingCandidate(Bool_t flag)
Definition TGeoVolume.h:228
Bool_t IsOverlappingCandidate() const
Definition TGeoVolume.h:148
Int_t fRefCount
Definition TGeoVolume.h:57
void ResetTransparency(Char_t transparency=-1)
Definition TGeoVolume.h:383
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:295
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:164
TObject * UncheckedAt(Int_t i) const
Definition TObjArray.h:84
Mother of all ROOT objects.
Definition TObject.h:41
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:201
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:780
Basic string class.
Definition TString.h:139
const char * Data() const
Definition TString.h:378
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
ThreadData_t()
index of next node to be entered
Int_t fNext
index of current selected node
Definition TGeoVolume.h:320
th1 Draw()