13 : m_geoManager(NULL), m_nMaterials(0), m_debug(false) {
21 std::cerr <<
"GeometryRoot::SetGeometry:\n";
22 std::cerr <<
" Pointer to TGeoManager is null.\n";
32 const double z)
const {
38 std::string name(cnode->GetMedium()->GetMaterial()->GetName());
51 std::cerr <<
"GeometryRoot::GetNumberOfMaterials:\n";
52 std::cerr <<
" ROOT geometry is not defined.\n";
53 std::cerr <<
" Call SetGeometry first.\n";
63 std::cerr <<
"GeometryRoot::GetMaterial:\n";
64 std::cerr <<
" ROOT geometry is not defined.\n";
65 std::cerr <<
" Call SetGeometry first.\n";
75 std::cerr <<
"GeometryRoot::GetMaterial:\n";
76 std::cerr <<
" ROOT geometry is not defined.\n";
77 std::cerr <<
" Call SetGeometry first.\n";
87 std::cerr <<
"GeometryRoot::SetMedium:\n";
88 std::cerr <<
" ROOT geometry is not defined.\n";
89 std::cerr <<
" Call SetGeometry first.\n";
94 std::cerr <<
"GeometryRoot::SetMedium:\n";
95 std::cerr <<
" Medium pointer is null.\n";
101 std::cerr <<
"GeometryRoot::SetMedium:\n";
102 std::cerr <<
" ROOT material with index " << imat
103 <<
" does not exist.\n";
107 std::string name(mat->GetName());
112 std::cout <<
"GeometryRoot::SetMedium:\n";
113 std::cout <<
" Current association of material " << name
114 <<
" with medium " << med->
GetName() <<
" is overwritten.\n";
123 newMaterial.
name = name;
130 const double rho1 = mat->GetDensity();
132 std::cout <<
"GeometryROOT::SetMedium:\n";
133 std::cout <<
" ROOT material: " << name <<
"\n";
134 std::cout <<
" Density: " << rho1 <<
" g / cm3\n";
135 std::cout <<
" Medium: " << med->
GetName() <<
"\n";
136 std::cout <<
" Density: " << rho2 <<
" g / cm3\n";
137 if (rho1 > 0 &&
fabs(rho1 - rho2) / rho1 > 0.01) {
138 std::cout <<
" WARNING: Densities differ by > 1%.\n";
145 std::cerr <<
"GeometryRoot::SetMedium:\n";
146 std::cerr <<
" ROOT geometry is not defined.\n";
147 std::cerr <<
" Call SetGeometry first.\n";
152 std::cerr <<
"GeometryRoot::SetMedium:\n";
153 std::cerr <<
" Medium pointer is null.\n";
159 std::cerr <<
"GeometryRoot::SetMedium:" << std::endl;
160 std::cerr <<
" ROOT material " << name <<
" does not exist."
169 double& xmax,
double& ymax,
double& zmax) {
172 TGeoBBox* box = (TGeoBBox*)
m_geoManager->GetTopVolume()->GetShape();
173 const double dx = box->GetDX();
174 const double dy = box->GetDY();
175 const double dz = box->GetDZ();
176 const double ox = box->GetOrigin()[0];
177 const double oy = box->GetOrigin()[1];
178 const double oz = box->GetOrigin()[2];
DoubleAc fabs(const DoubleAc &f)
TGeoManager * m_geoManager
void SetMedium(const int imat, Medium *med)
std::vector< material > m_materials
TGeoMaterial * GetMaterial(const int i)
bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax)
void SetGeometry(TGeoManager *geoman)
int GetNumberOfMaterials()
Medium * GetMedium(const double x, const double y, const double z) const
virtual double GetMassDensity() const
std::string GetName() const