CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Attributes
MagCylinder Class Reference

#include <MagCylinder.h>

Inheritance diagram for MagCylinder:
MagVolume GloballyPositioned< float > MagneticField

Public Member Functions

virtual const std::vector
< VolumeSide > & 
faces () const
 Access to volume faces. More...
 
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 Member Functions inherited from MagVolume
LocalVector fieldInTesla (const LocalPoint &lp) const
 
GlobalVector fieldInTesla (const GlobalPoint &lp) const
 
virtual ::GlobalVector inTesla (const ::GlobalPoint &gp) const
 
bool isIron () const
 Temporary hack to pass information on material. Will eventually be replaced! More...
 
 MagVolume (const PositionType &pos, const RotationType &rot, DDSolidShape shape, const MagneticFieldProvider< float > *mfp, double sf=1.)
 
void ownsFieldProvider (bool o)
 
const MagneticFieldProvider
< float > * 
provider () const
 
void setIsIron (bool iron)
 
DDSolidShape shapeType () const
 
virtual ~MagVolume ()
 
- Public Member Functions inherited from GloballyPositioned< float >
float eta () const
 
 GloballyPositioned (const PositionType &pos, const RotationType &rot)
 
void move (const GlobalVector &displacement)
 
float phi () const
 
const PositionTypeposition () const
 
void rotate (const RotationType &rotation)
 
const RotationTyperotation () const
 
GlobalPoint toGlobal (const LocalPoint &lp) const
 
Point3DBase< U, GlobalTagtoGlobal (const Point3DBase< U, LocalTag > &lp) const
 
GlobalVector toGlobal (const LocalVector &lv) const
 
Vector3DBase< U, GlobalTagtoGlobal (const Vector3DBase< U, LocalTag > &lv) const
 
LocalPoint toLocal (const GlobalPoint &gp) const
 
Point3DBase< U, LocalTagtoLocal (const Point3DBase< U, GlobalTag > &gp) const
 
LocalVector toLocal (const GlobalVector &gv) const
 
Vector3DBase< U, LocalTagtoLocal (const Vector3DBase< U, GlobalTag > &gv) const
 
virtual ~GloballyPositioned ()
 
- Public Member Functions inherited from MagneticField
virtual MagneticFieldclone () const
 
GlobalVector inInverseGeV (const GlobalPoint &gp) const
 Field value ad specified global point, in 1/Gev. More...
 
GlobalVector inKGauss (const GlobalPoint &gp) const
 Field value ad specified global point, in KGauss. More...
 
virtual GlobalVector inTesla (const GlobalPoint &gp) const =0
 Field value ad specified global point, in Tesla. More...
 
virtual GlobalVector inTeslaUnchecked (const GlobalPoint &gp) const
 
virtual bool isDefined (const GlobalPoint &gp) const
 True if the point is within the region where the concrete field. More...
 
 MagneticField ()
 
int nominalValue () const
 The nominal field value for this map in kGauss. More...
 
virtual ~MagneticField ()
 

Public Attributes

std::string name
 

Private Attributes

std::vector< VolumeSidetheFaces
 
Scalar theInnerR
 
Scalar theOuterR
 
Scalar theZmax
 
Scalar theZmin
 

Additional Inherited Members

- Public Types inherited from MagVolume
typedef GloballyPositioned< float > Base
 
typedef GloballyPositioned
< float >::GlobalPoint 
GlobalPoint
 
typedef GloballyPositioned
< float >::GlobalVector 
GlobalVector
 
typedef GloballyPositioned
< float >::LocalPoint 
LocalPoint
 
typedef GloballyPositioned
< float >::LocalVector 
LocalVector
 
- Public Types inherited from GloballyPositioned< float >
typedef Point3DBase< float,
GlobalTag
GlobalPoint
 
typedef Vector3DBase< float,
GlobalTag
GlobalVector
 
typedef Point3DBase< float,
LocalTag
LocalPoint
 
typedef Vector3DBase< float,
LocalTag
LocalVector
 
typedef Point3DBase< float,
GlobalTag
PositionType
 
typedef TkRotation< float > RotationType
 
typedef float Scalar
 
- Static Public Member Functions inherited from GloballyPositioned< float >
static float iniEta ()
 
static float iniPhi ()
 

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 8 of file MagCylinder.cc.

References def, i, SurfaceOrientation::inner, SurfaceOrientation::outer, Cylinder::radius(), theInnerR, theOuterR, theZmax, theZmin, GloballyPositioned< float >::toLocal(), detailsBasic3DVector::z, SurfaceOrientation::zminus, and SurfaceOrientation::zplus.

13  : MagVolume(pos,rot,shape,mfp), theFaces(faces), theZmin(0.), theZmax(0.), theInnerR(0.), theOuterR(0.)
14 {
16 
17  unsigned int def = 0;
18  for (std::vector<VolumeSide>::const_iterator i=faces.begin(); i!= faces.end(); ++i) {
19  if (i->globalFace() == SurfaceOrientation::zminus) {
20  theZmin = MagVolume::toLocal( i->surface().position()).z();
21  ++def;
22  }
23  else if (i->globalFace() == SurfaceOrientation::zplus) {
24  theZmax = MagVolume::toLocal( i->surface().position()).z();
25  ++def;
26  }
27  else if (i->globalFace() == SurfaceOrientation::outer || i->globalFace() == SurfaceOrientation::inner) {
28  const Cylinder* cyl = dynamic_cast<const Cylinder*>(&(i->surface()));
29  if (cyl == 0) {
30  throw MagGeometryError("MagCylinder inner/outer surface is not a cylinder");
31  }
32  if (i->globalFace() == SurfaceOrientation::outer) theOuterR = cyl->radius();
33  else theInnerR = cyl->radius();
34  ++def;
35  }
36  }
37  if (def != faces.size()) {
38  throw MagGeometryError("MagCylinder constructed with wrong number/type of faces");
39  }
40 
41 }
int i
Definition: DBlmapReader.cc:9
Scalar theZmax
Definition: MagCylinder.h:37
virtual const std::vector< VolumeSide > & faces() const
Access to volume faces.
Definition: MagCylinder.h:27
double double double z
Scalar theInnerR
Definition: MagCylinder.h:38
Scalar radius() const
Radius of the cylinder.
Definition: Cylinder.h:55
LocalPoint toLocal(const GlobalPoint &gp) const
std::vector< VolumeSide > theFaces
Definition: MagCylinder.h:35
Scalar theOuterR
Definition: MagCylinder.h:39
MagVolume(const PositionType &pos, const RotationType &rot, DDSolidShape shape, const MagneticFieldProvider< float > *mfp, double sf=1.)
Definition: MagVolume.h:23
Scalar theZmin
Definition: MagCylinder.h:36
JetCorrectorParameters::Definitions def
Definition: classes.h:10

Member Function Documentation

virtual const std::vector<VolumeSide>& MagCylinder::faces ( ) const
inlinevirtual

Access to volume faces.

Implements MagVolume.

Definition at line 27 of file MagCylinder.h.

References theFaces.

27 {return theFaces;}
std::vector< VolumeSide > theFaces
Definition: MagCylinder.h:35
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().

44 {
45  return inside( toLocal(gp), tolerance);
46 }
LocalPoint toLocal(const GlobalPoint &gp) const
virtual bool inside(const GlobalPoint &gp, double tolerance=0.) const
Definition: MagCylinder.cc:43
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.

49 {
50  Scalar r( lp.perp());
51  return
52  lp.z() > theZmin - tolerance &&
53  lp.z() < theZmax + tolerance &&
54  r > theInnerR - tolerance &&
55  r < theOuterR + tolerance;
56 }
T perp() const
Definition: PV3DBase.h:71
Scalar theZmax
Definition: MagCylinder.h:37
Scalar theInnerR
Definition: MagCylinder.h:38
T z() const
Definition: PV3DBase.h:63
Scalar theOuterR
Definition: MagCylinder.h:39
Scalar theZmin
Definition: MagCylinder.h:36

Member Data Documentation

std::string MagCylinder::name
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().