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 
39 { return (*this)(track); }
40 
42 {
43  if (!track) return false;
44  if (track->chi2() > theChi2Max) return false;
45  if ( (fabs(track->d0())-theTIPMax)/track->d0Error() > theNSigmaTipMaxTolerance) return false;
46 
47  float theta = track->theta();
48  float cosTheta = cos(theta);
49  float sinTheta = sin(theta);
50  float errLambda2 = sqr( track->lambdaError() );
51 
52  float pt_v = track->pt();
53  float errInvP2 = sqr(track->qoverpError());
55  float errInvPt2 = ( errInvP2
56  + sqr(cosTheta/pt_v)*errLambda2
57  + 2*(cosTheta/pt_v)*covIPtTheta
58  ) / sqr(sinTheta);
59  if ( (1/pt_v - 1/thePtMin)/sqrt(errInvPt2) > theNSigmaInvPtTolerance ) return false;
60 
61  return true;
62 }
virtual bool operator()(const reco::Track *) const
std::vector< const TrackingRecHit * > Hits
double d0Error() const
error on d0
Definition: TrackBase.h:789
tuple cfg
Definition: looper.py:293
double d0() const
dxy parameter in perigee convention (d0 = -dxy)
Definition: TrackBase.h:584
double theta() const
polar angle
Definition: TrackBase.h:566
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
double chi2() const
chi-squared of the fit
Definition: TrackBase.h:536
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:718
T sqrt(T t)
Definition: SSEVec.h:48
double pt() const
track transverse momentum
Definition: TrackBase.h:608
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
void update(const edm::Event &, const edm::EventSetup &) override
double qoverpError() const
error on signed transverse curvature
Definition: TrackBase.h:744
PixelTrackFilterByKinematics(const edm::ParameterSet &cfg)
double ptmin
Definition: HydjetWrapper.h:90
double lambdaError() const
error on lambda
Definition: TrackBase.h:765
Square< F >::type sqr(const F &f)
Definition: Square.h:13
long double T