422 dummyMaterial->
SetName(
"dummy");
433 fShape->ClearThreadData();
441 fFinder->CreateThreadData(nthreads);
443 fShape->CreateThreadData(nthreads);
485 Warning(
"Ctor",
"volume %s has invalid shape",
name);
488 Fatal(
"ctor",
"Shape of volume %s invalid. Aborting!",
fName.Data());
493 fMedium->GetMaterial()->SetUsed();
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(),
577 return fShape->Capacity();
581 for (i = 0; i < nd; i++)
600 checker->CheckGeometry(nrays, startx, starty, startz);
611 Info(
"CheckOverlaps",
"Option 's' deprecated. Use CheckOverlapsBySampling() instead.");
618 geom->ClearOverlaps();
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 static thread_local bool navInit =
false;
686 if (!geom->GetCurrentNavigator())
687 geom->AddNavigator();
691 std::vector<TGeoOverlapResult> local;
694 for (
size_t i = range.first; i < range.second; ++i) {
696 if (checker->ComputeOverlap(candidates[i],
r))
697 local.emplace_back(std::move(
r));
700 if (!local.empty()) {
701 std::lock_guard<std::mutex> lock(resultsMutex);
702 results.insert(results.end(), std::make_move_iterator(local.begin()), std::make_move_iterator(local.end()));
708 Info(
"CheckOverlaps",
"--- checking candidates with on a single thread (IMT not configured)...");
710 for (
size_t i = 0; i < candidates.size(); ++i) {
712 if (checker->ComputeOverlap(candidates[i],
r))
713 results.emplace_back(std::move(
r));
718 for (
const auto &
r : results)
719 checker->MaterializeOverlap(
r);
721 geom->SetCheckingOverlaps(
kFALSE);
722 geom->SortOverlaps();
725 TObjArray *overlaps = geom->GetListOfOverlaps();
727 for (
Int_t i = 0; i < novlps; i++)
731 Info(
"CheckOverlaps",
"Number of illegal overlaps/extrusions : %d found in %g [sec]", novlps, timer.
RealTime());
744 Info(
"CheckOverlaps",
"[LEGACY] Checking overlaps by sampling %d points for volume %s", npoints,
GetName());
745 Info(
"CheckOverlaps",
"=== NOTE: Many overlaps may be missed. Extrusions NOT checked with sampling option ! ===");
748 checker->CheckOverlapsBySampling(
this, ovlp, npoints);
756 for (
Int_t i = 0; i < novlps; i++) {
764 Info(
"CheckOverlaps",
"Number of illegal overlaps/extrusions sampled for volume %s: %d\n",
GetName(), novlps);
773 fShape->CheckShape(testNo, nsamples, option);
798 if (
fShape->IsRunTimeShape()) {
799 Error(
"CheckShapes",
"volume %s has run-time shape",
GetName());
810 for (
Int_t i = 0; i < nd; i++) {
814 printf(
"Daughter %i of volume %s - NO NAME!!!\n", i,
GetName());
824 Fatal(
"CheckShapes",
"Cannot make copy node for %s", node->
GetName());
829 Error(
"CheckShapes",
"cannot resolve runtime shape for volume %s/%s\n",
GetName(), old_vol->
GetName());
837 fNodes->AddAt(new_node, i);
852 static Int_t maxlevel = 0;
853 static Int_t nlev = 0;
855 if (option < 0 || option > 3)
876 case 3:
return maxlevel;
889 for (
Int_t i = 0; i < nd; i++) {
906 for (
Int_t i = 0; i < nd; i++)
922 for (
Int_t i = 0; i < nd; i++) {
929 while ((browser = (
TBrowser *)next())) {
930 for (
Int_t i = 0; i < nd + 1; i++) {
1000 if (strstr(filename,
".gdml")) {
1006 if (!
f ||
f->IsZombie()) {
1007 printf(
"Error: TGeoVolume::Import : Cannot open file %s\n", filename);
1013 TIter next(
f->GetListOfKeys());
1015 while ((key = (
TKey *)next())) {
1052 Info(
"Export",
"Exporting volume %s as C++ code",
GetName());
1058 Info(
"Export",
"Exporting %s as gdml code - not implemented yet",
GetName());
1063 Info(
"Export",
"Exporting %s as root file.",
GetName());
1068 if (!
f ||
f->IsZombie()) {
1069 Error(
"Export",
"Cannot open file");
1098 if (matrix ==
nullptr)
1103 Error(
"AddNode",
"Volume is NULL");
1107 Error(
"AddNode",
"Won't add node with invalid shape");
1108 printf(
"### invalid volume was : %s\n", vol->
GetName());
1116 Error(
"AddNode",
"Cannot add node %s_%i into divided volume %s", vol->
GetName(), copy_no,
GetName());
1141 Error(
"AddNodeOffset",
"invalid volume");
1145 Error(
"AddNode",
"Won't add node with invalid shape");
1146 printf(
"### invalid volume was : %s\n", vol->
GetName());
1167 Error(
"AddNodeOverlap",
"Volume is NULL");
1171 Error(
"AddNodeOverlap",
"Won't add node with invalid shape");
1172 printf(
"### invalid volume was : %s\n", vol->
GetName());
1177 "Declaring assembly %s as possibly overlapping inside %s not allowed. Using AddNode instead !",
1179 AddNode(vol, copy_no, mat, option);
1183 if (matrix ==
nullptr)
1192 Error(
"AddNodeOverlap",
"Cannot add node %s_%i into divided volume %s", vol->
GetName(), copy_no,
GetName());
1201 Warning(
"AddNode",
"Volume %s : added node %s with same name",
GetName(),
name.Data());
1228 Fatal(
"Divide",
"volume %s already divided",
GetName());
1237 range =
fShape->GetAxisRange(iaxis, xlo, xhi);
1239 if (!strcmp(
fShape->GetAxisName(iaxis),
"PHI")) {
1240 if ((
start - xlo) < -1E-3)
1244 xhi =
start + range;
1249 Fatal(
"Divide",
"cannot divide volume %s (%s) on %s axis",
GetName(), stype.
Data(),
fShape->GetAxisName(iaxis));
1252 if (ndiv <= 0 || opt.
Contains(
"s")) {
1254 Fatal(
"Divide",
"invalid division type for volume %s : ndiv=%i, step=%g",
GetName(), ndiv, step);
1258 if ((xlo -
start) > 1E-3 || (xhi -
start) < -1E-3) {
1259 Fatal(
"Divide",
"invalid START=%g for division on axis %s of volume %s. Range is (%g, %g)",
start,
1266 ndiv =
Int_t((range + 0.1 * step) / step);
1267 Double_t ddx = range - ndiv * step;
1270 Warning(
"Divide",
"division of volume %s on %s axis (ndiv=%d) will be centered in the full range",
GetName(),
1271 fShape->GetAxisName(iaxis), ndiv);
1272 start = xlo + 0.5 * ddx;
1274 if (step <= 0 || opt.
Contains(
"n")) {
1276 if ((xlo -
start) > 1E-3 || (xhi -
start) < -1E-3) {
1277 Fatal(
"Divide",
"invalid START=%g for division on axis %s of volume %s. Range is (%g, %g)",
start,
1284 step = range / ndiv;
1289 if (((
start - xlo) < -1E-3) || ((end - xhi) > 1E-3)) {
1290 Fatal(
"Divide",
"division of volume %s on axis %s exceed range (%g, %g)",
GetName(),
fShape->GetAxisName(iaxis),
1298 Fatal(
"Divide",
"invalid medium number %d for division volume %s", numed, divname);
1335 if (option && option[0] > 0) {
1338 painter->
DrawVolume(
this,
gEnv->GetValue(
"Viewer3D.DefaultDrawOption",
""));
1348 Info(
"DrawOnly",
"Volume assemblies do not support this option.");
1356 if (option && option[0] > 0) {
1359 painter->
DrawVolume(
this,
gEnv->GetValue(
"Viewer3D.DefaultDrawOption",
""));
1369 printf(
"Optimizing volume %s ...\n",
GetName());
1371 return checker->TestVoxels(
this);
1392 if (option && option[0] > 0) {
1393 painter->
Paint(option);
1395 painter->
Paint(
gEnv->GetValue(
"Viewer3D.DefaultDrawOption",
""));
1428 for (
Int_t i = 0; i < nd; i++) {
1443 for (
Int_t i = 0; i < nd; i++) {
1457 if (old_vol !=
this)
1461 TH2F *hist = checker->LegoPlot(ntheta, themin, themax, nphi, phimin, phimax, rmin, rmax, option);
1462 hist->
Draw(
"lego1sph");
1471 if (
fGeoManager->GetListOfVolumes()->FindObject(
this))
1477 if (
fShape->IsComposite()) {
1495 for (i = 0; i < nd; i++) {
1500 else if (!
fGeoManager->GetListOfMatrices()->FindObject(matrix)) {
1505 for (i = 0; i < nd; i++)
1517 if (old_vol !=
this)
1535 if (old_vol !=
this)
1539 fGeoManager->RandomRays(nrays, startx, starty, startz, target_vol, check_norm);
1572 out.open(filename, std::ios::out);
1574 Error(
"SavePrimitive",
"Bad file name: %s", filename);
1584 out <<
"void " << fname <<
"() {" << std::endl;
1585 out <<
" gSystem->Load(\"libGeom\");" << std::endl;
1587 out << std::setprecision(prec);
1588 ((
TGeoVolume *)
this)->SavePrimitive(out, option);
1589 out <<
"}" << std::endl;
1665 if (
fGeoManager->GetGeomPainter()->GetTopVolume() ==
this)
1674 out <<
" Double_t dx, dy, dz;" << std::endl;
1675 out <<
" Double_t dx1, dx2, dy1, dy2;" << std::endl;
1676 out <<
" Double_t vert[20], par[20];" << std::endl;
1677 out <<
" Double_t theta, phi, h1, bl1, tl1, alpha1, h2, bl2, tl2, alpha2;" << std::endl;
1678 out <<
" Double_t twist;" << std::endl;
1679 out <<
" Double_t origin[3];" << std::endl;
1680 out <<
" Double_t rmin, rmax, rmin1, rmax1, rmin2, rmax2;" << std::endl;
1681 out <<
" Double_t r, rlo, rhi;" << std::endl;
1682 out <<
" Double_t a, b;" << std::endl;
1683 out <<
" Double_t point[3], norm[3];" << std::endl;
1684 out <<
" Double_t rin, stin, rout, stout;" << std::endl;
1685 out <<
" Double_t thx, phx, thy, phy, thz, phz;" << std::endl;
1686 out <<
" Double_t alpha, theta1, theta2, phi1, phi2, dphi;" << std::endl;
1687 out <<
" Double_t tr[3], rot[9];" << std::endl;
1688 out <<
" Double_t z, density, radl, absl, w;" << std::endl;
1689 out <<
" Double_t lx, ly, lz, tx, ty, tz;" << std::endl;
1690 out <<
" Double_t xvert[50], yvert[50];" << std::endl;
1691 out <<
" Double_t zsect, x0, y0, scale0;" << std::endl;
1692 out <<
" Int_t nel, numed, nz, nedges, nvert;" << std::endl;
1693 out <<
" TGeoBoolNode *pBoolNode = nullptr;" << std::endl << std::endl;
1695 out <<
" // MATERIALS, MIXTURES AND TRACKING MEDIA" << std::endl;
1698 out << std::endl <<
" // TRANSFORMATION MATRICES" << std::endl;
1702 out << std::endl <<
" // SET TOP VOLUME OF GEOMETRY" << std::endl;
1703 out <<
" gGeoManager->SetTopVolume(" <<
GetPointerName() <<
");" << std::endl;
1705 out << std::endl <<
" // SHAPES, VOLUMES AND GEOMETRICAL HIERARCHY" << std::endl;
1707 out << std::endl <<
" // CLOSE GEOMETRY" << std::endl;
1708 out <<
" gGeoManager->CloseGeometry();" << std::endl;
1711 out <<
" gGeoManager->GetTopVolume()->Draw();" << std::endl;
1713 out <<
" gGeoManager->GetTopVolume()->Raytrace();" << std::endl;
1718 if (!strcmp(option,
"s")) {
1723 fShape->SavePrimitive(out, option);
1724 out <<
" // Volume: " <<
GetName() << std::endl;
1726 <<
fShape->GetPointerName();
1728 out <<
", " <<
fMedium->GetPointerName();
1729 out <<
");" << std::endl;
1731 out <<
" // Assembly: " <<
GetName() << std::endl;
1733 <<
");" << std::endl;
1737 out <<
" " <<
GetPointerName() <<
"->SetVisibility(kFALSE);" << std::endl;
1739 out <<
" " <<
GetPointerName() <<
"->VisibleDaughters(kFALSE);" << std::endl;
1741 out <<
" " <<
GetPointerName() <<
"->SetVisContainers(kTRUE);" << std::endl;
1743 out <<
" " <<
GetPointerName() <<
"->SetVisLeaves(kTRUE);" << std::endl;
1747 if (!strcmp(option,
"m")) {
1749 fMedium->SavePrimitive(out, option);
1750 for (i = 0; i < nd; i++) {
1757 if (!strcmp(option,
"x")) {
1763 for (i = 0; i < nd; i++) {
1773 if (!strcmp(option,
"d")) {
1785 fFinder->SavePrimitive(out, option);
1788 out <<
");" << std::endl;
1792 for (i = 0; i < nd; i++) {
1805 out <<
");" << std::endl;
1808 for (i = 0; i < nd; i++) {
1852 for (
Int_t i = 0; i < ncheck; i++) {
1854 if (current == node)
1855 return check_list[i];
1869 for (
Int_t i = 0; i < nd; i++) {
1871 if (current == node)
1900 for (
id = 0;
id < nd;
id++) {
1904 if (ncyl > (nd / 2))
1944 return fShape->IsAssembly();
1964 for (i = 0; i < nbits; i++)
1966 for (i = 14; i < 24; i++)
1972 for (i = 0; i < nbits; i++)
2013 for (
Int_t i = 0; i < nd; i++) {
2017 Fatal(
"CloneNodesAndConnect",
"cannot make copy node");
2039 for (
Int_t i = 0; i < nd; i++)
2082 Error(
"MakeReflectedVolume",
"Geometry must be closed.");
2087 if (newname && newname[0])
2094 Fatal(
"MakeReflectedVolume",
"Cannot clone volume %s\n",
GetName());
2098 if (newname && newname[0])
2119 for (
Int_t i = 0; i < nd; i++) {
2152 Fatal(
"MakeReflectedVolume",
"Could not copy finder for volume %s",
GetName());
2159 for (
Int_t i = 0; i < nd; i++) {
2190 Error(
"SetShape",
"No shape");
2203 Error(
"SortNodes",
"Bounding box not valid");
2218 for (
id = 0;
id < nd;
id++) {
2227 for (
id = 0;
id < nd;
id++) {
2238 for (
id = 0;
id < nd;
id++) {
2248 printf(
" volume %s : number of nodes does not match!!!\n",
GetName());
2326 Int_t count = 28 + 2 + 6 + 4 + 0;
2328 count += 7 *
sizeof(
char *);
2331 count +=
fShape->GetByteCount();
2333 count +=
fFinder->GetByteCount();
2335 count += 32 + 4 *
fNodes->GetEntries();
2338 while ((node = (
TGeoNode *)next()))
2350 Error(
"FindOverlaps",
"Bounding box not valid");
2360 for (inode = 0; inode < nd; inode++) {
2375 if (!
fNodes->Remove(node))
2396 Error(
"ReplaceNode",
"Cannot replace node %s since it is an assembly", nodeorig->
GetName());
2400 if (newshape && !nodeorig->
IsOffset())
2419 Fatal(
"ReplaceNode",
"Cannot make copy node for %s", nodeorig->
GetName());
2425 if (newpos && !nodeorig->
IsOffset()) {
2431 fNodes->AddAt(newnode, ind);
2448 static Int_t len = 0;
2452 for (i = 0; i < len; i++) {
2476 while ((browser = (
TBrowser *)next())) {
2531 return fShape->IsValidBox();
2552 for (i = 0; i < nd; i++) {
2561 for (i = 0; i < nd; i++) {
2587 Error(
"Voxelize",
"Bounding box not valid");
2644 for (i = 0; i < nd; i++) {
2646 weight += daughter->
WeightA();
2652 density =
fMedium->GetMaterial()->GetDensity();
2656 weight += 0.001 * capacity * density;
2712 fVolumes->AddAtAndExpand(vol, idx);
2719 Fatal(
"AddVolume",
"Cannot divide volume %s", vol->
GetName());
2729 for (
Int_t id = 0;
id < nd;
id++) {
2750 for (
Int_t ivo = 0; ivo < nvolumes; ivo++) {
2756 volume->
AddNode(vol, copy_no, mat, option);
2771 for (
Int_t ivo = 0; ivo < nvolumes; ivo++) {
2797 Int_t numed,
const char *option)
2800 Error(
"Divide",
"volume %s already divided",
GetName());
2808 Error(
"Divide",
"Invalid medium number %d for division volume %s", numed, divname);
2833 for (
Int_t ivo = 0; ivo < nvolumes; ivo++) {
2877 Fatal(
"MakeCopyVolume",
"Cannot divide volume %s", vol->
GetName());
2897 for (i = 0; i < nd; i++) {
2901 Fatal(
"MakeCopyNode",
"cannot make copy node for daughter %d of %s", i,
GetName());
2918 for (
Int_t ivo = 0; ivo < nvolumes; ivo++) {
2932 for (
Int_t ivo = 0; ivo < nvolumes; ivo++) {
2946 for (
Int_t ivo = 0; ivo < nvolumes; ivo++) {
2960 for (
Int_t ivo = 0; ivo < nvolumes; ivo++) {
2974 for (
Int_t ivo = 0; ivo < nvolumes; ivo++) {
3002 std::lock_guard<std::mutex> guard(
fMutex);
3004 std::vector<ThreadData_t *>::iterator i =
fThreadData.begin();
3017 std::lock_guard<std::mutex> guard(
fMutex);
3021 for (
Int_t tid = 0; tid < nthreads; tid++) {
3108 "Declaring assembly %s as possibly overlapping inside %s not allowed. Using AddNode instead !",
3110 AddNode(vol, copy_no, mat, option);
3123 for (i = 0; i < nbits; i++)
3125 for (i = 14; i < 24; i++)
3131 for (i = 0; i < nbits; i++)
3160 Error(
"Divide",
"Assemblies cannot be divided");
3172 Error(
"Divide",
"Cannot divide assembly %s since it has nodes",
GetName());
3176 Error(
"Divide",
"Assembly %s already divided",
GetName());
3180 if (!ncells || pattern->
GetStep() <= 0) {
3181 Error(
"Divide",
"Pattern finder for dividing assembly %s not initialized. Use SetRange() method.",
GetName());
3192 for (
Int_t i = 0; i < ncells; i++) {
3215 for (i = 0; i < nbits; i++)
3217 for (i = 14; i < 24; i++)
3223 for (i = 0; i < nbits; i++)
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
short Width_t
Line width (short).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
short Color_t
Color number (short).
short Style_t
Style number (short).
const char Option_t
Option string (const char).
externTGeoManager * gGeoManager
externTGeoIdentity * gGeoIdentity
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 SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual Style_t GetLineStyle() const
Return the line style.
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.
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.
static UInt_t GetExportPrecision()
static Int_t ThreadId()
Translates the current thread id to an ordinal number.
Base class describing materials.
void SetUsed(Bool_t flag=kTRUE)
void Print(const Option_t *option="") const override
print characteristics of this material
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 ...
TGeoMaterial * GetMaterial() const
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
virtual Int_t GetDivAxis()
void SetVolume(TGeoVolume *vol)
Double_t GetStart() 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.
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 ComputeBBox()=0
virtual TGeoShape * GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const =0
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".
Int_t GetNextNodeIndex() const override
void CreateThreadData(Int_t nthreads) override
TGeoVolumeAssembly(const TGeoVolumeAssembly &)=delete
TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="") override
Add a component to the assembly.
void ClearThreadData() const override
TGeoVolume * CloneVolume() const override
Clone this volume.
void AddNodeOverlap(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat, Option_t *option) override
Add an overlapping node - not allowed for assemblies.
std::vector< ThreadData_t * > fThreadData
! Thread specific data vector
std::mutex fMutex
! Mutex for concurrent operations
Int_t fThreadSize
! Thread vector size
void SetNextNodeIndex(Int_t index)
Int_t GetCurrentNodeIndex() const override
void SetCurrentNodeIndex(Int_t index)
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.
ThreadData_t & GetThreadData() const
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.
TGeoVolumeMulti(const TGeoVolumeMulti &)=delete
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
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.
TGeoVolume(const TGeoVolume &)=delete
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.
virtual void Voxelize(Option_t *option="")
Voxelize attached volume according to option If the volume is an assembly, make sure the bbox is comp...
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.
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
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 Clear(Option_t *option="") override
Remove all objects from the array.
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
TObject * At(Int_t idx) const override
void Add(TObject *obj) override
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.
TObject()
TObject constructor.
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.
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 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.
ThreadData_t()
Constructor.
Int_t fCurrent
! index of current selected node
~ThreadData_t()
Destructor.
Int_t fNext
! index of next node to be entered