1 #ifndef GeometryManager_hxx_seen 2 #define GeometryManager_hxx_seen 10 #include <TGeoVolume.h> 11 #include <TGeoManager.h> 13 #include <TGeoMatrix.h> 14 #include "BasicUtils.hxx" 21 std::runtime_error(
"Error reading file with ROOT geometry") {
29 std::runtime_error(
"No ROOT geometry found in file") {
37 std::runtime_error(
"No t2k volume found in the geometry") {
50 TGeoManager* GeoManager(){
52 TGeoManager* man = NULL;
54 if (_currentGeomID>=0 && _currentGeomID<(Int_t)(_GeoManagers.size()))
55 man = _GeoManagers[_currentGeomID];
59 if (_currentGeomID>=0 && _currentGeomID<(Int_t)(_GeoManagers.size()))
60 man = _GeoManagers[_currentGeomID];
65 std::cout <<
"ERROR. GeometryManager::GeoManager() failed to retrieve valid manager" << std::endl;
71 void InitializeGeometry(
bool IsMC =
true)
const;
74 void InitializeDetectorDefinitionFromROOTGeometry()
const;
77 void FillFGDInfoFromROOTGeometry()
const;
80 void GetVolumeProperties(
const std::string& name, Double_t* pos, Double_t* size)
const;
83 void SetDetectorBoundaries(
const std::string& det_name, Float_t* det_min, Float_t* det_max,
84 const std::string& name1,
const std::string& name2=
"")
const;
88 bool LoadGeometry(
const std::string& file=
"",Int_t geomID=-1,
const std::string& geomDir=
"");
92 anaUtils::CopyArray(min, detMin, 3);
93 anaUtils::CopyArray(max, detMax, 3);
98 return _currentGeomID;
110 mutable std::vector<TGeoManager*> _GeoManagers;
113 std::string _defaultFileName;
116 bool _useDefaultGeometry;
119 Int_t _currentGeomID;
122 void FillVolumesWithGeometryLoop()
const;
127 bool VisitNode(
const std::string& name,
const TGeoNode* node)
const;
130 void UpdateVolumeBound(Float_t* detMin, Float_t* detMax,
const Float_t* low,
const Float_t* high)
const;
133 void RecurseGeometry(std::string name)
const;
136 void ResetVolumeDefinitions()
const;
This exception is thrown when the geometry is not a proper one (not with t2k volume) ...
This exception is thrown when fail to open a file with geometry.
Int_t GetCurrentGeomID() const
Retrieve current geometry ID.
void SetDetectorBoundaries(Float_t *detMin, Float_t *detMax, const Float_t *min, const Float_t *max) const
Set detector boundaries.
This exception is thrown when no geometry is found in a file.