13 #include <TGeoManager.h>
14 #include <TGeoVolume.h>
51 cout << __PRETTY_FUNCTION__ <<
" - Error - Invalid input" << endl;
56 TMemFile f1(
"mem",
"CREATE");
60 const Long64_t n = f1.GetSize();
63 Long64_t n1 = f1.CopyTo(
Data.data(), n);
73 TMemFile f2(
"mem2",
Data.data(),
Data.size(),
"READ");
74 TGeoVolume * vol =
dynamic_cast<TGeoVolume *
>(f2.Get(
"TOP"));
88 TGeoManager * tgeo =
new TGeoManager(
"PHGeometry",
"");
92 vol->RegisterYourself();
94 tgeo->SetTopVolume(vol);
99 <<
"TGeoManager built by PHGeomUtility::LoadFromIONode based on RUN/GEOMETRY_IO node with name ("
100 << vol->GetName() <<
") and title ("
101 << vol->GetTitle() <<
")";
103 tgeo->SetTitle(stitle.str().c_str());
114 os <<
"PHGeomIOTGeo - ";
116 os <<
" with geometry data " <<
Data.size()<<
"Byte";
virtual PHObject * clone() const
Virtual copy constructor.
virtual void identify(std::ostream &os=std::cout) const
virtual void Reset()
Clear Event.
std::vector< char > Data
store the streamed geometry and its streamer via a binary stream
TGeoManager * ConstructTGeoManager()
Construct TGeoManager. The result TGeoManager is not yet closed and open for further editing...
void SetGeometry(const TGeoVolume *g)
PHGeomIOTGeo do NOT own this TGeoVolume * g. Internally, it will use g to make a copy which PHGeomIOT...
PHGeomIOTGeo store geometry information to DST files in the format of binary streamed TGeoVolume...
virtual int isValid() const
isValid returns non zero if object contains vailid data
TGeoVolume * GetGeometryCopy()