CMS 3D CMS Logo

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

#include <CylinderFromSectorMFGrid.h>

Inheritance diagram for CylinderFromSectorMFGrid:
MFGrid MagneticFieldProvider< float >

Public Member Functions

 CylinderFromSectorMFGrid (const GloballyPositioned< float > &vol, double phiMin, double phiMax, MFGrid *sectorGrid)
 
virtual Dimensions dimensions () const
 
virtual LocalPoint fromGridFrame (double a, double b, double c) const
 find grid coordinates for point. For debugging and validation only. More...
 
virtual LocalPoint nodePosition (int i, int j, int k) const
 Position of node in local frame. More...
 
virtual LocalVector nodeValue (int i, int j, int k) const
 Field value at node. More...
 
virtual void toGridFrame (const LocalPoint &p, double &a, double &b, double &c) const
 find grid coordinates for point. For debugging and validation only. More...
 
virtual LocalVector valueInTesla (const LocalPoint &p) const
 Interpolated field value at given point. More...
 
 ~CylinderFromSectorMFGrid ()
 
- Public Member Functions inherited from MFGrid
virtual void dump () const
 
const GloballyPositioned< float > & frame () const
 Local reference frame. More...
 
virtual Indexes index (const LocalPoint &p) const
 
 MFGrid (const GloballyPositioned< float > &vol)
 
virtual ~MFGrid ()
 
- Public Member Functions inherited from MagneticFieldProvider< float >
virtual LocalVectorType derivativeInTeslaPerMeter (const LocalPointType &p, int N) const
 
virtual int hasDerivatives () const
 
virtual LocalVectorType valueInTesla (const LocalPointType &p) const =0
 
virtual ~MagneticFieldProvider ()
 

Private Member Functions

void throwUp (const char *message) const
 

Private Attributes

double theDelta
 
double thePhiMax
 
double thePhiMin
 
MFGridtheSectorGrid
 

Additional Inherited Members

- Public Types inherited from MFGrid
typedef GloballyPositioned
< float >::GlobalPoint 
GlobalPoint
 
typedef GloballyPositioned
< float >::GlobalVector 
GlobalVector
 
typedef GloballyPositioned
< float >::LocalPoint 
LocalPoint
 
typedef GloballyPositioned
< float >::LocalVector 
LocalVector
 
- Public Types inherited from MagneticFieldProvider< float >
typedef Point3DBase< float,
GlobalTag
GlobalPointType
 
typedef Vector3DBase< float,
GlobalTag
GlobalVectorType
 
typedef Point3DBase< float,
LocalTag
LocalPointType
 
typedef Vector3DBase< float,
LocalTag
LocalVectorType
 

Detailed Description

Definition at line 7 of file CylinderFromSectorMFGrid.h.

Constructor & Destructor Documentation

CylinderFromSectorMFGrid::CylinderFromSectorMFGrid ( const GloballyPositioned< float > &  vol,
double  phiMin,
double  phiMax,
MFGrid sectorGrid 
)

Definition at line 5 of file CylinderFromSectorMFGrid.cc.

References Geom::pi(), theDelta, thePhiMax, and thePhiMin.

7  :
8  MFGrid(vol), thePhiMin(phiMin), thePhiMax(phiMax), theSectorGrid( sectorGrid)
9 
10 {
11  if (thePhiMax < thePhiMin) thePhiMax += 2.0*Geom::pi();
13 }
MFGrid(const GloballyPositioned< float > &vol)
Definition: MFGrid.h:39
double pi()
Definition: Pi.h:31
CylinderFromSectorMFGrid::~CylinderFromSectorMFGrid ( )

Definition at line 15 of file CylinderFromSectorMFGrid.cc.

References theSectorGrid.

16 {
17  delete theSectorGrid;
18 }

Member Function Documentation

Dimensions CylinderFromSectorMFGrid::dimensions ( void  ) const
virtual

Implements MFGrid.

Definition at line 55 of file CylinderFromSectorMFGrid.cc.

References MFGrid::dimensions(), and theSectorGrid.

56 {return theSectorGrid->dimensions();}
virtual Dimensions dimensions() const =0
MFGrid::LocalPoint CylinderFromSectorMFGrid::fromGridFrame ( double  a,
double  b,
double  c 
) const
virtual

find grid coordinates for point. For debugging and validation only.

Implements MFGrid.

Definition at line 49 of file CylinderFromSectorMFGrid.cc.

References throwUp().

50 {
51  throwUp("Not implemented yet");
52  return LocalPoint();
53 }
GloballyPositioned< float >::LocalPoint LocalPoint
Definition: MFGrid.h:36
void throwUp(const char *message) const
MFGrid::LocalPoint CylinderFromSectorMFGrid::nodePosition ( int  i,
int  j,
int  k 
) const
virtual

Position of node in local frame.

Implements MFGrid.

Definition at line 58 of file CylinderFromSectorMFGrid.cc.

References throwUp().

59 {
60  throwUp("Not implemented yet");
61  return LocalPoint();
62 }
GloballyPositioned< float >::LocalPoint LocalPoint
Definition: MFGrid.h:36
void throwUp(const char *message) const
MFGrid::LocalVector CylinderFromSectorMFGrid::nodeValue ( int  i,
int  j,
int  k 
) const
virtual

Field value at node.

Implements MFGrid.

Definition at line 64 of file CylinderFromSectorMFGrid.cc.

References throwUp().

65 {
66  throwUp("Not implemented yet");
67  return LocalVector();
68 }
void throwUp(const char *message) const
GloballyPositioned< float >::LocalVector LocalVector
Definition: MFGrid.h:37
void CylinderFromSectorMFGrid::throwUp ( const char *  message) const
private

Definition at line 39 of file CylinderFromSectorMFGrid.cc.

References gather_cfg::cout.

Referenced by fromGridFrame(), nodePosition(), nodeValue(), and toGridFrame().

40 {
41  std::cout << "Throwing exception " << message << std::endl;
43 }
tuple cout
Definition: gather_cfg.py:121
void CylinderFromSectorMFGrid::toGridFrame ( const LocalPoint p,
double &  a,
double &  b,
double &  c 
) const
virtual

find grid coordinates for point. For debugging and validation only.

Implements MFGrid.

Definition at line 44 of file CylinderFromSectorMFGrid.cc.

References throwUp().

45 {
46  throwUp("Not implemented yet");
47 }
void throwUp(const char *message) const
MFGrid::LocalVector CylinderFromSectorMFGrid::valueInTesla ( const LocalPoint p) const
virtual

Interpolated field value at given point.

Implements MFGrid.

Definition at line 20 of file CylinderFromSectorMFGrid.cc.

References trackerHits::c, funct::cos(), phi, alignCSCRings::s, funct::sin(), theDelta, thePhiMin, theSectorGrid, tmp, and MFGrid::valueInTesla().

21 {
22  double phi = p.phi();
23  if (phi < thePhiMax && phi > thePhiMin) return theSectorGrid->valueInTesla(p);
24  else {
25  double phiRot = floor((phi-thePhiMin)/theDelta) * theDelta;
26  double c = cos(phiRot);
27  double s = sin(phiRot);
28  double xrot = p.x()*c + p.y()*s;
29  double yrot = -p.x()*s + p.y()*c;
30 
31  // get field in interpolation sector
33 
34  // rotate field back to original sector
35  return MFGrid::LocalVector( tmp.x()*c - tmp.y()*s, tmp.x()*s + tmp.y()*c, tmp.z());
36  }
37 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T y() const
Definition: PV3DBase.h:63
GloballyPositioned< float >::LocalPoint LocalPoint
Definition: MFGrid.h:36
T z() const
Definition: PV3DBase.h:64
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
virtual LocalVector valueInTesla(const LocalPoint &p) const =0
Interpolated field value at given point.
GloballyPositioned< float >::LocalVector LocalVector
Definition: MFGrid.h:37
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
T x() const
Definition: PV3DBase.h:62
Definition: DDAxes.h:10

Member Data Documentation

double CylinderFromSectorMFGrid::theDelta
private

Definition at line 33 of file CylinderFromSectorMFGrid.h.

Referenced by CylinderFromSectorMFGrid(), and valueInTesla().

double CylinderFromSectorMFGrid::thePhiMax
private

Definition at line 31 of file CylinderFromSectorMFGrid.h.

Referenced by CylinderFromSectorMFGrid().

double CylinderFromSectorMFGrid::thePhiMin
private

Definition at line 30 of file CylinderFromSectorMFGrid.h.

Referenced by CylinderFromSectorMFGrid(), and valueInTesla().

MFGrid* CylinderFromSectorMFGrid::theSectorGrid
private

Definition at line 32 of file CylinderFromSectorMFGrid.h.

Referenced by dimensions(), valueInTesla(), and ~CylinderFromSectorMFGrid().