379 if (fgDummyMedium)
return;
381 fgDummyMedium->SetName(
"dummy");
383 dummyMaterial->
SetName(
"dummy");
384 fgDummyMedium->SetMaterial(dummyMaterial);
442 Warning(
"Ctor",
"volume %s has invalid shape", name);
445 Fatal(
"ctor",
"Shape of volume %s invalid. Aborting!",
fName.
Data());
478 fGeoManager(gv.fGeoManager),
484 fUserExtension(gv.fUserExtension->Grab()),
485 fFWExtension(gv.fFWExtension->Grab())
547 if (daughter->
IsAssembly()) title.TString::Format(
"Assembly with %d daughter(s)",
552 title.TString::Format(
"Volume having %s shape divided in %d %s slices",
555 }
else title.TString::Format(
"Volume with %s shape having %d daughter(s)",
624 for (
Int_t i=0; i<novlps; i++) {
630 if (novlps)
Info(
"CheckOverlaps",
"Number of illegal overlaps/extrusions for volume %s: %d\n",
GetName(), novlps);
667 Error(
"CheckShapes",
"volume %s has run-time shape",
GetName());
677 for (
Int_t i=0; i<nd; i++) {
680 if (!node->
GetName()[0])
printf(
"Daughter %i of volume %s - NO NAME!!!\n",
691 Fatal(
"CheckShapes",
"Cannot make copy node for %s", node->
GetName());
696 Error(
"CheckShapes",
"cannot resolve runtime shape for volume %s/%s\n",
720 static Int_t maxlevel = 0;
721 static Int_t nlev = 0;
723 if (option<0 || option>3) option = 0;
753 if (nlev>maxlevel) maxlevel = nlev;
757 for (
Int_t i=0; i<nd; i++) {
787 for (
Int_t i=0; i<nd; i++) {
795 for (
Int_t i=0; i<nd+1; i++) {
797 browser->CheckObjectItem(vol, !flag);
857 if (!filename)
return 0;
859 if (strstr(filename,
".gdml")) {
866 printf(
"Error: TGeoVolume::Import : Cannot open file %s\n", filename);
869 if (name && name[0]) {
875 if (strcmp(key->GetClassName(),
"TGeoVolume") != 0)
continue;
882 if (!volume)
return NULL;
908 Info(
"Export",
"Exporting volume %s as C++ code",
GetName());
914 Info(
"Export",
"Exporting %s as gdml code - not implemented yet",
GetName());
919 Info(
"Export",
"Exporting %s as root file.",
GetName());
921 if (!opt.
Length()) opt =
"recreate";
924 Error(
"Export",
"Cannot open file");
954 Error(
"AddNode",
"Volume is NULL");
958 Error(
"AddNode",
"Won't add node with invalid shape");
966 Error(
"AddNode",
"Cannot add node %s_%i into divided volume %s", vol->
GetName(), copy_no,
GetName());
990 Error(
"AddNodeOffset",
"invalid volume");
994 Error(
"AddNode",
"Won't add node with invalid shape");
1015 Error(
"AddNodeOverlap",
"Volume is NULL");
1019 Error(
"AddNodeOverlap",
"Won't add node with invalid shape");
1024 Warning(
"AddNodeOverlap",
"Declaring assembly %s as possibly overlapping inside %s not allowed. Using AddNode instead !",vol->
GetName(),
GetName());
1025 AddNode(vol, copy_no, mat, option);
1035 Error(
"AddNodeOverlap",
"Cannot add node %s_%i into divided volume %s", vol->
GetName(), copy_no,
GetName());
1044 Warning(
"AddNode",
"Volume %s : added node %s with same name",
GetName(), name.
Data());
1070 Fatal(
"Divide",
"volume %s already divided",
GetName());
1081 if ((start-xlo)<-1
E-3) start+=360.;
1092 if (ndiv<=0 || opt.
Contains(
"s")) {
1094 Fatal(
"Divide",
"invalid division type for volume %s : ndiv=%i, step=%g",
GetName(), ndiv, step);
1098 if ((xlo-start)>1
E-3 || (xhi-start)<-1
E-3) {
1099 Fatal(
"Divide",
"invalid START=%g for division on axis %s of volume %s. Range is (%g, %g)",
1106 ndiv =
Int_t((range+0.1*step)/step);
1109 if (ddx>1
E-3)
Warning(
"Divide",
"division of volume %s on %s axis (ndiv=%d) will be centered in the full range",
1111 start = xlo + 0.5*ddx;
1113 if (step<=0 || opt.
Contains(
"n")) {
1115 if ((xlo-start)>1
E-3 || (xhi-start)<-1
E-3) {
1116 Fatal(
"Divide",
"invalid START=%g for division on axis %s of volume %s. Range is (%g, %g)",
1128 if (((start-xlo)<-1
E-3) || ((end-xhi)>1
E-3)) {
1129 Fatal(
"Divide",
"division of volume %s on axis %s exceed range (%g, %g)",
1137 Fatal(
"Divide",
"invalid medium number %d for division volume %s", numed, divname);
1154 if (!painter)
return dist;
1168 if (option && option[0] > 0) {
1181 Info(
"DrawOnly",
"Volume assemblies do not support this option.");
1188 if (option && option[0] > 0) {
1224 if (option && option[0] > 0) {
1225 painter->
Paint(option);
1258 for (
Int_t i=0; i<nd; i++) {
1271 for (
Int_t i=0; i<nd; i++) {
1288 TH2F *hist = p->
LegoPlot(ntheta, themin, themax, nphi, phimin, phimax, rmin, rmax, option);
1289 hist->
Draw(
"lego1sph");
1321 for (i=0; i<nd; i++) {
1383 if (!filename)
return;
1387 Error(
"SavePrimitive",
"Bad file name: %s", filename);
1394 if (ind>0) fname.
Remove(ind);
1395 out <<
"void "<<fname<<
"() {" << std::endl;
1396 out <<
" gSystem->Load(\"libGeom\");" << std::endl;
1397 ((
TGeoVolume*)
this)->SavePrimitive(out,option);
1398 out <<
"}" << std::endl;
1461 out.setf(std::ios::fixed);
1476 out <<
" Double_t dx,dy,dz;" << std::endl;
1477 out <<
" Double_t dx1, dx2, dy1, dy2;" << std::endl;
1478 out <<
" Double_t vert[20], par[20];" << std::endl;
1479 out <<
" Double_t theta, phi, h1, bl1, tl1, alpha1, h2, bl2, tl2, alpha2;" << std::endl;
1480 out <<
" Double_t twist;" << std::endl;
1481 out <<
" Double_t origin[3];" << std::endl;
1482 out <<
" Double_t rmin, rmax, rmin1, rmax1, rmin2, rmax2;" << std::endl;
1483 out <<
" Double_t r, rlo, rhi;" << std::endl;
1484 out <<
" Double_t phi1, phi2;" << std::endl;
1485 out <<
" Double_t a,b;" << std::endl;
1486 out <<
" Double_t point[3], norm[3];" << std::endl;
1487 out <<
" Double_t rin, stin, rout, stout;" << std::endl;
1488 out <<
" Double_t thx, phx, thy, phy, thz, phz;" << std::endl;
1489 out <<
" Double_t alpha, theta1, theta2, phi1, phi2, dphi;" << std::endl;
1490 out <<
" Double_t tr[3], rot[9];" << std::endl;
1491 out <<
" Double_t z, density, radl, absl, w;" << std::endl;
1492 out <<
" Double_t lx,ly,lz,tx,ty,tz;" << std::endl;
1493 out <<
" Double_t xvert[50], yvert[50];" << std::endl;
1494 out <<
" Double_t zsect,x0,y0,scale0;" << std::endl;
1495 out <<
" Int_t nel, numed, nz, nedges, nvert;" << std::endl;
1496 out <<
" TGeoBoolNode *pBoolNode = 0;" << std::endl << std::endl;
1498 out <<
" // MATERIALS, MIXTURES AND TRACKING MEDIA" << std::endl;
1501 out << std::endl <<
" // TRANSFORMATION MATRICES" << std::endl;
1505 out << std::endl <<
" // SET TOP VOLUME OF GEOMETRY" << std::endl;
1506 out <<
" gGeoManager->SetTopVolume(" <<
GetPointerName() <<
");" << std::endl;
1508 out << std::endl <<
" // SHAPES, VOLUMES AND GEOMETRICAL HIERARCHY" << std::endl;
1510 out << std::endl <<
" // CLOSE GEOMETRY" << std::endl;
1511 out <<
" gGeoManager->CloseGeometry();" << std::endl;
1513 if (!
IsRaytracing()) out <<
" gGeoManager->GetTopVolume()->Draw();" << std::endl;
1514 else out <<
" gGeoManager->GetTopVolume()->Raytrace();" << std::endl;
1519 if (!strcmp(option,
"s")) {
1524 out <<
" // Volume: " <<
GetName() << std::endl;
1529 out <<
" // Assembly: " <<
GetName() << std::endl;
1530 out <<
" " <<
GetPointerName() <<
" = new TGeoVolumeAssembly(\"" <<
GetName() <<
"\"" <<
");" << std::endl;
1542 if (!strcmp(option,
"m")) {
1544 for (i=0; i<nd; i++) {
1551 if (!strcmp(option,
"x")) {
1557 for (i=0; i<nd; i++) {
1566 if (!strcmp(option,
"d")) {
1580 out <<
");" << std::endl;
1584 for (i=0; i<nd; i++) {
1595 out <<
");" << std::endl;
1598 for (i=0; i<nd; i++) {
1622 if (!painter)
return;
1640 for (
Int_t i=0; i<ncheck; i++) {
1642 if (current==node)
return check_list[i];
1655 for (
Int_t i=0; i<nd; i++) {
1657 if (current==node)
return i;
1669 if (!painter)
return 0;
1683 for (
id=0;
id<nd;
id++) {
1687 if (ncyl>(nd/2))
return kTRUE;
1698 return (
char*)name.
Data();
1743 for (i=0; i<nbits; i++)
1745 for (i=14; i<24; i++)
1751 for (i=0; i<nbits; i++)
1790 for (
Int_t i=0; i<nd; i++) {
1794 Fatal(
"CloneNodesAndConnect",
"cannot make copy node");
1854 static TMap map(100);
1856 Error(
"MakeReflectedVolume",
"Geometry must be closed.");
1861 if (newname && newname[0]) vol->
SetName(newname);
1867 Fatal(
"MakeReflectedVolume",
"Cannot clone volume %s\n",
GetName());
1871 if (newname && newname[0]) vol->
SetName(newname);
1885 if (!nd)
return vol;
1890 for (
Int_t i=0; i<nd; i++) {
1922 Fatal(
"MakeReflectedVolume",
"Could not copy finder for volume %s",
GetName());
1929 for (
Int_t i=0; i<nd; i++) {
1960 Error(
"SetShape",
"No shape");
1973 Error(
"SortNodes",
"Bounding box not valid");
1986 for (
id=0;
id<nd;
id++) {
1994 for (
id=0;
id<nd;
id++) {
2004 for (
id=0;
id<nd;
id++) {
2012 if (inode != nd)
printf(
" volume %s : number of nodes does not match!!!\n",
GetName());
2020 void TGeoVolume::Streamer(
TBuffer &R__b)
2088 Int_t count = 28+2+6+4+0;
2090 count += 7*
sizeof(
char*);
2109 Error(
"FindOverlaps",
"Bounding box not valid");
2117 for (inode=0; inode<nd; inode++) {
2144 if (ind < 0)
return NULL;
2147 Error(
"ReplaceNode",
"Cannot replace node %s since it is an assembly", nodeorig->
GetName());
2151 if (newshape && !nodeorig->
IsOffset()) shape = newshape;
2153 if (newmed) med = newmed;
2168 Fatal(
"ReplaceNode",
"Cannot make copy node for %s", nodeorig->
GetName());
2174 if (newpos && !nodeorig->
IsOffset()) {
2195 static Int_t len = 0;
2199 for (i=0; i<len; i++) {
2279 if (vol ==
this)
return kTRUE;
2283 if (!global)
return kFALSE;
2288 for (i=0; i<nd; i++) {
2297 for (i=0; i<nd; i++) {
2321 Error(
"Voxelize",
"Bounding box not valid");
2371 for (i=0; i<nd; i++) {
2373 weight += daughter->
WeightA();
2379 if (density<0.01) density = 0.0;
2381 weight += 0.001*capacity * density;
2429 fVolumes(vm.fVolumes),
2430 fDivision(vm.fDivision),
2481 Fatal(
"AddVolume",
"Cannot divide volume %s", vol->
GetName());
2491 for (
Int_t id=0;
id<nd;
id++) {
2511 for (
Int_t ivo=0; ivo<nvolumes; ivo++) {
2517 volume->
AddNode(vol, copy_no, mat, option);
2531 for (
Int_t ivo=0; ivo<nvolumes; ivo++) {
2558 Error(
"Divide",
"volume %s already divided",
GetName());
2566 Error(
"Divide",
"Invalid medium number %d for division volume %s", numed, divname);
2590 for (
Int_t ivo=0; ivo<nvolumes; ivo++) {
2632 Fatal(
"MakeCopyVolume",
"Cannot divide volume %s", vol->
GetName());
2644 if (!nd)
return vol;
2650 for (i=0; i<nd; i++) {
2654 Fatal(
"MakeCopyNode",
"cannot make copy node for daughter %d of %s", i,
GetName());
2671 for (
Int_t ivo=0; ivo<nvolumes; ivo++) {
2685 for (
Int_t ivo=0; ivo<nvolumes; ivo++) {
2699 for (
Int_t ivo=0; ivo<nvolumes; ivo++) {
2713 for (
Int_t ivo=0; ivo<nvolumes; ivo++) {
2728 for (
Int_t ivo=0; ivo<nvolumes; ivo++) {
2740 fCurrent(-1), fNext(-1)
2777 std::vector<ThreadData_t*>::iterator i =
fThreadData.begin();
2796 for (
Int_t tid=0; tid<nthreads; tid++) {
2882 Warning(
"AddNodeOverlap",
"Declaring assembly %s as possibly overlapping inside %s not allowed. Using AddNode instead !",vol->
GetName(),
GetName());
2883 AddNode(vol, copy_no, mat, option);
2896 for (i=0; i<nbits; i++)
2898 for (i=14; i<24; i++)
2904 for (i=0; i<nbits; i++)
2929 Error(
"Divide",
"Assemblies cannot be divided");
2941 Error(
"Divide",
"Cannot divide assembly %s since it has nodes",
GetName());
2945 Error(
"Divide",
"Assembly %s already divided",
GetName());
2949 if (!ncells || pattern->
GetStep()<=0) {
2950 Error(
"Divide",
"Pattern finder for dividing assembly %s not initialized. Use SetRange() method.",
GetName());
2959 for (
Int_t i=0; i<ncells; i++) {
2980 for (i=0; i<nbits; i++)
2982 for (i=14; i<24; i++)
2988 for (i=0; i<nbits; i++)
Bool_t IsVisLeaves() const
char * GetPointerName() const
Provide a pointer name containing uid.
void Add(TObject *obj, const char *name=0, Int_t check=-1)
Add object with name to browser.
TGeoManager * fGeoManager
TGeoVolume()
dummy constructor
void CreateThreadData(Int_t nthreads)
Create thread data for n threads max.
virtual void Paint(Option_t *option="")=0
This method must be overridden if a class wants to paint itself.
void CleanAll()
Clean data of the volume.
virtual void ClearThreadData() const
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
virtual const char * GetTitle() const
Returns title of object.
virtual Style_t GetLineStyle() const
virtual Style_t GetFillStyle() const
TGeoVolumeAssembly()
Thread vector size.
virtual void SetLineWidth(Width_t lwidth)
virtual void cd(Int_t inode) const
Actualize matrix of node indexed
void CheckShape(Int_t testNo, Int_t nsamples=10000, Option_t *option="")
Test for shape navigation methods.
Bool_t IsRunTimeShape() const
Double_t GetStart() const
double dist(Rotation3D const &r1, Rotation3D const &r2)
Bool_t IsVisibleDaughters() const
Bool_t IsAllInvisible() const
Return TRUE if volume and all daughters are invisible.
void SetNodes(TObjArray *nodes)
void ResetAttBit(UInt_t f)
virtual void SetLineColor(Color_t lcolor)
Set the line color for all components.
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
void ClearShape()
Clear the shape of this volume from the list held by the current manager.
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.
TList * GetListOfMaterials() const
virtual void CreateThreadData(Int_t nthreads)
virtual void SetVisContainers(Bool_t flag=kTRUE)
Set branch type visibility.
void Voxelize(Option_t *option)
build the voxels for this volume
void SetFinder(TGeoPatternFinder *finder)
virtual void ModifiedPad(Bool_t update=kFALSE) const =0
void SetAllIndex()
Assigns uid's for all materials,media and matrices.
virtual void Voxelize(Option_t *option="")
Voxelize attached volume according to option If the volume is an assembly, make sure the bbox is comp...
TGeoVolume * GetVolume() const
TGeoExtension * fUserExtension
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
virtual void ExecuteVolumeEvent(TGeoVolume *volume, Int_t event, Int_t px, Int_t py)=0
virtual Bool_t IsVolumeMulti() const
void SetVolume(TGeoVolume *vol)
virtual void Clear(Option_t *option="")
Remove all objects from the array.
void MultiplyLeft(const TGeoMatrix *left)
multiply to the left with an other transformation if right is identity matrix, just return ...
void AddNodeOffset(TGeoVolume *vol, Int_t copy_no, Double_t offset=0, Option_t *option="")
Add a division node to the list of nodes.
TGeoPatternFinder * GetFinder() const
virtual Int_t GetByteCount() const =0
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
virtual void CheckGeometry(Int_t nrays, Double_t startx, Double_t starty, Double_t startz) const =0
virtual void Print(Option_t *option="") const
Print the voxels.
TGeoExtension * fFWExtension
Transient user-defined extension to volumes.
static TGeoMedium * DummyMedium()
virtual void CreateThreadData(Int_t)
TString & ReplaceAll(const TString &s1, const TString &s2)
void InspectShape() const
virtual void CheckOverlaps(const TGeoVolume *vol, Double_t ovlp=0.1, Option_t *option="") const =0
R__EXTERN TStyle * gStyle
TGeoVolumeMulti & operator=(const TGeoVolumeMulti &)
assignment operator
virtual void SetVisibility(Bool_t vis=kTRUE)
Set visibility for this object.
virtual void SetName(const char *name)
Change (i.e.
virtual TList * GetListOfKeys() const
virtual Int_t GetByteCount() const
get the total size in bytes for this volume
Option_t * GetOption() const
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
Add a TGeoNode to the list of nodes.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
ClassImp(TGeoVolumeMulti) TGeoVolumeMulti
dummy constructor
virtual void Draw(Option_t *option="")
draw top volume according to option
void RegisterYourself()
Register the shape and all components to TGeoManager class.
Use this attribute class when an object should have 3D capabilities.
Buffer base class used for serializing objects.
virtual void ClearThreadData() const
virtual Int_t GetOptimalVoxels() const
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
static const char * filename()
void Add(TObject *obj)
This function may not be used (but we need to provide it since it is a pure virtual in TCollection)...
virtual void SetVisibility(Bool_t vis=kTRUE)
Set visibility for all components.
virtual TObject * Remove(TObject *obj)
Remove object from array.
void SetTopVolume(TGeoVolume *vol)
Set the top volume and corresponding node as starting point of the geometry.
virtual void SetTopVolume(TGeoVolume *vol)=0
virtual void ClearThreadData() const
TObjArray * GetListOfShapes() const
virtual void DrawOnly(Option_t *option="")
draw only this volume
virtual TGeoShape * GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const =0
void ToLower()
Change string to lower-case.
void VisibleDaughters(Bool_t vis=kTRUE)
set visibility for daughters
void SetOption(const char *option)
Set the current options (none implemented)
virtual ~TGeoVolumeAssembly()
Destructor. The assembly is owner of its "shape".
virtual void SetFillStyle(Style_t fstyle)
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
void RemoveNode(TGeoNode *node)
Remove an existing daughter.
void ReplayCreation(const TGeoVolume *other)
Recreate the content of the other volume without pointer copying.
void CheckObjectItem(TObject *obj, Bool_t check=kFALSE)
Change status of checkbox for this item.
Int_t GetEntriesFast() const
virtual TGeoNode * MakeCopyNode() const
Bool_t IsReflection() const
void SetAsTopVolume()
Set this volume as the TOP one (the whole geometry starts from here)
virtual Bool_t TestVoxels(TGeoVolume *vol)=0
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
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.
static Bool_t IsSameWithinTolerance(Double_t a, Double_t b)
Check if two numbers differ with less than a tolerance.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
TGeoVolume * GetVolume(Int_t id) const
TGeoHMatrix * GetHMatrix()
Return stored current matrix (global matrix of the next touched node).
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
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...
void Browse(TBrowser *b)
How to browse a volume.
virtual void CreateThreadData(Int_t nthreads)
const char * Data() const
void SetVisRaytrace(Bool_t flag=kTRUE)
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
TObject * fField
pointer to TGeoManager owning this volume
Sequenceable collection abstract base class.
virtual ~TGeoVolume()
Destructor.
Fill Area Attributes class.
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...
virtual void SetVisLeaves(Bool_t flag=kTRUE)
Set visibility for leaves.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
Double_t WeightA() const
Analytical computation of the weight.
void RandomRays(Int_t nrays=1000, Double_t startx=0, Double_t starty=0, Double_t startz=0, const char *target_vol=0, Bool_t check_norm=kFALSE)
Randomly shoot nrays and plot intersections with surfaces for current top node.
virtual void GrabFocus(Int_t nfr=0, Double_t dlong=0, Double_t dlat=0, Double_t dpsi=0)=0
Bool_t IsOverlapping() const
const char Int_t const char TProof Int_t stype
virtual TGeoVolume * Divide(const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed=0, Option_t *option="")
Division makes no sense for assemblies.
void SetCurrentPoint(Double_t *point)
Int_t GetNvolumes() const
The TNamed class is the base class for all named ROOT classes.
void AddVolume(TGeoVolume *vol)
Add a volume with valid shape to the list of volumes.
Bool_t IsVisDaughters() const
void InvisibleAll(Bool_t flag=kTRUE)
Make volume and each of it daughters (in)visible.
Int_t fThreadSize
Thread specific data vector.
Bool_t GetOptimalVoxels() const
— Returns true if cylindrical voxelization is optimal.
void ClearShape(const TGeoShape *shape)
Remove a shape from the list of shapes.
TVirtualGeoPainter * GetPainter() const
TList * GetListOfMedia() const
TGeoExtension * GrabFWExtension() const
Get a copy of the framework extension pointer.
void SortOverlaps()
Sort overlaps by decreasing overlap distance. Extrusions comes first.
Bool_t IsIdentity() const
virtual Int_t GetNextNodeIndex() const
Bool_t IsOverlappingCandidate() const
Int_t AddVolume(TGeoVolume *volume)
Add a volume to the list. Returns index of the volume in list.
virtual void SetVisLeaves(Bool_t flag=kTRUE)
Set branch type visibility.
TObject * GetValue(const char *keyname) const
Returns a pointer to the value associated with keyname as name of the key.
virtual TGeoMatrix * GetMatrix() const =0
virtual TGeoVolume * MakeCopyVolume(TGeoShape *newshape)
Make a copy of this volume build a volume with same name, shape and medium.
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TGeoMaterial * GetMaterial() const
TGeoVolume * GetTopVolume() const
void RandomPoints(Int_t npoints=1000000, Option_t *option="")
Draw random points in the bounding box of this volume.
virtual Int_t DistanceToPrimitiveVol(TGeoVolume *vol, Int_t px, Int_t py)=0
virtual void SetMedium(TGeoMedium *medium)
Set medium for a multiple volume.
virtual void Paint(Option_t *option="")
paint volume
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Double_t Capacity() const
Computes the capacity of this [cm^3] as the capacity of its shape.
virtual Bool_t IsValidBox() const =0
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.
TString fOption
just a hook for now
static TGeoVolumeAssembly * MakeAssemblyFromVolume(TGeoVolume *vol)
Make a clone of volume VOL but which is an assembly.
void SortNodes()
sort nodes by decreasing volume of the bounding box.
virtual TGeoVolume * CloneVolume() const
Clone this volume.
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
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.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option="")
Add a new node to the list of nodes.
void SetShape(const TGeoShape *shape)
set the shape associated with this volume
TObjArray * GetListOfVolumes() const
char * GetPointerName() const
Provide a pointer name containing uid.
virtual void SetLineColor(Color_t lcolor)
Using a TBrowser one can browse all ROOT objects.
char * GetPointerName() const
Provide a pointer name containing uid.
virtual TGeoVolume * CloneVolume() const
Clone this volume.
TGeoVoxelFinder * fVoxels
virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option="")
Add a new node to the list of nodes, This node is possibly overlapping with other daughters of the vo...
virtual void Release() const =0
void SetNeedRebuild(Bool_t flag=kTRUE)
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
compute the closest distance of approach from point px,py to this volume
TNamed & operator=(const TNamed &rhs)
TNamed assignment operator.
Int_t GetIndex(const TGeoNode *node) const
get index number for a given daughter
void InspectMaterial() const
Inspect the material for this volume.
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
void SetMotherVolume(TGeoVolume *mother)
virtual void Draw(Option_t *option="")
Draw this histogram with options.
TGeoPatternFinder * fFinder
dummy medium
void SetSpacedOut(Bool_t flag)
virtual void SetFillColor(Color_t fcolor)
void SetField(TObject *field)
virtual void SetVisOnly(Bool_t flag=kTRUE)
Set branch type visibility.
virtual Bool_t IsAssembly() const
Returns true if the volume is an assembly or a scaled assembly.
virtual TObject * RemoveAt(Int_t idx)
Remove object at index idx.
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.
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)=0
2-D histogram with a float per channel (see TH1 documentation)}
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual Color_t GetFillColor() const
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.
virtual Int_t GetByteCount() const
void SetMatrix(const TGeoMatrix *matrix)
Matrix setter.
void CloneNodesAndConnect(TGeoVolume *newmother) const
Clone the array of nodes.
Bool_t TestBit(UInt_t f) const
Bool_t IsVisRaytrace() const
void UnmarkSaved()
Reset SavePrimitive bits.
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
virtual const char * GetName() const
Returns name of object.
Bool_t IsStyleDefault() const
check if the visibility and attributes are the default ones
TSubString Strip(EStripType s=kTrailing, char c= ' ') const
Return a substring of self stripped at beginning and/or end.
TGeoMedium * GetMedium(const char *medium) const
Search for a named tracking medium. All trailing blanks stripped.
static Int_t Lock()
Static method to lock the main thread mutex.
virtual Color_t GetLineColor() const
void PrintVoxels() const
Print the voxels for this volume.
Bool_t TestAttBit(UInt_t f) const
void SetDivIndex(Int_t index)
virtual void DrawVolume(TGeoVolume *vol, Option_t *option="")=0
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.
TGeoNode * GetNode(const char *name) const
get the pointer to a daughter node
virtual void AddAt(TObject *obj, Int_t idx)
Add object at position ids.
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
TObjArray * GetListOfMatrices() const
void SetUserExtension(TGeoExtension *ext)
Connect user-defined extension to the volume.
virtual TGeoVolume * GetTopVolume() const =0
void RandomPoints(const TGeoVolume *vol, Int_t npoints=10000, Option_t *option="")
Draw random points in the bounding box of a volume.
virtual const char * GetAxisName(Int_t iaxis) const =0
TGeoExtension * GrabUserExtension() const
Get a copy of the user extension pointer.
virtual TGeoMatrix * GetMatrix() const
TGeoMaterial * GetMaterial() const
void SetFinder(TGeoPatternFinder *finder)
void SetAttVisibility(Bool_t vis)
void SetOverlapping(Bool_t flag=kTRUE)
TString & Remove(Ssiz_t pos)
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
void SetNextNodeIndex(Int_t index)
Double_t Weight(Double_t precision=0.01, Option_t *option="va")
Estimate weight of volume VOL with a precision SIGMA(W)/W better than PRECISION.
virtual Int_t GetCurrentNodeIndex() const
Int_t GetVisOption() const
Returns current depth to which geometry is drawn.
static Int_t UnLock()
Static method to unlock the main thread mutex.
virtual void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to XY.
TGeoShape * GetShape() const
~ThreadData_t()
Destructor.
R__EXTERN TGeoManager * gGeoManager
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.
void SetVoxelFinder(TGeoVoxelFinder *finder)
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
virtual Bool_t IsComposite() const
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
ThreadData_t & GetThreadData() const
Bool_t IsRegistered() const
Int_t fNumber
option - if any
virtual const char * GetVolumeInfo(const TGeoVolume *volume, Int_t px, Int_t py) const =0
virtual void SetVisContainers(Bool_t flag=kTRUE)
Set visibility for containers.
virtual void Print(const Option_t *option="") const
print characteristics of this material
Int_t GetEntries() const
Return the number of objects in array (i.e.
virtual TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step)=0
virtual void ComputeBBox()=0
const char * GetPointerName() const
Provide a pointer name containing uid.
Int_t AddShape(const TGeoShape *shape)
Add a shape to the list. Returns index of the shape in list.
virtual void SetLineStyle(Style_t lstyle)
void Print(Option_t *option="") const
print the matrix in 4x4 format
virtual Double_t Capacity() const =0
virtual void SetLineColor(Color_t lcolor)
Set the line color.
void SetVolume(TGeoVolume *volume)
Binding & operator=(OUT(*fun)(void))
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.
virtual Int_t GetDivAxis()
Mother of all ROOT objects.
static TGeoShape * MakeScaledShape(const char *name, TGeoShape *shape, TGeoScale *scale)
Create a scaled shape starting from a non-scaled one.
TGeoVolume & operator=(const TGeoVolume &)
assignment operator
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.
Bool_t IsCheckingOverlaps() const
virtual ~TGeoVolumeMulti()
Destructor.
void CheckShape(Int_t testNo, Int_t nsamples=10000, Option_t *option="")
Tests for checking the shape navigation algorithms. See TGeoShape::CheckShape()
static TGeoVolume * Import(const char *filename, const char *name="", Option_t *option="")
Import a volume from a file.
virtual void Print(Option_t *option="") const
Print volume info.
void ClearOverlaps()
Clear the list of overlaps.
void SetNsegments(Int_t nseg)
Set number of segments for approximating circles in drawing.
virtual TGeoExtension * Grab()=0
R__EXTERN TGeoIdentity * gGeoIdentity
Bool_t TestShapeBit(UInt_t f) const
static Int_t ThreadId()
Translates the current thread id to an ordinal number.
virtual Double_t GetDensity() const
TObject * GetField() const
Bool_t IsTopVolume() const
True if this is the top volume of the geometry.
TGeoVolumeMulti * fDivision
virtual void Add(TObject *obj)
void SetVisDaughters(Bool_t vis=kTRUE)
Set visibility for the daughters.
void SetUsed(Bool_t flag=kTRUE)
TGeoMedium * GetMedium() const
void PrintNodes() const
print nodes
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual Int_t GetByteCount() const
virtual Bool_t IsVisible() const
void SetCurrentNodeIndex(Int_t index)
virtual void SetLineStyle(Style_t lstyle)
Set the line style for all components.
void SetCurrentPoint(Double_t x, Double_t y, Double_t z)
Set the current tracking point.
Int_t AddMaterial(const TGeoMaterial *material)
Add a material to the list. Returns index of the material in list.
virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const =0
void SetOverlappingCandidate(Bool_t flag)
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
void ClearThreadData() const
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Get volume info for the browser.
Bool_t Valid() const
Check if the shape of this volume is valid.
TObjArray * GetListOfOverlaps()
Bool_t IsStreamingVoxels() const
void FindOverlaps() const
loop all nodes marked as overlaps and find overlaping brothers
TObject * At(Int_t idx) const
virtual void SetMedium(TGeoMedium *medium)
virtual void FindOverlaps(Int_t inode) const
create the list of nodes for which the bboxes overlap with inode's bbox
virtual Bool_t IsFolder() const
Return TRUE if volume contains nodes return (GetNdaughters()?kTRUE:kFALSE);.
Bool_t FindMatrixOfDaughterVolume(TGeoVolume *vol) const
Find a daughter node having VOL as volume and fill TGeoManager::fHMatrix with its global matrix...
virtual TGeoVolume * GetDrawnVolume() const =0
virtual void Compress()
Remove empty slots from array.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
std::vector< ThreadData_t * > fThreadData
void SaveAs(const char *filename, Option_t *option="") const
Save geometry having this as top volume as a C++ macro.
virtual Width_t GetLineWidth() const
void SetVisTouched(Bool_t vis=kTRUE)
Mark visualization attributes as "modified".
void SetNumber(Int_t number)
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
void CheckShapes()
check for negative parameters in shapes.
virtual Bool_t IsAssembly() const
void SetVisOption(Int_t option=0)
set drawing mode : option=0 (default) all nodes drawn down to vislevel option=1 leaves and nodes at v...
void SelectVolume(Bool_t clear=kFALSE)
Select this volume as matching an arbitrary criteria.
TVirtualGeoPainter * GetGeomPainter()
Make a default painter if none present. Returns pointer to it.
Bool_t OptimizeVoxels()
Perform an exensive sampling to find which type of voxelization is most efficient.
virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option)
Add an overlapping node - not allowed for assemblies.
void Refresh()
Refresh browser contents.
TGeoNode * FindNode(const char *name) const
search a daughter inside the list of nodes
void SetNumber(Int_t number)
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...
virtual TH2F * LegoPlot(Int_t ntheta=60, Double_t themin=0., Double_t themax=180., Int_t nphi=90, Double_t phimin=0., Double_t phimax=360., Double_t rmin=0., Double_t rmax=9999999, Option_t *option="")=0
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
void SetNtotal(Int_t ntotal)
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.