13 #include <TGeoManager.h>
14 #include <TGeoVolume.h>
39 cout << __PRETTY_FUNCTION__ <<
" - Error - Invalid input" << endl;
44 TMemFile
f1(
"mem",
"CREATE");
48 const Long64_t
n = f1.GetSize();
51 Long64_t n1 = f1.CopyTo(
Data.data(),
n);
58 if (not
isValid())
return nullptr;
60 TMemFile
f2(
"mem2",
Data.data(),
Data.size(),
"READ");
61 TGeoVolume* vol =
dynamic_cast<TGeoVolume*
>(
f2.Get(
"TOP"));
72 if (not
isValid())
return nullptr;
75 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,23,2)
76 TGeoManager::LockDefaultUnits(kFALSE);
77 TGeoManager::SetDefaultUnits( TGeoManager::kRootUnits );
78 TGeoManager::LockDefaultUnits(kTRUE);
80 TGeoManager::SetDefaultRootUnits();
84 TGeoManager* tgeo =
new TGeoManager(
"PHGeometry",
"");
88 vol->RegisterYourself();
90 tgeo->SetTopVolume(vol);
95 <<
"TGeoManager built by PHGeomUtility::LoadFromIONode based on RUN/GEOMETRY_IO node with name ("
96 << vol->GetName() <<
") and title ("
97 << vol->GetTitle() <<
")";
99 tgeo->SetTitle(stitle.str().c_str());
109 os <<
"PHGeomIOTGeo - ";
111 os <<
" with geometry data " <<
Data.size() <<
"Byte";