CMS 3D CMS Logo

MagCylinder Class Reference

#include <MagneticField/VolumeGeometry/interface/MagCylinder.h>

Inheritance diagram for MagCylinder:

MagVolume GloballyPositioned< float > MagneticField

List of all members.

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< VolumeSidetheFaces
Scalar theInnerR
Scalar theOuterR
Scalar theZmax
Scalar theZmin


Detailed Description

Definition at line 16 of file MagCylinder.h.


Constructor & Destructor Documentation

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 }


Member Function Documentation

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 }


Member Data Documentation

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 MagCylinder().

Scalar MagCylinder::theOuterR [private]

Definition at line 39 of file MagCylinder.h.

Referenced by MagCylinder().

Scalar MagCylinder::theZmax [private]

Definition at line 37 of file MagCylinder.h.

Referenced by MagCylinder().

Scalar MagCylinder::theZmin [private]

Definition at line 36 of file MagCylinder.h.

Referenced by MagCylinder().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:27:56 2009 for CMSSW by  doxygen 1.5.4