test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
PixelFitterByHelixProjections Class Referencefinal

#include <PixelFitterByHelixProjections.h>

Inheritance diagram for PixelFitterByHelixProjections:
PixelFitter

Public Member Functions

 PixelFitterByHelixProjections (const edm::ParameterSet &cfg)
 
virtual reco::Trackrun (const edm::EventSetup &es, const std::vector< const TrackingRecHit * > &hits, const TrackingRegion &region) const
 
virtual ~PixelFitterByHelixProjections ()
 
- Public Member Functions inherited from PixelFitter
virtual reco::Trackrun (const edm::Event &ev, const edm::EventSetup &es, const std::vector< const TrackingRecHit * > &hits, const TrackingRegion &region) const
 
virtual ~PixelFitter ()
 

Private Attributes

edm::ParameterSet theConfig
 
const MagneticFieldtheField
 

Detailed Description

Definition at line 15 of file PixelFitterByHelixProjections.h.

Constructor & Destructor Documentation

PixelFitterByHelixProjections::PixelFitterByHelixProjections ( const edm::ParameterSet cfg)

Definition at line 95 of file PixelFitterByHelixProjections.cc.

97  : theConfig(cfg), theField(nullptr) {}
virtual PixelFitterByHelixProjections::~PixelFitterByHelixProjections ( )
inlinevirtual

Definition at line 18 of file PixelFitterByHelixProjections.h.

18 {}

Member Function Documentation

reco::Track * PixelFitterByHelixProjections::run ( const edm::EventSetup es,
const std::vector< const TrackingRecHit * > &  hits,
const TrackingRegion region 
) const
virtual

Reimplemented from PixelFitter.

Definition at line 99 of file PixelFitterByHelixProjections.cc.

References PV3DBase< T, PVType, FrameType >::barePhi(), PV3DBase< T, PVType, FrameType >::basicVector(), PixelTrackBuilder::build(), CircleFromThreePoints::center(), RecoTauCleanerPlugins::charge, RZLine::chi2(), beam_dqm_sourceclient-live_cfg::chi2, funct::cos(), PixelRecoUtilities::curvature(), CircleFromThreePoints::curvature(), declareDynArray, alignCSCRings::e, PixelTrackErrorParam::errCot(), benchmark_cfg::errors, PixelTrackErrorParam::errPhi(), PixelTrackErrorParam::errPt(), PixelTrackErrorParam::errTip(), PixelTrackErrorParam::errZip(), f, PixelRecoUtilities::fieldInInvGev(), RZLine::fit(), edm::EventSetup::get(), i, PixelRecoUtilities::inversePt(), GeomDetEnumerators::isBarrel(), likely, Basic2DVector< T >::mag(), nhits, TrackingRegion::origin(), phi, edm::ESHandle< class >::product(), EnergyCorrector::pt, funct::sin(), theField, HLT_25ns10e33_v2_cff::tip, Basic2DVector< T >::x(), Basic2DVector< T >::y(), and ComparisonHelper::zip().

103 {
104  int nhits = hits.size();
105  if (nhits <2) return 0;
106 
107  {
109  es.get<IdealMagneticFieldRecord>().get(fieldESH);
110  theField = fieldESH.product();
111  }
112 
113  declareDynArray(GlobalPoint,nhits, points);
115  declareDynArray(bool,nhits, isBarrel);
116 
117 
118  for ( int i=0; i!=nhits; ++i) {
119  auto const & recHit = hits[i];
120  points[i] = GlobalPoint( recHit->globalPosition().basicVector()-region.origin().basicVector());
121  errors[i] = recHit->globalPositionError();
122  isBarrel[i] = recHit->detUnit()->type().isBarrel();
123  }
124 
125  CircleFromThreePoints circle = (nhits==2) ?
126  CircleFromThreePoints( GlobalPoint(0.,0.,0.), points[0], points[1]) :
127  CircleFromThreePoints(points[0],points[1],points[2]);
128 
129  float valPhi, valTip, valPt;
130 
131  int iCharge = charge(points);
132  float curvature = circle.curvature();
133 
134  if ((curvature > 1.e-4)&&
136  float invPt = PixelRecoUtilities::inversePt( circle.curvature(), es);
137  valPt = (invPt > 1.e-4f) ? 1.f/invPt : 1.e4f;
138  CircleFromThreePoints::Vector2D center = circle.center();
139  valTip = iCharge * (center.mag()-1.f/curvature);
140  valPhi = phi(center.x(), center.y(), iCharge);
141  }
142  else {
143  valPt = 1.e4f;
144  GlobalVector direction(points[1]-points[0]);
145  valPhi = direction.barePhi();
146  valTip = -points[0].x()*sin(valPhi) + points[0].y()*cos(valPhi);
147  }
148 
149  float valCotTheta = cotTheta(points[0],points[1]);
150  float valEta = std::asinh(valCotTheta);
151  float valZip = zip(valTip, valPhi, curvature, points[0],points[1]);
152 
153  PixelTrackErrorParam param(valEta, valPt);
154  float errValPt = param.errPt();
155  float errValCot = param.errCot();
156  float errValTip = param.errTip();
157  float errValPhi = param.errPhi();
158  float errValZip = param.errZip();
159 
160 
161  float chi2 = 0;
162  if (nhits > 2) {
163  RZLine rzLine(points,errors,isBarrel);
164  float cottheta, intercept, covss, covii, covsi;
165  rzLine.fit(cottheta, intercept, covss, covii, covsi);
166  chi2 = rzLine.chi2(cottheta, intercept); //FIXME: check which intercept to use!
167  }
168 
169  PixelTrackBuilder builder;
170  Measurement1D pt(valPt, errValPt);
171  Measurement1D phi(valPhi, errValPhi);
172  Measurement1D cotTheta(valCotTheta, errValCot);
173  Measurement1D tip(valTip, errValTip);
174  Measurement1D zip(valZip, errValZip);
175 
176  return builder.build(pt, phi, cotTheta, tip, zip, chi2, iCharge, hits, theField, region.origin() );
177 }
int i
Definition: DBlmapReader.cc:9
GlobalPoint const & origin() const
bool isBarrel(GeomDetEnumerators::SubDetector m)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
T inversePt(T curvature, const edm::EventSetup &iSetup)
#define likely(x)
T curvature(T InversePt, const edm::EventSetup &iSetup)
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
reco::Track * build(const Measurement1D &pt, const Measurement1D &phi, const Measurement1D &cotTheta, const Measurement1D &tip, const Measurement1D &zip, float chi2, int charge, const std::vector< const TrackingRecHit * > &hits, const MagneticField *mf, const GlobalPoint &reference=GlobalPoint(0, 0, 0)) const
double f[11][100]
T y() const
Cartesian y coordinate.
Definition: RZLine.h:9
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
#define declareDynArray(T, n, x)
Definition: DynArray.h:58
float fieldInInvGev(const edm::EventSetup &iSetup)
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
T x() const
Cartesian x coordinate.

Member Data Documentation

edm::ParameterSet PixelFitterByHelixProjections::theConfig
private

Definition at line 36 of file PixelFitterByHelixProjections.h.

const MagneticField* PixelFitterByHelixProjections::theField
mutableprivate

Definition at line 37 of file PixelFitterByHelixProjections.h.

Referenced by run().