#include <TrackPropagation/RungeKutta/interface/PathToPlane2Order.h>
Public Types | |
typedef GloballyPositioned < Scalar > | Frame |
typedef Plane::Scalar | Scalar |
typedef Basic3DVector< Scalar > | Vector3D |
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) |
the position and momentum are local in the FieldFrame; the plane is in the global frame | |
PathToPlane2Order (const RKLocalFieldProvider &fld, const Frame *fieldFrame) | |
Private Attributes | |
const RKLocalFieldProvider & | theField |
const Frame * | theFieldFrame |
Definition at line 20 of file PathToPlane2Order.h.
Definition at line 25 of file PathToPlane2Order.h.
Definition at line 23 of file PathToPlane2Order.h.
Definition at line 24 of file PathToPlane2Order.h.
PathToPlane2Order::PathToPlane2Order | ( | const RKLocalFieldProvider & | fld, | |
const Frame * | fieldFrame | |||
) | [inline] |
Definition at line 27 of file PathToPlane2Order.h.
00027 : 00028 theField(fld), theFieldFrame(fieldFrame) {}
std::pair<bool,double> PathToPlane2Order::operator() | ( | const Plane & | plane, | |
const GlobalPoint & | position, | |||
const GlobalVector & | momentum, | |||
double | charge, | |||
const PropagationDirection | propDir = alongMomentum | |||
) | [inline] |
Definition at line 38 of file PathToPlane2Order.h.
References PV3DBase< T, PVType, FrameType >::basicVector(), operator()(), theFieldFrame, and GloballyPositioned< T >::toLocal().
00042 { 00043 return operator()( plane, theFieldFrame->toLocal(position).basicVector(), 00044 theFieldFrame->toLocal(momentum).basicVector(), charge, propDir); 00045 }
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 9 of file PathToPlane2Order.cc.
References PV3DBase< T, PVType, FrameType >::basicVector(), Vector3DBase< T, FrameTag >::cross(), PixelRecoUtilities::curvature(), RKLocalFieldProvider::inTesla(), k, PV3DBase< T, PVType, FrameType >::mag(), Basic3DVector< T >::mag(), PV3DBase< T, PVType, FrameType >::perp(), res, theField, theFieldFrame, GloballyPositioned< T >::toGlobal(), GloballyPositioned< T >::toLocal(), FrameChanger::transformPlane(), Basic3DVector< T >::unit(), Vector3DBase< T, FrameTag >::unit(), Basic3DVector< T >::x(), Basic3DVector< T >::y(), and Basic3DVector< T >::z().
Referenced by operator()().
00014 { 00015 // access to the field in field frame local coordinates 00016 RKLocalFieldProvider::Vector B = theField.inTesla( pos.x(), pos.y(), pos.z()); 00017 00018 // Frame::GlobalVector localZ = Frame::GlobalVector( B.unit()); // local Z along field 00019 // transform field axis to global frame 00020 Frame::GlobalVector localZ = theFieldFrame->toGlobal( Frame::LocalVector( B.unit())); // local Z along field 00021 00022 Frame::GlobalVector localY = localZ.cross( Frame::GlobalVector( 1,0,0)); 00023 if (localY.mag() < 0.1) { 00024 localY = localZ.cross( Frame::GlobalVector(0,1,0)).unit(); 00025 } 00026 else { 00027 localY = localY.unit(); 00028 } 00029 Frame::GlobalVector localX = localY.cross(localZ); 00030 00031 00032 Frame::PositionType fpos( theFieldFrame->toGlobal( Frame::LocalPoint(pos))); 00033 Frame::RotationType frot( localX, localY, localZ); 00034 // frame in which the field is along Z 00035 Frame frame( fpos, frot); 00036 00037 // cout << "PathToPlane2Order frame " << frame.position() << endl << frame.rotation() << endl; 00038 00039 // transform the position and direction to that frame 00040 Frame::LocalPoint localPos = frame.toLocal( fpos); // same as LocalPoint(0,0,0) 00041 00042 //transform momentum from field frame to new frame via global frame 00043 Frame::GlobalVector gmom( theFieldFrame->toGlobal( Frame::LocalVector(momentum))); 00044 Frame::LocalVector localMom = frame.toLocal( gmom); 00045 00046 // transform the plane to the same frame 00047 FrameChanger changer; 00048 FrameChanger::PlanePtr localPlane = changer.transformPlane( plane, frame); 00049 /* 00050 cout << "PathToPlane2Order input plane " << plane.position() << endl 00051 << plane.rotation() << endl; 00052 cout << "PathToPlane2Order transformed plane " << localPlane->position() << endl 00053 << localPlane->rotation() << endl; 00054 */ 00055 double k = 2.99792458e-3; 00056 double transverseMomentum = localMom.perp(); // transverse to the field 00057 double curvature = -k * charge * B.mag() / transverseMomentum; 00058 /* 00059 cout << "PathToPlane2Order curvature " << curvature << endl; 00060 cout << "transverseMomentum " << transverseMomentum << endl; 00061 cout << "B.mag() " << B.mag() << endl; 00062 cout << "localZ " << localZ << endl; 00063 cout << "pos " << pos << endl; 00064 cout << "momentum " << momentum << endl; 00065 cout << "localPos " << localPos << endl; 00066 cout << "localMom " << localMom << endl; 00067 */ 00068 /* 00069 cout << "PathToPlane2Order: local pos " << localPos << " mom " << localMom 00070 << " curvature " << curvature << endl; 00071 cout << "PathToPlane2Order: local plane pos " << localPlane->position() 00072 << " normal " << localPlane->normalVector() << endl; 00073 */ 00074 HelixArbitraryPlaneCrossing crossing( localPos.basicVector(), localMom.basicVector(), 00075 curvature, propDir); 00076 std::pair<bool,double> res = crossing.pathLength(*localPlane); 00077 00078 return res; 00079 }
const RKLocalFieldProvider& PathToPlane2Order::theField [private] |
const Frame* PathToPlane2Order::theFieldFrame [private] |