25#include "TGeoManager.h"
26#include "TGeoMedium.h"
33 const std::string& name,
VGM::ISolid* solid,
const std::string& mediumName)
34 :
VGM::IVolume(),
BaseVGM::VVolume(solid), fGeoVolume(0)
44 VGM::IDisplacedSolid* displacedSolid =
45 dynamic_cast<VGM::IDisplacedSolid*>(constSolid);
46 constSolid = displacedSolid->ConstituentSolid();
51 TGeoMedium* geoMedium = gGeoManager->GetMedium(mediumName.data());
54 std::cerr <<
"+++ Warning +++" << std::endl;
55 std::cerr <<
" RootGM::Volume::Volume:" << std::endl;
56 std::cerr <<
" Medium \"" << mediumName <<
"\" not found." << std::endl;
60 fGeoVolume =
new TGeoVolume(name.data(), geoSolid, geoMedium);
68 :
VGM::IVolume(),
BaseVGM::VVolume(solid), fGeoVolume(volume)
103 return std::string(fGeoVolume->GetName());
112 if (!fGeoVolume->GetMedium() ||
113 (fGeoVolume->GetMedium() && !fGeoVolume->GetMedium()->GetMaterial()))
116 return std::string(fGeoVolume->GetMedium()->GetMaterial()->GetName());
125 if (!fGeoVolume->GetMedium())
return "None";
127 return std::string(fGeoVolume->GetMedium()->GetName());
135 TGeoVolume* oldVolume = fGeoVolume;
138 if (oldVolume) fGeoVolume->SetMedium(oldVolume->GetMedium());
TGeoShape * GetSolid(VGM::ISolid *iSolid) const
static SolidMap * Instance()
static VolumeMap * Instance()
void AddVolume(VGM::IVolume *, TGeoVolume *)
VGM implementation for Root volume.
virtual std::string MediumName() const
Return the name of the associated medium.
void ResetVolume(TGeoVolume *rootVolume)
virtual std::string MaterialName() const
Return the name of the associated material.
virtual std::string Name() const
Return the name of this volume.
The VGM interface to solids.
virtual SolidType Type() const =0
Return the type of this solid.