CMS 3D CMS Logo

CylinderFromSectorMFGrid.cc
Go to the documentation of this file.
3 #include <iostream>
4 
6  double phiMin,
7  double phiMax,
8  MFGrid* sectorGrid)
9  : MFGrid(vol),
10  thePhiMin(phiMin),
11  thePhiMax(phiMax),
12  theSectorGrid(sectorGrid)
13 
14 {
15  if (thePhiMax < thePhiMin)
16  thePhiMax += 2.0 * Geom::pi();
18 }
19 
21 
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 }
40 
41 void CylinderFromSectorMFGrid::throwUp(const char* message) const {
42  std::cout << "Throwing exception " << message << std::endl;
43  throw MagGeometryError(message);
44 }
45 void CylinderFromSectorMFGrid::toGridFrame(const LocalPoint& p, double& a, double& b, double& c) const {
46  throwUp("Not implemented yet");
47 }
48 
50  throwUp("Not implemented yet");
51  return LocalPoint();
52 }
53 
55 
57  throwUp("Not implemented yet");
58  return LocalPoint();
59 }
60 
62  throwUp("Not implemented yet");
63  return LocalVector();
64 }
GloballyPositioned< float >
CylinderFromSectorMFGrid::nodeValue
LocalVector nodeValue(int i, int j, int k) const override
Field value at node.
Definition: CylinderFromSectorMFGrid.cc:61
mps_fire.i
i
Definition: mps_fire.py:428
CylinderFromSectorMFGrid::nodePosition
LocalPoint nodePosition(int i, int j, int k) const override
Position of node in local frame.
Definition: CylinderFromSectorMFGrid.cc:56
CylinderFromSectorMFGrid::toGridFrame
void toGridFrame(const LocalPoint &p, double &a, double &b, double &c) const override
find grid coordinates for point. For debugging and validation only.
Definition: CylinderFromSectorMFGrid.cc:45
CylinderFromSectorMFGrid::valueInTesla
LocalVector valueInTesla(const LocalPoint &p) const override
Interpolated field value at given point.
Definition: CylinderFromSectorMFGrid.cc:22
CylinderFromSectorMFGrid::dimensions
Dimensions dimensions() const override
Definition: CylinderFromSectorMFGrid.cc:54
MFGrid
Definition: MFGrid.h:27
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
MagExceptions.h
CylinderFromSectorMFGrid.h
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
dqmdumpme.k
k
Definition: dqmdumpme.py:60
b
double b
Definition: hdecay.h:118
CylinderFromSectorMFGrid::~CylinderFromSectorMFGrid
~CylinderFromSectorMFGrid() override
Definition: CylinderFromSectorMFGrid.cc:20
a
double a
Definition: hdecay.h:119
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
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
MFGrid::valueInTesla
LocalVector valueInTesla(const LocalPoint &p) const override=0
Interpolated field value at given point.
CylinderFromSectorMFGrid::fromGridFrame
LocalPoint fromGridFrame(double a, double b, double c) const override
find grid coordinates for point. For debugging and validation only.
Definition: CylinderFromSectorMFGrid.cc:49
Dimensions
Definition: MFGrid.h:15
CylinderFromSectorMFGrid::CylinderFromSectorMFGrid
CylinderFromSectorMFGrid(const GloballyPositioned< float > &vol, double phiMin, double phiMax, MFGrid *sectorGrid)
Definition: CylinderFromSectorMFGrid.cc:5