ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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="");
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;
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;
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
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 togeather 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;
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;}
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 
Bool_t IsVisLeaves() const
Definition: TGeoVolume.h:172
char * GetPointerName() const
Provide a pointer name containing uid.
TGeoManager * fGeoManager
Definition: TGeoVolume.h:74
TGeoVolume()
dummy constructor
Definition: TGeoVolume.cxx:413
Bool_t IsVisible() const
Definition: TGeoAtt.h:96
void CleanAll()
Clean data of the volume.
Definition: TGeoVolume.cxx:645
virtual void ClearThreadData() const
Definition: TGeoVolume.cxx:389
TGeoVolumeAssembly()
Thread vector size.
virtual void cd(Int_t inode) const
Actualize matrix of node indexed <inode>
Definition: TGeoVolume.cxx:939
Bool_t IsRunTimeShape() const
Definition: TGeoShape.h:148
Bool_t IsVisibleDaughters() const
Definition: TGeoVolume.h:170
An array of TObjects.
Definition: TObjArray.h:39
void SetReplicated()
Definition: TGeoVolume.h:227
Bool_t IsAllInvisible() const
Return TRUE if volume and all daughters are invisible.
Definition: TGeoVolume.cxx:769
void SetNodes(TObjArray *nodes)
Definition: TGeoVolume.h:230
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:654
virtual void SetLineWidth(Width_t lwidth)
Set the line width for all components.
Bool_t IsRaytracing() const
Check if the painter is currently ray-tracing the content of this volume.
Definition: TGeoVolume.cxx:838
virtual void CreateThreadData(Int_t nthreads)
Definition: TGeoVolume.cxx:397
Bool_t IsXYZVoxels() const
Definition: TGeoVolume.h:166
void Release()
Definition: TGeoVolume.h:156
void Voxelize(Option_t *option)
build the voxels for this volume
void SetFinder(TGeoPatternFinder *finder)
Definition: TGeoVolume.h:247
short Style_t
Definition: RtypesCore.h:76
virtual Int_t GetCurrentNodeIndex() const
Definition: TGeoVolume.h:181
TGeoExtension * fUserExtension
Definition: TGeoVolume.h:81
virtual Bool_t IsVolumeMulti() const
Definition: TGeoVolume.h:131
void SetCylVoxels(Bool_t flag=kTRUE)
Definition: TGeoVolume.h:229
Bool_t IsReplicated() const
Definition: TGeoVolume.h:163
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:987
TGeoPatternFinder * GetFinder() const
Definition: TGeoVolume.h:191
Int_t GetNdiv() const
Definition: TGeoVolume.h:298
virtual Bool_t IsVolumeMulti() const
Definition: TGeoVolume.h:301
const char Option_t
Definition: RtypesCore.h:62
tuple offset
Definition: tree.py:93
Int_t GetNtotal() const
Definition: TGeoVolume.h:185
Bool_t IsActive() const
Definition: TGeoVolume.h:159
TGeoExtension * fFWExtension
Transient user-defined extension to volumes.
Definition: TGeoVolume.h:82
static TGeoMedium * DummyMedium()
Definition: TGeoVolume.cxx:405
void InspectShape() const
Definition: TGeoVolume.h:209
TGeoVolumeMulti & operator=(const TGeoVolumeMulti &)
assignment operator
ThreadData_t()
index of next node to be entered
virtual void SetVisibility(Bool_t vis=kTRUE)
Set visibility for this object.
Definition: TGeoAtt.cxx:101
#define BIT(n)
Definition: Rtypes.h:120
TGeoMedium * fMedium
Definition: TGeoVolume.h:70
Int_t GetAxis() const
Definition: TGeoVolume.h:297
virtual Int_t GetByteCount() const
get the total size in bytes for this volume
Double_t fStart
Definition: TGeoVolume.h:277
Option_t * GetOption() const
Definition: TGeoVolume.h:201
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
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:29
virtual void ClearThreadData() const
static const char * filename()
static void CreateDummyMedium()
virtual void SetVisibility(Bool_t vis=kTRUE)
Set visibility for all components.
virtual Int_t GetNextNodeIndex() const
Definition: TGeoVolume.h:182
Basic string class.
Definition: TString.h:137
Bool_t IsValid() const
Definition: TGeoVolume.h:168
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)
virtual ~TGeoVolumeAssembly()
Destructor. The assembly is owner of its "shape".
const Bool_t kFALSE
Definition: Rtypes.h:92
Int_t fNext
index of current selected node
Definition: TGeoVolume.h:326
void RemoveNode(TGeoNode *node)
Remove an existing daughter.
void ReplayCreation(const TGeoVolume *other)
Recreate the content of the other volume without pointer copying.
Int_t GetEntriesFast() const
Definition: TObjArray.h:66
Float_t py
Definition: hprod.C:33
void SetAsTopVolume()
Set this volume as the TOP one (the whole geometry starts from here)
void RegisterYourself(Option_t *option="")
Register the volume and all materials/media/matrices/shapes to the manager.
TGeoShape * GetLastShape() const
Returns the last shape.
Int_t GetNdaughters() const
Definition: TGeoVolume.h:362
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.
TGeoExtension * GetFWExtension() const
Definition: TGeoVolume.h:152
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:732
TGeoVolume * GetVolume(Int_t id) const
Definition: TGeoVolume.h:291
Int_t CountNodes(Int_t nlevels=1000, Int_t option=0)
Count total number of subnodes starting from this volume, nlevels down option = 0 (default) - count o...
Definition: TGeoVolume.cxx:718
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:537
virtual void CreateThreadData(Int_t nthreads)
const char * Data() const
Definition: TString.h:349
TObject * fField
pointer to TGeoManager owning this volume
Definition: TGeoVolume.h:76
Bool_t IsVisOnly() const
Definition: TGeoAtt.h:101
virtual Bool_t Contains(const Double_t *point) const =0
virtual ~TGeoVolume()
Destructor.
Definition: TGeoVolume.cxx:520
Fill Area Attributes class.
Definition: TAttFill.h:32
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...
Double_t WeightA() const
Analytical computation of the weight.
void SetActiveDaughters(Bool_t flag=kTRUE)
Definition: TGeoVolume.h:224
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.
Int_t GetNvolumes() const
Definition: TGeoVolume.h:296
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
void AddVolume(TGeoVolume *vol)
Add a volume with valid shape to the list of volumes.
Bool_t IsVisDaughters() const
Definition: TGeoAtt.h:97
void InvisibleAll(Bool_t flag=kTRUE)
Make volume and each of it daughters (in)visible.
Definition: TGeoVolume.cxx:780
Int_t fThreadSize
Thread specific data vector.
Definition: TGeoVolume.h:338
Bool_t GetOptimalVoxels() const
— Returns true if cylindrical voxelization is optimal.
TGeoExtension * GrabFWExtension() const
Get a copy of the framework extension pointer.
virtual Int_t GetNextNodeIndex() const
Bool_t IsOverlappingCandidate() const
Definition: TGeoVolume.h:162
Bool_t IsRunTime() const
Definition: TGeoVolume.h:130
static const std::string pattern("pattern")
ClassDef(TAttLine, 2)
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:188
void SetActivity(Bool_t flag=kTRUE)
Definition: TGeoAtt.h:87
Float_t z[5]
Definition: Ifit.C:16
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
Double_t Capacity() const
Computes the capacity of this [cm^3] as the capacity of its shape.
Definition: TGeoVolume.cxx:571
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
char * out
Definition: TBase64.cxx:29
short Color_t
Definition: RtypesCore.h:79
static TGeoVolumeAssembly * MakeAssemblyFromVolume(TGeoVolume *vol)
Make a clone of volume VOL but which is an assembly.
TObjArray * fVolumes
Definition: TGeoVolume.h:272
void SortNodes()
sort nodes by decreasing volume of the bounding box.
virtual TGeoVolume * CloneVolume() const
Clone this volume.
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:948
Double_t GetStart() const
Definition: TGeoVolume.h:299
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual Bool_t IsVisible() const
Definition: TGeoVolume.h:354
virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option="")
Add a new node to the list of nodes.
TObject * UncheckedAt(Int_t i) const
Definition: TObjArray.h:91
void SetShape(const TGeoShape *shape)
set the shape associated with this volume
Bool_t IsCylVoxels() const
Definition: TGeoVolume.h:165
Char_t GetTransparency() const
Definition: TGeoMaterial.h:116
virtual void DrawOnly(Option_t *)
draw only this volume
Definition: TGeoVolume.h:350
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
virtual TGeoVolume * CloneVolume() const
Clone this volume.
TGeoVoxelFinder * fVoxels
Definition: TGeoVolume.h:73
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...
Bool_t IsAdded() const
Definition: TGeoVolume.h:161
Bool_t Contains(const Double_t *point) const
Definition: TGeoVolume.h:125
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
compute the closest distance of approach from point px,py to this volume
Double_t GetStep() const
Definition: TGeoVolume.h:300
Int_t GetIndex(const TGeoNode *node) const
get index number for a given daughter
void InspectMaterial() const
Inspect the material for this volume.
Definition: TGeoVolume.cxx:846
TGeoPatternFinder * fFinder
dummy medium
Definition: TGeoVolume.h:72
void SetField(TObject *field)
Definition: TGeoVolume.h:234
virtual Bool_t IsAssembly() const
Returns true if the volume is an assembly or a scaled assembly.
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:256
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
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.
Bool_t IsSelected() const
Definition: TGeoVolume.h:164
TGeoManager * GetGeoManager() const
Definition: TGeoVolume.h:187
void CloneNodesAndConnect(TGeoVolume *newmother) const
Clone the array of nodes.
Bool_t TestBit(UInt_t f) const
Definition: TObject.h:173
TGeoShape * fShape
Definition: TGeoVolume.h:69
void UnmarkSaved()
Reset SavePrimitive bits.
virtual Bool_t IsAssembly() const
Returns true if the volume is an assembly or a scaled assembly.
Definition: TGeoVolume.h:353
Bool_t IsVisOnly() const
Definition: TGeoVolume.h:173
Bool_t IsStyleDefault() const
check if the visibility and attributes are the default ones
Definition: TGeoVolume.cxx:817
void PrintVoxels() const
Print the voxels for this volume.
virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
Add a component to the assembly.
void CheckOverlaps(Double_t ovlp=0.1, Option_t *option="") const
Overlap checking tool.
Definition: TGeoVolume.cxx:603
TGeoNode * GetNode(const char *name) const
get the pointer to a daughter node
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
virtual const char * GetName() const
Get the shape name.
Definition: TGeoShape.cxx:247
void SetUserExtension(TGeoExtension *ext)
Connect user-defined extension to the volume.
TGeoNode * GetNode(Int_t i) const
Definition: TGeoVolume.h:196
TGeoExtension * GrabUserExtension() const
Get a copy of the user extension pointer.
short Width_t
Definition: RtypesCore.h:78
const char * GetIconName() const
Returns mime type name of object.
Definition: TGeoVolume.h:193
TGeoMaterial * GetMaterial() const
Definition: TGeoMedium.h:54
void SetAttVisibility(Bool_t vis)
Definition: TGeoVolume.h:236
void SetActivity(Bool_t flag=kTRUE)
Definition: TGeoVolume.h:223
Bool_t IsVisContainers() const
Definition: TGeoAtt.h:99
void SetNextNodeIndex(Int_t index)
virtual Int_t GetCurrentNodeIndex() const
TGeoShape * GetShape() const
Definition: TGeoVolume.h:204
Int_t GetNumber() const
Definition: TGeoVolume.h:198
virtual TGeoVolume * MakeCopyVolume(TGeoShape *newshape)
make a copy of this volume build a volume with same name, shape and medium
Bool_t IsVisLeaves() const
Definition: TGeoAtt.h:100
Int_t Export(const char *filename, const char *name="", Option_t *option="")
Export this volume to a file.
Definition: TGeoVolume.cxx:903
double Double_t
Definition: RtypesCore.h:55
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
TGeoVoxelFinder * GetVoxels() const
Getter for optimization structure.
void MakeCopyNodes(const TGeoVolume *other)
make a new list of nodes and copy all nodes of other volume inside
Bool_t IsVisContainers() const
Definition: TGeoVolume.h:171
void SetActiveDaughters(Bool_t flag=kTRUE)
Definition: TGeoAtt.h:88
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
void SetInvisible()
Definition: TGeoVolume.h:244
ThreadData_t & GetThreadData() const
Int_t fNumber
option - if any
Definition: TGeoVolume.h:78
Double_t y[n]
Definition: legend1.C:17
Bool_t IsActiveDaughters() const
Definition: TGeoAtt.h:94
TGeoExtension * GetUserExtension() const
Definition: TGeoVolume.h:151
void ClearNodes()
Definition: TGeoVolume.h:116
virtual void SetVisContainers(Bool_t flag=kTRUE)
Set visibility for containers.
Int_t GetRefCount() const
Definition: TGeoVolume.h:150
Bool_t IsValid() const
Definition: TGeoShape.h:149
virtual void SetLineColor(Color_t lcolor)
Set the line color.
#define name(a, b)
Definition: linkTestLib0.cpp:5
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.
Double_t fStep
Definition: TGeoVolume.h:278
Bool_t IsActive() const
Definition: TGeoAtt.h:93
Mother of all ROOT objects.
Definition: TObject.h:58
TGeoVolume & operator=(const TGeoVolume &)
assignment operator
Definition: TGeoVolume.cxx:492
Int_t GetNodeIndex(const TGeoNode *node, Int_t *check_list, Int_t ncheck) const
Get the index of a daugther within check_list by providing the node pointer.
virtual ~TGeoVolumeMulti()
Destructor.
char Char_t
Definition: RtypesCore.h:29
Float_t px
Definition: hprod.C:33
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:637
static TGeoVolume * Import(const char *filename, const char *name="", Option_t *option="")
Import a volume from a file.
Definition: TGeoVolume.cxx:854
virtual void Print(Option_t *option="") const
Print volume info.
TObject * GetField() const
Definition: TGeoVolume.h:190
Bool_t IsTopVolume() const
True if this is the top volume of the geometry.
Definition: TGeoVolume.cxx:829
TGeoVolumeMulti * fDivision
Definition: TGeoVolume.h:273
TGeoMedium * GetMedium() const
Definition: TGeoVolume.h:189
void PrintNodes() const
print nodes
virtual Bool_t IsVisible() const
Definition: TGeoVolume.h:169
void SetCurrentNodeIndex(Int_t index)
virtual void SetLineStyle(Style_t lstyle)
Set the line style for all components.
virtual void InspectShape() const =0
void SetCurrentPoint(Double_t x, Double_t y, Double_t z)
Set the current tracking point.
void SetOverlappingCandidate(Bool_t flag)
Definition: TGeoVolume.h:231
TGeoVolume * MakeReflectedVolume(const char *newname="") const
Make a copy of this volume which is reflected with respect to XY plane.
void GrabFocus()
Move perspective view focus to this volume.
static TGeoMedium * fgDummyMedium
Definition: TGeoVolume.h:71
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Get volume info for the browser.
Bool_t IsActiveDaughters() const
Definition: TGeoVolume.h:160
Bool_t Valid() const
Check if the shape of this volume is valid.
Char_t GetTransparency() const
Definition: TGeoVolume.h:203
void FindOverlaps() const
loop all nodes marked as overlaps and find overlaping brothers
TObject * At(Int_t idx) const
Definition: TObjArray.h:167
virtual void SetMedium(TGeoMedium *medium)
Definition: TGeoVolume.h:245
virtual Bool_t IsFolder() const
Return TRUE if volume contains nodes return (GetNdaughters()?kTRUE:kFALSE);.
Definition: TGeoVolume.cxx:809
Bool_t FindMatrixOfDaughterVolume(TGeoVolume *vol) const
Find a daughter node having VOL as volume and fill TGeoManager::fHMatrix with its global matrix...
std::vector< ThreadData_t * > fThreadData
Definition: TGeoVolume.h:337
void SaveAs(const char *filename, Option_t *option="") const
Save geometry having this as top volume as a C++ macro.
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:664
void SetTransparency(Char_t transparency=0)
Definition: TGeoMaterial.h:137
void Grab()
Definition: TGeoVolume.h:155
void SelectVolume(Bool_t clear=kFALSE)
Select this volume as matching an arbitrary criteria.
Bool_t OptimizeVoxels()
Perform an exensive sampling to find which type of voxelization is most efficient.
Line Attributes class.
Definition: TAttLine.h:32
virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option)
Add an overlapping node - not allowed for assemblies.
TGeoNode * FindNode(const char *name) const
search a daughter inside the list of nodes
virtual void SetVisOnly(Bool_t flag=kTRUE)
Set visibility for leaves.
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:586
Int_t fRefCount
Definition: TGeoVolume.h:80
void SetNtotal(Int_t ntotal)
Definition: TGeoVolume.h:249