6 #include "geartgeo/TGeoGearPointProperties.h"
7 #include "geartgeo/TGeoGeometryInitializer.h"
8 #include "TGeoVolume.h"
9 #include "TGeoManager.h"
14 TGeoGearPointProperties::TGeoGearPointProperties(TGeoManager *geoMgr){
37 static std::string matName(
"unknown");
38 TGeoNode *node=_tgeomanager->FindNode(position[0],position[1],position[2]);
40 matName=node->GetMedium()->GetMaterial()->GetName();
42 throw OutsideGeometryException(
"No geometry node found at given location. Either there is no node placed here or position is outside of top volume.");
56 TGeoNode *node=_tgeomanager->FindNode(position[0],position[1],position[2]);
58 density=node->GetMedium()->GetMaterial()->GetDensity();
60 throw OutsideGeometryException(
"No geometry node found at given location. Either there is no node placed here or position is outside of top volume.");
72 TGeoNode *node=_tgeomanager->FindNode(position[0],position[1],position[2]);
74 temperature=node->GetMedium()->GetMaterial()->GetTemperature();
76 throw OutsideGeometryException(
"No geometry node found at given location. Either there is no node placed here or position is outside of top volume.");
90 TGeoNode *node=_tgeomanager->FindNode(position[0],position[1],position[2]);
92 pressure=node->GetMedium()->GetMaterial()->GetPressure();
94 throw OutsideGeometryException(
"No geometry node found at given location. Either there is no node placed here or position is outside of top volume.");
104 position[0] = pos[0];
105 position[1] = pos[1];
106 position[2] = pos[2];
109 TGeoNode *node=_tgeomanager->FindNode(position[0],position[1],position[2]);
111 radLen=node->GetMedium()->GetMaterial()->GetRadLen();
113 throw OutsideGeometryException(
"No geometry node found at given location. Either there is no node placed here or position is outside of top volume.");
122 position[0] = pos[0];
123 position[1] = pos[1];
124 position[2] = pos[2];
127 TGeoNode *node=_tgeomanager->FindNode(position[0],position[1],position[2]);
129 intLen=node->GetMedium()->GetMaterial()->GetIntLen();
131 throw OutsideGeometryException(
"No geometry node found at given location. Either there is no node placed here or position is outside of top volume.");
139 const Double_t global[3]={pos[0],pos[1],pos[2]};
142 _tgeomanager->MasterToLocal(global, local);
144 return Vector3D(local[0],local[1],local[2]) ;
168 position[0] = pos[0];
169 position[1] = pos[1];
170 position[2] = pos[2];
171 std::vector<std::string> names;
172 TGeoNode *node= _tgeomanager->FindNode(position[0],position[1],position[2]);
174 throw OutsideGeometryException(
"No geometry node found at given location. Either there is no node placed here or position is outside of top volume.");
176 TGeoVolume *cvol=_tgeomanager->GetCurrentVolume();
180 const char *name=cvol->GetName();
181 names.push_back(name);
182 _tgeomanager->CdUp();
183 cvol=_tgeomanager->GetCurrentVolume();
184 if(name==_tgeomanager->GetTopVolume()->GetName())
195 position[0] = pos[0];
196 position[1] = pos[1];
197 position[2] = pos[2];
199 std::vector<std::string> names;
200 TGeoNode *node=_tgeomanager->FindNode(position[0],position[1],position[2]);
202 throw OutsideGeometryException(
"No geometry node found at given location. Either there is no node placed here or position is outside of top volume.");
207 const char *name=node->GetName();
208 names.push_back(name);
209 _tgeomanager->CdUp();
210 node=_tgeomanager->GetCurrentNode();
211 if(name==_tgeomanager->GetTopNode()->GetName())
virtual bool isCalorimeter(const Vector3D &pos) const
True if region that contains pos is defined as a calorimeter.
virtual bool isTracker(const Vector3D &pos) const
True if region that contains pos is defined as a tracker.
virtual std::vector< std::string > getListOfLogicalVolumes(const Vector3D &pos) const
Names of (geant4) logical volumes in heirarchy starting at given pos ending with the world volume...
virtual Vector3D getLocalPosition(const Vector3D &pos) const
Position in local coordinate.
virtual double getTemperature(const Vector3D &pos) const
Name of material at pos.
virtual Vector3D getB(const Vector3D &pos) const
The magnetic field vector at pos in [Tesla].
virtual double getIntlen(const Vector3D &pos) const
Interaction length of material in mm at pos.
NotImplementedException used for features that are not implemented.
Simple three dimensional vector providing the components for cartesian, cylindrical and spherical coo...
long long long64
64 bit integer,e.g.to be used for cellids
virtual double getDensity(const Vector3D &pos) const
Density in kg/m^3 at pos.
OutsideGeometryException used if user asks for info from geometry tree where no node is defined...
virtual std::string getRegion(const Vector3D &pos) const
Names of (geant4) region that contains the given pos.
virtual double getPressure(const Vector3D &pos) const
Pressure in P at pos.
virtual double getRadlen(const Vector3D &pos) const
Radiation length of material in mm at pos.
virtual long64 getCellID(const Vector3D &pos) const
The cellID of the the sensitive detector at pos.
virtual const std::string & getMaterialName(const Vector3D &pos) const
Name of material at pos.
virtual std::vector< std::string > getListOfPhysicalVolumes(const Vector3D &pos) const
Names of (geant4) physical volumes in heirarchy starting at given pos ending with the world volume...
virtual Vector3D getE(const Vector3D &pos) const
The electric field vector at pos in [V/m].