#include <MagCylinder.h>
Public Member Functions | |
virtual const std::vector < VolumeSide > & | faces () const |
Access to volume faces. | |
virtual bool | inside (const GlobalPoint &gp, double tolerance=0.) const |
virtual bool | inside (const LocalPoint &lp, double tolerance=0.) const |
MagCylinder (const PositionType &pos, const RotationType &rot, DDSolidShape shape, const std::vector< VolumeSide > &faces, const MagneticFieldProvider< float > *mfp) | |
Public Attributes | |
std::string | name |
Private Attributes | |
std::vector< VolumeSide > | theFaces |
Scalar | theInnerR |
Scalar | theOuterR |
Scalar | theZmax |
Scalar | theZmin |
Definition at line 16 of file MagCylinder.h.
MagCylinder::MagCylinder | ( | const PositionType & | pos, |
const RotationType & | rot, | ||
DDSolidShape | shape, | ||
const std::vector< VolumeSide > & | faces, | ||
const MagneticFieldProvider< float > * | mfp | ||
) |
Definition at line 8 of file MagCylinder.cc.
References def, i, SurfaceOrientation::inner, SurfaceOrientation::outer, Cylinder::radius(), theInnerR, theOuterR, theZmax, theZmin, GloballyPositioned< float >::toLocal(), z, SurfaceOrientation::zminus, and SurfaceOrientation::zplus.
: MagVolume(pos,rot,shape,mfp), theFaces(faces), theInnerR(0) { using SurfaceOrientation::GlobalFace; unsigned int def = 0; for (std::vector<VolumeSide>::const_iterator i=faces.begin(); i!= faces.end(); ++i) { if (i->globalFace() == SurfaceOrientation::zminus) { theZmin = MagVolume::toLocal( i->surface().position()).z(); ++def; } else if (i->globalFace() == SurfaceOrientation::zplus) { theZmax = MagVolume::toLocal( i->surface().position()).z(); ++def; } else if (i->globalFace() == SurfaceOrientation::outer || i->globalFace() == SurfaceOrientation::inner) { const Cylinder* cyl = dynamic_cast<const Cylinder*>(&(i->surface())); if (cyl == 0) { throw MagGeometryError("MagCylinder inner/outer surface is not a cylinder"); } if (i->globalFace() == SurfaceOrientation::outer) theOuterR = cyl->radius(); else theInnerR = cyl->radius(); ++def; } } if (def != faces.size()) { throw MagGeometryError("MagCylinder constructed with wrong number/type of faces"); } }
virtual const std::vector<VolumeSide>& MagCylinder::faces | ( | ) | const [inline, virtual] |
Access to volume faces.
Implements MagVolume.
Definition at line 27 of file MagCylinder.h.
References theFaces.
{return theFaces;}
bool MagCylinder::inside | ( | const GlobalPoint & | gp, |
double | tolerance = 0. |
||
) | const [virtual] |
Implements MagVolume.
Definition at line 43 of file MagCylinder.cc.
References GloballyPositioned< float >::toLocal().
bool MagCylinder::inside | ( | const LocalPoint & | lp, |
double | tolerance = 0. |
||
) | const [virtual] |
Reimplemented from MagVolume.
Definition at line 48 of file MagCylinder.cc.
References alignCSCRings::r, theInnerR, theOuterR, theZmax, and theZmin.
std::string MagCylinder::name |
Definition at line 30 of file MagCylinder.h.
std::vector<VolumeSide> MagCylinder::theFaces [private] |
Definition at line 35 of file MagCylinder.h.
Referenced by faces().
Scalar MagCylinder::theInnerR [private] |
Definition at line 38 of file MagCylinder.h.
Referenced by inside(), and MagCylinder().
Scalar MagCylinder::theOuterR [private] |
Definition at line 39 of file MagCylinder.h.
Referenced by inside(), and MagCylinder().
Scalar MagCylinder::theZmax [private] |
Definition at line 37 of file MagCylinder.h.
Referenced by inside(), and MagCylinder().
Scalar MagCylinder::theZmin [private] |
Definition at line 36 of file MagCylinder.h.
Referenced by inside(), and MagCylinder().