#include <MagneticField/VolumeGeometry/interface/MagCylinder.h>
Public Member Functions | |
virtual const std::vector < VolumeSide > & | faces () const |
Access to volume faces. | |
virtual bool | inside (const LocalPoint &lp, double tolerance=0.) const |
virtual bool | inside (const GlobalPoint &gp, 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 14 of file MagCylinder.cc.
References i, SurfaceOrientation::inner, SurfaceOrientation::outer, Cylinder::radius(), theInnerR, theOuterR, theZmax, theZmin, GloballyPositioned< float >::toLocal(), z, SurfaceOrientation::zminus, and SurfaceOrientation::zplus.
00019 : MagVolume(pos,rot,shape,mfp), theFaces(faces), theInnerR(0) 00020 { 00021 using SurfaceOrientation::GlobalFace; 00022 00023 unsigned int def = 0; 00024 for (std::vector<VolumeSide>::const_iterator i=faces.begin(); i!= faces.end(); ++i) { 00025 if (i->globalFace() == SurfaceOrientation::zminus) { 00026 theZmin = MagVolume::toLocal( i->surface().position()).z(); 00027 ++def; 00028 } 00029 else if (i->globalFace() == SurfaceOrientation::zplus) { 00030 theZmax = MagVolume::toLocal( i->surface().position()).z(); 00031 ++def; 00032 } 00033 else if (i->globalFace() == SurfaceOrientation::outer || i->globalFace() == SurfaceOrientation::inner) { 00034 const Cylinder* cyl = dynamic_cast<const Cylinder*>(&(i->surface())); 00035 if (cyl == 0) { 00036 throw MagGeometryError("MagCylinder inner/outer surface is not a cylinder"); 00037 } 00038 if (i->globalFace() == SurfaceOrientation::outer) theOuterR = cyl->radius(); 00039 else theInnerR = cyl->radius(); 00040 ++def; 00041 } 00042 } 00043 if (def != faces.size()) { 00044 throw MagGeometryError("MagCylinder constructed with wrong number/type of faces"); 00045 } 00046 00047 #ifndef NO_DETAILED_TIMING 00048 // TOFIX 00049 // static SimpleConfigurable<bool> timerOn(false,"MagCylinder:timing"); 00050 // bool timerOn = false; 00051 // (*TimingReport::current()).switchOn("MagCylinder::inside",timerOn); 00052 #endif 00053 }
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.
00027 {return theFaces;}
virtual bool MagCylinder::inside | ( | const LocalPoint & | lp, | |
double | tolerance = 0. | |||
) | const [virtual] |
Implements MagVolume.
bool MagCylinder::inside | ( | const GlobalPoint & | gp, | |
double | tolerance = 0. | |||
) | const [virtual] |
Implements MagVolume.
Definition at line 55 of file MagCylinder.cc.
References GloballyPositioned< float >::toLocal().
00056 { 00057 #ifndef NO_DETAILED_TIMING 00058 // TOFIX 00059 // static TimingReport::Item & timer = (*TimingReport::current())["MagCylinder::inside(global)"]; 00060 // TimeMe t(timer,false); 00061 #endif 00062 return inside( toLocal(gp), tolerance); 00063 }
std::string MagCylinder::name |
Definition at line 30 of file MagCylinder.h.
std::vector<VolumeSide> MagCylinder::theFaces [private] |
Scalar MagCylinder::theInnerR [private] |
Scalar MagCylinder::theOuterR [private] |
Scalar MagCylinder::theZmax [private] |
Scalar MagCylinder::theZmin [private] |