399 if (!
gROOT->GetListOfGeometries()->FindObject(
this))
gROOT->GetListOfGeometries()->Add(
this);
400 if (!
gROOT->GetListOfBrowsables()->FindObject(
this))
gROOT->GetListOfBrowsables()->Add(
this);
415 if (
fgLock)
Fatal(
"Init",
"New geometry created while the old one locked !!!");
502 if (
gROOT->GetListOfFiles()) {
503 gROOT->GetListOfGeometries()->Remove(
this);
504 gROOT->GetListOfBrowsables()->Remove(
this);
582 auto pos =
fProperties.insert(ConstPropMap_t::value_type(property, value));
584 Warning(
"AddProperty",
"Property \"%s\" already exists with value %g", property, (pos.first)->second);
597 if (error) *error =
kTRUE;
600 if (error) *error =
kFALSE;
611 if (error) *error =
kTRUE;
616 while (pos < i) { ++it; ++pos; }
617 if (error) *error =
kFALSE;
676 Error(
"AddVolume",
"invalid volume");
721 std::thread::id threadId = std::this_thread::get_id();
722 NavigatorsMap_t::const_iterator it =
fNavigators.find(threadId);
727 fNavigators.insert(NavigatorsMap_t::value_type(threadId, array));
744 std::thread::id threadId = std::this_thread::get_id();
745 NavigatorsMap_t::const_iterator it =
fNavigators.find(threadId);
758 std::thread::id threadId = std::this_thread::get_id();
759 NavigatorsMap_t::const_iterator it =
fNavigators.find(threadId);
770 std::thread::id threadId = std::this_thread::get_id();
771 NavigatorsMap_t::const_iterator it =
fNavigators.find(threadId);
773 Error(
"SetCurrentNavigator",
"No navigator defined for this thread\n");
774 std::cout <<
" thread id: " << threadId << std::endl;
780 Error(
"SetCurrentNavigator",
"Navigator %d not existing for this thread\n", index);
781 std::cout <<
" thread id: " << threadId << std::endl;
803 for (NavigatorsMap_t::iterator it =
fNavigators.begin();
829 Error(
"Remove navigator",
"Navigator %p not found", nav);
839 Error(
"SetMaxThreads",
"Cannot set maximum number of threads before closing the geometry");
844 std::thread::id threadId = std::this_thread::get_id();
845 NavigatorsMap_t::const_iterator it =
fNavigators.find(threadId);
849 fNavigators.insert(NavigatorsMap_t::value_type(threadId, array));
907 TTHREAD_TLS(
Int_t) tid = -1;
909 if (ttid > -1)
return ttid;
911 std::thread::id threadId = std::this_thread::get_id();
913 if (it !=
fgThreadId->end())
return it->second;
939 "TGeoManager",
this,
"SetVisibility(TObject*,Bool_t)");
955 if(obj->IsA() == TGeoVolume::Class()) {
1018 if (!vorig || !vnew)
return nref;
1021 if (morig) checkmed =
kTRUE;
1025 Error(
"ReplaceVolume",
"Replacement volume %s has no medium and it is not an assembly",
1029 if (mnew && checkmed) {
1031 Warning(
"ReplaceVolume",
"Replacement volume %s has different medium than original volume %s",
1044 for (i=0; i<nvol; i++) {
1047 if (vol==vorig || vol==vnew)
continue;
1049 for (j=0; j<nd; j++) {
1054 if (mnew && mnew->
GetId()!=morig->
GetId()) ierr++;
1059 Info(
"ReplaceVolume",
"%s replaced with assembly and declared NON-OVERLAPPING!",node->
GetName());
1070 Info(
"ReplaceVolume",
"%s inside substitute assembly %s declared NON-OVERLAPPING!",node->
GetName(),vnew->
GetName());
1076 if (ierr)
Warning(
"ReplaceVolume",
"Volumes should not be replaced with assemblies if they are positioned in containers having a different medium ID.\n %i occurrences for assembly replacing volume %s",
1088 Warning(
"TransformVolumeToAssembly",
"Volume %s not found", vname);
1096 while (index<indmax) {
1105 Warning(
"TransformVolumeToAssembly",
"Volume %s already assembly", toTransform->
GetName());
1107 Warning(
"TransformVolumeToAssembly",
"Volume %s has no daughters, cannot transform", toTransform->
GetName());
1109 Warning(
"TransformVolumeToAssembly",
"Volume %s divided, cannot transform", toTransform->
GetName());
1113 if (index >= indmax)
return count;
1115 if (!strcmp(toTransform->
GetName(),vname)) replace =
kTRUE;
1215 return TGeoBuilder::Instance(
this)->
Medium(
name, numed, nmat, isvol, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
1363 Warning(
"CloseGeometry",
"geometry already closed");
1367 Error(
"CloseGeometry",
"you MUST call SetTopVolume() first !");
1370 if (!
gROOT->GetListOfGeometries()->FindObject(
this))
gROOT->GetListOfGeometries()->Add(
this);
1371 if (!
gROOT->GetListOfBrowsables()->FindObject(
this))
gROOT->GetListOfBrowsables()->Add(
this);
1382 Int_t nnavigators = 0;
1390 Error(
"CloseGeometry",
"Master volume not streamed");
1403 for (
Int_t i=0; i<nnavigators; i++) {
1424 if (
fgVerboseLevel>0)
Info(
"CloseGeometry",
"----------------modeler ready----------------");
1451 for (
Int_t i=0; i<nnavigators; i++) {
1459 Info(
"CloseGeometry",
"----------------modeler ready----------------");
1590 while ((node=next())) {
1617 Error(
"CountLevels",
"Top node not defined.");
1623 if (
fgVerboseLevel>1 && fixrefs)
Info(
"CountLevels",
"Fixing volume reference counts");
1627 Int_t maxvertices = 1;
1628 while ((node=next())) {
1631 for (
Int_t ibit=10; ibit<14; ibit++) {
1688 if (tmin<0 || tmin>=tmax || nframes<1)
return;
1709 for (i=0; i<3; i++) {
1710 start[i+3] = 20 + 1.3*start[i+3];
1711 end[i+3] = 20 + 0.9*end[i+3];
1713 for (i=0; i<6; i++) {
1714 dd[i] = (end[i]-start[i])/10.;
1718 dlong = (-206-dlong)/
Double_t(nframes);
1719 dlat = (126-dlat)/
Double_t(nframes);
1720 dpsi = (75-dpsi)/
Double_t(nframes);
1724 for (i=0; i<nframes; i++) {
1728 for (j=0; j<6; j++)
box[j]+=dd[j];
1754 if (track) track->
Draw(option);
1807 static char defaultname[5] = {
"XXX" };
1808 if (!
fPdgNames || !pdg)
return defaultname;
1827 Warning(
"SetPdgName",
"No more than 256 different pdg codes allowed");
1848 Error(
"AddGDMLMatrix",
"Matrix %s already added to manager", mat->
GetName());
1867 Error(
"AddOpticalSurface",
"Surface %s already added to manager", optsurf->
GetName());
1886 Error(
"AddSkinSurface",
"Surface %s already added to manager", surf->
GetName());
1905 Error(
"AddBorderSurface",
"Surface %s already added to manager", surf->
GetName());
1936 bombx = bomby = bombz = bombr = 1.3;
2018 if (trk)
return trk;
2024 if (trk)
return trk;
2037 if (track->
GetId() ==
id)
return track;
2050 if (track->
GetId()==
id)
return track;
2063 if (track->
GetId() ==
id)
return i;
2090 const Int_t nmax = 110;
2097 col[ 4] = col[ 5] =
kGreen-10;
2098 col[ 6] = col[ 7] =
kBlue-7;
2100 col[10] = col[11] =
kRed-10;
2106 col[24] = col[25] = col[26] =
kBlue-8;
2144 if (strcmp(volume->
GetName(),
name) && !all)
continue;
2154 if (strcmp(volume->
GetName(),
name) && !all)
continue;
2163 Warning(
"SetVolumeAttribute",
"volume: %s does not exist",
name);
2194 Info(
"SetMaxVisNodes",
"Automatic visible depth for %d visible nodes", maxnodes);
2233 if ((option>=0) && (option<3))
fVisOption=option;
2264 Info(
"SetVisLevel",
"Automatic visible depth disabled");
2285 Error(
"OptimizeVoxels",
"Geometry must be closed first");
2290 if (fname.
IsNull()) fname =
"tgeovox.C";
2291 out.open(fname, std::ios::out);
2293 Error(
"OptimizeVoxels",
"cannot open file");
2300 out << sname.
Data()<<
"()"<<std::endl;
2301 out <<
"{" << std::endl;
2302 out <<
"//=== Macro generated by ROOT version "<<
gROOT->GetVersion()<<
" : "<<t.
AsString()<<std::endl;
2303 out <<
"//=== Voxel optimization for " <<
GetTitle() <<
" geometry"<<std::endl;
2304 out <<
"//===== <run this macro JUST BEFORE closing the geometry>"<<std::endl;
2305 out <<
" TGeoVolume *vol = 0;"<<std::endl;
2306 out <<
" // parse all voxelized volumes"<<std::endl;
2312 out<<
" vol = gGeoManager->GetVolume(\""<<vol->
GetName()<<
"\");"<<std::endl;
2315 out<<
" vol->SetCylVoxels();"<<std::endl;
2317 out<<
" vol->SetCylVoxels(kFALSE);"<<std::endl;
2320 out <<
"}" << std::endl;
2344 for (i=0; i< len; i++) {
2345 if (startstr(i)==
' ')
continue;
2346 e0 += startstr(i, 1);
2364 for (i=0; i<len; i++) {
2366 if (!level) iloop++;
2372 if (level==0) lastpp=i;
2375 if ((e0(i)==
'+') || (e0(i)==
'-') || (e0(i)==
'*')) {
2383 if ((e0(i)==
':') && (level==0)) {
2392 if (iloop==1 && (e0(0)==
'(') && (e0(len-1)==
')')) {
2397 if (foundmat)
break;
2398 if (((lastop==0) && (lastdp>0)) || ((lastpp>0) && (lastdp>lastpp) && (indop<lastpp))) {
2399 expr3 = e0(lastdp+1, len-lastdp);
2408 for (i=0; i<len; i++) {
2418 if (level<=levmin) {
2440 expr1 = e0(0, indop);
2441 expr2 = e0(indop+1, len-indop);
2452 Error(
"SaveAttributes",
"geometry must be closed first\n");
2457 if (fname.
IsNull()) fname =
"tgeoatt.C";
2458 out.open(fname, std::ios::out);
2460 Error(
"SaveAttributes",
"cannot open file");
2467 out << sname.
Data()<<
"()"<<std::endl;
2468 out <<
"{" << std::endl;
2469 out <<
"//=== Macro generated by ROOT version "<<
gROOT->GetVersion()<<
" : "<<t.
AsString()<<std::endl;
2470 out <<
"//=== Attributes for " <<
GetTitle() <<
" geometry"<<std::endl;
2471 out <<
"//===== <run this macro AFTER loading the geometry in memory>"<<std::endl;
2473 out <<
" TGeoVolume *top = gGeoManager->GetVolume(\""<<
fTopVolume->
GetName()<<
"\");"<<std::endl;
2474 out <<
" TGeoVolume *vol = 0;"<<std::endl;
2475 out <<
" TGeoNode *node = 0;"<<std::endl;
2476 out <<
" // clear all volume attributes and get painter"<<std::endl;
2477 out <<
" gGeoManager->ClearAttributes();"<<std::endl;
2478 out <<
" gGeoManager->GetGeomPainter();"<<std::endl;
2479 out <<
" // set visualization modes and bomb factors"<<std::endl;
2480 out <<
" gGeoManager->SetVisOption("<<
GetVisOption()<<
");"<<std::endl;
2481 out <<
" gGeoManager->SetVisLevel("<<
GetVisLevel()<<
");"<<std::endl;
2482 out <<
" gGeoManager->SetExplodedView("<<
GetBombMode()<<
");"<<std::endl;
2483 Double_t bombx, bomby, bombz, bombr;
2485 out <<
" gGeoManager->SetBombFactors("<<bombx<<
","<<bomby<<
","<<bombz<<
","<<bombr<<
");"<<std::endl;
2486 out <<
" // iterate volumes container and set new attributes"<<std::endl;
2495 out <<
" // draw top volume with new settings"<<std::endl;
2496 out <<
" top->Draw();"<<std::endl;
2497 out <<
" gPad->x3d();"<<std::endl;
2498 out <<
"}" << std::endl;
2632 if (phi<0) phi+=360.;
2689 if (
fgVerboseLevel>0)
Info(
"GetByteCount",
"Total size of logical tree : %i bytes", count);
2699 const char *kind =
"root";
2700 if (
gROOT->IsWebDisplay() && !
gROOT->IsWebDisplayBatch()) kind =
"web";
2701 if (
auto h =
gROOT->GetPluginManager()->FindHandler(
"TVirtualGeoPainter", kind)) {
2702 if (
h->LoadPlugin() == -1) {
2703 Error(
"GetGeomPainter",
"could not load plugin for %s geo_painter", kind);
2708 Error(
"GetGeomPainter",
"could not create %s geo_painter", kind);
2712 Error(
"GetGeomPainter",
"not found plugin %s for geo_painter", kind);
2724 sname = sname.
Strip();
2744 sname = sname.
Strip();
2759 if (!vol)
return -1;
2769 if (index <= 0)
return 0;
2771 for (
Int_t i=0; i<index; i++) {
2773 if (other == mat)
continue;
2774 if (other->
IsEq(mat))
return other;
2785 sname = sname.
Strip();
2796 sname = sname.
Strip();
2809 if (med->
GetId()==numed)
return med;
2833 sname = sname.
Strip();
3018 return TGeoBuilder::Instance(
this)->
MakeCtub(
name, medium, rmin, rmax, dz, phi1, phi2, lx, ly, lz, tx, ty, tz);
3087 return TGeoBuilder::Instance(
this)->
MakeTrap(
name, medium, dz, theta, phi,
h1, bl1, tl1, alpha1, h2, bl2, tl2, alpha2);
3098 return TGeoBuilder::Instance(
this)->
MakeGtra(
name, medium, dz, theta, phi, twist,
h1, bl1, tl1, alpha1, h2, bl2, tl2, alpha2);
3122 Error(
"SetAlignableEntry",
"An alignable object with name %s already existing. NOT ADDED !", unique_name);
3131 if (!added)
Error(
"SetAlignableEntry",
"A PN entry: has already uid=%i", uid);
3161 if (index<0 ||
fKeyPNEId[index]!=uid)
return NULL;
3208 keys[index+1] = uid;
3209 values[index+1] = ientry;
3222 for (i=
fNPNEId-1; i>index; i--) {
3239 Error(
"MakeAlignablePN",
"No alignable object named %s found !",
name);
3251 Error(
"MakeAlignablePN",
"No alignable object specified !");
3254 const char *path = entry->
GetTitle();
3256 Error(
"MakeAlignablePN",
"Alignable object %s poins to invalid path: %s",
3274 Error(
"MakePhysicalNode",
"path: %s not valid", path);
3338 if ((phimin==0) && (phimax==360)) {
3442 Int_t nnavigators = 0;
3446 for (
Int_t i=0; i<nnavigators; i++) {
3564 Error(
"CheckGeometryFull",
"The option string must contain a letter. See method documentation.");
3589 has_runtime =
kTRUE;
3602 Warning(
"CheckGeometry",
"Volume \"%s\" has no medium: assigned dummy medium and material", vol->
GetName());
3614 Error(
"CheckOverlaps",
"Top node not set");
3651 Info(
"Weight",
"Estimating weight of %s with %g %% precision",
fTopVolume->
GetName(), 100.*precision);
3652 printf(
" event weight err\n");
3653 printf(
"========================================\n");
3672void TGeoManager::Streamer(
TBuffer &R__b)
3726 cmd =
TString::Format(
"TGDMLWrite::StartGDMLWriting(gGeoManager,\"%s\",\"%s\")", filename, option);
3727 gROOT->ProcessLineFast(cmd);
3733 if (!
f ||
f->IsZombie()) {
3734 Error(
"Export",
"Cannot open file");
3831 ::Warning(
"TGeoManager::Import",
"TGeoMananager in lock mode. NOT IMPORTING new geometry");
3834 if (!filename)
return 0;
3840 if (strstr(filename,
".gdml")) {
3842 new TGeoManager(
"GDMLImport",
"Geometry imported from GDML");
3847 ::Error(
"TGeoManager::Import",
"Cannot open file");
3860 if (strstr(filename,
"http"))
f =
TFile::Open(filename,
"CACHEREAD");
3862 if (!
f ||
f->IsZombie()) {
3863 ::Error(
"TGeoManager::Import",
"Cannot open file");
3869 TIter next(
f->GetListOfKeys());
3871 while ((key = (
TKey*)next())) {
3872 if (strcmp(key->
GetClassName(),
"TGeoManager") != 0)
continue;
3901 for (i=0; i<nelem; i++) {
3903 if (!elem)
continue;
3905 if (!elem_table)
continue;
3906 if (elem != elem_table) {
3915 if (!elem)
continue;
3917 if (!elem_table)
continue;
3918 if (elem != elem_table) {
3937 while ((obj = next())) {
4005 Error(
"SetUseParallelWorldNav",
"No parallel world geometry defined. Use CreateParallelWorld.");
4013 Error(
"SetUseParallelWorldNav",
"The geometry must be closed first");
4037 ::Fatal(
"TGeoManager",
"The system of units may only be changed once, \n"
4038 "BEFORE any elements and materials are created! \n"
4039 "Alternatively unlock the default units at own risk.");
4041 else if ( new_value ==
kG4Units ) {
4042 ::Warning(
"TGeoManager",
"Changing system of units to Geant4 units (mm, ns, MeV).");
4045 ::Warning(
"TGeoManager",
"Changing system of units to ROOT units (cm, s, GeV).");
TGeoManager * gGeoManager
static Bool_t gGeometryLocked
R__EXTERN TGeoManager * gGeoManager
R__EXTERN TGeoIdentity * gGeoIdentity
R__EXTERN TStyle * gStyle
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Using a TBrowser one can browse all ROOT objects.
virtual void RecursiveRemove(TObject *obj)
Recursively remove obj from browser.
static const char * GetFloatFormat()
return current printf format for float members, default "%e"
static void SetFloatFormat(const char *fmt="%e")
set printf format for float/double members, default "%e" to change format only for doubles,...
static const char * GetDoubleFormat()
return current printf format for double members, default "%.14e"
static void SetDoubleFormat(const char *fmt="%.14e")
set printf format for double members, default "%.14e" use it after SetFloatFormat,...
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
static ENewType IsCallingNew()
Static method returning the defConstructor flag passed to TClass::New().
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
const char * AsString() const
Return the date & time as a string (ctime() format).
Small helper to keep current directory context.
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::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
This class is used in the process of reading and writing the GDML "matrix" tag.
Bool_t IsVisTouched() const
void SetVisStreamed(Bool_t vis=kTRUE)
Mark attributes as "streamed to file".
void SetVisTouched(Bool_t vis=kTRUE)
Mark visualization attributes as "modified".
void SetVisBranch()
Set branch type visibility.
void Node(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot, Bool_t isOnly, Float_t *upar, Int_t npar=0)
Create a node called <name_nr> pointing to the volume called <name> as daughter of the volume called ...
TGeoVolume * MakePgon(const char *name, TGeoMedium *medium, Double_t phi, Double_t dphi, Int_t nedges, Int_t nz)
Make in one step a volume pointing to a polygone shape with given medium.
TGeoVolume * MakeGtra(const char *name, TGeoMedium *medium, Double_t dz, Double_t theta, Double_t phi, Double_t twist, Double_t h1, Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2, Double_t tl2, Double_t alpha2)
Make in one step a volume pointing to a twisted trapezoid shape with given medium.
TGeoVolume * MakeXtru(const char *name, TGeoMedium *medium, Int_t nz)
Make a TGeoXtru-shaped volume with nz planes.
TGeoVolume * MakePcon(const char *name, TGeoMedium *medium, Double_t phi, Double_t dphi, Int_t nz)
Make in one step a volume pointing to a polycone shape with given medium.
TGeoVolume * MakeTrap(const char *name, TGeoMedium *medium, Double_t dz, Double_t theta, Double_t phi, Double_t h1, Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2, Double_t tl2, Double_t alpha2)
Make in one step a volume pointing to a trapezoid shape with given medium.
Int_t AddShape(TGeoShape *shape)
Add a shape to the list. Returns index of the shape in list.
TGeoVolume * MakeTorus(const char *name, TGeoMedium *medium, Double_t r, Double_t rmin, Double_t rmax, Double_t phi1=0, Double_t dphi=360)
Make in one step a volume pointing to a torus shape with given medium.
static TGeoBuilder * Instance(TGeoManager *geom)
Return pointer to singleton.
TGeoVolume * MakeEltu(const char *name, TGeoMedium *medium, Double_t a, Double_t b, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
TGeoVolume * MakeHype(const char *name, TGeoMedium *medium, Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
TGeoMaterial * Material(const char *name, Double_t a, Double_t z, Double_t dens, Int_t uid, Double_t radlen=0, Double_t intlen=0)
Create material with given A, Z and density, having an unique id.
TGeoVolume * MakeTube(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
TGeoVolume * MakePara(const char *name, TGeoMedium *medium, Double_t dx, Double_t dy, Double_t dz, Double_t alpha, Double_t theta, Double_t phi)
Make in one step a volume pointing to a parallelepiped shape with given medium.
Int_t AddTransformation(TGeoMatrix *matrix)
Add a matrix to the list. Returns index of the matrix in list.
TGeoVolume * MakeSphere(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t themin=0, Double_t themax=180, Double_t phimin=0, Double_t phimax=360)
Make in one step a volume pointing to a sphere shape with given medium.
TGeoMedium * Medium(const char *name, Int_t numed, Int_t nmat, Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd, Double_t stemax, Double_t deemax, Double_t epsil, Double_t stmin)
Create tracking medium.
TGeoVolume * MakeTubs(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2)
Make in one step a volume pointing to a tube segment shape with given medium.
TGeoVolume * MakeBox(const char *name, TGeoMedium *medium, Double_t dx, Double_t dy, Double_t dz)
Make in one step a volume pointing to a box shape with given medium.
void Matrix(Int_t index, Double_t theta1, Double_t phi1, Double_t theta2, Double_t phi2, Double_t theta3, Double_t phi3)
Create rotation matrix named 'mat<index>'.
TGeoVolume * Division(const char *name, const char *mother, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed=0, Option_t *option="")
Create a new volume by dividing an existing one (GEANT3 like)
TGeoVolume * MakeParaboloid(const char *name, TGeoMedium *medium, Double_t rlo, Double_t rhi, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
TGeoVolume * MakeTrd1(const char *name, TGeoMedium *medium, Double_t dx1, Double_t dx2, Double_t dy, Double_t dz)
Make in one step a volume pointing to a TGeoTrd1 shape with given medium.
TGeoVolumeAssembly * MakeVolumeAssembly(const char *name)
Make an assembly of volumes.
TGeoVolume * MakeCons(const char *name, TGeoMedium *medium, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2)
Make in one step a volume pointing to a cone segment shape with given medium.
Int_t AddMaterial(TGeoMaterial *material)
Add a material to the list. Returns index of the material in list.
TGeoVolumeMulti * MakeVolumeMulti(const char *name, TGeoMedium *medium)
Make a TGeoVolumeMulti handling a list of volumes.
TGeoVolume * MakeTrd2(const char *name, TGeoMedium *medium, Double_t dx1, Double_t dx2, Double_t dy1, Double_t dy2, Double_t dz)
Make in one step a volume pointing to a TGeoTrd2 shape with given medium.
TGeoVolume * MakeArb8(const char *name, TGeoMedium *medium, Double_t dz, Double_t *vertices=0)
Make an TGeoArb8 volume.
TGeoVolume * Volume(const char *name, const char *shape, Int_t nmed, Float_t *upar, Int_t npar=0)
Create a volume in GEANT3 style.
TGeoMaterial * Mixture(const char *name, Float_t *a, Float_t *z, Double_t dens, Int_t nelem, Float_t *wmat, Int_t uid)
Create mixture OR COMPOUND IMAT as composed by THE BASIC nelem materials defined by arrays A,...
TGeoVolume * MakeCone(const char *name, TGeoMedium *medium, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2)
Make in one step a volume pointing to a cone shape with given medium.
void RegisterMatrix(TGeoMatrix *matrix)
Register a matrix to the list of matrices.
TGeoVolume * MakeCtub(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2, Double_t lx, Double_t ly, Double_t lz, Double_t tx, Double_t ty, Double_t tz)
Make in one step a volume pointing to a tube segment shape with given medium.
Class describing rotation + translation.
Class handling Boolean composition of shapes.
TGeoElement * GetElement(Int_t z)
Base class for chemical elements.
void SetDefined(Bool_t flag=kTRUE)
void SetUsed(Bool_t flag=kTRUE)
Matrix class used for computing global transformations Should NOT be used for node definition.
An identity transformation.
The manager class for any TGeo geometry.
static void UnlockGeometry()
Unlock current geometry.
Double_t fPhimax
lowest range for phi cut
TGeoVolume * MakeCone(const char *name, TGeoMedium *medium, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2)
Make in one step a volume pointing to a cone shape with given medium.
void AnimateTracks(Double_t tmin=0, Double_t tmax=5E-8, Int_t nframes=200, Option_t *option="/*")
Draw animation of tracks.
void AddSkinSurface(TGeoSkinSurface *surf)
Add skin surface;.
TGeoVolume * MakeXtru(const char *name, TGeoMedium *medium, Int_t nz)
Make a TGeoXtru-shaped volume with nz planes.
Double_t * FindNormalFast()
Computes fast normal to next crossed boundary, assuming that the current point is close enough to the...
TGeoVolume * MakePcon(const char *name, TGeoMedium *medium, Double_t phi, Double_t dphi, Int_t nz)
Make in one step a volume pointing to a polycone shape with given medium.
void Browse(TBrowser *b)
Describe how to browse this object.
Int_t fRaytraceMode
Flag for multi-threading.
Double_t fVisDensity
particles to be drawn
TGeoNavigator * AddNavigator()
Add a navigator in the list of navigators.
TVirtualGeoTrack * GetTrackOfId(Int_t id) const
Get track with a given ID.
TGeoMaterial * FindDuplicateMaterial(const TGeoMaterial *mat) const
Find if a given material duplicates an existing one.
TGeoVolume * Division(const char *name, const char *mother, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed=0, Option_t *option="")
Create a new volume by dividing an existing one (GEANT3 like)
TGeoVolume * Volume(const char *name, const char *shape, Int_t nmed, Float_t *upar, Int_t npar=0)
Create a volume in GEANT3 style.
Int_t ReplaceVolume(TGeoVolume *vorig, TGeoVolume *vnew)
Replaces all occurrences of VORIG with VNEW in the geometry tree.
void DoRestoreState()
Restore a backed-up state without affecting the cache stack.
Int_t GetCurrentNodeId() const
Get the unique ID of the current node.
TGeoNode * SearchNode(Bool_t downwards=kFALSE, const TGeoNode *skipnode=0)
Returns the deepest node containing fPoint, which must be set a priori.
TGeoPNEntry * GetAlignableEntry(const char *name) const
Retrieves an existing alignable object.
TGeoVolume * fMasterVolume
top physical node
TVirtualGeoTrack * FindTrackWithId(Int_t id) const
Search the track hierarchy to find the track with the given id.
virtual Int_t GetByteCount(Option_t *option=0)
Get total size of geometry in bytes.
void TestOverlaps(const char *path="")
Geometry overlap checker based on sampling.
static EDefaultUnits GetDefaultUnits()
void RemoveMaterial(Int_t index)
Remove material at given index.
Int_t CountNodes(const TGeoVolume *vol=0, Int_t nlevels=10000, Int_t option=0)
Count the total number of nodes starting from a volume, nlevels down.
void Matrix(Int_t index, Double_t theta1, Double_t phi1, Double_t theta2, Double_t phi2, Double_t theta3, Double_t phi3)
Create rotation matrix named 'mat<index>'.
TGeoElementTable * GetElementTable()
Returns material table. Creates it if not existing.
THashList * fHashPNE
hash list of group volumes providing fast search
TGeoVolume * MakeArb8(const char *name, TGeoMedium *medium, Double_t dz, Double_t *vertices=0)
Make an TGeoArb8 volume.
static Int_t fgVerboseLevel
Lock preventing a second geometry to be loaded.
void Init()
Initialize manager class.
Bool_t InitArrayPNE() const
Initialize PNE array for fast access via index and unique-id.
TObjArray * fPhysicalNodes
virtual ULong_t SizeOf(const TGeoNode *node, Option_t *option)
computes the total size in bytes of the branch starting with node.
TObjArray * fUniqueVolumes
static UInt_t fgExportPrecision
Maximum number of Xtru vertices.
void Node(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot, Bool_t isOnly, Float_t *upar, Int_t npar=0)
Create a node called <name_nr> pointing to the volume called <name> as daughter of the volume called ...
TGeoVolume * fPaintVolume
TGeoSkinSurface * GetSkinSurface(const char *name) const
Get skin surface with a given name;.
void UpdateElements()
Update element flags when geometry is loaded from a file.
TGeoManager()
Default constructor.
ConstPropMap_t fProperties
TGeoVolume * MakeTube(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
void CdUp()
Go one level up in geometry.
void DoBackupState()
Backup the current state without affecting the cache stack.
void CheckBoundaryErrors(Int_t ntracks=1000000, Double_t radius=-1.)
Check pushes and pulls needed to cross the next boundary with respect to the position given by FindNe...
TGeoPNEntry * GetAlignableEntryByUID(Int_t uid) const
Retrieves an existing alignable object having a preset UID.
void AddGDMLMatrix(TGDMLMatrix *mat)
Add GDML matrix;.
void AddBorderSurface(TGeoBorderSurface *surf)
Add border surface;.
void SetClippingShape(TGeoShape *clip)
Set a user-defined shape as clipping for ray tracing.
TGeoVolume * fCurrentVolume
current navigator
void ClearOverlaps()
Clear the list of overlaps.
TGeoVolume * MakeCons(const char *name, TGeoMedium *medium, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2)
Make in one step a volume pointing to a cone segment shape with given medium.
THashList * fHashGVolumes
hash list of volumes providing fast search
static std::mutex fgMutex
Bool_t IsInPhiRange() const
True if current node is in phi range.
virtual Bool_t cd(const char *path="")
Browse the tree of nodes starting from fTopNode according to pathname.
TGeoMaterial * Material(const char *name, Double_t a, Double_t z, Double_t dens, Int_t uid, Double_t radlen=0, Double_t intlen=0)
Create material with given A, Z and density, having an unique id.
void LocalToMaster(const Double_t *local, Double_t *master) const
static Bool_t fgLockNavigators
Number of registered threads.
void SaveAttributes(const char *filename="tgeoatt.C")
Save current attributes in a macro.
void RestoreMasterVolume()
Restore the master volume of the geometry.
virtual Int_t Export(const char *filename, const char *name="", Option_t *option="vg")
Export this geometry to a file.
TGeoNode * FindNextDaughterBoundary(Double_t *point, Double_t *dir, Int_t &idaughter, Bool_t compmatrix=kFALSE)
Computes as fStep the distance to next daughter of the current volume.
Int_t GetUID(const char *volname) const
Retrieve unique id for a volume name. Return -1 if name not found.
TGeoShape * fClippingShape
TGeoNavigator * GetCurrentNavigator() const
Returns current navigator for the calling thread.
TObjArray * fMatrices
current painter
static Int_t GetNumThreads()
Returns number of threads that were set to use geometry.
TGeoVolumeMulti * MakeVolumeMulti(const char *name, TGeoMedium *medium)
Make a TGeoVolumeMulti handling a list of volumes.
void ClearNavigators()
Clear all navigators.
Int_t AddTrack(Int_t id, Int_t pdgcode, TObject *particle=0)
Add a track to the list of tracks.
Int_t AddTransformation(const TGeoMatrix *matrix)
Add a matrix to the list. Returns index of the matrix in list.
TObjArray * fOpticalSurfaces
TVirtualGeoTrack * GetParentTrackOfId(Int_t id) const
Get parent track with a given ID.
void CdNode(Int_t nodeid)
Change current path to point to the node having this id.
static Int_t GetMaxLevels()
Return maximum number of levels used in the geometry.
Double_t fTmin
highest range for phi cut
static Bool_t IsLocked()
Check lock state.
TGeoVolume * fTopVolume
current volume
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.
TGeoVolume * fUserPaintVolume
volume currently painted
TVirtualGeoPainter * GetGeomPainter()
Make a default painter if none present. Returns pointer to it.
void GetBranchOnlys(Int_t *isonly) const
Fill node copy numbers of current branch into an array.
TGeoNode * GetCurrentNode() const
void SetVisOption(Int_t option=0)
set drawing mode :
void SetPdgName(Int_t pdg, const char *name)
Set a name for a particle having a given pdg.
TObjArray * fBorderSurfaces
Int_t GetNAlignable(Bool_t with_uid=kFALSE) const
Retrieves number of PN entries with or without UID.
void RefreshPhysicalNodes(Bool_t lock=kTRUE)
Refresh physical nodes to reflect the actual geometry paths after alignment was applied.
static Bool_t fgLock
mutex for navigator booking in MT mode
TGeoVolume * MakePara(const char *name, TGeoMedium *medium, Double_t dx, Double_t dy, Double_t dz, Double_t alpha, Double_t theta, Double_t phi)
Make in one step a volume pointing to a parallelepiped shape with given medium.
void TopToMaster(const Double_t *top, Double_t *master) const
Convert coordinates from top volume frame to master.
void AddOpticalSurface(TGeoOpticalSurface *optsurf)
Add optical surface;.
static void SetDefaultUnits(EDefaultUnits new_value)
Bool_t fLoopVolumes
flag that geometry is closed
Int_t AddMaterial(const TGeoMaterial *material)
Add a material to the list. Returns index of the material in list.
void ClearAttributes()
Reset all attributes to default ones.
static Int_t fgMaxDaughters
Maximum level in geometry.
Bool_t fUsePWNav
Raytrace mode: 0=normal, 1=pass through, 2=transparent.
void SetRTmode(Int_t mode)
Change raytracing mode.
Bool_t CheckPath(const char *path) const
Check if a geometry path is valid without changing the state of the current navigator.
void InspectState() const
Inspects path and all flags for the current state.
void ConvertReflections()
Convert all reflections in geometry to normal rotations + reflected shapes.
void SetVisLevel(Int_t level=3)
set default level down to which visualization is performed
TGeoNode * FindNextBoundary(Double_t stepmax=TGeoShape::Big(), const char *path="", Bool_t frombdr=kFALSE)
Find distance to next boundary and store it in fStep.
static TGeoManager * Import(const char *filename, const char *name="", Option_t *option="")
static function Import a geometry from a gdml or ROOT file
void CountLevels()
Count maximum number of nodes per volume, maximum depth and maximum number of xtru vertices.
TGeoVolume * MakeTorus(const char *name, TGeoMedium *medium, Double_t r, Double_t rmin, Double_t rmax, Double_t phi1=0, Double_t dphi=360)
Make in one step a volume pointing to a torus shape with given medium.
TGeoHMatrix * GetHMatrix()
Return stored current matrix (global matrix of the next touched node).
TGeoParallelWorld * fParallelWorld
void RegisterMatrix(const TGeoMatrix *matrix)
Register a matrix to the list of matrices.
TVirtualGeoTrack * GetTrack(Int_t index)
static Int_t GetMaxDaughters()
Return maximum number of daughters of a volume used in the geometry.
static void ClearThreadsMap()
Clear the current map of threads.
Int_t AddVolume(TGeoVolume *volume)
Add a volume to the list. Returns index of the volume in list.
TVirtualGeoPainter * fPainter
flag that nodes are the selected objects in pad rather than volumes
void SetVolumeAttribute(const char *name, const char *att, Int_t val)
Set volume attributes in G3 style.
const char * GetPdgName(Int_t pdg) const
Get name for given pdg code;.
void CheckGeometryFull(Int_t ntracks=1000000, Double_t vx=0., Double_t vy=0., Double_t vz=0., Option_t *option="ob")
Geometry checking.
Bool_t fIsNodeSelectable
switch ON/OFF volume activity (default OFF - all volumes active))
TGeoNode * Step(Bool_t is_geom=kTRUE, Bool_t cross=kTRUE)
Make a rectilinear step of length fStep from current point (fPoint) on current direction (fDirection)...
Bool_t GotoSafeLevel()
Go upwards the tree until a non-overlapping node.
Bool_t fActivity
flag for GL reflections
void GetBranchNames(Int_t *names) const
Fill volume names of current branch into an array.
static ThreadsMap_t * fgThreadId
Map between thread id's and navigator arrays.
void CloseGeometry(Option_t *option="d")
Closing geometry implies checking the geometry validity, fixing shapes with negative parameters (run-...
TVirtualGeoTrack * MakeTrack(Int_t id, Int_t pdgcode, TObject *particle)
Makes a primary track but do not attach it to the list of tracks.
Int_t GetTrackIndex(Int_t id) const
Get index for track id, -1 if not found.
Int_t fNNodes
upper time limit for tracks drawing
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute mouse actions on this manager.
Int_t fNLevel
table of elements
void OptimizeVoxels(const char *filename="tgeovox.C")
Optimize voxelization type for all volumes. Save best choice in a macro.
void CheckPoint(Double_t x=0, Double_t y=0, Double_t z=0, Option_t *option="")
Classify a given point. See TGeoChecker::CheckPoint().
TGeoVolume * GetVolume(const char *name) const
Search for a named volume. All trailing blanks stripped.
void SetAnimateTracks(Bool_t flag=kTRUE)
Bool_t fIsGeomCleaning
flag set when reading geometry
Bool_t IsSameLocation() const
void DefaultColors()
Set default volume colors according to A of material.
TGeoNode * FindNextBoundaryAndStep(Double_t stepmax=TGeoShape::Big(), Bool_t compsafe=kFALSE)
Compute distance to next boundary within STEPMAX.
TGeoVolume * MakeTrd2(const char *name, TGeoMedium *medium, Double_t dx1, Double_t dx2, Double_t dy1, Double_t dy2, Double_t dz)
Make in one step a volume pointing to a TGeoTrd2 shape with given medium.
Double_t * FindNormal(Bool_t forward=kTRUE)
Computes normal vector to the next surface that will be or was already crossed when propagating on a ...
TGeoVolume * MakeGtra(const char *name, TGeoMedium *medium, Double_t dz, Double_t theta, Double_t phi, Double_t twist, Double_t h1, Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2, Double_t tl2, Double_t alpha2)
Make in one step a volume pointing to a twisted trapezoid shape with given medium.
TGeoElementTable * fElementTable
clipping shape for raytracing
static void SetNavigatorsLock(Bool_t flag)
Set the lock for navigators.
static Int_t fgMaxXtruVert
Maximum number of daughters.
TGeoNode * FindNode(Bool_t safe_start=kTRUE)
Returns deepest node containing current point.
Int_t GetVisOption() const
Returns current depth to which geometry is drawn.
static void LockGeometry()
Lock current geometry so that no other geometry can be imported.
static UInt_t GetExportPrecision()
TGeoVolume * MakeBox(const char *name, TGeoMedium *medium, Double_t dx, Double_t dy, Double_t dz)
Make in one step a volume pointing to a box shape with given medium.
void CheckShape(TGeoShape *shape, Int_t testNo, Int_t nsamples, Option_t *option)
Test for shape navigation methods.
static Int_t fgMaxLevel
Verbosity level for Info messages (no IO).
void PrintOverlaps() const
Prints the current list of overlaps.
TGeoVolume * MakeTrd1(const char *name, TGeoMedium *medium, Double_t dx1, Double_t dx2, Double_t dy, Double_t dz)
Make in one step a volume pointing to a TGeoTrd1 shape with given medium.
TGeoVolume * MakeSphere(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t themin=0, Double_t themax=180, Double_t phimin=0, Double_t phimax=360)
Make in one step a volume pointing to a sphere shape with given medium.
void ResetUserData()
Sets all pointers TGeoVolume::fField to NULL.
TGeoVolume * FindVolumeFast(const char *name, Bool_t multi=kFALSE)
Fast search for a named volume. All trailing blanks stripped.
Bool_t GetTminTmax(Double_t &tmin, Double_t &tmax) const
Get time cut for drawing tracks.
TGeoNode * InitTrack(const Double_t *point, const Double_t *dir)
Initialize current point and current direction vector (normalized) in MARS.
ThreadsMap_t::const_iterator ThreadsMapIt_t
Bool_t fMatrixTransform
flag that the list of physical nodes has to be drawn
void Voxelize(Option_t *option=0)
Voxelize all non-divided volumes.
void SetVisibility(TObject *obj, Bool_t vis)
Set visibility for a volume.
void SetTopVolume(TGeoVolume *vol)
Set the top volume and corresponding node as starting point of the geometry.
Bool_t fMatrixReflection
flag for using GL matrix
TGeoPNEntry * SetAlignableEntry(const char *unique_name, const char *path, Int_t uid=-1)
Creates an alignable object with unique name corresponding to a path and adds it to the list of align...
void ClearShape(const TGeoShape *shape)
Remove a shape from the list of shapes.
void ModifiedPad() const
Send "Modified" signal to painter.
void BombTranslation(const Double_t *tr, Double_t *bombtr)
Get the new 'bombed' translation vector according current exploded view mode.
TGeoNavigator * fCurrentNavigator
Lock existing navigators.
static Bool_t LockDefaultUnits(Bool_t new_value)
virtual ~TGeoManager()
Destructor.
TGeoMedium * GetMedium(const char *medium) const
Search for a named tracking medium. All trailing blanks stripped.
Bool_t InsertPNEId(Int_t uid, Int_t ientry)
Insert a PN entry in the sorted array of indexes.
void ViewLeaves(Bool_t flag=kTRUE)
Set visualization option (leaves only OR all volumes)
TGeoVolume * MakeCtub(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2, Double_t lx, Double_t ly, Double_t lz, Double_t tx, Double_t ty, Double_t tz)
Make in one step a volume pointing to a tube segment shape with given medium.
void SetTminTmax(Double_t tmin=0, Double_t tmax=999)
Set time cut interval for drawing tracks.
NavigatorsMap_t fNavigators
void GetBranchNumbers(Int_t *copyNumbers, Int_t *volumeNumbers) const
Fill node copy numbers of current branch into an array.
Bool_t fPhiCut
flag to notify that the manager is being destructed
TGeoNode * CrossBoundaryAndLocate(Bool_t downwards, TGeoNode *skipnode)
Cross next boundary and locate within current node The current point must be on the boundary of fCurr...
void DrawTracks(Option_t *option="")
Draw tracks over the geometry, according to option.