CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PixelTrackFilterByKinematics.cc
Go to the documentation of this file.
4 
6 
7 template <class T> T sqr( T t) {return t*t;}
8 
9 #include <iostream>
10 
12  : thePtMin( cfg.getParameter<double>("ptMin") ),
13  theNSigmaInvPtTolerance( cfg.getParameter<double>("nSigmaInvPtTolerance")),
14  theTIPMax( cfg.getParameter<double>("tipMax") ),
15  theNSigmaTipMaxTolerance( cfg.getParameter<double>("nSigmaTipMaxTolerance")),
16  theChi2Max( cfg.getParameter<double>("chi2") )
17 { }
18 
20  : thePtMin( cfg.getParameter<double>("ptMin") ),
21  theNSigmaInvPtTolerance( cfg.getParameter<double>("nSigmaInvPtTolerance")),
22  theTIPMax( cfg.getParameter<double>("tipMax") ),
23  theNSigmaTipMaxTolerance( cfg.getParameter<double>("nSigmaTipMaxTolerance")),
24  theChi2Max( cfg.getParameter<double>("chi2") )
25 { }
26 
28  : thePtMin(ptmin), theNSigmaInvPtTolerance(0.),
29  theTIPMax(tipmax), theNSigmaTipMaxTolerance(0.),
30  theChi2Max(chi2max)
31 { }
32 
34 { }
35 
37 { return (*this)(track); }
38 
40 {
41  if (!track) return false;
42  if (track->chi2() > theChi2Max) return false;
43  if ( (fabs(track->d0())-theTIPMax)/track->d0Error() > theNSigmaTipMaxTolerance) return false;
44 
45  float theta = track->theta();
46  float cosTheta = cos(theta);
47  float sinTheta = sin(theta);
48  float errLambda2 = sqr( track->lambdaError() );
49 
50  float pt_v = track->pt();
51  float errInvP2 = sqr(track->qoverpError());
53  float errInvPt2 = ( errInvP2
54  + sqr(cosTheta/pt_v)*errLambda2
55  + 2*(cosTheta/pt_v)*covIPtTheta
56  ) / sqr(sinTheta);
57  if ( (1/pt_v - 1/thePtMin)/sqrt(errInvPt2) > theNSigmaInvPtTolerance ) return false;
58 
59  return true;
60 }
virtual bool operator()(const reco::Track *) const
std::vector< const TrackingRecHit * > Hits
double d0Error() const
error on d0
Definition: TrackBase.h:211
double d0() const
dxy parameter in perigee convention (d0 = - dxy)
Definition: TrackBase.h:123
double theta() const
polar angle
Definition: TrackBase.h:117
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:182
double chi2() const
chi-squared of the fit
Definition: TrackBase.h:107
T sqrt(T t)
Definition: SSEVec.h:46
double pt() const
track transverse momentum
Definition: TrackBase.h:131
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double qoverpError() const
error on signed transverse curvature
Definition: TrackBase.h:192
PixelTrackFilterByKinematics(const edm::ParameterSet &cfg)
double ptmin
Definition: HydjetWrapper.h:86
double lambdaError() const
error on lambda
Definition: TrackBase.h:203
Square< F >::type sqr(const F &f)
Definition: Square.h:13
long double T