Logo ROOT   6.08/07
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 
17 #ifndef ROOT_TGeoAtt
18 #include "TGeoAtt.h"
19 #endif
20 
21 #ifndef ROOT_TAttLine
22 #include "TAttLine.h"
23 #endif
24 
25 #ifndef ROOT_TAttFill
26 #include "TAttFill.h"
27 #endif
28 
29 #ifndef ROOT_TAtt3D
30 #include "TAtt3D.h"
31 #endif
32 
33 #ifndef ROOT_TObjArray
34 #include "TObjArray.h"
35 #endif
36 
37 #ifndef ROOT_TGeoMedium
38 #include "TGeoMedium.h"
39 #endif
40 
41 #ifndef ROOT_TGeoShape
42 #include "TGeoShape.h"
43 #endif
44 
45 // forward declarations
46 class TH2F;
47 class TGeoNode;
48 class TGeoMatrix;
49 class TGeoPatternFinder;
50 class TGeoVoxelFinder;
51 class TGeoManager;
52 class TGeoExtension;
53 
54 ////////////////////////////////////////////////////////////////////////////
55 // //
56 // TGeoVolume - base class representing a single volume having a shape //
57 // and a medium. //
58 // //
59 ////////////////////////////////////////////////////////////////////////////
60 
61 class TGeoVolume : public TNamed,
62  public TGeoAtt,
63  public TAttLine,
64  public TAttFill,
65  public TAtt3D
66 {
67 protected :
68  TObjArray *fNodes; // array of nodes inside this volume
69  TGeoShape *fShape; // shape
70  TGeoMedium *fMedium; // tracking medium
71  static TGeoMedium *fgDummyMedium; //! dummy medium
72  TGeoPatternFinder *fFinder; // finder object for divisions
73  TGeoVoxelFinder *fVoxels; // finder object for bounding boxes
74  TGeoManager *fGeoManager; //! pointer to TGeoManager owning this volume
75 
76  TObject *fField; //! just a hook for now
77  TString fOption; //! option - if any
78  Int_t fNumber; // volume serial number in the list of volumes
79  Int_t fNtotal; // total number of physical nodes
80  Int_t fRefCount; // reference counter
81  TGeoExtension *fUserExtension; //! Transient user-defined extension to volumes
82  TGeoExtension *fFWExtension; //! Transient framework-defined extension to volumes
83 
84  TGeoVolume(const TGeoVolume&);
86 
87 public:
88  virtual void ClearThreadData() const;
89  virtual void CreateThreadData(Int_t nthreads);
90 
91 public:
95  kVolumeDiv = BIT(16),
99  kVoxelsXYZ = BIT(20), // not used
100  kVoxelsCyl = BIT(21), // not used
103  kVolumeOC = BIT(21) // overlapping candidates
104  };
105  // constructors
106  TGeoVolume();
107  TGeoVolume(const char *name, const TGeoShape *shape, const TGeoMedium *med=0);
108 
109  // destructor
110  virtual ~TGeoVolume();
111  // methods
112  virtual void cd(Int_t inode) const;
113  void Browse(TBrowser *b);
114  Double_t Capacity() const;
115  void CheckShapes();
116  void ClearNodes() {fNodes = 0;}
117  void ClearShape();
118  void CleanAll();
119  virtual TGeoVolume *CloneVolume() const;
120  void CloneNodesAndConnect(TGeoVolume *newmother) const;
121  void CheckGeometry(Int_t nrays=1, Double_t startx=0, Double_t starty=0, Double_t startz=0) const;
122  void CheckOverlaps(Double_t ovlp=0.1, Option_t *option="") const; // *MENU*
123  void CheckShape(Int_t testNo, Int_t nsamples=10000, Option_t *option=""); // *MENU*
124  Int_t CountNodes(Int_t nlevels=1000, Int_t option=0);
125  Bool_t Contains(const Double_t *point) const {return fShape->Contains(point);}
126  static void CreateDummyMedium();
127  static TGeoMedium *DummyMedium();
128  virtual Bool_t IsAssembly() const;
129  virtual Bool_t IsFolder() const;
130  Bool_t IsRunTime() const {return fShape->IsRunTimeShape();}
131  virtual Bool_t IsVolumeMulti() const {return kFALSE;}
132  virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option=""); // most general case
133  void AddNodeOffset(TGeoVolume *vol, Int_t copy_no, Double_t offset=0, Option_t *option="");
134  virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="");
135 
136  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="");
137  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
138  virtual void Draw(Option_t *option=""); // *MENU*
139  virtual void DrawOnly(Option_t *option=""); // *MENU*
140  TH2F *LegoPlot(Int_t ntheta=20, Double_t themin=0., Double_t themax=180.,
141  Int_t nphi=60, Double_t phimin=0., Double_t phimax=360.,
142  Double_t rmin=0., Double_t rmax=9999999, Option_t *option=""); // *MENU*
143  virtual void Paint(Option_t *option="");
144  virtual void Print(Option_t *option="") const; // *MENU*
145  void PrintNodes() const;
146  void PrintVoxels() const; // *MENU*
147  void ReplayCreation(const TGeoVolume *other);
148  void SetUserExtension(TGeoExtension *ext);
149  void SetFWExtension(TGeoExtension *ext);
150  Int_t GetRefCount() const {return fRefCount;}
155  void Grab() {fRefCount++;}
156  void Release() {fRefCount--; if (fRefCount==0) delete this;}
157  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
158 
159  Bool_t IsActive() const {return TGeoAtt::IsActive();}
167  Bool_t IsTopVolume() const;
168  Bool_t IsValid() const {return fShape->IsValid();}
169  virtual Bool_t IsVisible() const {return TGeoAtt::IsVisible();}
173  Bool_t IsVisOnly() const {return TGeoAtt::IsVisOnly();}
174  Bool_t IsAllInvisible() const;
175  Bool_t IsRaytracing() const;
176  static TGeoVolume *Import(const char *filename, const char *name="", Option_t *option="");
177  Int_t Export(const char *filename, const char *name="", Option_t *option="");
178  TGeoNode *FindNode(const char *name) const;
179  void FindOverlaps() const;
181  virtual Int_t GetCurrentNodeIndex() const {return -1;}
182  virtual Int_t GetNextNodeIndex() const {return -1;}
183  TObjArray *GetNodes() {return fNodes;}
184  Int_t GetNdaughters() const;
185  Int_t GetNtotal() const {return fNtotal;}
186  virtual Int_t GetByteCount() const;
189  TGeoMedium *GetMedium() const {return (fMedium)?fMedium:DummyMedium();}
190  TObject *GetField() const {return fField;}
192  TGeoVoxelFinder *GetVoxels() const;
193  const char *GetIconName() const {return fShape->GetName();}
194  Int_t GetIndex(const TGeoNode *node) const;
195  TGeoNode *GetNode(const char *name) const;
196  TGeoNode *GetNode(Int_t i) const {return (TGeoNode*)fNodes->UncheckedAt(i);}
197  Int_t GetNodeIndex(const TGeoNode *node, Int_t *check_list, Int_t ncheck) const;
198  Int_t GetNumber() const {return fNumber;}
199  virtual char *GetObjectInfo(Int_t px, Int_t py) const;
200  Bool_t GetOptimalVoxels() const;
201  Option_t *GetOption() const { return fOption.Data(); }
202  char *GetPointerName() const;
203  Char_t GetTransparency() const {return (fMedium==0)?0:(fMedium->GetMaterial()->GetTransparency());}
204  TGeoShape *GetShape() const {return fShape;}
205  void GrabFocus(); // *MENU*
206  void Gsord(Int_t /*iaxis*/) {;}
207  Bool_t IsStyleDefault() const;
208  void InspectMaterial() const; // *MENU*
209  void InspectShape() const {fShape->InspectShape();} // *MENU*
210  virtual TGeoVolume *MakeCopyVolume(TGeoShape *newshape);
211  void MakeCopyNodes(const TGeoVolume *other);
212  TGeoVolume *MakeReflectedVolume(const char *newname="") const;
213  Bool_t OptimizeVoxels(); // *MENU*
214  void RandomPoints(Int_t npoints=1000000, Option_t *option=""); // *MENU*
215  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*
216  void Raytrace(Bool_t flag=kTRUE); // *TOGGLE* *GETTER=IsRaytracing
217  void RegisterYourself(Option_t *option="");
218  void RemoveNode(TGeoNode *node);
219  TGeoNode *ReplaceNode(TGeoNode *nodeorig, TGeoShape *newshape=0, TGeoMatrix *newpos=0, TGeoMedium *newmed=0);
220  void SaveAs(const char *filename,Option_t *option="") const; // *MENU*
221  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
222  void SelectVolume(Bool_t clear = kFALSE);
225  void SetAsTopVolume(); // *TOGGLE* *GETTER=IsTopVolume
230  void SetNodes(TObjArray *nodes) {fNodes = nodes; TObject::SetBit(kVolumeImportNodes);}
232  void SetShape(const TGeoShape *shape);
233  void SetTransparency(Char_t transparency=0) {if (fMedium) fMedium->GetMaterial()->SetTransparency(transparency);} // *MENU*
234  void SetField(TObject *field) {fField = field;}
235  void SetOption(const char *option);
237  virtual void SetVisibility(Bool_t vis=kTRUE); // *TOGGLE* *GETTER=IsVisible
238  virtual void SetVisContainers(Bool_t flag=kTRUE); // *TOGGLE* *GETTER=IsVisContainers
239  virtual void SetVisLeaves(Bool_t flag=kTRUE); // *TOGGLE* *GETTER=IsVisLeaves
240  virtual void SetVisOnly(Bool_t flag=kTRUE); // *TOGGLE* *GETTER=IsVisOnly
241  virtual void SetLineColor(Color_t lcolor);
242  virtual void SetLineStyle(Style_t lstyle);
243  virtual void SetLineWidth(Width_t lwidth);
245  virtual void SetMedium(TGeoMedium *medium) {fMedium = medium;}
246  void SetVoxelFinder(TGeoVoxelFinder *finder) {fVoxels = finder;}
247  void SetFinder(TGeoPatternFinder *finder) {fFinder = finder;}
248  void SetNumber(Int_t number) {fNumber = number;}
249  void SetNtotal(Int_t ntotal) {fNtotal = ntotal;}
250  void SortNodes();
251  void UnmarkSaved();
252  Bool_t Valid() const;
253  void VisibleDaughters(Bool_t vis=kTRUE); // *TOGGLE* *GETTER=IsVisibleDaughters
254  void InvisibleAll(Bool_t flag=kTRUE); // *TOGGLE* *GETTER=IsAllInvisible
255  void Voxelize(Option_t *option);
256  Double_t Weight(Double_t precision=0.01, Option_t *option="va"); // *MENU*
257  Double_t WeightA() const;
258 
259  ClassDef(TGeoVolume, 6) // geometry volume descriptor
260 };
261 
262 ////////////////////////////////////////////////////////////////////////////
263 // //
264 // TGeoVolumeMulti - class storing a list of volumes that have to //
265 // be handled together at build time //
266 // //
267 ////////////////////////////////////////////////////////////////////////////
268 
270 {
271 private:
272  TObjArray *fVolumes; // list of volumes
273  TGeoVolumeMulti *fDivision; // division of this volume
274  Int_t fNumed; // medium number for divisions
275  Int_t fNdiv; // number of divisions
276  Int_t fAxis; // axis of division
277  Double_t fStart; // division start offset
278  Double_t fStep; // division step
279  Bool_t fAttSet; // flag attributes set
280 
281 protected:
284 
285 public:
286  TGeoVolumeMulti();
287  TGeoVolumeMulti(const char* name, TGeoMedium *med=0);
288  virtual ~TGeoVolumeMulti();
289 
290  void AddVolume(TGeoVolume *vol);
291  TGeoVolume *GetVolume(Int_t id) const {return (TGeoVolume*)fVolumes->At(id);}
292  virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option=""); // most general case
293  virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option="");
294  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="");
295  TGeoShape *GetLastShape() const;
296  Int_t GetNvolumes() const {return fVolumes->GetEntriesFast();}
297  Int_t GetAxis() const {return fNdiv;}
298  Int_t GetNdiv() const {return fNdiv;}
299  Double_t GetStart() const {return fStart;}
300  Double_t GetStep() const {return fStep;}
301  virtual Bool_t IsVolumeMulti() const {return kTRUE;}
302  virtual TGeoVolume *MakeCopyVolume(TGeoShape *newshape);
303  virtual void SetLineColor(Color_t lcolor);
304  virtual void SetLineStyle(Style_t lstyle);
305  virtual void SetLineWidth(Width_t lwidth);
306  virtual void SetMedium(TGeoMedium *medium);
307  virtual void SetVisibility(Bool_t vis=kTRUE);
308 
309 
310  ClassDef(TGeoVolumeMulti, 3) // class to handle multiple volumes in one step
311 };
312 
313 ////////////////////////////////////////////////////////////////////////////
314 // //
315 // TGeoVolumeAssembly - special assembly of volumes. The assembly has no //
316 // medium and its shape is the union of all component shapes //
317 // //
318 ////////////////////////////////////////////////////////////////////////////
319 
321 {
322 public:
324  {
325  Int_t fCurrent; //! index of current selected node
326  Int_t fNext; //! index of next node to be entered
327 
328  ThreadData_t();
329  ~ThreadData_t();
330  };
331 
332  ThreadData_t& GetThreadData() const;
333  virtual void ClearThreadData() const;
334  virtual void CreateThreadData(Int_t nthreads);
335 
336 protected:
337  mutable std::vector<ThreadData_t*> fThreadData; //! Thread specific data vector
338  mutable Int_t fThreadSize; //! Thread vector size
339 
340 public:
342  TGeoVolumeAssembly(const char *name);
343  virtual ~TGeoVolumeAssembly();
344 
345  virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="");
346  virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option);
347  virtual TGeoVolume *CloneVolume() const;
348  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="");
349  TGeoVolume *Divide(TGeoVolume *cell, TGeoPatternFinder *pattern, Option_t *option="spacedout");
350  virtual void DrawOnly(Option_t *) {;}
351  virtual Int_t GetCurrentNodeIndex() const;
352  virtual Int_t GetNextNodeIndex() const;
353  virtual Bool_t IsAssembly() const {return kTRUE;}
354  virtual Bool_t IsVisible() const {return kFALSE;}
355  static TGeoVolumeAssembly *MakeAssemblyFromVolume(TGeoVolume *vol);
356  void SetCurrentNodeIndex(Int_t index);
357  void SetNextNodeIndex(Int_t index);
358 
359  ClassDef(TGeoVolumeAssembly, 2) // an assembly of volumes
360 };
361 
362 inline Int_t TGeoVolume::GetNdaughters() const {if (!fNodes) return 0; return (fNodes->GetEntriesFast());}
363 
364 #endif
365 
TGeoManager * fGeoManager
Definition: TGeoVolume.h:74
TGeoVolume()
dummy constructor
Definition: TGeoVolume.cxx:448
virtual TGeoVolume * CloneVolume() const
Clone this volume.
void CleanAll()
Clean data of the volume.
Definition: TGeoVolume.cxx:684
void PrintNodes() const
print nodes
Volume families.
Definition: TGeoVolume.h:269
Bool_t IsVisible() const
Definition: TGeoAtt.h:90
Int_t GetNdiv() const
Definition: TGeoVolume.h:298
Double_t GetStart() const
Definition: TGeoVolume.h:299
Int_t GetAxis() const
Definition: TGeoVolume.h:297
An array of TObjects.
Definition: TObjArray.h:39
void SetReplicated()
Definition: TGeoVolume.h:227
void SetNodes(TObjArray *nodes)
Definition: TGeoVolume.h:230
void ClearShape()
Clear the shape of this volume from the list held by the current manager.
Definition: TGeoVolume.cxx:693
static TGeoMedium * fgDummyMedium
Definition: TGeoVolume.h:71
The manager class for any TGeo geometry.
Definition: TGeoManager.h:38
virtual void CreateThreadData(Int_t nthreads)
Definition: TGeoVolume.cxx:432
Bool_t IsActive() const
Definition: TGeoAtt.h:87
char * GetPointerName() const
Provide a pointer name containing uid.
void Release()
Definition: TGeoVolume.h:156
Volume assemblies.
Definition: TGeoVolume.h:320
void Voxelize(Option_t *option)
build the voxels for this volume
void SetFinder(TGeoPatternFinder *finder)
Definition: TGeoVolume.h:247
Bool_t IsValid() const
Definition: TGeoShape.h:142
short Style_t
Definition: RtypesCore.h:76
Bool_t IsActive() const
Definition: TGeoVolume.h:159
TGeoExtension * fUserExtension
Definition: TGeoVolume.h:81
TGeoVolume * GetVolume(Int_t id) const
Definition: TGeoVolume.h:291
void SetCylVoxels(Bool_t flag=kTRUE)
Definition: TGeoVolume.h:229
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:354
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:19
TGeoExtension * fFWExtension
Transient user-defined extension to volumes.
Definition: TGeoVolume.h:82
Bool_t IsStyleDefault() const
check if the visibility and attributes are the default ones
Definition: TGeoVolume.cxx:853
static TGeoMedium * DummyMedium()
Definition: TGeoVolume.cxx:440
TGeoNode * GetNode(const char *name) const
get the pointer to a daughter node
Bool_t TestBit(UInt_t f) const
Definition: TObject.h:157
virtual void SetVisibility(Bool_t vis=kTRUE)
Set visibility for this object.
Definition: TGeoAtt.cxx:103
TGeoMaterial * GetMaterial() const
Definition: TGeoMedium.h:54
#define BIT(n)
Definition: Rtypes.h:120
TGeoMedium * fMedium
Definition: TGeoVolume.h:70
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition: TGeoVolume.h:61
Double_t fStart
Definition: TGeoVolume.h:277
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:21
void InspectShape() const
Definition: TGeoVolume.h:209
Basic string class.
Definition: TString.h:137
Base class describing materials.
Definition: TGeoMaterial.h:35
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:606
const Bool_t kFALSE
Definition: Rtypes.h:92
Int_t fNext
index of current selected node
Definition: TGeoVolume.h:326
virtual Bool_t IsAssembly() const
Returns true if the volume is an assembly or a scaled assembly.
Definition: TGeoVolume.h:353
void RemoveNode(TGeoNode *node)
Remove an existing daughter.
Bool_t IsAllInvisible() const
Return TRUE if volume and all daughters are invisible.
Definition: TGeoVolume.cxx:806
void ReplayCreation(const TGeoVolume *other)
Recreate the content of the other volume without pointer copying.
TObject * At(Int_t idx) const
Definition: TObjArray.h:167
Bool_t IsVisibleDaughters() const
Definition: TGeoVolume.h:170
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:171
void RegisterYourself(Option_t *option="")
Register the volume and all materials/media/matrices/shapes to the manager.
Int_t GetRefCount() const
Definition: TGeoVolume.h:150
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:739
TObject * GetField() const
Definition: TGeoVolume.h:190
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:874
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:755
void Gsord(Int_t)
Definition: TGeoVolume.h:206
TObjArray * GetNodes()
Definition: TGeoVolume.h:183
Int_t fNtotal
Definition: TGeoVolume.h:79
void Browse(TBrowser *b)
How to browse a volume.
Definition: TGeoVolume.cxx:572
Int_t GetNdaughters() const
Definition: TGeoVolume.h:362
TObject * fField
pointer to TGeoManager owning this volume
Definition: TGeoVolume.h:76
virtual Bool_t Contains(const Double_t *point) const =0
virtual ~TGeoVolume()
Destructor.
Definition: TGeoVolume.cxx:555
TGeoPatternFinder * GetFinder() const
Definition: TGeoVolume.h:191
Fill Area Attributes class.
Definition: TAttFill.h:24
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:296
#define ClassDef(name, id)
Definition: Rtypes.h:254
Bool_t IsActiveDaughters() const
Definition: TGeoVolume.h:160
void SetActiveDaughters(Bool_t flag=kTRUE)
Definition: TGeoVolume.h:224
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:173
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
void InvisibleAll(Bool_t flag=kTRUE)
Make volume and each of it daughters (in)visible.
Definition: TGeoVolume.cxx:817
Int_t fThreadSize
Thread specific data vector.
Definition: TGeoVolume.h:338
TGeoNode * GetNode(Int_t i) const
Definition: TGeoVolume.h:196
Char_t GetTransparency() const
Definition: TGeoMaterial.h:103
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:189
static const std::string pattern("pattern")
virtual Bool_t IsVisible() const
Definition: TGeoVolume.h:169
TGeoMaterial * GetMaterial() const
Definition: TGeoVolume.h:188
Bool_t IsRunTime() const
Definition: TGeoVolume.h:130
Bool_t IsVisLeaves() const
Definition: TGeoAtt.h:94
Bool_t IsAdded() const
Definition: TGeoVolume.h:161
void SetActivity(Bool_t flag=kTRUE)
Definition: TGeoAtt.h:81
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:226
TString fOption
just a hook for now
Definition: TGeoVolume.h:77
short Color_t
Definition: RtypesCore.h:79
virtual void ClearThreadData() const
Definition: TGeoVolume.cxx:424
TObjArray * fVolumes
Definition: TGeoVolume.h:272
void SortNodes()
sort nodes by decreasing volume of the bounding box.
Option_t * GetOption() const
Definition: TGeoVolume.h:201
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:985
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:250
virtual void DrawOnly(Option_t *)
draw only this volume
Definition: TGeoVolume.h:350
Char_t GetTransparency() const
Definition: TGeoVolume.h:203
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
TGeoVoxelFinder * fVoxels
Definition: TGeoVolume.h:73
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:27
TGeoPatternFinder * fFinder
dummy medium
Definition: TGeoVolume.h:72
void SetField(TObject *field)
Definition: TGeoVolume.h:234
ABC for user objects attached to TGeoVolume or TGeoNode.
Definition: TGeoExtension.h:21
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.
tomato 2-D histogram with a float per channel (see TH1 documentation)}
Definition: TH2.h:255
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:233
const char * GetIconName() const
Returns mime type name of object.
Definition: TGeoVolume.h:193
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:69
Int_t GetEntriesFast() const
Definition: TObjArray.h:66
void UnmarkSaved()
Reset SavePrimitive bits.
virtual Bool_t IsFolder() const
Return TRUE if volume contains nodes.
Definition: TGeoVolume.cxx:845
void CheckOverlaps(Double_t ovlp=0.1, Option_t *option="") const
Overlap checking tool.
Definition: TGeoVolume.cxx:642
Double_t GetStep() const
Definition: TGeoVolume.h:300
Bool_t IsXYZVoxels() const
Definition: TGeoVolume.h:166
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:621
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:125
void SetAttVisibility(Bool_t vis)
Definition: TGeoVolume.h:236
void SetActivity(Bool_t flag=kTRUE)
Definition: TGeoVolume.h:223
Bool_t IsTopVolume() const
True if this is the top volume of the geometry.
Definition: TGeoVolume.cxx:865
virtual Int_t GetCurrentNodeIndex() const
Definition: TGeoVolume.h:181
TGeoExtension * GrabUserExtension() const
Get a copy of the user extension pointer.
TGeoExtension * GetFWExtension() const
Definition: TGeoVolume.h:152
TObject * UncheckedAt(Int_t i) const
Definition: TObjArray.h:91
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:940
double Double_t
Definition: RtypesCore.h:55
Int_t GetNumber() const
Definition: TGeoVolume.h:198
void SetVoxelFinder(TGeoVoxelFinder *finder)
Definition: TGeoVolume.h:246
TObjArray * fNodes
Definition: TGeoVolume.h:68
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:82
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:244
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:78
Bool_t IsActiveDaughters() const
Definition: TGeoAtt.h:88
Double_t y[n]
Definition: legend1.C:17
void ClearNodes()
Definition: TGeoVolume.h:116
virtual void SetVisContainers(Bool_t flag=kTRUE)
Set visibility for containers.
Finder class handling voxels.
Bool_t IsVisContainers() const
Definition: TGeoAtt.h:93
Media are used to store properties related to tracking and which are useful only when using geometry ...
Definition: TGeoMedium.h:25
Bool_t IsVisLeaves() const
Definition: TGeoVolume.h:172
virtual void SetLineColor(Color_t lcolor)
Set the line color.
void InspectMaterial() const
Inspect the material for this volume.
Definition: TGeoVolume.cxx:882
static void CreateDummyMedium()
Create a dummy medium.
Definition: TGeoVolume.cxx:412
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:164
Double_t fStep
Definition: TGeoVolume.h:278
Mother of all ROOT objects.
Definition: TObject.h:37
TGeoVolume & operator=(const TGeoVolume &)
assignment operator
Definition: TGeoVolume.cxx:527
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:676
static TGeoVolume * Import(const char *filename, const char *name="", Option_t *option="")
Import a volume from a file.
Definition: TGeoVolume.cxx:890
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
Definition: TGeoNode.h:51
virtual Int_t GetNextNodeIndex() const
Definition: TGeoVolume.h:182
Bool_t IsVisDaughters() const
Definition: TGeoAtt.h:91
virtual Bool_t IsVolumeMulti() const
Definition: TGeoVolume.h:301
TGeoVolumeMulti * fDivision
Definition: TGeoVolume.h:273
TGeoExtension * GetUserExtension() const
Definition: TGeoVolume.h:151
virtual void InspectShape() const =0
Bool_t IsOverlappingCandidate() const
Definition: TGeoVolume.h:162
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:95
Double_t WeightA() const
Analytical computation of the weight.
void SetOverlappingCandidate(Bool_t flag)
Definition: TGeoVolume.h:231
void GrabFocus()
Move perspective view focus to this volume.
virtual Bool_t IsVolumeMulti() const
Definition: TGeoVolume.h:131
TGeoManager * GetGeoManager() const
Definition: TGeoVolume.h:187
virtual void SetMedium(TGeoMedium *medium)
Definition: TGeoVolume.h:245
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:204
std::vector< ThreadData_t * > fThreadData
Definition: TGeoVolume.h:337
const Bool_t kTRUE
Definition: Rtypes.h:91
void SetNumber(Int_t number)
Definition: TGeoVolume.h:248
void CheckShapes()
check for negative parameters in shapes.
Definition: TGeoVolume.cxx:701
void SetTransparency(Char_t transparency=0)
Definition: TGeoMaterial.h:124
void Grab()
Definition: TGeoVolume.h:155
void SelectVolume(Bool_t clear=kFALSE)
Select this volume as matching an arbitrary criteria.
Bool_t IsReplicated() const
Definition: TGeoVolume.h:163
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:24
char name[80]
Definition: TGX11.cxx:109
Bool_t IsCylVoxels() const
Definition: TGeoVolume.h:165
virtual void cd(Int_t inode) const
Actualize matrix of node indexed <inode>
Definition: TGeoVolume.cxx:976
Int_t GetNtotal() const
Definition: TGeoVolume.h:185
virtual void SetVisOnly(Bool_t flag=kTRUE)
Set visibility for leaves.
Bool_t IsValid() const
Definition: TGeoVolume.h:168
Int_t fRefCount
Definition: TGeoVolume.h:80
Bool_t IsRunTimeShape() const
Definition: TGeoShape.h:141
const char * Data() const
Definition: TString.h:349
void SetNtotal(Int_t ntotal)
Definition: TGeoVolume.h:249
virtual Bool_t IsAssembly() const
Returns true if the volume is an assembly or a scaled assembly.