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;
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 = ""); // *MENU*
102 void CheckOverlapsBySampling(Double_t ovlp = 0.1, Int_t npoints = 1000000); // *MENU*
103 void CheckShape(Int_t testNo, Int_t nsamples = 10000, Option_t *option = ""); // *MENU*
105 Bool_t Contains(const Double_t *point) const { return fShape->Contains(point); }
106 static void CreateDummyMedium();
107 static TGeoMedium *DummyMedium();
108 virtual Bool_t IsAssembly() const;
109 Bool_t IsFolder() const override;
110 Bool_t IsRunTime() const { return fShape->IsRunTimeShape(); }
111 virtual Bool_t IsVolumeMulti() const { return kFALSE; }
112 virtual TGeoNode *
113 AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat = nullptr, Option_t *option = ""); // most general case
115 virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat = nullptr, Option_t *option = "");
116
117 virtual TGeoVolume *Divide(const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step,
118 Int_t numed = 0, Option_t *option = "");
119 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
120 void Draw(Option_t *option = "") override; // *MENU*
121 virtual void DrawOnly(Option_t *option = ""); // *MENU*
122 TH2F *LegoPlot(Int_t ntheta = 20, Double_t themin = 0., Double_t themax = 180., Int_t nphi = 60,
123 Double_t phimin = 0., Double_t phimax = 360., Double_t rmin = 0., Double_t rmax = 9999999,
124 Option_t *option = ""); // *MENU*
125 void Paint(Option_t *option = "") override;
126 void Print(Option_t *option = "") const override; // *MENU*
127 void PrintNodes() const;
128 void PrintVoxels() const; // *MENU*
129 void ReplayCreation(const TGeoVolume *other);
132 Int_t GetRefCount() const { return fRefCount; }
137 void Grab() { fRefCount++; }
138 void Release()
139 {
140 fRefCount--;
141 if (fRefCount == 0)
142 delete this;
143 }
144 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
145
146 Bool_t IsActive() const { return TGeoAtt::IsActive(); }
154 Bool_t IsTopVolume() const;
155 Bool_t IsValid() const { return fShape->IsValid(); }
156 virtual Bool_t IsVisible() const { return TGeoAtt::IsVisible(); }
160 Bool_t IsVisOnly() const { return TGeoAtt::IsVisOnly(); }
161 Bool_t IsAllInvisible() const;
162 Bool_t IsRaytracing() const;
163 static TGeoVolume *Import(const char *filename, const char *name = "", Option_t *option = "");
164 Int_t Export(const char *filename, const char *name = "", Option_t *option = "");
165 TGeoNode *FindNode(const char *name) const;
166 void FindOverlaps() const;
168 virtual Int_t GetCurrentNodeIndex() const { return -1; }
169 virtual Int_t GetNextNodeIndex() const { return -1; }
170 TObjArray *GetNodes() { return fNodes; }
171 Int_t GetNdaughters() const;
172 Int_t GetNtotal() const { return fNtotal; }
173 virtual Int_t GetByteCount() const;
176 TGeoMedium *GetMedium() const { return (fMedium) ? fMedium : DummyMedium(); }
177 TObject *GetField() const { return fField; }
179 TGeoVoxelFinder *GetVoxels() const;
180 const char *GetIconName() const override { return fShape->GetName(); }
181 Int_t GetIndex(const TGeoNode *node) const;
182 TGeoNode *GetNode(const char *name) const;
183 TGeoNode *GetNode(Int_t i) const { return (TGeoNode *)fNodes->UncheckedAt(i); }
184 Int_t GetNodeIndex(const TGeoNode *node, Int_t *check_list, Int_t ncheck) const;
185 Int_t GetNumber() const { return fNumber; }
186 char *GetObjectInfo(Int_t px, Int_t py) const override;
187 Bool_t GetOptimalVoxels() const;
188 Option_t *GetOption() const override { return fOption.Data(); }
189 const char *GetPointerName() const;
190 Char_t GetTransparency() const;
191 TGeoShape *GetShape() const { return fShape; }
192 void GrabFocus(); // *MENU*
193 void Gsord(Int_t /*iaxis*/) {}
194 Bool_t IsStyleDefault() const;
195 void InspectMaterial() const; // *MENU*
196 void InspectShape() const { fShape->InspectShape(); } // *MENU*
198 void MakeCopyNodes(const TGeoVolume *other);
199 TGeoVolume *MakeReflectedVolume(const char *newname = "") const;
200 Bool_t OptimizeVoxels(); // *MENU*
201 void RandomPoints(Int_t npoints = 1000000, Option_t *option = ""); // *MENU*
202 void RandomRays(Int_t nrays = 10000, Double_t startx = 0, Double_t starty = 0, Double_t startz = 0,
203 const char *target_vol = nullptr, Bool_t check_norm = kFALSE); // *MENU*
204 void Raytrace(Bool_t flag = kTRUE); // *TOGGLE* *GETTER=IsRaytracing
205 void RegisterYourself(Option_t *option = "");
206 void RemoveNode(TGeoNode *node);
208 TGeoMedium *newmed = nullptr);
209 void ResetTransparency(Char_t transparency = -1); // *MENU*
210 void SaveAs(const char *filename = "", Option_t *option = "") const override; // *MENU*
211 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
212 void SelectVolume(Bool_t clear = kFALSE);
215 void SetAsTopVolume(); // *TOGGLE* *GETTER=IsTopVolume
224 void SetNodes(TObjArray *nodes)
225 {
226 fNodes = nodes;
228 }
230 void SetShape(const TGeoShape *shape);
231 void SetTransparency(Char_t transparency = 0); // *MENU*
233 void SetOption(const char *option);
235 void SetVisibility(Bool_t vis = kTRUE) override; // *TOGGLE* *GETTER=IsVisible
236 void SetVisContainers(Bool_t flag = kTRUE) override; // *TOGGLE* *GETTER=IsVisContainers
237 void SetVisLeaves(Bool_t flag = kTRUE) override; // *TOGGLE* *GETTER=IsVisLeaves
238 void SetVisOnly(Bool_t flag = kTRUE) override; // *TOGGLE* *GETTER=IsVisOnly
239 void SetLineColor(Color_t lcolor) override;
240 void SetLineStyle(Style_t lstyle) override;
241 void SetLineWidth(Width_t lwidth) override;
246 void SetNumber(Int_t number) { fNumber = number; }
248 void SortNodes();
249 void UnmarkSaved();
250 Bool_t Valid() const;
251 void VisibleDaughters(Bool_t vis = kTRUE); // *TOGGLE* *GETTER=IsVisibleDaughters
252 void InvisibleAll(Bool_t flag = kTRUE); // *TOGGLE* *GETTER=IsAllInvisible
253 void Voxelize(Option_t *option);
254 Double_t Weight(Double_t precision = 0.01, Option_t *option = "va"); // *MENU*
255 Double_t WeightA() const;
256
257 ClassDefOverride(TGeoVolume, 7) // geometry volume descriptor
258};
259
260////////////////////////////////////////////////////////////////////////////
261// //
262// TGeoVolumeMulti - class storing a list of volumes that have to //
263// be handled together at build time //
264// //
265////////////////////////////////////////////////////////////////////////////
266
268private:
269 TObjArray *fVolumes; // list of volumes
270 TGeoVolumeMulti *fDivision; // division of this volume
271 Int_t fNumed; // medium number for divisions
272 Int_t fNdiv; // number of divisions
273 Int_t fAxis; // axis of division
274 Double_t fStart; // division start offset
275 Double_t fStep; // division step
276 Bool_t fAttSet; // flag attributes set
277
280
281public:
283 TGeoVolumeMulti(const char *name, TGeoMedium *med = nullptr);
284 ~TGeoVolumeMulti() override;
285
286 void AddVolume(TGeoVolume *vol);
287 TGeoVolume *GetVolume(Int_t id) const { return (TGeoVolume *)fVolumes->At(id); }
288 TGeoNode *
289 AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option = "") override; // most general case
290 void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option = "") override;
291 TGeoVolume *Divide(const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed = 0,
292 Option_t *option = "") override;
293 TGeoShape *GetLastShape() const;
295 Int_t GetAxis() const { return fNdiv; }
296 Int_t GetNdiv() const { return fNdiv; }
297 Double_t GetStart() const { return fStart; }
298 Double_t GetStep() const { return fStep; }
299 Bool_t IsVolumeMulti() const override { return kTRUE; }
301 void SetLineColor(Color_t lcolor) override;
302 void SetLineStyle(Style_t lstyle) override;
303 void SetLineWidth(Width_t lwidth) override;
304 void SetMedium(TGeoMedium *medium) override;
305 void SetVisibility(Bool_t vis = kTRUE) override;
306
307 ClassDefOverride(TGeoVolumeMulti, 3) // class to handle multiple volumes in one step
308};
309
310////////////////////////////////////////////////////////////////////////////
311// //
312// TGeoVolumeAssembly - special assembly of volumes. The assembly has no //
313// medium and its shape is the union of all component shapes //
314// //
315////////////////////////////////////////////////////////////////////////////
316
318public:
320 Int_t fCurrent; //! index of current selected node
321 Int_t fNext; //! index of next node to be entered
322
323 ThreadData_t();
325 };
326
328 void ClearThreadData() const override;
329 void CreateThreadData(Int_t nthreads) override;
330
331protected:
332 mutable std::vector<ThreadData_t *> fThreadData; //! Thread specific data vector
333 mutable Int_t fThreadSize; //! Thread vector size
334 mutable std::mutex fMutex; //! Mutex for concurrent operations
335
336private:
339
340public:
342 TGeoVolumeAssembly(const char *name);
343 ~TGeoVolumeAssembly() override;
344
345 TGeoNode *AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat = nullptr, Option_t *option = "") override;
347 TGeoVolume *CloneVolume() const override;
348 TGeoVolume *Divide(const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed = 0,
349 Option_t *option = "") override;
350 TGeoVolume *Divide(TGeoVolume *cell, TGeoPatternFinder *pattern, Option_t *option = "spacedout");
351 void DrawOnly(Option_t *) override {}
352 Int_t GetCurrentNodeIndex() const override;
353 Int_t GetNextNodeIndex() const override;
354 Bool_t IsAssembly() const override { return kTRUE; }
355 Bool_t IsVisible() const override { return kFALSE; }
359
360 ClassDefOverride(TGeoVolumeAssembly, 2) // an assembly of volumes
361};
362
364{
365 if (!fNodes)
366 return 0;
367 return (fNodes->GetEntriesFast());
368}
369
371{
372 // If the transparency is (-1), the old default handling is applied
373 if (fTransparency >= 0)
374 return fTransparency;
375 return !fMedium ? 0 : fMedium->GetMaterial()->GetTransparency();
376}
377
384
389
390#endif
#define b(i)
Definition RSha256.hxx:100
short Style_t
Style number (short)
Definition RtypesCore.h:96
bool Bool_t
Boolean (0=false, 1=true) (bool)
Definition RtypesCore.h:77
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
short Color_t
Color number (short)
Definition RtypesCore.h:99
char Char_t
Character 1 byte (char)
Definition RtypesCore.h:51
short Width_t
Line width (short)
Definition RtypesCore.h:98
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
#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:110
Use this attribute class when an object should have 3D capabilities.
Definition TAtt3D.h:19
Fill Area Attributes class.
Definition TAttFill.h:20
Line Attributes class.
Definition TAttLine.h:20
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:317
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:355
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:332
std::mutex fMutex
Thread vector size.
Definition TGeoVolume.h:334
void DrawOnly(Option_t *) override
draw only this volume
Definition TGeoVolume.h:351
Int_t fThreadSize
Thread specific data vector.
Definition TGeoVolume.h:333
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:354
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:267
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:274
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:295
TGeoVolume * GetVolume(Int_t id) const
Definition TGeoVolume.h:287
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:297
TGeoVolumeMulti * fDivision
Definition TGeoVolume.h:270
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:298
Int_t GetNvolumes() const
Definition TGeoVolume.h:294
Bool_t IsVolumeMulti() const override
Definition TGeoVolume.h:299
TObjArray * fVolumes
Definition TGeoVolume.h:269
Int_t GetNdiv() const
Definition TGeoVolume.h:296
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:43
virtual Int_t GetNextNodeIndex() const
Definition TGeoVolume.h:169
Double_t WeightA() const
Analytical computation of the weight.
Bool_t IsCylVoxels() const
Definition TGeoVolume.h:152
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:158
void SetVoxelFinder(TGeoVoxelFinder *finder)
Definition TGeoVolume.h:244
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:183
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:133
Bool_t IsAllInvisible() const
Return TRUE if volume and all daughters are invisible.
Bool_t IsXYZVoxels() const
Definition TGeoVolume.h:153
Int_t fNtotal
Definition TGeoVolume.h:56
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:246
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:176
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:132
Bool_t IsActiveDaughters() const
Definition TGeoVolume.h:147
Bool_t IsSelected() const
Definition TGeoVolume.h:151
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:193
TGeoManager * GetGeoManager() const
Definition TGeoVolume.h:174
Double_t Capacity() const
Computes the capacity of this [cm^3] as the capacity of its shape.
Bool_t IsRunTime() const
Definition TGeoVolume.h:110
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:150
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:105
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:219
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:134
void SetActivity(Bool_t flag=kTRUE)
Definition TGeoVolume.h:213
TGeoVoxelFinder * fVoxels
Definition TGeoVolume.h:50
TGeoMaterial * GetMaterial() const
Definition TGeoVolume.h:175
virtual Bool_t IsVolumeMulti() const
Definition TGeoVolume.h:111
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:245
Int_t GetNdaughters() const
Definition TGeoVolume.h:363
Bool_t IsValid() const
Definition TGeoVolume.h:155
void Grab()
Definition TGeoVolume.h:137
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:170
void SetTransparency(Char_t transparency=0)
Definition TGeoVolume.h:378
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:138
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:247
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:157
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:224
TGeoPatternFinder * GetFinder() const
Definition TGeoVolume.h:178
void PrintVoxels() const
Print the voxels for this volume.
TGeoExtension * fUserExtension
Definition TGeoVolume.h:59
virtual void SetMedium(TGeoMedium *medium)
Definition TGeoVolume.h:243
TGeoVoxelFinder * GetVoxels() const
Getter for optimization structure.
void SetAttVisibility(Bool_t vis)
Definition TGeoVolume.h:234
~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:185
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:214
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:191
void SetInvisible()
Definition TGeoVolume.h:242
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
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
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.
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:168
TGeoShape * fShape
Definition TGeoVolume.h:46
void SetField(TObject *field)
Definition TGeoVolume.h:232
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:216
Bool_t IsVisLeaves() const
Definition TGeoVolume.h:159
Option_t * GetOption() const override
Definition TGeoVolume.h:188
void SetReplicated()
Definition TGeoVolume.h:217
TObject * GetField() const
Definition TGeoVolume.h:177
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:180
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:160
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:370
Bool_t IsActive() const
Definition TGeoVolume.h:146
TObjArray * fNodes
Definition TGeoVolume.h:45
virtual Bool_t IsVisible() const
Definition TGeoVolume.h:156
Bool_t IsAdded() const
Definition TGeoVolume.h:148
Int_t GetNtotal() const
Definition TGeoVolume.h:172
void SetVisLeaves(Bool_t flag=kTRUE) override
Set visibility for leaves.
void InspectShape() const
Definition TGeoVolume.h:196
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:229
Bool_t IsOverlappingCandidate() const
Definition TGeoVolume.h:149
Int_t fRefCount
Definition TGeoVolume.h:57
void ResetTransparency(Char_t transparency=-1)
Definition TGeoVolume.h:385
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:41
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:202
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:881
Basic string class.
Definition TString.h:138
const char * Data() const
Definition TString.h:384
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:321
th1 Draw()