CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
PathToPlane2Order Class Reference

#include <PathToPlane2Order.h>

Public Types

typedef GloballyPositioned< ScalarFrame
 
typedef Plane::Scalar Scalar
 
typedef Basic3DVector< ScalarVector3D
 

Public Member Functions

std::pair< bool, double > operator() (const Plane &plane, const GlobalPoint &position, const GlobalVector &momentum, double charge, const PropagationDirection propDir=alongMomentum)
 
std::pair< bool, double > operator() (const Plane &plane, const Vector3D &position, const Vector3D &momentum, double charge, const PropagationDirection propDir=alongMomentum)
 
 PathToPlane2Order (const RKLocalFieldProvider &fld, const Frame *fieldFrame)
 

Private Attributes

const RKLocalFieldProvidertheField
 
const FrametheFieldFrame
 

Detailed Description

Definition at line 21 of file PathToPlane2Order.h.

Member Typedef Documentation

◆ Frame

Definition at line 25 of file PathToPlane2Order.h.

◆ Scalar

Definition at line 23 of file PathToPlane2Order.h.

◆ Vector3D

Definition at line 24 of file PathToPlane2Order.h.

Constructor & Destructor Documentation

◆ PathToPlane2Order()

PathToPlane2Order::PathToPlane2Order ( const RKLocalFieldProvider fld,
const Frame fieldFrame 
)
inline

Definition at line 27 of file PathToPlane2Order.h.

28  : theField(fld), theFieldFrame(fieldFrame) {}

Member Function Documentation

◆ operator()() [1/2]

std::pair<bool, double> PathToPlane2Order::operator() ( const Plane plane,
const GlobalPoint position,
const GlobalVector momentum,
double  charge,
const PropagationDirection  propDir = alongMomentum 
)
inline

◆ operator()() [2/2]

std::pair< bool, double > PathToPlane2Order::operator() ( const Plane plane,
const Vector3D position,
const Vector3D momentum,
double  charge,
const PropagationDirection  propDir = alongMomentum 
)

the position and momentum are local in the FieldFrame; the plane is in the global frame

Definition at line 8 of file PathToPlane2Order.cc.

12  {
13  // access to the field in field frame local coordinates
15 
16  // Frame::GlobalVector localZ = Frame::GlobalVector( B.unit()); // local Z along field
17  // transform field axis to global frame
18  Frame::GlobalVector localZ = theFieldFrame->toGlobal(Frame::LocalVector(B.unit())); // local Z along field
19 
20  Frame::GlobalVector localY = localZ.cross(Frame::GlobalVector(1, 0, 0));
21  if (localY.mag() < 0.1) {
22  localY = localZ.cross(Frame::GlobalVector(0, 1, 0)).unit();
23  } else {
24  localY = localY.unit();
25  }
26  Frame::GlobalVector localX = localY.cross(localZ);
27 
29  Frame::RotationType frot(localX, localY, localZ);
30  // frame in which the field is along Z
31  Frame frame(fpos, frot);
32 
33  // cout << "PathToPlane2Order frame " << frame.position() << endl << frame.rotation() << endl;
34 
35  // transform the position and direction to that frame
36  Frame::LocalPoint localPos = frame.toLocal(fpos); // same as LocalPoint(0,0,0)
37 
38  //transform momentum from field frame to new frame via global frame
40  Frame::LocalVector localMom = frame.toLocal(gmom);
41 
42  // transform the plane to the same frame
43  Plane localPlane = FrameChanger::transformPlane(plane, frame);
44  /*
45  cout << "PathToPlane2Order input plane " << plane.position() << endl
46  << plane.rotation() << endl;
47  cout << "PathToPlane2Order transformed plane " << localPlane->position() << endl
48  << localPlane->rotation() << endl;
49 */
50  double k = 2.99792458e-3;
51  double transverseMomentum = localMom.perp(); // transverse to the field
52  if (!(transverseMomentum != 0)) { // if (!(x!=0)) will trap both 0 and NaN
53  //LogDebug("PathToPlane2Order_ZeroMomentum") << "Momentum transverse to the field is zero or Nan (" << transverseMomentum << ")\n";
54  return std::pair<bool, double>(false, 0);
55  }
56  double curvature = -k * charge * B.mag() / transverseMomentum;
57  /*
58  cout << "PathToPlane2Order curvature " << curvature << endl;
59  cout << "transverseMomentum " << transverseMomentum << endl;
60  cout << "B.mag() " << B.mag() << endl;
61  cout << "localZ " << localZ << endl;
62  cout << "pos " << pos << endl;
63  cout << "momentum " << momentum << endl;
64  cout << "localPos " << localPos << endl;
65  cout << "localMom " << localMom << endl;
66 */
67  /*
68  cout << "PathToPlane2Order: local pos " << localPos << " mom " << localMom
69  << " curvature " << curvature << endl;
70  cout << "PathToPlane2Order: local plane pos " << localPlane->position()
71  << " normal " << localPlane->normalVector() << endl;
72 */
73  HelixArbitraryPlaneCrossing crossing(localPos.basicVector(), localMom.basicVector(), curvature, propDir);
74  std::pair<bool, double> res = crossing.pathLength(localPlane);
75 
76  return res;
77 }

References TtFullHadDaughter::B, PV3DBase< T, PVType, FrameType >::basicVector(), ALCARECOTkAlJpsiMuMu_cff::charge, Vector3DBase< T, FrameTag >::cross(), PixelRecoUtilities::curvature(), amptDefault_cfi::frame, RKLocalFieldProvider::inTesla(), dqmdumpme::k, phase1PixelTopology::localX(), phase1PixelTopology::localY(), PV3DBase< T, PVType, FrameType >::perp(), theField, theFieldFrame, GloballyPositioned< T >::toGlobal(), and FrameChanger::transformPlane().

Member Data Documentation

◆ theField

const RKLocalFieldProvider& PathToPlane2Order::theField
private

Definition at line 51 of file PathToPlane2Order.h.

Referenced by operator()().

◆ theFieldFrame

const Frame* PathToPlane2Order::theFieldFrame
private

Definition at line 52 of file PathToPlane2Order.h.

Referenced by operator()().

GloballyPositioned::LocalPoint
Point3DBase< T, LocalTag > LocalPoint
Definition: GloballyPositioned.h:24
PathToPlane2Order::Frame
GloballyPositioned< Scalar > Frame
Definition: PathToPlane2Order.h:25
phase1PixelTopology::localY
constexpr uint16_t localY(uint16_t py)
Definition: phase1PixelTopology.h:58
pos
Definition: PixelAliasList.h:18
RKLocalFieldProvider::inTesla
Vector inTesla(const LocalPoint &lp) const
the argument lp is in the local frame specified in the constructor
Definition: RKLocalFieldProvider.cc:11
PixelRecoUtilities::curvature
T curvature(T InversePt, const edm::EventSetup &iSetup)
Definition: PixelRecoUtilities.h:42
GloballyPositioned::GlobalVector
Vector3DBase< T, GlobalTag > GlobalVector
Definition: GloballyPositioned.h:25
GloballyPositioned::RotationType
TkRotation< T > RotationType
Definition: GloballyPositioned.h:22
PathToPlane2Order::operator()
std::pair< bool, double > operator()(const Plane &plane, const Vector3D &position, const Vector3D &momentum, double charge, const PropagationDirection propDir=alongMomentum)
Definition: PathToPlane2Order.cc:8
HelixArbitraryPlaneCrossing
Definition: HelixArbitraryPlaneCrossing.h:10
dqmdumpme.k
k
Definition: dqmdumpme.py:60
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
GloballyPositioned::LocalVector
Vector3DBase< T, LocalTag > LocalVector
Definition: GloballyPositioned.h:26
phase1PixelTopology::localX
constexpr uint16_t localX(uint16_t px)
Definition: phase1PixelTopology.h:49
FrameChanger::transformPlane
static Plane transformPlane(const Plane &plane, const GloballyPositioned< T > &frame)
Definition: FrameChanger.h:14
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
res
Definition: Electron.h:6
PV3DBase::basicVector
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
TtFullHadDaughter::B
static const std::string B
Definition: TtFullHadronicEvent.h:9
GloballyPositioned::PositionType
Point3DBase< T, GlobalTag > PositionType
Definition: GloballyPositioned.h:21
GloballyPositioned::toLocal
LocalPoint toLocal(const GlobalPoint &gp) const
Definition: GloballyPositioned.h:98
amptDefault_cfi.frame
frame
Definition: amptDefault_cfi.py:12
PathToPlane2Order::theField
const RKLocalFieldProvider & theField
Definition: PathToPlane2Order.h:51
Plane
Definition: Plane.h:16
PathToPlane2Order::theFieldFrame
const Frame * theFieldFrame
Definition: PathToPlane2Order.h:52
Basic3DVector
Definition: extBasic3DVector.h:30
GloballyPositioned::toGlobal
GlobalPoint toGlobal(const LocalPoint &lp) const
Definition: GloballyPositioned.h:66