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