CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CylinderFromSectorMFGrid.cc
Go to the documentation of this file.
3 #include <iostream>
4 
6  double phiMin, double phiMax,
7  MFGrid* sectorGrid) :
8  MFGrid(vol), thePhiMin(phiMin), thePhiMax(phiMax), theSectorGrid( sectorGrid)
9 
10 {
11  if (thePhiMax < thePhiMin) thePhiMax += 2.0*Geom::pi();
13 }
14 
16 {
17  delete theSectorGrid;
18 }
19 
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 }
38 
40 {
41  std::cout << "Throwing exception " << message << std::endl;
42  throw MagGeometryError(message);
43 }
44 void CylinderFromSectorMFGrid::toGridFrame( const LocalPoint& p, double& a, double& b, double& c) const
45 {
46  throwUp("Not implemented yet");
47 }
48 
50 {
51  throwUp("Not implemented yet");
52  return LocalPoint();
53 }
54 
56 {return theSectorGrid->dimensions();}
57 
59 {
60  throwUp("Not implemented yet");
61  return LocalPoint();
62 }
63 
65 {
66  throwUp("Not implemented yet");
67  return LocalVector();
68 }
int i
Definition: DBlmapReader.cc:9
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
virtual LocalVector nodeValue(int i, int j, int k) const
Field value at node.
GloballyPositioned< float >::LocalPoint LocalPoint
Definition: MFGrid.h:34
void throwUp(const char *message) const
virtual LocalPoint fromGridFrame(double a, double b, double c) const
find grid coordinates for point. For debugging and validation only.
CylinderFromSectorMFGrid(const GloballyPositioned< float > &vol, double phiMin, double phiMax, MFGrid *sectorGrid)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
virtual Dimensions dimensions() const =0
int j
Definition: DBlmapReader.cc:9
virtual Dimensions dimensions() const
virtual LocalPoint nodePosition(int i, int j, int k) const
Position of node in local frame.
virtual LocalVector valueInTesla(const LocalPoint &p) const =0
Interpolated field value at given point.
virtual void toGridFrame(const LocalPoint &p, double &a, double &b, double &c) const
find grid coordinates for point. For debugging and validation only.
double b
Definition: hdecay.h:120
Definition: MFGrid.h:29
GloballyPositioned< float >::LocalVector LocalVector
Definition: MFGrid.h:35
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
virtual LocalVector valueInTesla(const LocalPoint &p) const
Interpolated field value at given point.
double pi()
Definition: Pi.h:31
double a
Definition: hdecay.h:121
tuple cout
Definition: gather_cfg.py:121