417 dummyMaterial->
SetName(
"dummy");
476 Warning(
"Ctor",
"volume %s has invalid shape",
name);
479 Fatal(
"ctor",
"Shape of volume %s invalid. Aborting!",
fName.
Data());
512 fGeoManager(gv.fGeoManager),
518 fUserExtension(gv.fUserExtension->Grab()),
519 fFWExtension(gv.fFWExtension->Grab())
581 if (daughter->
IsAssembly()) title.TString::Format(
"Assembly with %d daughter(s)",
585 s1.ReplaceAll(
"TGeoPattern",
"");
586 title.TString::Format(
"Volume having %s shape divided in %d %s slices",
589 }
else title.TString::Format(
"Volume with %s shape having %d daughter(s)",
662 for (
Int_t i=0; i<novlps; i++) {
668 if (novlps)
Info(
"CheckOverlaps",
"Number of illegal overlaps/extrusions for volume %s: %d\n",
GetName(), novlps);
703 Error(
"CheckShapes",
"volume %s has run-time shape",
GetName());
713 for (
Int_t i=0; i<nd; i++) {
716 if (!node->
GetName()[0]) printf(
"Daughter %i of volume %s - NO NAME!!!\n",
727 Fatal(
"CheckShapes",
"Cannot make copy node for %s", node->
GetName());
732 Error(
"CheckShapes",
"cannot resolve runtime shape for volume %s/%s\n",
756 static Int_t maxlevel = 0;
757 static Int_t nlev = 0;
759 if (option<0 || option>3) option = 0;
789 if (nlev>maxlevel) maxlevel = nlev;
793 for (
Int_t i=0; i<nd; i++) {
823 for (
Int_t i=0; i<nd; i++) {
830 while ((browser=(
TBrowser*)next())) {
831 for (
Int_t i=0; i<nd+1; i++) {
892 if (!filename)
return 0;
894 if (strstr(filename,
".gdml")) {
900 if (!
f ||
f->IsZombie()) {
901 printf(
"Error: TGeoVolume::Import : Cannot open file %s\n", filename);
907 TIter next(
f->GetListOfKeys());
909 while ((key = (
TKey*)next())) {
910 if (strcmp(key->
GetClassName(),
"TGeoVolume") != 0)
continue;
917 if (!volume)
return NULL;
944 Info(
"Export",
"Exporting volume %s as C++ code",
GetName());
950 Info(
"Export",
"Exporting %s as gdml code - not implemented yet",
GetName());
955 Info(
"Export",
"Exporting %s as root file.",
GetName());
957 if (!opt.
Length()) opt =
"recreate";
959 if (!
f ||
f->IsZombie()) {
960 Error(
"Export",
"Cannot open file");
990 Error(
"AddNode",
"Volume is NULL");
994 Error(
"AddNode",
"Won't add node with invalid shape");
995 printf(
"### invalid volume was : %s\n", vol->
GetName());
1002 Error(
"AddNode",
"Cannot add node %s_%i into divided volume %s", vol->
GetName(), copy_no,
GetName());
1026 Error(
"AddNodeOffset",
"invalid volume");
1030 Error(
"AddNode",
"Won't add node with invalid shape");
1031 printf(
"### invalid volume was : %s\n", vol->
GetName());
1051 Error(
"AddNodeOverlap",
"Volume is NULL");
1055 Error(
"AddNodeOverlap",
"Won't add node with invalid shape");
1056 printf(
"### invalid volume was : %s\n", vol->
GetName());
1060 Warning(
"AddNodeOverlap",
"Declaring assembly %s as possibly overlapping inside %s not allowed. Using AddNode instead !",vol->
GetName(),
GetName());
1061 AddNode(vol, copy_no, mat, option);
1071 Error(
"AddNodeOverlap",
"Cannot add node %s_%i into divided volume %s", vol->
GetName(), copy_no,
GetName());
1080 Warning(
"AddNode",
"Volume %s : added node %s with same name",
GetName(),
name.Data());
1106 Fatal(
"Divide",
"volume %s already divided",
GetName());
1117 if ((start-xlo)<-1
E-3) start+=360.;
1128 if (ndiv<=0 || opt.
Contains(
"s")) {
1130 Fatal(
"Divide",
"invalid division type for volume %s : ndiv=%i, step=%g",
GetName(), ndiv, step);
1134 if ((xlo-start)>1
E-3 || (xhi-start)<-1
E-3) {
1135 Fatal(
"Divide",
"invalid START=%g for division on axis %s of volume %s. Range is (%g, %g)",
1142 ndiv =
Int_t((range+0.1*step)/step);
1145 if (ddx>1
E-3)
Warning(
"Divide",
"division of volume %s on %s axis (ndiv=%d) will be centered in the full range",
1147 start = xlo + 0.5*ddx;
1149 if (step<=0 || opt.
Contains(
"n")) {
1151 if ((xlo-start)>1
E-3 || (xhi-start)<-1
E-3) {
1152 Fatal(
"Divide",
"invalid START=%g for division on axis %s of volume %s. Range is (%g, %g)",
1164 if (((start-xlo)<-1
E-3) || ((end-xhi)>1
E-3)) {
1165 Fatal(
"Divide",
"division of volume %s on axis %s exceed range (%g, %g)",
1173 Fatal(
"Divide",
"invalid medium number %d for division volume %s", numed, divname);
1190 if (!painter)
return dist;
1205 if (option && option[0] > 0) {
1218 Info(
"DrawOnly",
"Volume assemblies do not support this option.");
1225 if (option && option[0] > 0) {
1238 printf(
"Optimizing volume %s ...\n",
GetName());
1261 if (option && option[0] > 0) {
1262 painter->
Paint(option);
1295 for (
Int_t i=0; i<nd; i++) {
1308 for (
Int_t i=0; i<nd; i++) {
1325 TH2F *hist = p->
LegoPlot(ntheta, themin, themax, nphi, phimin, phimax, rmin, rmax, option);
1326 hist->
Draw(
"lego1sph");
1358 for (i=0; i<nd; i++) {
1420 if (!filename)
return;
1422 out.open(filename, std::ios::out);
1424 Error(
"SavePrimitive",
"Bad file name: %s", filename);
1431 if (ind>0) fname.
Remove(ind);
1432 out <<
"void "<<fname<<
"() {" << std::endl;
1433 out <<
" gSystem->Load(\"libGeom\");" << std::endl;
1435 out << std::setprecision(prec);
1436 ((
TGeoVolume*)
this)->SavePrimitive(out,option);
1437 out <<
"}" << std::endl;
1511 out <<
" Double_t dx,dy,dz;" << std::endl;
1512 out <<
" Double_t dx1, dx2, dy1, dy2;" << std::endl;
1513 out <<
" Double_t vert[20], par[20];" << std::endl;
1514 out <<
" Double_t theta, phi, h1, bl1, tl1, alpha1, h2, bl2, tl2, alpha2;" << std::endl;
1515 out <<
" Double_t twist;" << std::endl;
1516 out <<
" Double_t origin[3];" << std::endl;
1517 out <<
" Double_t rmin, rmax, rmin1, rmax1, rmin2, rmax2;" << std::endl;
1518 out <<
" Double_t r, rlo, rhi;" << std::endl;
1519 out <<
" Double_t phi1, phi2;" << std::endl;
1520 out <<
" Double_t a,b;" << std::endl;
1521 out <<
" Double_t point[3], norm[3];" << std::endl;
1522 out <<
" Double_t rin, stin, rout, stout;" << std::endl;
1523 out <<
" Double_t thx, phx, thy, phy, thz, phz;" << std::endl;
1524 out <<
" Double_t alpha, theta1, theta2, phi1, phi2, dphi;" << std::endl;
1525 out <<
" Double_t tr[3], rot[9];" << std::endl;
1526 out <<
" Double_t z, density, radl, absl, w;" << std::endl;
1527 out <<
" Double_t lx,ly,lz,tx,ty,tz;" << std::endl;
1528 out <<
" Double_t xvert[50], yvert[50];" << std::endl;
1529 out <<
" Double_t zsect,x0,y0,scale0;" << std::endl;
1530 out <<
" Int_t nel, numed, nz, nedges, nvert;" << std::endl;
1531 out <<
" TGeoBoolNode *pBoolNode = 0;" << std::endl << std::endl;
1533 out <<
" // MATERIALS, MIXTURES AND TRACKING MEDIA" << std::endl;
1536 out << std::endl <<
" // TRANSFORMATION MATRICES" << std::endl;
1540 out << std::endl <<
" // SET TOP VOLUME OF GEOMETRY" << std::endl;
1541 out <<
" gGeoManager->SetTopVolume(" <<
GetPointerName() <<
");" << std::endl;
1543 out << std::endl <<
" // SHAPES, VOLUMES AND GEOMETRICAL HIERARCHY" << std::endl;
1545 out << std::endl <<
" // CLOSE GEOMETRY" << std::endl;
1546 out <<
" gGeoManager->CloseGeometry();" << std::endl;
1548 if (!
IsRaytracing()) out <<
" gGeoManager->GetTopVolume()->Draw();" << std::endl;
1549 else out <<
" gGeoManager->GetTopVolume()->Raytrace();" << std::endl;
1554 if (!strcmp(option,
"s")) {
1559 out <<
" // Volume: " <<
GetName() << std::endl;
1564 out <<
" // Assembly: " <<
GetName() << std::endl;
1565 out <<
" " <<
GetPointerName() <<
" = new TGeoVolumeAssembly(\"" <<
GetName() <<
"\"" <<
");" << std::endl;
1577 if (!strcmp(option,
"m")) {
1579 for (i=0; i<nd; i++) {
1586 if (!strcmp(option,
"x")) {
1592 for (i=0; i<nd; i++) {
1601 if (!strcmp(option,
"d")) {
1615 out <<
");" << std::endl;
1619 for (i=0; i<nd; i++) {
1630 out <<
");" << std::endl;
1633 for (i=0; i<nd; i++) {
1657 if (!painter)
return;
1675 for (
Int_t i=0; i<ncheck; i++) {
1677 if (current==node)
return check_list[i];
1690 for (
Int_t i=0; i<nd; i++) {
1692 if (current==node)
return i;
1704 if (!painter)
return 0;
1718 for (
id=0;
id<nd;
id++) {
1722 if (ncyl>(nd/2))
return kTRUE;
1733 return (
char*)
name.Data();
1778 for (i=0; i<nbits; i++)
1780 for (i=14; i<24; i++)
1786 for (i=0; i<nbits; i++)
1825 for (
Int_t i=0; i<nd; i++) {
1829 Fatal(
"CloneNodesAndConnect",
"cannot make copy node");
1889 static TMap map(100);
1891 Error(
"MakeReflectedVolume",
"Geometry must be closed.");
1896 if (newname && newname[0]) vol->
SetName(newname);
1902 Fatal(
"MakeReflectedVolume",
"Cannot clone volume %s\n",
GetName());
1906 if (newname && newname[0]) vol->
SetName(newname);
1920 if (!nd)
return vol;
1925 for (
Int_t i=0; i<nd; i++) {
1957 Fatal(
"MakeReflectedVolume",
"Could not copy finder for volume %s",
GetName());
1964 for (
Int_t i=0; i<nd; i++) {
1995 Error(
"SetShape",
"No shape");
2008 Error(
"SortNodes",
"Bounding box not valid");
2021 for (
id=0;
id<nd;
id++) {
2029 for (
id=0;
id<nd;
id++) {
2039 for (
id=0;
id<nd;
id++) {
2047 if (inode != nd) printf(
" volume %s : number of nodes does not match!!!\n",
GetName());
2055void TGeoVolume::Streamer(
TBuffer &R__b)
2123 Int_t count = 28+2+6+4+0;
2125 count += 7*
sizeof(
char*);
2144 Error(
"FindOverlaps",
"Bounding box not valid");
2152 for (inode=0; inode<nd; inode++) {
2179 if (ind < 0)
return NULL;
2182 Error(
"ReplaceNode",
"Cannot replace node %s since it is an assembly", nodeorig->
GetName());
2186 if (newshape && !nodeorig->
IsOffset()) shape = newshape;
2188 if (newmed) med = newmed;
2203 Fatal(
"ReplaceNode",
"Cannot make copy node for %s", nodeorig->
GetName());
2209 if (newpos && !nodeorig->
IsOffset()) {
2230 static Int_t len = 0;
2234 for (i=0; i<len; i++) {
2243 array.AddAtAndExpand(
this, len++);
2257 while ((browser=(
TBrowser*)next())) {
2314 if (vol ==
this)
return kTRUE;
2318 if (!global)
return kFALSE;
2323 for (i=0; i<nd; i++) {
2332 for (i=0; i<nd; i++) {
2356 Error(
"Voxelize",
"Bounding box not valid");
2406 for (i=0; i<nd; i++) {
2408 weight += daughter->
WeightA();
2414 if (density<0.01) density = 0.0;
2416 weight += 0.001*capacity * density;
2464 fVolumes(vm.fVolumes),
2465 fDivision(vm.fDivision),
2516 Fatal(
"AddVolume",
"Cannot divide volume %s", vol->
GetName());
2526 for (
Int_t id=0;
id<nd;
id++) {
2546 for (
Int_t ivo=0; ivo<nvolumes; ivo++) {
2552 volume->
AddNode(vol, copy_no, mat, option);
2566 for (
Int_t ivo=0; ivo<nvolumes; ivo++) {
2593 Error(
"Divide",
"volume %s already divided",
GetName());
2601 Error(
"Divide",
"Invalid medium number %d for division volume %s", numed, divname);
2625 for (
Int_t ivo=0; ivo<nvolumes; ivo++) {
2667 Fatal(
"MakeCopyVolume",
"Cannot divide volume %s", vol->
GetName());
2679 if (!nd)
return vol;
2685 for (i=0; i<nd; i++) {
2689 Fatal(
"MakeCopyNode",
"cannot make copy node for daughter %d of %s", i,
GetName());
2706 for (
Int_t ivo=0; ivo<nvolumes; ivo++) {
2720 for (
Int_t ivo=0; ivo<nvolumes; ivo++) {
2734 for (
Int_t ivo=0; ivo<nvolumes; ivo++) {
2748 for (
Int_t ivo=0; ivo<nvolumes; ivo++) {
2763 for (
Int_t ivo=0; ivo<nvolumes; ivo++) {
2775 fCurrent(-1), fNext(-1)
2798 std::lock_guard<std::mutex> guard(
fMutex);
2800 std::vector<ThreadData_t*>::iterator i =
fThreadData.begin();
2814 std::lock_guard<std::mutex> guard(
fMutex);
2818 for (
Int_t tid=0; tid<nthreads; tid++) {
2903 Warning(
"AddNodeOverlap",
"Declaring assembly %s as possibly overlapping inside %s not allowed. Using AddNode instead !",vol->
GetName(),
GetName());
2904 AddNode(vol, copy_no, mat, option);
2917 for (i=0; i<nbits; i++)
2919 for (i=14; i<24; i++)
2925 for (i=0; i<nbits; i++)
2950 Error(
"Divide",
"Assemblies cannot be divided");
2962 Error(
"Divide",
"Cannot divide assembly %s since it has nodes",
GetName());
2966 Error(
"Divide",
"Assembly %s already divided",
GetName());
2970 if (!ncells || pattern->
GetStep()<=0) {
2971 Error(
"Divide",
"Pattern finder for dividing assembly %s not initialized. Use SetRange() method.",
GetName());
2980 for (
Int_t i=0; i<ncells; i++) {
3001 for (i=0; i<nbits; i++)
3003 for (i=14; i<24; i++)
3009 for (i=0; i<nbits; i++)
R__EXTERN TGeoManager * gGeoManager
R__EXTERN TGeoIdentity * gGeoIdentity
Binding & operator=(OUT(*fun)(void))
R__EXTERN TStyle * gStyle
Use this attribute class when an object should have 3D capabilities.
Fill Area Attributes class.
virtual Color_t GetFillColor() const
Return the fill area color.
virtual Style_t GetFillStyle() const
Return the fill area style.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual Width_t GetLineWidth() const
Return the line width.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Width_t fLineWidth
Line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual Style_t GetLineStyle() const
Return the line style.
Style_t fLineStyle
Line style.
Color_t fLineColor
Line color.
Using a TBrowser one can browse all ROOT objects.
void CheckObjectItem(TObject *obj, Bool_t check=kFALSE)
Change status of checkbox for this item.
void Refresh()
Refresh browser contents.
Buffer base class used for serializing objects.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseGeneralPurpose, Int_t netopt=0)
Create / open a file.
Visualization and tracking attributes for volumes and nodes.
Bool_t IsVisRaytrace() const
virtual void SetVisOnly(Bool_t flag=kTRUE)
Set branch type visibility.
Bool_t TestAttBit(UInt_t f) const
virtual void SetVisLeaves(Bool_t flag=kTRUE)
Set branch type visibility.
void SetVisDaughters(Bool_t vis=kTRUE)
Set visibility for the daughters.
void ResetAttBit(UInt_t f)
void SetVisRaytrace(Bool_t flag=kTRUE)
Bool_t IsVisDaughters() const
virtual void SetVisibility(Bool_t vis=kTRUE)
Set visibility for this object.
void SetVisTouched(Bool_t vis=kTRUE)
Mark visualization attributes as "modified".
virtual void SetVisContainers(Bool_t flag=kTRUE)
Set branch type visibility.
Class describing rotation + translation.
Class handling Boolean composition of shapes.
void RegisterYourself()
Register the shape and all components to TGeoManager class.
ABC for user objects attached to TGeoVolume or TGeoNode.
virtual TGeoExtension * Grab()=0
virtual void Release() const =0
Matrix class used for computing global transformations Should NOT be used for node definition.
void MultiplyLeft(const TGeoMatrix *left)
multiply to the left with an other transformation if right is identity matrix, just return
The manager class for any TGeo geometry.
TObjArray * GetListOfOverlaps()
TList * GetListOfMedia() const
void SetUserPaintVolume(TGeoVolume *vol)
TObjArray * GetListOfVolumes() const
void ClearOverlaps()
Clear the list of overlaps.
TObjArray * GetListOfMatrices() const
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.
TVirtualGeoPainter * GetGeomPainter()
Make a default painter if none present. Returns pointer to it.
void SetVisOption(Int_t option=0)
set drawing mode :
Int_t AddMaterial(const TGeoMaterial *material)
Add a material to the list. Returns index of the material in list.
TGeoHMatrix * GetHMatrix()
Return stored current matrix (global matrix of the next touched node).
Int_t AddVolume(TGeoVolume *volume)
Add a volume to the list. Returns index of the volume in list.
Bool_t IsStreamingVoxels() const
void SetCurrentPoint(Double_t *point)
Int_t GetVisOption() const
Returns current depth to which geometry is drawn.
static UInt_t GetExportPrecision()
void SetTopVolume(TGeoVolume *vol)
Set the top volume and corresponding node as starting point of the geometry.
void ClearShape(const TGeoShape *shape)
Remove a shape from the list of shapes.
TGeoMedium * GetMedium(const char *medium) const
Search for a named tracking medium. All trailing blanks stripped.
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.
void SetNsegments(Int_t nseg)
Set number of segments for approximating circles in drawing.
TVirtualGeoPainter * GetPainter() const
Bool_t IsCheckingOverlaps() const
void RandomPoints(const TGeoVolume *vol, Int_t npoints=10000, Option_t *option="")
Draw random points in the bounding box of a volume.
TList * GetListOfMaterials() const
void SetAllIndex()
Assigns uid's for all materials,media and matrices.
TObjArray * GetListOfShapes() const
TGeoVolume * GetTopVolume() const
static Int_t ThreadId()
Translates the current thread id to an ordinal number.
Int_t AddShape(const TGeoShape *shape)
Add a shape to the list. Returns index of the shape in list.
void SortOverlaps()
Sort overlaps by decreasing overlap distance. Extrusions comes first.
Base class describing materials.
virtual void Print(const Option_t *option="") const
print characteristics of this material
void SetUsed(Bool_t flag=kTRUE)
virtual Double_t GetDensity() const
Geometrical transformation package.
virtual void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to XY.
Bool_t IsReflection() const
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
void Print(Option_t *option="") const
print the matrix in 4x4 format
Bool_t IsIdentity() const
Bool_t IsRegistered() const
char * GetPointerName() const
Provide a pointer name containing uid.
Media are used to store properties related to tracking and which are useful only when using geometry ...
TGeoMaterial * GetMaterial() const
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
void SetMaterial(TGeoMaterial *mat)
char * GetPointerName() const
Provide a pointer name containing uid.
A node containing local transformation.
void SetMatrix(const TGeoMatrix *matrix)
Matrix setter.
virtual TGeoMatrix * GetMatrix() const
Node containing an offset.
void SetFinder(TGeoPatternFinder *finder)
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
Bool_t IsOverlapping() const
TGeoVolume * GetVolume() const
void SetVolume(TGeoVolume *volume)
virtual Int_t GetByteCount() const
void SetOverlapping(Bool_t flag=kTRUE)
virtual Int_t GetOptimalVoxels() const
virtual TGeoMatrix * GetMatrix() const =0
void SetMotherVolume(TGeoVolume *mother)
virtual TGeoNode * MakeCopyNode() const
void SetNumber(Int_t number)
Base finder class for patterns.
void SetSpacedOut(Bool_t flag)
void SetDivIndex(Int_t index)
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)=0
virtual Int_t GetDivAxis()
void SetVolume(TGeoVolume *vol)
void ClearThreadData() const
Double_t GetStart() const
virtual Int_t GetByteCount() const
void CreateThreadData(Int_t nthreads)
Create thread data for n threads max.
Class describing scale transformations.
static TGeoShape * MakeScaledShape(const char *name, TGeoShape *shape, TGeoScale *scale)
Create a scaled shape starting from a non-scaled one.
The shape encapsulating an assembly (union) of volumes.
Base abstract class for all shapes.
virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const =0
virtual void CreateThreadData(Int_t)
virtual const char * GetAxisName(Int_t iaxis) const =0
virtual TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step)=0
virtual Bool_t IsComposite() const
static Bool_t IsSameWithinTolerance(Double_t a, Double_t b)
Check if two numbers differ with less than a tolerance.
Bool_t IsRunTimeShape() const
virtual void ClearThreadData() const
const char * GetPointerName() const
Provide a pointer name containing uid.
void CheckShape(Int_t testNo, Int_t nsamples=10000, Option_t *option="")
Test for shape navigation methods.
virtual Bool_t IsValidBox() const =0
virtual Int_t GetByteCount() const =0
virtual void ComputeBBox()=0
virtual Double_t Capacity() const =0
virtual TGeoShape * GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const =0
virtual Bool_t IsAssembly() const
Bool_t TestShapeBit(UInt_t f) const
static TGeoVolumeAssembly * MakeAssemblyFromVolume(TGeoVolume *vol)
Make a clone of volume VOL but which is an assembly.
virtual Int_t GetCurrentNodeIndex() const
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.
virtual void ClearThreadData() const
virtual Int_t GetNextNodeIndex() const
virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option)
Add an overlapping node - not allowed for assemblies.
std::vector< ThreadData_t * > fThreadData
virtual ~TGeoVolumeAssembly()
Destructor. The assembly is owner of its "shape".
std::mutex fMutex
Thread vector size.
virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
Add a component to the assembly.
Int_t fThreadSize
Thread specific data vector.
void SetNextNodeIndex(Int_t index)
virtual TGeoVolume * CloneVolume() const
Clone this volume.
void SetCurrentNodeIndex(Int_t index)
TGeoVolumeAssembly()
Mutex for concurrent operations.
virtual void CreateThreadData(Int_t nthreads)
ThreadData_t & GetThreadData() const
virtual void SetVisibility(Bool_t vis=kTRUE)
Set visibility for all components.
virtual TGeoVolume * MakeCopyVolume(TGeoShape *newshape)
Make a copy of this volume build a volume with same name, shape and medium.
void AddVolume(TGeoVolume *vol)
Add a volume with valid shape to the list of volumes.
virtual void SetLineStyle(Style_t lstyle)
Set the line style for all components.
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...
TGeoVolume * GetVolume(Int_t id) const
virtual ~TGeoVolumeMulti()
Destructor.
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 void SetLineColor(Color_t lcolor)
Set the line color for all components.
TGeoVolumeMulti * fDivision
TGeoVolumeMulti & operator=(const TGeoVolumeMulti &)
assignment operator
TGeoVolumeMulti()
dummy constructor
virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option="")
Add a new node to the list of nodes.
TGeoShape * GetLastShape() const
Returns the last shape.
Int_t GetNvolumes() const
virtual void SetMedium(TGeoMedium *medium)
Set medium for a multiple volume.
virtual void SetLineWidth(Width_t lwidth)
Set the line width for all components.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Double_t WeightA() const
Analytical computation of the weight.
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 void cd(Int_t inode) const
Actualize matrix of node indexed <inode>
virtual void ClearThreadData() const
virtual ~TGeoVolume()
Destructor.
virtual void Print(Option_t *option="") const
Print volume info.
Bool_t IsVisContainers() const
void SetVoxelFinder(TGeoVoxelFinder *finder)
void RemoveNode(TGeoNode *node)
Remove an existing daughter.
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.
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 Valid() const
Check if the shape of this volume is valid.
Bool_t IsAllInvisible() const
Return TRUE if volume and all daughters are invisible.
void MakeCopyNodes(const TGeoVolume *other)
make a new list of nodes and copy all nodes of other volume inside
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,...
void SetUserExtension(TGeoExtension *ext)
Connect user-defined extension to the volume.
TGeoExtension * GrabFWExtension() const
Get a copy of the framework extension pointer.
void SetNumber(Int_t number)
void Raytrace(Bool_t flag=kTRUE)
Draw this volume with current settings and perform raytracing in the pad.
TGeoVolume()
dummy constructor
TGeoMedium * GetMedium() const
virtual Bool_t IsFolder() const
Return TRUE if volume contains nodes.
void CloneNodesAndConnect(TGeoVolume *newmother) const
Clone the array of nodes.
void SortNodes()
sort nodes by decreasing volume of the bounding box.
Bool_t FindMatrixOfDaughterVolume(TGeoVolume *vol) const
Find a daughter node having VOL as volume and fill TGeoManager::fHMatrix with its global matrix.
void Voxelize(Option_t *option)
build the voxels for this volume
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 Capacity() const
Computes the capacity of this [cm^3] as the capacity of its shape.
virtual TGeoVolume * MakeCopyVolume(TGeoShape *newshape)
make a copy of this volume build a volume with same name, shape and medium
void ReplayCreation(const TGeoVolume *other)
Recreate the content of the other volume without pointer copying.
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.
Int_t fNumber
option - if any
virtual void CreateThreadData(Int_t nthreads)
virtual Int_t GetByteCount() const
get the total size in bytes for this volume
Bool_t OptimizeVoxels()
Perform an extensive sampling to find which type of voxelization is most efficient.
void SetCurrentPoint(Double_t x, Double_t y, Double_t z)
Set the current tracking point.
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute mouse actions on this volume.
virtual void SetVisLeaves(Bool_t flag=kTRUE)
Set visibility for leaves.
void Browse(TBrowser *b)
How to browse a volume.
TGeoManager * fGeoManager
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.
TGeoVoxelFinder * fVoxels
TGeoMaterial * GetMaterial() const
virtual Bool_t IsVolumeMulti() const
TGeoExtension * GrabUserExtension() const
Get a copy of the user extension pointer.
Int_t CountNodes(Int_t nlevels=1000, Int_t option=0)
Count total number of subnodes starting from this volume, nlevels down.
void GrabFocus()
Move perspective view focus to this volume.
void UnmarkSaved()
Reset SavePrimitive bits.
virtual TGeoVolume * CloneVolume() const
Clone this volume.
void SetFinder(TGeoPatternFinder *finder)
Int_t GetNdaughters() const
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
char * GetPointerName() const
Provide a pointer name containing uid.
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...
void SelectVolume(Bool_t clear=kFALSE)
Select this volume as matching an arbitrary criteria.
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Get volume info for the browser.
Option_t * GetOption() const
void ClearShape()
Clear the shape of this volume from the list held by the current manager.
void SetFWExtension(TGeoExtension *ext)
Connect framework defined extension to the volume.
void VisibleDaughters(Bool_t vis=kTRUE)
set visibility for daughters
void FindOverlaps() const
loop all nodes marked as overlaps and find overlapping brothers
TGeoNode * GetNode(const char *name) const
get the pointer to a daughter node
virtual void SetVisibility(Bool_t vis=kTRUE)
set visibility of this volume
void RandomPoints(Int_t npoints=1000000, Option_t *option="")
Draw random points in the bounding box of this volume.
void CheckShapes()
check for negative parameters in shapes.
void SetNtotal(Int_t ntotal)
virtual void Paint(Option_t *option="")
paint volume
Bool_t GetOptimalVoxels() const
Returns true if cylindrical voxelization is optimal.
void InvisibleAll(Bool_t flag=kTRUE)
Make volume and each of it daughters (in)visible.
Bool_t IsVisibleDaughters() const
TString fOption
just a hook for now
void SaveAs(const char *filename, Option_t *option="") const
Save geometry having this as top volume as a C++ macro.
Int_t GetIndex(const TGeoNode *node) const
get index number for a given daughter
void SetNodes(TObjArray *nodes)
TGeoPatternFinder * GetFinder() const
void PrintVoxels() const
Print the voxels for this volume.
TGeoExtension * fUserExtension
virtual void SetMedium(TGeoMedium *medium)
TGeoVoxelFinder * GetVoxels() const
Getter for optimization structure.
void SetAttVisibility(Bool_t vis)
TGeoVolume & operator=(const TGeoVolume &)
assignment operator
void SetShape(const TGeoShape *shape)
set the shape associated with this volume
static TGeoMedium * DummyMedium()
TObject * fField
pointer to TGeoManager owning this volume
void CleanAll()
Clean data of the volume.
Bool_t IsTopVolume() const
True if this is the top volume of the geometry.
TGeoShape * GetShape() const
void InspectMaterial() const
Inspect the material for this volume.
void PrintNodes() const
print nodes
static TGeoMedium * fgDummyMedium
void RegisterYourself(Option_t *option="")
Register the volume and all materials/media/matrices/shapes to the manager.
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 SetVisOnly(Bool_t flag=kTRUE)
Set visibility for leaves.
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.
Bool_t IsRaytracing() const
Check if the painter is currently ray-tracing the content of this volume.
void SetField(TObject *field)
static TGeoVolume * Import(const char *filename, const char *name="", Option_t *option="")
Import a volume from a file.
Bool_t IsStyleDefault() const
check if the visibility and attributes are the default ones
static void CreateDummyMedium()
Create a dummy medium.
TGeoExtension * fFWExtension
Transient user-defined extension to volumes.
void SetAsTopVolume()
Set this volume as the TOP one (the whole geometry starts from here)
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Bool_t IsVisLeaves() const
virtual void SetVisContainers(Bool_t flag=kTRUE)
Set visibility for containers.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
TObject * GetField() const
TGeoPatternFinder * fFinder
dummy medium
Int_t Export(const char *filename, const char *name="", Option_t *option="")
Export this volume to a file.
virtual void DrawOnly(Option_t *option="")
draw only this volume
virtual void SetLineColor(Color_t lcolor)
Set the line color.
void SetOption(const char *option)
Set the current options (none implemented)
virtual Bool_t IsAssembly() const
Returns true if the volume is an assembly or a scaled assembly.
TGeoVolume * MakeReflectedVolume(const char *newname="") const
Make a copy of this volume which is reflected with respect to XY plane.
virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
Add a TGeoNode to the list of nodes.
virtual Bool_t IsVisible() const
void InspectShape() const
TGeoNode * FindNode(const char *name) const
search a daughter inside the list of nodes
void CheckOverlaps(Double_t ovlp=0.1, Option_t *option="") const
Overlap checking tool.
void SetOverlappingCandidate(Bool_t flag)
Bool_t IsOverlappingCandidate() const
void CheckShape(Int_t testNo, Int_t nsamples=10000, Option_t *option="")
Tests for checking the shape navigation algorithms. See TGeoShape::CheckShape()
Finder class handling voxels.
void SetNeedRebuild(Bool_t flag=kTRUE)
virtual void Voxelize(Option_t *option="")
Voxelize attached volume according to option If the volume is an assembly, make sure the bbox is comp...
virtual void FindOverlaps(Int_t inode) const
create the list of nodes for which the bboxes overlap with inode's bbox
virtual void Print(Option_t *option="") const
Print the voxels.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
2-D histogram with a float per channel (see TH1 documentation)}
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual const char * GetClassName() const
virtual TObject * ReadObj()
To read a TObject* from the file.
virtual void Add(TObject *obj)
virtual TObject * FindObject(const char *name) const
Delete a TObjLink object.
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
void Add(TObject *obj)
This function may not be used (but we need to provide it since it is a pure virtual in TCollection).
TObject * GetValue(const char *keyname) const
Returns a pointer to the value associated with keyname as name of the key.
The TNamed class is the base class for all named ROOT classes.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual const char * GetTitle() const
Returns title of object.
TNamed & operator=(const TNamed &rhs)
TNamed assignment operator.
virtual const char * GetName() const
Returns name of object.
Int_t GetEntriesFast() const
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
virtual void Compress()
Remove empty slots from array.
Int_t GetEntries() const
Return the number of objects in array (i.e.
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
virtual TObject * Remove(TObject *obj)
Remove object from array.
virtual void AddAt(TObject *obj, Int_t idx)
Add object at position ids.
virtual TObject * RemoveAt(Int_t idx)
Remove object at index idx.
TObject * At(Int_t idx) const
Mother of all ROOT objects.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Sequenceable collection abstract base class.
void ToLower()
Change string to lower-case.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
const char * Data() const
TString & Remove(Ssiz_t pos)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Abstract class for geometry painters.
virtual void SetTopVolume(TGeoVolume *vol)=0
virtual void ModifiedPad(Bool_t update=kFALSE) const =0
virtual TGeoVolume * GetTopVolume() const =0
virtual void DrawVolume(TGeoVolume *vol, Option_t *option="")=0
virtual void GrabFocus(Int_t nfr=0, Double_t dlong=0, Double_t dlat=0, Double_t dpsi=0)=0
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 CheckOverlaps(const TGeoVolume *vol, Double_t ovlp=0.1, Option_t *option="") const =0
virtual void Paint(Option_t *option="")=0
This method must be overridden if a class wants to paint itself.
virtual Int_t DistanceToPrimitiveVol(TGeoVolume *vol, Int_t px, Int_t py)=0
virtual Bool_t TestVoxels(TGeoVolume *vol)=0
virtual TGeoVolume * GetDrawnVolume() const =0
virtual const char * GetVolumeInfo(const TGeoVolume *volume, Int_t px, Int_t py) const =0
virtual void ExecuteVolumeEvent(TGeoVolume *volume, Int_t event, Int_t px, Int_t py)=0
virtual void CheckGeometry(Int_t nrays, Double_t startx, Double_t starty, Double_t startz) const =0
double dist(Rotation3D const &r1, Rotation3D const &r2)
constexpr Double_t E()
Base of natural log:
ThreadData_t()
index of next node to be entered
~ThreadData_t()
Destructor.