#include <RecoTracker/TkSeedGenerator/interface/FastHelix.h>
Public Member Functions | |
FastHelix (const GlobalPoint &outerHit, const GlobalPoint &middleHit, const GlobalPoint &aVertex, const edm::EventSetup &iSetup) | |
FTS | helixStateAtVertex () const |
bool | isValid () const |
FTS | stateAtVertex () const |
FTS | straightLineStateAtVertex () const |
~FastHelix () | |
Private Types | |
typedef FreeTrajectoryState | FTS |
Private Attributes | |
edm::ESHandle< MagneticField > | pSetup |
GlobalVector | tesla0 |
FastCircle | theCircle |
GlobalPoint | theMiddleHit |
GlobalPoint | theOuterHit |
GlobalPoint | theVertex |
It is used e.g. by a seed generator.
21.02.2001: Old FastHelix is now called FastHelixFit. Replace FastLineFit by FastLine (z0, dz/drphi calculated without vertex and errors) 14.02.2001: Replace general Circle by FastCircle. 13.02.2001: LinearFitErrorsInTwoCoordinates replaced by FastLineFit 29.11.2000: (Pascal Vanlaer) Modification of calculation of sign of px,py and change in calculation of pz, z0. 29.11.2000: (Matthias Winkler) Split stateAtVertex() in two parts (Circle is valid or not): helixStateAtVertex() and straightLineStateAtVertex()
Definition at line 31 of file FastHelix.h.
typedef FreeTrajectoryState FastHelix::FTS [private] |
Definition at line 35 of file FastHelix.h.
FastHelix::FastHelix | ( | const GlobalPoint & | outerHit, | |
const GlobalPoint & | middleHit, | |||
const GlobalPoint & | aVertex, | |||
const edm::EventSetup & | iSetup | |||
) |
Definition at line 9 of file FastHelix.cc.
References edm::EventSetup::get(), pSetup, and tesla0.
00012 : theOuterHit(outerHit), 00013 theMiddleHit(middleHit), 00014 theVertex(aVertex), 00015 theCircle(outerHit, 00016 middleHit, 00017 aVertex) { 00018 00019 iSetup.get<IdealMagneticFieldRecord>().get(pSetup); 00020 tesla0=pSetup->inTesla(GlobalPoint(0,0,0)); 00021 }
FastHelix::~FastHelix | ( | ) | [inline] |
FreeTrajectoryState FastHelix::helixStateAtVertex | ( | ) | const |
Definition at line 32 of file FastHelix.cc.
References funct::C, pSetup, FastCircle::rho(), rho, pydbsAccessor::root, funct::sqrt(), tesla0, theCircle, theMiddleHit, theOuterHit, theVertex, v, PV3DBase< T, PVType, FrameType >::x(), FastCircle::x0(), PV3DBase< T, PVType, FrameType >::y(), FastCircle::y0(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by stateAtVertex().
00032 { 00033 00034 GlobalPoint pMid(theMiddleHit); 00035 GlobalPoint v(theVertex); 00036 00037 double dydx = 0.; 00038 double pt = 0., px = 0., py = 0.; 00039 00040 //remember (radius rho in cm): 00041 //rho = 00042 //100. * pt * 00043 //(10./(3.*MagneticField::inTesla(GlobalPoint(0., 0., 0.)).z())); 00044 00045 double rho = theCircle.rho(); 00046 // pt = 0.01 * rho * (0.3*MagneticField::inTesla(GlobalPoint(0.,0.,0.)).z()); 00047 pt = 0.01 * rho * (0.3*tesla0.z()); 00048 // pt = 0.01 * rho * (0.3*GlobalPoint(0.,0.,0.).MagneticField().z()); 00049 00050 // (py/px)|x=v.x() = (dy/dx)|x=v.x() 00051 //remember: 00052 //y(x) = +-sqrt(rho^2 - (x-x0)^2) + y0 00053 //y(x) = sqrt(rho^2 - (x-x0)^2) + y0 if y(x) >= y0 00054 //y(x) = -sqrt(rho^2 - (x-x0)^2) + y0 if y(x) < y0 00055 //=> (dy/dx) = -(x-x0)/sqrt(Q) if y(x) >= y0 00056 // (dy/dx) = (x-x0)/sqrt(Q) if y(x) < y0 00057 //with Q = rho^2 - (x-x0)^2 00058 double root = sqrt(rho*rho - (v.x()-theCircle.x0())*(v.x()-theCircle.x0())); 00059 if((v.y() - theCircle.y0()) > 0.) 00060 dydx = -(v.x() - theCircle.x0()) / root; 00061 else 00062 dydx = (v.x() - theCircle.x0()) / root; 00063 00064 px = pt/sqrt(1. + dydx*dydx); 00065 py = px*dydx; 00066 // check sign with scalar product 00067 if(px*(pMid.x() - v.x()) + py*(pMid.y() - v.y()) < 0.) { 00068 px *= -1.; 00069 py *= -1.; 00070 } 00071 00072 //calculate z0, pz 00073 //(z, R*phi) linear relation in a helix 00074 //with R, phi defined as radius and angle w.r.t. centre of circle 00075 //in transverse plane 00076 //pz = pT*(dz/d(R*phi))) 00077 00078 FastLine flfit(theOuterHit, theMiddleHit, theCircle.rho()); 00079 double z_0 = -flfit.c()/flfit.n2(); 00080 double dzdrphi = -flfit.n1()/flfit.n2(); 00081 double pz = pt*dzdrphi; 00082 00083 //get sign of particle 00084 00085 00086 00087 GlobalVector magvtx=pSetup->inTesla(v); 00088 TrackCharge q = 00089 ((theCircle.x0()*py - theCircle.y0()*px) / 00090 (magvtx.z()) < 0.) ? 00091 -1 : 1; 00092 00093 AlgebraicSymMatrix C(5,1); 00094 //MP 00095 FTS atVertex = FTS(GlobalTrajectoryParameters(GlobalPoint(v.x(), v.y(), z_0), 00096 GlobalVector(px, py, pz), 00097 q, 00098 &(*pSetup)), 00099 CurvilinearTrajectoryError(C)); 00100 00101 00102 00103 return atVertex; 00104 }
Definition at line 46 of file FastHelix.h.
References FastCircle::isValid(), and theCircle.
Referenced by ElectronSiStripSeedGenerator::checkHitsAndTSOS(), RoadSearchTrackCandidateMakerAlgorithm::initialTrajectory(), RoadSearchTrackCandidateMakerAlgorithm::initialTrajectoryFromTriplet(), and stateAtVertex().
FreeTrajectoryState FastHelix::stateAtVertex | ( | ) | const |
Definition at line 23 of file FastHelix.cc.
References e, helixStateAtVertex(), isValid(), straightLineStateAtVertex(), tesla0, and PV3DBase< T, PVType, FrameType >::z().
Referenced by ElectronSiStripSeedGenerator::checkHitsAndTSOS(), SeedFromConsecutiveHits::construct(), ElectronSiStripSeedGenerator::findSeedsFromCluster(), RoadSearchTrackCandidateMakerAlgorithm::initialTrajectory(), RoadSearchTrackCandidateMakerAlgorithm::initialTrajectoryFromTriplet(), SimpleCosmicBONSeeder::pqFromHelixFit(), ConvBremSeedProducer::produce(), SeedFromGenericPairOrTriplet::seedFromTriplet(), and SeedGeneratorForCosmics::seeds().
00023 { 00024 00025 if(isValid() && (fabs(tesla0.z()) > 1e-3)) 00026 return helixStateAtVertex(); 00027 else 00028 return straightLineStateAtVertex(); 00029 00030 }
FreeTrajectoryState FastHelix::straightLineStateAtVertex | ( | ) | const |
Definition at line 106 of file FastHelix.cc.
References funct::C, FastLine::c(), FastLine::n1(), FastCircle::n1(), FastLine::n2(), FastCircle::n2(), funct::sqrt(), theCircle, theMiddleHit, theOuterHit, theVertex, v, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().
Referenced by stateAtVertex().
00106 { 00107 00108 //calculate FTS assuming straight line... 00109 00110 GlobalPoint pMid(theMiddleHit); 00111 GlobalPoint v(theVertex); 00112 00113 double dydx = 0.; 00114 double pt = 0., px = 0., py = 0.; 00115 00116 if(fabs(theCircle.n1()) > 0. || fabs(theCircle.n2()) > 0.) 00117 pt = 1.e+4;// 10 TeV //else no pt 00118 if(fabs(theCircle.n2()) > 0.) { 00119 dydx = -theCircle.n1()/theCircle.n2(); //else px = 0 00120 } 00121 px = pt/sqrt(1. + dydx*dydx); 00122 py = px*dydx; 00123 // check sign with scalar product 00124 if (px*(pMid.x() - v.x()) + py*(pMid.y() - v.y()) < 0.) { 00125 px *= -1.; 00126 py *= -1.; 00127 } 00128 00129 //calculate z_0 and pz at vertex using weighted mean 00130 //z = z(r) = z0 + (dz/dr)*r 00131 //tan(theta) = dr/dz = (dz/dr)^-1 00132 //theta = atan(1./dzdr) 00133 //p = pt/sin(theta) 00134 //pz = p*cos(theta) = pt/tan(theta) 00135 00136 FastLine flfit(theOuterHit, theMiddleHit); 00137 double z_0 = -flfit.c()/flfit.n2(); 00138 double dzdr = -flfit.n1()/flfit.n2(); 00139 double pz = pt*dzdr; 00140 00141 TrackCharge q = 1; 00142 AlgebraicSymMatrix66 C = AlgebraicMatrixID(); 00143 //MP 00144 FTS atVertex = FTS(GlobalTrajectoryParameters(GlobalPoint(v.x(), v.y(), z_0), 00145 GlobalVector(px, py, pz), 00146 q, 00147 &(*pSetup)), 00148 CartesianTrajectoryError()); 00149 00150 return atVertex; 00151 }
edm::ESHandle<MagneticField> FastHelix::pSetup [private] |
GlobalVector FastHelix::tesla0 [private] |
Definition at line 61 of file FastHelix.h.
Referenced by FastHelix(), helixStateAtVertex(), and stateAtVertex().
FastCircle FastHelix::theCircle [private] |
Definition at line 59 of file FastHelix.h.
Referenced by helixStateAtVertex(), isValid(), and straightLineStateAtVertex().
GlobalPoint FastHelix::theMiddleHit [private] |
Definition at line 57 of file FastHelix.h.
Referenced by helixStateAtVertex(), and straightLineStateAtVertex().
GlobalPoint FastHelix::theOuterHit [private] |
Definition at line 56 of file FastHelix.h.
Referenced by helixStateAtVertex(), and straightLineStateAtVertex().
GlobalPoint FastHelix::theVertex [private] |
Definition at line 58 of file FastHelix.h.
Referenced by helixStateAtVertex(), and straightLineStateAtVertex().