CMS 3D CMS Logo

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)
 
Dimensions dimensions () const override
 
LocalPoint fromGridFrame (double a, double b, double c) const override
 find grid coordinates for point. For debugging and validation only. More...
 
LocalPoint nodePosition (int i, int j, int k) const override
 Position of node in local frame. More...
 
LocalVector nodeValue (int i, int j, int k) const override
 Field value at node. More...
 
void toGridFrame (const LocalPoint &p, double &a, double &b, double &c) const override
 find grid coordinates for point. For debugging and validation only. More...
 
LocalVector valueInTesla (const LocalPoint &p) const override
 Interpolated field value at given point. More...
 
 ~CylinderFromSectorMFGrid () override
 
- 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)
 
 ~MFGrid () override
 
- 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, GlobalTagGlobalPointType
 
typedef Vector3DBase< float, GlobalTagGlobalVectorType
 
typedef Point3DBase< float, LocalTagLocalPointType
 
typedef Vector3DBase< float, LocalTagLocalVectorType
 

Detailed Description

Definition at line 7 of file CylinderFromSectorMFGrid.h.

Constructor & Destructor Documentation

◆ CylinderFromSectorMFGrid()

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

Definition at line 5 of file CylinderFromSectorMFGrid.cc.

9  : MFGrid(vol),
12  theSectorGrid(sectorGrid)
13 
14 {
15  if (thePhiMax < thePhiMin)
16  thePhiMax += 2.0 * Geom::pi();
18 }

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

◆ ~CylinderFromSectorMFGrid()

CylinderFromSectorMFGrid::~CylinderFromSectorMFGrid ( )
override

Definition at line 20 of file CylinderFromSectorMFGrid.cc.

20 { delete theSectorGrid; }

References theSectorGrid.

Member Function Documentation

◆ dimensions()

Dimensions CylinderFromSectorMFGrid::dimensions ( void  ) const
overridevirtual

Implements MFGrid.

Definition at line 54 of file CylinderFromSectorMFGrid.cc.

54 { return theSectorGrid->dimensions(); }

References MFGrid::dimensions(), and theSectorGrid.

◆ fromGridFrame()

MFGrid::LocalPoint CylinderFromSectorMFGrid::fromGridFrame ( double  a,
double  b,
double  c 
) const
overridevirtual

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

Implements MFGrid.

Definition at line 49 of file CylinderFromSectorMFGrid.cc.

49  {
50  throwUp("Not implemented yet");
51  return LocalPoint();
52 }

References throwUp().

◆ nodePosition()

MFGrid::LocalPoint CylinderFromSectorMFGrid::nodePosition ( int  i,
int  j,
int  k 
) const
overridevirtual

Position of node in local frame.

Implements MFGrid.

Definition at line 56 of file CylinderFromSectorMFGrid.cc.

56  {
57  throwUp("Not implemented yet");
58  return LocalPoint();
59 }

References throwUp().

◆ nodeValue()

MFGrid::LocalVector CylinderFromSectorMFGrid::nodeValue ( int  i,
int  j,
int  k 
) const
overridevirtual

Field value at node.

Implements MFGrid.

Definition at line 61 of file CylinderFromSectorMFGrid.cc.

61  {
62  throwUp("Not implemented yet");
63  return LocalVector();
64 }

References throwUp().

◆ throwUp()

void CylinderFromSectorMFGrid::throwUp ( const char *  message) const
private

Definition at line 41 of file CylinderFromSectorMFGrid.cc.

41  {
42  std::cout << "Throwing exception " << message << std::endl;
43  throw MagGeometryError(message);
44 }

References gather_cfg::cout.

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

◆ toGridFrame()

void CylinderFromSectorMFGrid::toGridFrame ( const LocalPoint p,
double &  a,
double &  b,
double &  c 
) const
overridevirtual

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

Implements MFGrid.

Definition at line 45 of file CylinderFromSectorMFGrid.cc.

45  {
46  throwUp("Not implemented yet");
47 }

References throwUp().

◆ valueInTesla()

MFGrid::LocalVector CylinderFromSectorMFGrid::valueInTesla ( const LocalPoint p) const
overridevirtual

Interpolated field value at given point.

Implements MFGrid.

Definition at line 22 of file CylinderFromSectorMFGrid.cc.

22  {
23  double phi = p.phi();
24  if (phi < thePhiMax && phi > thePhiMin)
25  return theSectorGrid->valueInTesla(p);
26  else {
27  double phiRot = floor((phi - thePhiMin) / theDelta) * theDelta;
28  double c = cos(phiRot);
29  double s = sin(phiRot);
30  double xrot = p.x() * c + p.y() * s;
31  double yrot = -p.x() * s + p.y() * c;
32 
33  // get field in interpolation sector
35 
36  // rotate field back to original sector
37  return MFGrid::LocalVector(tmp.x() * c - tmp.y() * s, tmp.x() * s + tmp.y() * c, tmp.z());
38  }
39 }

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

Member Data Documentation

◆ theDelta

double CylinderFromSectorMFGrid::theDelta
private

Definition at line 29 of file CylinderFromSectorMFGrid.h.

Referenced by CylinderFromSectorMFGrid(), and valueInTesla().

◆ thePhiMax

double CylinderFromSectorMFGrid::thePhiMax
private

Definition at line 27 of file CylinderFromSectorMFGrid.h.

Referenced by CylinderFromSectorMFGrid().

◆ thePhiMin

double CylinderFromSectorMFGrid::thePhiMin
private

Definition at line 26 of file CylinderFromSectorMFGrid.h.

Referenced by CylinderFromSectorMFGrid(), and valueInTesla().

◆ theSectorGrid

MFGrid* CylinderFromSectorMFGrid::theSectorGrid
private

Definition at line 28 of file CylinderFromSectorMFGrid.h.

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

gather_cfg.cout
cout
Definition: gather_cfg.py:144
MFGrid::LocalVector
GloballyPositioned< float >::LocalVector LocalVector
Definition: MFGrid.h:32
CylinderFromSectorMFGrid::theDelta
double theDelta
Definition: CylinderFromSectorMFGrid.h:29
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
CylinderFromSectorMFGrid::thePhiMax
double thePhiMax
Definition: CylinderFromSectorMFGrid.h:27
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
alignCSCRings.s
s
Definition: alignCSCRings.py:92
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
CylinderFromSectorMFGrid::theSectorGrid
MFGrid * theSectorGrid
Definition: CylinderFromSectorMFGrid.h:28
AlignmentTrackSelector_cfi.phiMin
phiMin
Definition: AlignmentTrackSelector_cfi.py:18
AlignmentTrackSelector_cfi.phiMax
phiMax
Definition: AlignmentTrackSelector_cfi.py:17
Geom::pi
constexpr double pi()
Definition: Pi.h:31
MFGrid::LocalPoint
GloballyPositioned< float >::LocalPoint LocalPoint
Definition: MFGrid.h:31
CylinderFromSectorMFGrid::throwUp
void throwUp(const char *message) const
Definition: CylinderFromSectorMFGrid.cc:41
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CylinderFromSectorMFGrid::thePhiMin
double thePhiMin
Definition: CylinderFromSectorMFGrid.h:26
DDAxes::phi
MagGeometryError
Definition: MagExceptions.h:18
MFGrid::dimensions
virtual Dimensions dimensions() const =0
MFGrid::MFGrid
MFGrid(const GloballyPositioned< float > &vol)
Definition: MFGrid.h:34
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
MFGrid::valueInTesla
LocalVector valueInTesla(const LocalPoint &p) const override=0
Interpolated field value at given point.