Logo ROOT   6.14/05
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 
20 #include "TAttLine.h"
21 
22 #include "TAttFill.h"
23 
24 #include "TAtt3D.h"
25 
26 #include "TObjArray.h"
27 
28 #include "TGeoMedium.h"
29 
30 #include "TGeoShape.h"
31 
32 // forward declarations
33 class TH2F;
34 class TGeoNode;
35 class TGeoMatrix;
36 class TGeoPatternFinder;
37 class TGeoVoxelFinder;
38 class TGeoManager;
39 class TGeoExtension;
40 
41 ////////////////////////////////////////////////////////////////////////////
42 // //
43 // TGeoVolume - base class representing a single volume having a shape //
44 // and a medium. //
45 // //
46 ////////////////////////////////////////////////////////////////////////////
47 
48 class TGeoVolume : public TNamed,
49  public TGeoAtt,
50  public TAttLine,
51  public TAttFill,
52  public TAtt3D
53 {
54 protected :
55  TObjArray *fNodes; // array of nodes inside this volume
56  TGeoShape *fShape; // shape
57  TGeoMedium *fMedium; // tracking medium
58  static TGeoMedium *fgDummyMedium; //! dummy medium
59  TGeoPatternFinder *fFinder; // finder object for divisions
60  TGeoVoxelFinder *fVoxels; // finder object for bounding boxes
61  TGeoManager *fGeoManager; //! pointer to TGeoManager owning this volume
62 
63  TObject *fField; //! just a hook for now
64  TString fOption; //! option - if any
65  Int_t fNumber; // volume serial number in the list of volumes
66  Int_t fNtotal; // total number of physical nodes
67  Int_t fRefCount; // reference counter
68  TGeoExtension *fUserExtension; //! Transient user-defined extension to volumes
69  TGeoExtension *fFWExtension; //! Transient framework-defined extension to volumes
70 
71  TGeoVolume(const TGeoVolume&);
73 
74 public:
75  virtual void ClearThreadData() const;
76  virtual void CreateThreadData(Int_t nthreads);
77 
78 public:
82  kVolumeDiv = BIT(16),
86  kVoxelsXYZ = BIT(20), // not used
87  kVoxelsCyl = BIT(21), // not used
90  kVolumeOC = BIT(21) // overlapping candidates
91  };
92  // constructors
93  TGeoVolume();
94  TGeoVolume(const char *name, const TGeoShape *shape, const TGeoMedium *med=0);
95 
96  // destructor
97  virtual ~TGeoVolume();
98  // methods
99  virtual void cd(Int_t inode) const;
100  void Browse(TBrowser *b);
101  Double_t Capacity() const;
102  void CheckShapes();
103  void ClearNodes() {fNodes = 0;}
104  void ClearShape();
105  void CleanAll();
106  virtual TGeoVolume *CloneVolume() const;
107  void CloneNodesAndConnect(TGeoVolume *newmother) const;
108  void CheckGeometry(Int_t nrays=1, Double_t startx=0, Double_t starty=0, Double_t startz=0) const;
109  void CheckOverlaps(Double_t ovlp=0.1, Option_t *option="") const; // *MENU*
110  void CheckShape(Int_t testNo, Int_t nsamples=10000, Option_t *option=""); // *MENU*
111  Int_t CountNodes(Int_t nlevels=1000, Int_t option=0);
112  Bool_t Contains(const Double_t *point) const {return fShape->Contains(point);}
113  static void CreateDummyMedium();
114  static TGeoMedium *DummyMedium();
115  virtual Bool_t IsAssembly() const;
116  virtual Bool_t IsFolder() const;
117  Bool_t IsRunTime() const {return fShape->IsRunTimeShape();}
118  virtual Bool_t IsVolumeMulti() const {return kFALSE;}
119  virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option=""); // most general case
120  void AddNodeOffset(TGeoVolume *vol, Int_t copy_no, Double_t offset=0, Option_t *option="");
121  virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="");
122 
123  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="");
124  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
125  virtual void Draw(Option_t *option=""); // *MENU*
126  virtual void DrawOnly(Option_t *option=""); // *MENU*
127  TH2F *LegoPlot(Int_t ntheta=20, Double_t themin=0., Double_t themax=180.,
128  Int_t nphi=60, Double_t phimin=0., Double_t phimax=360.,
129  Double_t rmin=0., Double_t rmax=9999999, Option_t *option=""); // *MENU*
130  virtual void Paint(Option_t *option="");
131  virtual void Print(Option_t *option="") const; // *MENU*
132  void PrintNodes() const;
133  void PrintVoxels() const; // *MENU*
134  void ReplayCreation(const TGeoVolume *other);
135  void SetUserExtension(TGeoExtension *ext);
136  void SetFWExtension(TGeoExtension *ext);
137  Int_t GetRefCount() const {return fRefCount;}
142  void Grab() {fRefCount++;}
143  void Release() {fRefCount--; if (fRefCount==0) delete this;}
144  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
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 {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  virtual char *GetObjectInfo(Int_t px, Int_t py) const;
187  Bool_t GetOptimalVoxels() const;
188  Option_t *GetOption() const { return fOption.Data(); }
189  char *GetPointerName() const;
190  Char_t GetTransparency() const {return (fMedium==0)?0:(fMedium->GetMaterial()->GetTransparency());}
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*
197  virtual TGeoVolume *MakeCopyVolume(TGeoShape *newshape);
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, const char *target_vol=0, 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=0, TGeoMatrix *newpos=0, TGeoMedium *newmed=0);
207  void SaveAs(const char *filename,Option_t *option="") const; // *MENU*
208  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
209  void SelectVolume(Bool_t clear = kFALSE);
212  void SetAsTopVolume(); // *TOGGLE* *GETTER=IsTopVolume
217  void SetNodes(TObjArray *nodes) {fNodes = nodes; TObject::SetBit(kVolumeImportNodes);}
219  void SetShape(const TGeoShape *shape);
220  void SetTransparency(Char_t transparency=0) {if (fMedium) fMedium->GetMaterial()->SetTransparency(transparency);} // *MENU*
221  void SetField(TObject *field) {fField = field;}
222  void SetOption(const char *option);
224  virtual void SetVisibility(Bool_t vis=kTRUE); // *TOGGLE* *GETTER=IsVisible
225  virtual void SetVisContainers(Bool_t flag=kTRUE); // *TOGGLE* *GETTER=IsVisContainers
226  virtual void SetVisLeaves(Bool_t flag=kTRUE); // *TOGGLE* *GETTER=IsVisLeaves
227  virtual void SetVisOnly(Bool_t flag=kTRUE); // *TOGGLE* *GETTER=IsVisOnly
228  virtual void SetLineColor(Color_t lcolor);
229  virtual void SetLineStyle(Style_t lstyle);
230  virtual void SetLineWidth(Width_t lwidth);
232  virtual void SetMedium(TGeoMedium *medium) {fMedium = medium;}
233  void SetVoxelFinder(TGeoVoxelFinder *finder) {fVoxels = finder;}
234  void SetFinder(TGeoPatternFinder *finder) {fFinder = finder;}
235  void SetNumber(Int_t number) {fNumber = number;}
236  void SetNtotal(Int_t ntotal) {fNtotal = ntotal;}
237  void SortNodes();
238  void UnmarkSaved();
239  Bool_t Valid() const;
240  void VisibleDaughters(Bool_t vis=kTRUE); // *TOGGLE* *GETTER=IsVisibleDaughters
241  void InvisibleAll(Bool_t flag=kTRUE); // *TOGGLE* *GETTER=IsAllInvisible
242  void Voxelize(Option_t *option);
243  Double_t Weight(Double_t precision=0.01, Option_t *option="va"); // *MENU*
244  Double_t WeightA() const;
245 
246  ClassDef(TGeoVolume, 6) // geometry volume descriptor
247 };
248 
249 ////////////////////////////////////////////////////////////////////////////
250 // //
251 // TGeoVolumeMulti - class storing a list of volumes that have to //
252 // be handled together at build time //
253 // //
254 ////////////////////////////////////////////////////////////////////////////
255 
257 {
258 private:
259  TObjArray *fVolumes; // list of volumes
260  TGeoVolumeMulti *fDivision; // division of this volume
261  Int_t fNumed; // medium number for divisions
262  Int_t fNdiv; // number of divisions
263  Int_t fAxis; // axis of division
264  Double_t fStart; // division start offset
265  Double_t fStep; // division step
266  Bool_t fAttSet; // flag attributes set
267 
268 protected:
271 
272 public:
273  TGeoVolumeMulti();
274  TGeoVolumeMulti(const char* name, TGeoMedium *med=0);
275  virtual ~TGeoVolumeMulti();
276 
277  void AddVolume(TGeoVolume *vol);
278  TGeoVolume *GetVolume(Int_t id) const {return (TGeoVolume*)fVolumes->At(id);}
279  virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option=""); // most general case
280  virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option="");
281  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="");
282  TGeoShape *GetLastShape() const;
283  Int_t GetNvolumes() const {return fVolumes->GetEntriesFast();}
284  Int_t GetAxis() const {return fNdiv;}
285  Int_t GetNdiv() const {return fNdiv;}
286  Double_t GetStart() const {return fStart;}
287  Double_t GetStep() const {return fStep;}
288  virtual Bool_t IsVolumeMulti() const {return kTRUE;}
289  virtual TGeoVolume *MakeCopyVolume(TGeoShape *newshape);
290  virtual void SetLineColor(Color_t lcolor);
291  virtual void SetLineStyle(Style_t lstyle);
292  virtual void SetLineWidth(Width_t lwidth);
293  virtual void SetMedium(TGeoMedium *medium);
294  virtual void SetVisibility(Bool_t vis=kTRUE);
295 
296 
297  ClassDef(TGeoVolumeMulti, 3) // class to handle multiple volumes in one step
298 };
299 
300 ////////////////////////////////////////////////////////////////////////////
301 // //
302 // TGeoVolumeAssembly - special assembly of volumes. The assembly has no //
303 // medium and its shape is the union of all component shapes //
304 // //
305 ////////////////////////////////////////////////////////////////////////////
306 
308 {
309 public:
311  {
312  Int_t fCurrent; //! index of current selected node
313  Int_t fNext; //! index of next node to be entered
314 
315  ThreadData_t();
316  ~ThreadData_t();
317  };
318 
319  ThreadData_t& GetThreadData() const;
320  virtual void ClearThreadData() const;
321  virtual void CreateThreadData(Int_t nthreads);
322 
323 protected:
324  mutable std::vector<ThreadData_t*> fThreadData; //! Thread specific data vector
325  mutable Int_t fThreadSize; //! Thread vector size
326  mutable std::mutex fMutex; //! Mutex for concurrent operations
327 
328 public:
330  TGeoVolumeAssembly(const char *name);
331  virtual ~TGeoVolumeAssembly();
332 
333  virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="");
334  virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option);
335  virtual TGeoVolume *CloneVolume() const;
336  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="");
337  TGeoVolume *Divide(TGeoVolume *cell, TGeoPatternFinder *pattern, Option_t *option="spacedout");
338  virtual void DrawOnly(Option_t *) {;}
339  virtual Int_t GetCurrentNodeIndex() const;
340  virtual Int_t GetNextNodeIndex() const;
341  virtual Bool_t IsAssembly() const {return kTRUE;}
342  virtual Bool_t IsVisible() const {return kFALSE;}
343  static TGeoVolumeAssembly *MakeAssemblyFromVolume(TGeoVolume *vol);
344  void SetCurrentNodeIndex(Int_t index);
345  void SetNextNodeIndex(Int_t index);
346 
347  ClassDef(TGeoVolumeAssembly, 2) // an assembly of volumes
348 };
349 
350 inline Int_t TGeoVolume::GetNdaughters() const {if (!fNodes) return 0; return (fNodes->GetEntriesFast());}
351 
352 #endif
353 
TGeoManager * fGeoManager
Definition: TGeoVolume.h:61
TGeoVolume()
dummy constructor
Definition: TGeoVolume.cxx:447
virtual TGeoVolume * CloneVolume() const
Clone this volume.
void CleanAll()
Clean data of the volume.
Definition: TGeoVolume.cxx:683
std::mutex fMutex
Thread vector size.
Definition: TGeoVolume.h:326
void PrintNodes() const
print nodes
Volume families.
Definition: TGeoVolume.h:256
Bool_t IsVisible() const
Definition: TGeoAtt.h:88
Int_t GetNdiv() const
Definition: TGeoVolume.h:285
Double_t GetStart() const
Definition: TGeoVolume.h:286
Int_t GetAxis() const
Definition: TGeoVolume.h:284
An array of TObjects.
Definition: TObjArray.h:37
void SetReplicated()
Definition: TGeoVolume.h:214
void SetNodes(TObjArray *nodes)
Definition: TGeoVolume.h:217
void ClearShape()
Clear the shape of this volume from the list held by the current manager.
Definition: TGeoVolume.cxx:692
static TGeoMedium * fgDummyMedium
Definition: TGeoVolume.h:58
The manager class for any TGeo geometry.
Definition: TGeoManager.h:38
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:143
Volume assemblies.
Definition: TGeoVolume.h:307
void Voxelize(Option_t *option)
build the voxels for this volume
void SetFinder(TGeoPatternFinder *finder)
Definition: TGeoVolume.h:234
Bool_t IsValid() const
Definition: TGeoShape.h:140
short Style_t
Definition: RtypesCore.h:76
Bool_t IsActive() const
Definition: TGeoVolume.h:146
TGeoExtension * fUserExtension
Definition: TGeoVolume.h:68
TGeoVolume * GetVolume(Int_t id) const
Definition: TGeoVolume.h:278
void SetCylVoxels(Bool_t flag=kTRUE)
Definition: TGeoVolume.h:216
void AddNodeOffset(TGeoVolume *vol, Int_t copy_no, Double_t offset=0, Option_t *option="")
Add a division node to the list of nodes.
virtual Bool_t IsVisible() const
Definition: TGeoVolume.h:342
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
TGeoExtension * fFWExtension
Transient user-defined extension to volumes.
Definition: TGeoVolume.h:69
Bool_t IsStyleDefault() const
check if the visibility and attributes are the default ones
Definition: TGeoVolume.cxx:852
static TGeoMedium * DummyMedium()
Definition: TGeoVolume.cxx:439
TGeoNode * GetNode(const char *name) const
get the pointer to a daughter node
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:78
TGeoMedium * fMedium
Definition: TGeoVolume.h:57
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition: TGeoVolume.h:48
Double_t fStart
Definition: TGeoVolume.h:264
virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
Add a TGeoNode to the list of nodes.
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
void InspectShape() const
Definition: TGeoVolume.h:196
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:605
Int_t fNext
index of current selected node
Definition: TGeoVolume.h:313
virtual Bool_t IsAssembly() const
Returns true if the volume is an assembly or a scaled assembly.
Definition: TGeoVolume.h:341
void RemoveNode(TGeoNode *node)
Remove an existing daughter.
Bool_t IsAllInvisible() const
Return TRUE if volume and all daughters are invisible.
Definition: TGeoVolume.cxx:805
void ReplayCreation(const TGeoVolume *other)
Recreate the content of the other volume without pointer copying.
TObject * At(Int_t idx) const
Definition: TObjArray.h:165
Bool_t IsVisibleDaughters() const
Definition: TGeoVolume.h:157
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:158
void RegisterYourself(Option_t *option="")
Register the volume and all materials/media/matrices/shapes to the manager.
Int_t GetRefCount() const
Definition: TGeoVolume.h:137
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:177
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:873
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:754
void Gsord(Int_t)
Definition: TGeoVolume.h:193
TObjArray * GetNodes()
Definition: TGeoVolume.h:170
Int_t fNtotal
Definition: TGeoVolume.h:66
void Browse(TBrowser *b)
How to browse a volume.
Definition: TGeoVolume.cxx:571
Int_t GetNdaughters() const
Definition: TGeoVolume.h:350
TObject * fField
pointer to TGeoManager owning this volume
Definition: TGeoVolume.h:63
virtual Bool_t Contains(const Double_t *point) const =0
virtual ~TGeoVolume()
Destructor.
Definition: TGeoVolume.cxx:554
TGeoPatternFinder * GetFinder() const
Definition: TGeoVolume.h:178
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:283
#define ClassDef(name, id)
Definition: Rtypes.h:320
Bool_t IsActiveDaughters() const
Definition: TGeoVolume.h:147
void SetActiveDaughters(Bool_t flag=kTRUE)
Definition: TGeoVolume.h:211
Bool_t FindMatrixOfDaughterVolume(TGeoVolume *vol) const
Find a daughter node having VOL as volume and fill TGeoManager::fHMatrix with its global matrix...
void PrintVoxels() const
Print the voxels for this volume.
Bool_t IsVisOnly() const
Definition: TGeoVolume.h:160
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
void InvisibleAll(Bool_t flag=kTRUE)
Make volume and each of it daughters (in)visible.
Definition: TGeoVolume.cxx:816
Int_t fThreadSize
Thread specific data vector.
Definition: TGeoVolume.h:325
TGeoNode * GetNode(Int_t i) const
Definition: TGeoVolume.h:183
Char_t GetTransparency() const
Definition: TGeoMaterial.h:97
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:176
virtual Bool_t IsVisible() const
Definition: TGeoVolume.h:156
TGeoMaterial * GetMaterial() const
Definition: TGeoVolume.h:175
Bool_t IsRunTime() const
Definition: TGeoVolume.h:117
Bool_t IsVisLeaves() const
Definition: TGeoAtt.h:92
Bool_t IsAdded() const
Definition: TGeoVolume.h:148
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 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:213
TString fOption
just a hook for now
Definition: TGeoVolume.h:64
short Color_t
Definition: RtypesCore.h:79
virtual void ClearThreadData() const
Definition: TGeoVolume.cxx:423
TObjArray * fVolumes
Definition: TGeoVolume.h:259
void SortNodes()
sort nodes by decreasing volume of the bounding box.
Option_t * GetOption() const
Definition: TGeoVolume.h:188
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:984
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.
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:338
Char_t GetTransparency() const
Definition: TGeoVolume.h:190
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
TGeoVoxelFinder * fVoxels
Definition: TGeoVolume.h:60
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:59
void SetField(TObject *field)
Definition: TGeoVolume.h:221
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:250
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:220
const char * GetIconName() const
Returns mime type name of object.
Definition: TGeoVolume.h:180
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:56
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:844
void CheckOverlaps(Double_t ovlp=0.1, Option_t *option="") const
Overlap checking tool.
Definition: TGeoVolume.cxx:641
Double_t GetStep() const
Definition: TGeoVolume.h:287
Bool_t IsXYZVoxels() const
Definition: TGeoVolume.h:153
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:620
void CloneNodesAndConnect(TGeoVolume *newmother) const
Clone the array of nodes.
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:112
const Bool_t kFALSE
Definition: RtypesCore.h:88
void SetAttVisibility(Bool_t vis)
Definition: TGeoVolume.h:223
void SetActivity(Bool_t flag=kTRUE)
Definition: TGeoVolume.h:210
Bool_t IsTopVolume() const
True if this is the top volume of the geometry.
Definition: TGeoVolume.cxx:864
virtual Int_t GetCurrentNodeIndex() const
Definition: TGeoVolume.h:168
TGeoExtension * GrabUserExtension() const
Get a copy of the user extension pointer.
TGeoExtension * GetFWExtension() const
Definition: TGeoVolume.h:139
TObject * UncheckedAt(Int_t i) const
Definition: TObjArray.h:89
virtual TGeoVolume * MakeCopyVolume(TGeoShape *newshape)
make a copy of this volume build a volume with same name, shape and medium
Int_t Export(const char *filename, const char *name="", Option_t *option="")
Export this volume to a file.
Definition: TGeoVolume.cxx:939
double Double_t
Definition: RtypesCore.h:55
Int_t GetNumber() const
Definition: TGeoVolume.h:185
void SetVoxelFinder(TGeoVoxelFinder *finder)
Definition: TGeoVolume.h:233
TObjArray * fNodes
Definition: TGeoVolume.h:55
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:231
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:65
Bool_t IsActiveDaughters() const
Definition: TGeoAtt.h:86
Double_t y[n]
Definition: legend1.C:17
void ClearNodes()
Definition: TGeoVolume.h:103
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:159
virtual void SetLineColor(Color_t lcolor)
Set the line color.
void InspectMaterial() const
Inspect the material for this volume.
Definition: TGeoVolume.cxx:881
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:151
Double_t fStep
Definition: TGeoVolume.h:265
Mother of all ROOT objects.
Definition: TObject.h:37
TGeoVolume & operator=(const TGeoVolume &)
assignment operator
Definition: TGeoVolume.cxx:526
you should not use this method at all Int_t Int_t z
Definition: TRolke.cxx:630
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:675
static TGeoVolume * Import(const char *filename, const char *name="", Option_t *option="")
Import a volume from a file.
Definition: TGeoVolume.cxx:889
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:169
Bool_t IsVisDaughters() const
Definition: TGeoAtt.h:89
virtual Bool_t IsVolumeMulti() const
Definition: TGeoVolume.h:288
TGeoVolumeMulti * fDivision
Definition: TGeoVolume.h:260
TGeoExtension * GetUserExtension() const
Definition: TGeoVolume.h:138
virtual void InspectShape() const =0
Bool_t IsOverlappingCandidate() const
Definition: TGeoVolume.h:149
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:218
void GrabFocus()
Move perspective view focus to this volume.
virtual Bool_t IsVolumeMulti() const
Definition: TGeoVolume.h:118
TGeoManager * GetGeoManager() const
Definition: TGeoVolume.h:174
virtual void SetMedium(TGeoMedium *medium)
Definition: TGeoVolume.h:232
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:191
std::vector< ThreadData_t * > fThreadData
Definition: TGeoVolume.h:324
void SetNumber(Int_t number)
Definition: TGeoVolume.h:235
void CheckShapes()
check for negative parameters in shapes.
Definition: TGeoVolume.cxx:700
void SetTransparency(Char_t transparency=0)
Definition: TGeoMaterial.h:118
const Bool_t kTRUE
Definition: RtypesCore.h:87
void Grab()
Definition: TGeoVolume.h:142
void SelectVolume(Bool_t clear=kFALSE)
Select this volume as matching an arbitrary criteria.
Bool_t IsReplicated() const
Definition: TGeoVolume.h:150
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
char name[80]
Definition: TGX11.cxx:109
Bool_t IsCylVoxels() const
Definition: TGeoVolume.h:152
virtual void cd(Int_t inode) const
Actualize matrix of node indexed <inode>
Definition: TGeoVolume.cxx:975
Int_t GetNtotal() const
Definition: TGeoVolume.h:172
virtual void SetVisOnly(Bool_t flag=kTRUE)
Set visibility for leaves.
Bool_t IsValid() const
Definition: TGeoVolume.h:155
Int_t fRefCount
Definition: TGeoVolume.h:67
Bool_t IsRunTimeShape() const
Definition: TGeoShape.h:139
const char * Data() const
Definition: TString.h:364
void SetNtotal(Int_t ntotal)
Definition: TGeoVolume.h:236
virtual Bool_t IsAssembly() const
Returns true if the volume is an assembly or a scaled assembly.