422 dummyMaterial->
SetName(
"dummy");
485 Warning(
"Ctor",
"volume %s has invalid shape",
name);
488 Fatal(
"ctor",
"Shape of volume %s invalid. Aborting!",
fName.
Data());
550 title.TString::Format(
"Assembly with %d daughter(s)", daughter->
GetNdaughters());
553 s1.ReplaceAll(
"TGeoPattern",
"");
554 title.TString::Format(
"Volume having %s shape divided in %d %s slices", daughter->
GetShape()->
ClassName(),
558 title.TString::Format(
"Volume with %s shape having %d daughter(s)", daughter->
GetShape()->
ClassName(),
581 for (i = 0; i < nd; i++)
611 Info(
"CheckOverlaps",
"Option 's' deprecated. Use CheckOverlapsBySampling() instead.");
619 geom->SetCheckingOverlaps(
kTRUE);
621 Info(
"CheckOverlaps",
"Checking overlaps for %s and daughters within %g",
GetName(), ovlp);
623 auto checker = geom->GetGeomChecker();
626 std::vector<TGeoOverlapCandidate> candidates;
627 candidates.reserve(2048);
629 Int_t ncand = checker->EnumerateOverlapCandidates(
this, ovlp,
option, candidates);
632 while ((node = next())) {
635 ncand += checker->EnumerateOverlapCandidates(node->
GetVolume(), ovlp,
option, candidates);
639 Info(
"CheckOverlaps",
"--- found %d candidates in %g [sec]", ncand, timer.
RealTime());
641 Info(
"CheckOverlaps",
"--- filling points to be checked...");
643 checker->BuildMeshPointsCache(candidates);
645 Info(
"CheckOverlaps",
"--- points filled in: %g [sec]", timer.
RealTime());
649 std::vector<TGeoOverlapResult> results;
650 results.reserve(256);
654 const size_t chunkSize = 1024;
655 auto makeChunks = [&](
size_t n) {
656 std::vector<std::pair<size_t, size_t>> chunks;
657 chunks.reserve((
n + chunkSize - 1) / chunkSize);
658 for (
size_t b = 0;
b <
n;
b += chunkSize)
659 chunks.emplace_back(
b, std::min(
n,
b + chunkSize));
663 auto chunks = makeChunks(candidates.size());
664 std::mutex resultsMutex;
671 Info(
"CheckOverlaps",
"--- checking candidates with %u threads (use ROOT::EnableImplicitMT(N) to change)...",
674 Info(
"CheckOverlaps",
"--- checking candidates with %u threads...", nthreads);
678 geom->SetMaxThreads(nthreads);
682 [&](
const std::pair<size_t, size_t> &range) {
684 if (!geom->GetCurrentNavigator())
685 geom->AddNavigator();
687 std::vector<TGeoOverlapResult> local;
690 for (
size_t i = range.first; i < range.second; ++i) {
692 if (checker->ComputeOverlap(candidates[i],
r))
693 local.emplace_back(std::move(
r));
696 if (!local.empty()) {
697 std::lock_guard<std::mutex> lock(resultsMutex);
698 results.insert(results.end(), std::make_move_iterator(local.begin()), std::make_move_iterator(local.end()));
704 Info(
"CheckOverlaps",
"--- checking candidates with on a single thread (IMT not configured)...");
706 for (
size_t i = 0; i < candidates.size(); ++i) {
708 if (checker->ComputeOverlap(candidates[i],
r))
709 results.emplace_back(std::move(
r));
714 for (
const auto &
r : results)
715 checker->MaterializeOverlap(
r);
717 geom->SetCheckingOverlaps(
kFALSE);
718 geom->SortOverlaps();
721 TObjArray *overlaps = geom->GetListOfOverlaps();
723 for (
Int_t i = 0; i < novlps; i++)
727 Info(
"CheckOverlaps",
"Number of illegal overlaps/extrusions : %d found in %g [sec]", novlps, timer.
RealTime());
740 Info(
"CheckOverlaps",
"[LEGACY] Checking overlaps by sampling %d points for volume %s", npoints,
GetName());
741 Info(
"CheckOverlaps",
"=== NOTE: Many overlaps may be missed. Extrusions NOT checked with sampling option ! ===");
744 checker->CheckOverlapsBySampling(
this, ovlp, npoints);
752 for (
Int_t i = 0; i < novlps; i++) {
760 Info(
"CheckOverlaps",
"Number of illegal overlaps/extrusions sampled for volume %s: %d\n",
GetName(), novlps);
795 Error(
"CheckShapes",
"volume %s has run-time shape",
GetName());
806 for (
Int_t i = 0; i < nd; i++) {
810 printf(
"Daughter %i of volume %s - NO NAME!!!\n", i,
GetName());
820 Fatal(
"CheckShapes",
"Cannot make copy node for %s", node->
GetName());
825 Error(
"CheckShapes",
"cannot resolve runtime shape for volume %s/%s\n",
GetName(), old_vol->
GetName());
848 static Int_t maxlevel = 0;
849 static Int_t nlev = 0;
851 if (option < 0 || option > 3)
872 case 3:
return maxlevel;
885 for (
Int_t i = 0; i < nd; i++) {
902 for (
Int_t i = 0; i < nd; i++)
918 for (
Int_t i = 0; i < nd; i++) {
925 while ((browser = (
TBrowser *)next())) {
926 for (
Int_t i = 0; i < nd + 1; i++) {
1002 if (!
f ||
f->IsZombie()) {
1003 printf(
"Error: TGeoVolume::Import : Cannot open file %s\n",
filename);
1009 TIter next(
f->GetListOfKeys());
1011 while ((key = (
TKey *)next())) {
1048 Info(
"Export",
"Exporting volume %s as C++ code",
GetName());
1054 Info(
"Export",
"Exporting %s as gdml code - not implemented yet",
GetName());
1059 Info(
"Export",
"Exporting %s as root file.",
GetName());
1064 if (!
f ||
f->IsZombie()) {
1065 Error(
"Export",
"Cannot open file");
1094 if (matrix ==
nullptr)
1099 Error(
"AddNode",
"Volume is NULL");
1103 Error(
"AddNode",
"Won't add node with invalid shape");
1104 printf(
"### invalid volume was : %s\n", vol->
GetName());
1112 Error(
"AddNode",
"Cannot add node %s_%i into divided volume %s", vol->
GetName(), copy_no,
GetName());
1137 Error(
"AddNodeOffset",
"invalid volume");
1141 Error(
"AddNode",
"Won't add node with invalid shape");
1142 printf(
"### invalid volume was : %s\n", vol->
GetName());
1163 Error(
"AddNodeOverlap",
"Volume is NULL");
1167 Error(
"AddNodeOverlap",
"Won't add node with invalid shape");
1168 printf(
"### invalid volume was : %s\n", vol->
GetName());
1173 "Declaring assembly %s as possibly overlapping inside %s not allowed. Using AddNode instead !",
1179 if (matrix ==
nullptr)
1188 Error(
"AddNodeOverlap",
"Cannot add node %s_%i into divided volume %s", vol->
GetName(), copy_no,
GetName());
1197 Warning(
"AddNode",
"Volume %s : added node %s with same name",
GetName(),
name.Data());
1224 Fatal(
"Divide",
"volume %s already divided",
GetName());
1236 if ((start - xlo) < -1E-3)
1240 xhi = start + range;
1248 if (ndiv <= 0 || opt.
Contains(
"s")) {
1250 Fatal(
"Divide",
"invalid division type for volume %s : ndiv=%i, step=%g",
GetName(), ndiv, step);
1254 if ((xlo - start) > 1E-3 || (xhi - start) < -1E-3) {
1255 Fatal(
"Divide",
"invalid START=%g for division on axis %s of volume %s. Range is (%g, %g)", start,
1262 ndiv =
Int_t((range + 0.1 * step) / step);
1263 Double_t ddx = range - ndiv * step;
1266 Warning(
"Divide",
"division of volume %s on %s axis (ndiv=%d) will be centered in the full range",
GetName(),
1268 start = xlo + 0.5 * ddx;
1270 if (step <= 0 || opt.
Contains(
"n")) {
1272 if ((xlo - start) > 1E-3 || (xhi - start) < -1E-3) {
1273 Fatal(
"Divide",
"invalid START=%g for division on axis %s of volume %s. Range is (%g, %g)", start,
1280 step = range / ndiv;
1284 Double_t end = start + ndiv * step;
1285 if (((start - xlo) < -1E-3) || ((end - xhi) > 1E-3)) {
1294 Fatal(
"Divide",
"invalid medium number %d for division volume %s", numed, divname);
1344 Info(
"DrawOnly",
"Volume assemblies do not support this option.");
1365 printf(
"Optimizing volume %s ...\n",
GetName());
1424 for (
Int_t i = 0; i < nd; i++) {
1439 for (
Int_t i = 0; i < nd; i++) {
1453 if (old_vol !=
this)
1457 TH2F *hist = checker->LegoPlot(ntheta, themin, themax, nphi, phimin, phimax, rmin, rmax,
option);
1458 hist->
Draw(
"lego1sph");
1491 for (i = 0; i < nd; i++) {
1501 for (i = 0; i < nd; i++)
1513 if (old_vol !=
this)
1531 if (old_vol !=
this)
1578 out <<
"void " << fname <<
"() {" << std::endl;
1579 out <<
" gSystem->Load(\"libGeom\");" << std::endl;
1581 out << std::setprecision(prec);
1583 out <<
"}" << std::endl;
1668 out <<
" Double_t dx, dy, dz;" << std::endl;
1669 out <<
" Double_t dx1, dx2, dy1, dy2;" << std::endl;
1670 out <<
" Double_t vert[20], par[20];" << std::endl;
1671 out <<
" Double_t theta, phi, h1, bl1, tl1, alpha1, h2, bl2, tl2, alpha2;" << std::endl;
1672 out <<
" Double_t twist;" << std::endl;
1673 out <<
" Double_t origin[3];" << std::endl;
1674 out <<
" Double_t rmin, rmax, rmin1, rmax1, rmin2, rmax2;" << std::endl;
1675 out <<
" Double_t r, rlo, rhi;" << std::endl;
1676 out <<
" Double_t a, b;" << std::endl;
1677 out <<
" Double_t point[3], norm[3];" << std::endl;
1678 out <<
" Double_t rin, stin, rout, stout;" << std::endl;
1679 out <<
" Double_t thx, phx, thy, phy, thz, phz;" << std::endl;
1680 out <<
" Double_t alpha, theta1, theta2, phi1, phi2, dphi;" << std::endl;
1681 out <<
" Double_t tr[3], rot[9];" << std::endl;
1682 out <<
" Double_t z, density, radl, absl, w;" << std::endl;
1683 out <<
" Double_t lx, ly, lz, tx, ty, tz;" << std::endl;
1684 out <<
" Double_t xvert[50], yvert[50];" << std::endl;
1685 out <<
" Double_t zsect, x0, y0, scale0;" << std::endl;
1686 out <<
" Int_t nel, numed, nz, nedges, nvert;" << std::endl;
1687 out <<
" TGeoBoolNode *pBoolNode = nullptr;" << std::endl << std::endl;
1689 out <<
" // MATERIALS, MIXTURES AND TRACKING MEDIA" << std::endl;
1692 out << std::endl <<
" // TRANSFORMATION MATRICES" << std::endl;
1696 out << std::endl <<
" // SET TOP VOLUME OF GEOMETRY" << std::endl;
1697 out <<
" gGeoManager->SetTopVolume(" <<
GetPointerName() <<
");" << std::endl;
1699 out << std::endl <<
" // SHAPES, VOLUMES AND GEOMETRICAL HIERARCHY" << std::endl;
1701 out << std::endl <<
" // CLOSE GEOMETRY" << std::endl;
1702 out <<
" gGeoManager->CloseGeometry();" << std::endl;
1705 out <<
" gGeoManager->GetTopVolume()->Draw();" << std::endl;
1707 out <<
" gGeoManager->GetTopVolume()->Raytrace();" << std::endl;
1712 if (!strcmp(
option,
"s")) {
1718 out <<
" // Volume: " <<
GetName() << std::endl;
1723 out <<
");" << std::endl;
1725 out <<
" // Assembly: " <<
GetName() << std::endl;
1727 <<
");" << std::endl;
1731 out <<
" " <<
GetPointerName() <<
"->SetVisibility(kFALSE);" << std::endl;
1733 out <<
" " <<
GetPointerName() <<
"->VisibleDaughters(kFALSE);" << std::endl;
1735 out <<
" " <<
GetPointerName() <<
"->SetVisContainers(kTRUE);" << std::endl;
1737 out <<
" " <<
GetPointerName() <<
"->SetVisLeaves(kTRUE);" << std::endl;
1741 if (!strcmp(
option,
"m")) {
1744 for (i = 0; i < nd; i++) {
1751 if (!strcmp(
option,
"x")) {
1757 for (i = 0; i < nd; i++) {
1767 if (!strcmp(
option,
"d")) {
1782 out <<
");" << std::endl;
1786 for (i = 0; i < nd; i++) {
1799 out <<
");" << std::endl;
1802 for (i = 0; i < nd; i++) {
1846 for (
Int_t i = 0; i < ncheck; i++) {
1848 if (current == node)
1849 return check_list[i];
1863 for (
Int_t i = 0; i < nd; i++) {
1865 if (current == node)
1894 for (
id = 0;
id < nd;
id++) {
1898 if (ncyl > (nd / 2))
1958 for (i = 0; i < nbits; i++)
1960 for (i = 14; i < 24; i++)
1966 for (i = 0; i < nbits; i++)
2007 for (
Int_t i = 0; i < nd; i++) {
2011 Fatal(
"CloneNodesAndConnect",
"cannot make copy node");
2033 for (
Int_t i = 0; i < nd; i++)
2074 static TMap map(100);
2076 Error(
"MakeReflectedVolume",
"Geometry must be closed.");
2081 if (newname && newname[0])
2088 Fatal(
"MakeReflectedVolume",
"Cannot clone volume %s\n",
GetName());
2092 if (newname && newname[0])
2113 for (
Int_t i = 0; i < nd; i++) {
2146 Fatal(
"MakeReflectedVolume",
"Could not copy finder for volume %s",
GetName());
2153 for (
Int_t i = 0; i < nd; i++) {
2184 Error(
"SetShape",
"No shape");
2197 Error(
"SortNodes",
"Bounding box not valid");
2212 for (
id = 0;
id < nd;
id++) {
2221 for (
id = 0;
id < nd;
id++) {
2232 for (
id = 0;
id < nd;
id++) {
2242 printf(
" volume %s : number of nodes does not match!!!\n",
GetName());
2320 Int_t count = 28 + 2 + 6 + 4 + 0;
2322 count += 7 *
sizeof(
char *);
2332 while ((node = (
TGeoNode *)next()))
2344 Error(
"FindOverlaps",
"Bounding box not valid");
2354 for (inode = 0; inode < nd; inode++) {
2390 Error(
"ReplaceNode",
"Cannot replace node %s since it is an assembly", nodeorig->
GetName());
2394 if (newshape && !nodeorig->
IsOffset())
2413 Fatal(
"ReplaceNode",
"Cannot make copy node for %s", nodeorig->
GetName());
2419 if (newpos && !nodeorig->
IsOffset()) {
2446 for (i = 0; i <
len; i++) {
2470 while ((browser = (
TBrowser *)next())) {
2546 for (i = 0; i < nd; i++) {
2555 for (i = 0; i < nd; i++) {
2581 Error(
"Voxelize",
"Bounding box not valid");
2638 for (i = 0; i < nd; i++) {
2640 weight += daughter->
WeightA();
2650 weight += 0.001 *
capacity * density;
2713 Fatal(
"AddVolume",
"Cannot divide volume %s", vol->
GetName());
2723 for (
Int_t id = 0;
id < nd;
id++) {
2744 for (
Int_t ivo = 0; ivo < nvolumes; ivo++) {
2765 for (
Int_t ivo = 0; ivo < nvolumes; ivo++) {
2794 Error(
"Divide",
"volume %s already divided",
GetName());
2802 Error(
"Divide",
"Invalid medium number %d for division volume %s", numed, divname);
2827 for (
Int_t ivo = 0; ivo < nvolumes; ivo++) {
2871 Fatal(
"MakeCopyVolume",
"Cannot divide volume %s", vol->
GetName());
2891 for (i = 0; i < nd; i++) {
2895 Fatal(
"MakeCopyNode",
"cannot make copy node for daughter %d of %s", i,
GetName());
2912 for (
Int_t ivo = 0; ivo < nvolumes; ivo++) {
2926 for (
Int_t ivo = 0; ivo < nvolumes; ivo++) {
2940 for (
Int_t ivo = 0; ivo < nvolumes; ivo++) {
2954 for (
Int_t ivo = 0; ivo < nvolumes; ivo++) {
2968 for (
Int_t ivo = 0; ivo < nvolumes; ivo++) {
3020 "Declaring assembly %s as possibly overlapping inside %s not allowed. Using AddNode instead !",
3035 for (i = 0; i < nbits; i++)
3037 for (i = 14; i < 24; i++)
3043 for (i = 0; i < nbits; i++)
3072 Error(
"Divide",
"Assemblies cannot be divided");
3084 Error(
"Divide",
"Cannot divide assembly %s since it has nodes",
GetName());
3088 Error(
"Divide",
"Assembly %s already divided",
GetName());
3092 if (!ncells || pattern->
GetStep() <= 0) {
3093 Error(
"Divide",
"Pattern finder for dividing assembly %s not initialized. Use SetRange() method.",
GetName());
3104 for (
Int_t i = 0; i < ncells; i++) {
3127 for (i = 0; i < nbits; i++)
3129 for (i = 14; i < 24; i++)
3135 for (i = 0; i < nbits; i++)
short Style_t
Style number (short)
int Int_t
Signed integer 4 bytes (int)
short Color_t
Color number (short)
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
short Width_t
Line width (short)
const char Option_t
Option string (const char)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
R__EXTERN TGeoManager * gGeoManager
R__EXTERN TGeoIdentity * gGeoIdentity
R__EXTERN TStyle * gStyle
This class provides a simple interface to execute the same task multiple times in parallel threads,...
unsigned GetPoolSize() const
Returns the number of worker threads in the task arena.
void Foreach(F func, unsigned nTimes, unsigned nChunks=0)
Execute a function without arguments several times in parallel, dividing the execution in nChunks.
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.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual Style_t GetLineStyle() const
Return the line style.
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
Save line attributes as C++ statement(s) on output stream out.
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=nullptr)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
TDirectory::TContext keeps track and restore the current directory.
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
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.
Composite shapes are Boolean combinations of two or more shape components.
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)
TVirtualGeoChecker * GetGeomChecker()
Make a default checker if none present. Returns pointer to it.
TObjArray * GetListOfVolumes() const
void ClearOverlaps()
Clear the list of overlaps.
TObjArray * GetListOfMatrices() const
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.
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.
static UInt_t GetExportPrecision()
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 RandomRays(Int_t nrays=1000, Double_t startx=0, Double_t starty=0, Double_t startz=0, const char *target_vol=nullptr, Bool_t check_norm=kFALSE)
Randomly shoot nrays and plot intersections with surfaces for current top node.
void SetAllIndex()
Assigns uid's for all materials,media and matrices.
TObjArray * GetListOfShapes() const
TGeoVolume * GetTopVolume() const
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.
void SetUsed(Bool_t flag=kTRUE)
void Print(const Option_t *option="") const override
print characteristics of this material
virtual Double_t GetDensity() const
Geometrical transformation package.
void Print(Option_t *option="") const override
print the matrix in 4x4 format
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.
Bool_t IsIdentity() const
const char * GetPointerName() const
Provide a pointer name containing uid.
Bool_t IsRegistered() const
Media are used to store properties related to tracking and which are useful only when using geometry ...
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
TGeoMaterial * GetMaterial() const
const char * GetPointerName() const
Provide a pointer name containing uid.
void SetMaterial(TGeoMaterial *mat)
A node containing local transformation.
void SetMatrix(const TGeoMatrix *matrix)
Matrix setter.
TGeoMatrix * GetMatrix() const override
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. A pattern is specifying a division type
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 CreateThreadData(Int_t)
No-op: this finder allocates its scratch state lazily for every calling thread.
void ClearThreadData() const
Invalidate the per-thread data.
Double_t GetStart() const
virtual Int_t GetByteCount() const
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
const char * GetName() const override
Get the shape name.
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.
~TGeoVolumeAssembly() override
Destructor. The assembly is owner of its "shape".
TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="") override
Add a component to the assembly.
TGeoVolume * CloneVolume() const override
Clone this volume.
static std::atomic< UInt_t > fgInstanceCount
void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option) override
Add an overlapping node - not allowed for assemblies.
TGeoVolumeAssembly()
Default constructor.
TGeoVolume * Divide(const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed=0, Option_t *option="") override
Division makes no sense for assemblies.
TGeoVolume * Divide(const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed=0, Option_t *option="") override
division of multiple volumes
void SetLineColor(Color_t lcolor) override
Set the line color for all components.
void AddVolume(TGeoVolume *vol)
Add a volume with valid shape to the list of volumes.
TGeoVolume * MakeCopyVolume(TGeoShape *newshape) override
Make a copy of this volume build a volume with same name, shape and medium.
void SetMedium(TGeoMedium *medium) override
Set medium for a multiple volume.
TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option="") override
Add a new node to the list of nodes.
TGeoVolume * GetVolume(Int_t id) const
void SetVisibility(Bool_t vis=kTRUE) override
Set visibility for all components.
~TGeoVolumeMulti() override
Destructor.
TGeoVolumeMulti * fDivision
TGeoVolumeMulti()
dummy constructor
void SetLineWidth(Width_t lwidth) override
Set the line width for all components.
TGeoShape * GetLastShape() const
Returns the last shape.
void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option="") override
Add a new node to the list of nodes, This node is possibly overlapping with other daughters of the vo...
void SetLineStyle(Style_t lstyle) override
Set the line style for all components.
Int_t GetNvolumes() const
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.
void SetVisContainers(Bool_t flag=kTRUE) override
Set visibility for containers.
virtual void cd(Int_t inode) const
Actualize matrix of node indexed <inode>
virtual void ClearThreadData() const
void SetVisibility(Bool_t vis=kTRUE) override
set visibility of this volume
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.
Bool_t Valid() const
Check if the shape of this volume is valid.
void CheckOverlapsBySampling(Double_t ovlp=0.1, Int_t npoints=1000000)
Overlap by sampling legacy checking tool. Check for illegal overlaps within a limit OVLP.
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
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 SetLineWidth(Width_t lwidth) override
Set the line width.
void Raytrace(Bool_t flag=kTRUE)
Draw this volume with current settings and perform raytracing in the pad.
void RandomRays(Int_t nrays=10000, Double_t startx=0, Double_t starty=0, Double_t startz=0, const char *target_vol=nullptr, Bool_t check_norm=kFALSE)
Random raytracing method.
TGeoVolume()
dummy constructor
TGeoMedium * GetMedium() const
char * GetObjectInfo(Int_t px, Int_t py) const override
Get volume info for the browser.
void Print(Option_t *option="") const override
Print volume info.
void CloneNodesAndConnect(TGeoVolume *newmother) const
Clone the array of nodes.
Bool_t IsSelected() const
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
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.
virtual void CreateThreadData(Int_t nthreads)
virtual Int_t GetByteCount() const
get the total size in bytes for this volume
virtual TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
Add a TGeoNode to the list of nodes.
Bool_t OptimizeVoxels()
Perform an extensive sampling to find which type of voxelization is most efficient.
void Browse(TBrowser *b) override
How to browse a volume.
void SetCurrentPoint(Double_t x, Double_t y, Double_t z)
Set the current tracking point.
void Paint(Option_t *option="") override
paint volume
void SetVisOnly(Bool_t flag=kTRUE) override
Set visibility for leaves.
TGeoManager * fGeoManager
! pointer to TGeoManager owning this volume
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.
void Draw(Option_t *option="") override
draw 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.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute mouse actions on this volume.
virtual TGeoVolume * CloneVolume() const
Clone this volume.
void SetFinder(TGeoPatternFinder *finder)
Int_t GetNdaughters() const
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.
const char * GetPointerName() const
Provide a pointer name containing uid.
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
virtual void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
Add a TGeoNode to the list of nodes.
TGeoNode * GetNode(const char *name) const
get the pointer to a daughter node
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
compute the closest distance of approach from point px,py to 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)
Bool_t GetOptimalVoxels() const
Returns true if cylindrical voxelization is optimal.
TGeoNode * ReplaceNode(TGeoNode *nodeorig, TGeoShape *newshape=nullptr, TGeoMatrix *newpos=nullptr, TGeoMedium *newmed=nullptr)
Replace an existing daughter with a new volume having the same name but possibly a new shape,...
void InvisibleAll(Bool_t flag=kTRUE)
Make volume and each of it daughters (in)visible.
Bool_t IsVisibleDaughters() const
TString fOption
! option - if any
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
! Transient user-defined extension to volumes
virtual void SetMedium(TGeoMedium *medium)
TGeoVoxelFinder * GetVoxels() const
Getter for optimization structure.
void SetAttVisibility(Bool_t vis)
~TGeoVolume() override
Destructor.
void SetShape(const TGeoShape *shape)
set the shape associated with this volume
static TGeoMedium * DummyMedium()
TObject * fField
! just a hook for now
void SetLineColor(Color_t lcolor) override
Set the line color.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
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
! dummy medium
void RegisterYourself(Option_t *option="")
Register the volume and all materials/media/matrices/shapes to the manager.
void CheckOverlaps(Double_t ovlp=0.1, Option_t *option="")
Overlap checking tool. Check for illegal overlaps within a limit OVLP.
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 SaveAs(const char *filename="", Option_t *option="") const override
Save geometry having this as top volume as a C++ macro.
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 framework-defined extension to volumes
void SetAsTopVolume()
Set this volume as the TOP one (the whole geometry starts from here)
Bool_t IsVisLeaves() const
Option_t * GetOption() const override
TObject * GetField() const
TGeoPatternFinder * fFinder
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
void SetLineStyle(Style_t lstyle) override
Set the line style.
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 Bool_t IsVisible() const
void SetVisLeaves(Bool_t flag=kTRUE) override
Set visibility for leaves.
void InspectShape() const
Bool_t IsFolder() const override
Return TRUE if volume contains nodes.
TGeoNode * FindNode(const char *name) const
search a daughter inside the list of nodes
void SetOverlappingCandidate(Bool_t flag)
Bool_t IsOverlappingCandidate() const
void Streamer(TBuffer &) override
Stream an object of class TGeoVolume.
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 Print(Option_t *option="") const override
Print the 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
void Draw(Option_t *option="") override
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.
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
void Add(TObject *obj) override
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
void Add(TObject *obj) override
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.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
Int_t GetEntriesFast() const
void AddAt(TObject *obj, Int_t idx) override
Add object at position ids.
void Clear(Option_t *option="") override
Remove all objects from the array.
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 override
Return the number of objects in array (i.e.
void Delete(Option_t *option="") override
Remove all objects from the array AND delete all heap based objects.
TObject * At(Int_t idx) const override
TObject * Remove(TObject *obj) override
Remove object from array.
TObject * RemoveAt(Int_t idx) override
Remove object at index idx.
TObject * FindObject(const char *name) const override
Find an object in this collection using its name.
void Add(TObject *obj) override
Mother of all ROOT objects.
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".
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
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.
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
void Stop()
Stop the stopwatch.
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
virtual void CheckGeometry(Int_t nrays, Double_t startx, Double_t starty, Double_t startz) const =0
virtual Bool_t TestVoxels(TGeoVolume *vol, Int_t npoints=1000000)=0
Abstract class for geometry painters.
virtual void SetTopVolume(TGeoVolume *vol)=0
virtual void Raytrace(Option_t *option="")=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 Int_t DistanceToPrimitiveVol(TGeoVolume *vol, Int_t px, Int_t py)=0
void Paint(Option_t *option="") override=0
This method must be overridden if a class wants to paint itself.
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
Bool_t IsImplicitMTEnabled()
Returns true if the implicit multi-threading in ROOT is enabled.
UInt_t GetThreadPoolSize()
Returns the size of ROOT's thread pool.