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 Reference

#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 ~PixelFitter ()
 

Private Attributes

edm::ParameterSet theConfig
 
const MagneticFieldtheField
 
const TrackerGeometrytheTracker
 
const
TransientTrackingRecHitBuilder
theTTRecHitBuilder
 

Detailed Description

Definition at line 19 of file PixelFitterByHelixProjections.h.

Constructor & Destructor Documentation

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

Definition at line 156 of file PixelFitterByHelixProjections.cc.

158  : theConfig(cfg), theTracker(0), theField(0), theTTRecHitBuilder(0) { }
const TransientTrackingRecHitBuilder * theTTRecHitBuilder
virtual PixelFitterByHelixProjections::~PixelFitterByHelixProjections ( )
inlinevirtual

Definition at line 22 of file PixelFitterByHelixProjections.h.

22 {}

Member Function Documentation

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

Implements PixelFitter.

Definition at line 160 of file PixelFitterByHelixProjections.cc.

References TransientTrackingRecHitBuilder::build(), PixelTrackBuilder::build(), CircleFromThreePoints::center(), DeDxDiscriminatorTools::charge(), edm::ESWatcher< T >::check(), RZLine::chi2(), funct::cos(), PixelRecoUtilities::curvature(), CircleFromThreePoints::curvature(), benchmark_cfg::errors, f, RZLine::fit(), edm::EventSetup::get(), edm::ParameterSet::getParameter(), i, PixelRecoUtilities::inversePt(), Basic2DVector< T >::mag(), TrackingRegion::origin(), phi, PV3DBase< T, PVType, FrameType >::phi(), edm::ESHandle< class >::product(), funct::sin(), theConfig, theField, theTracker, theTTRecHitBuilder, Basic2DVector< T >::x(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), Basic2DVector< T >::y(), and PV3DBase< T, PVType, FrameType >::z().

164 {
165  int nhits = hits.size();
166  if (nhits <2) return 0;
167 
168  vector<GlobalPoint> points(nhits);
169  vector<GlobalError> errors(nhits);
170  vector<bool> isBarrel(nhits);
171 
172  static edm::ESWatcher<TrackerDigiGeometryRecord> watcherTrackerDigiGeometryRecord;
173  if (!theTracker || watcherTrackerDigiGeometryRecord.check(es)) {
175  es.get<TrackerDigiGeometryRecord>().get(trackerESH);
176  theTracker = trackerESH.product();
177  }
178 
179  static edm::ESWatcher<IdealMagneticFieldRecord> watcherIdealMagneticFieldRecord;
180  if (!theField || watcherIdealMagneticFieldRecord.check(es)) {
182  es.get<IdealMagneticFieldRecord>().get(fieldESH);
183  theField = fieldESH.product();
184  }
185 
186  static edm::ESWatcher<TransientRecHitRecord> watcherTransientRecHitRecord;
187  if (!theTTRecHitBuilder || watcherTransientRecHitRecord.check(es)) {
189  std::string builderName = theConfig.getParameter<std::string>("TTRHBuilder");
190  es.get<TransientRecHitRecord>().get(builderName,ttrhbESH);
191  theTTRecHitBuilder = ttrhbESH.product();
192  }
193 
194 
195  for ( int i=0; i!=nhits; ++i) {
197  points[i] = GlobalPoint( recHit->globalPosition().x()-region.origin().x(),
198  recHit->globalPosition().y()-region.origin().y(),
199  recHit->globalPosition().z()-region.origin().z()
200  );
201  errors[i] = recHit->globalPositionError();
202  isBarrel[i] = recHit->detUnit()->type().isBarrel();
203  }
204 
205  CircleFromThreePoints circle = (nhits==2) ?
206  CircleFromThreePoints( GlobalPoint(0.,0.,0.), points[0], points[1]) :
207  CircleFromThreePoints(points[0],points[1],points[2]);
208 
209  float valPhi, valTip, valPt;
210 
211  int iCharge = charge(points);
212  float curvature = circle.curvature();
213 
214  if (curvature > 1.e-4) {
215  float invPt = PixelRecoUtilities::inversePt( circle.curvature(), es);
216  valPt = (invPt > 1.e-4f) ? 1.f/invPt : 1.e4f;
217  CircleFromThreePoints::Vector2D center = circle.center();
218  valTip = iCharge * (center.mag()-1.f/curvature);
219  valPhi = phi(center.x(), center.y(), iCharge);
220  }
221  else {
222  valPt = 1.e4f;
223  GlobalVector direction(points[1]-points[0]);
224  valPhi = direction.phi();
225  valTip = -points[0].x()*sin(valPhi) + points[0].y()*cos(valPhi);
226  }
227 
228  float errPt = 0.055f*valPt + 0.017f*valPt*valPt;
229  float errValTip = errTip(valPt, points.back().eta());
230  float errPhi = 0.002f;
231 
232  float valZip = zip(valTip, valPhi, curvature, points[0],points[1]);
233  float errValZip = errZip(valPt, points.back().eta());
234 
235  float valCotTheta = cotTheta(points[0],points[1]);
236  float errCotTheta = 0.002f;
237 
238  float chi2 = 0;
239  if (nhits > 2) {
240  RZLine rzLine(points,errors,isBarrel);
241  float cottheta, intercept, covss, covii, covsi;
242  rzLine.fit(cottheta, intercept, covss, covii, covsi);
243  chi2 = rzLine.chi2(cottheta, intercept); //FIXME: check which intercept to use!
244  }
245 
246  PixelTrackBuilder builder;
247  Measurement1D pt(valPt, errPt);
248  Measurement1D phi(valPhi, errPhi);
249  Measurement1D cotTheta(valCotTheta, errCotTheta);
250  Measurement1D tip(valTip, errValTip);
251  Measurement1D zip(valZip, errValZip);
252 
253  return builder.build(pt, phi, cotTheta, tip, zip, chi2, iCharge, hits, theField, region.origin() );
254 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
virtual GlobalPoint origin() const =0
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:57
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
double charge(const std::vector< uint8_t > &Ampls)
T inversePt(T curvature, const edm::EventSetup &iSetup)
T curvature(T InversePt, const edm::EventSetup &iSetup)
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
T z() const
Definition: PV3DBase.h:58
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:8
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:59
const TransientTrackingRecHitBuilder * theTTRecHitBuilder
T x() const
Definition: PV3DBase.h:56
T x() const
Cartesian x coordinate.
Definition: DDAxes.h:10

Member Data Documentation

edm::ParameterSet PixelFitterByHelixProjections::theConfig
private

Definition at line 40 of file PixelFitterByHelixProjections.h.

Referenced by run().

const MagneticField* PixelFitterByHelixProjections::theField
mutableprivate

Definition at line 43 of file PixelFitterByHelixProjections.h.

Referenced by run().

const TrackerGeometry* PixelFitterByHelixProjections::theTracker
mutableprivate

Definition at line 42 of file PixelFitterByHelixProjections.h.

Referenced by run().

const TransientTrackingRecHitBuilder* PixelFitterByHelixProjections::theTTRecHitBuilder
mutableprivate

Definition at line 44 of file PixelFitterByHelixProjections.h.

Referenced by run().