12#include "GaudiKernel/Bootstrap.h"
13#include "GaudiKernel/ISvcLocator.h"
24#include "G4Polycone.hh"
25#include "G4UnionSolid.hh"
60 ATH_MSG_ERROR(
"Unable to create volume representation for geoID="<<geoID);
69 return StatusCode::SUCCESS;
82 G4ThreeVector posG4( pos.x(), pos.y(), pos.z() );
83 EInside g4Where = curVol->Inside( posG4 );
139 <<
"' (GeoID="<< geoID <<
").");
145 const double phimin = 0.;
146 const double deltaphi = 360.*CLHEP::deg;
154 size_t curVolNumPoints =
rz.size();
155 if ( !curVolNumPoints)
159 return StatusCode::FAILURE;
163 double *
z =
new double[curVolNumPoints];
164 double *
r =
new double[curVolNumPoints];
167 RZPairVector::const_iterator rzIt =
rz.begin();
168 for (
size_t i=0; i<curVolNumPoints; ++i)
177 std::stringstream curName;
178 curName << volumeName;
180 m_volume[geoID] =
new G4Polycone( curName.str(), phimin, deltaphi, curVolNumPoints,
r,
z);
182 m_volume[geoID]->SetName( volumeName);
189 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
bool validAtlasRegion(AtlasDetDescr::AtlasRegion region)
Check a given AtlasRegion for its validity.
std::vector< RZPair > RZPairVector
static const char * getName(int region)
ISF::InsideType m_typeConverter[ISF::fNumInsideTypes]
a quick way to convert G4 enum EInside to ISF::InsideType
AtlasDetDescr::AtlasRegion identifyGeoID(const Amg::Vector3D &pos) const
A static filter that returns the AtlasRegion of the given position.
ISF::InsideType inside(const Amg::Vector3D &pos, AtlasDetDescr::AtlasRegion geoID) const
Checks if the given position (ISFParticle) is inside a given AtlasRegion.
ServiceHandle< IEnvelopeDefSvc > m_envDefSvc
service providing the envelope dimensions for the different sub-detectors
G4VSolid * m_volume[AtlasDetDescr::fNumAtlasRegions]
G4PolyconeGeoIDSvc(const std::string &name, ISvcLocator *svc)
Constructor with parameters.
~G4PolyconeGeoIDSvc()
Destructor.
AtlasDetDescr::AtlasRegion identifyNextGeoID(const Amg::Vector3D &pos, const Amg::Vector3D &dir) const
Find the AtlasRegion that the particle will enter with its next infinitesimal step along the given di...
StatusCode createVolume(AtlasDetDescr::AtlasRegion geoID)
Retrieve and fill in the dimensions for the different AtlasRegion.
Eigen::Matrix< double, 3, 1 > Vector3D
AtlasRegion
A simple enum of ATLAS regions and sub-detectors.