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 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
 
edm::ESWatcher
< IdealMagneticFieldRecord
theFieldWatcher
 
const TrackerGeometrytheTracker
 
edm::ESWatcher
< TrackerDigiGeometryRecord
theTrackerWatcher
 
const
TransientTrackingRecHitBuilder
theTTRecHitBuilder
 
edm::ESWatcher
< TransientRecHitRecord
theTTRecHitBuilderWatcher
 

Detailed Description

Definition at line 23 of file PixelFitterByHelixProjections.h.

Constructor & Destructor Documentation

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

Definition at line 95 of file PixelFitterByHelixProjections.cc.

virtual PixelFitterByHelixProjections::~PixelFitterByHelixProjections ( )
inlinevirtual

Definition at line 26 of file PixelFitterByHelixProjections.h.

26 {}

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 PixelTrackBuilder::build(), CircleFromThreePoints::center(), DeDxDiscriminatorTools::charge(), edm::ESWatcher< T >::check(), RZLine::chi2(), funct::cos(), PixelRecoUtilities::curvature(), CircleFromThreePoints::curvature(), alignCSCRings::e, PixelTrackErrorParam::errCot(), benchmark_cfg::errors, PixelTrackErrorParam::errPhi(), PixelTrackErrorParam::errPt(), PixelTrackErrorParam::errTip(), PixelTrackErrorParam::errZip(), f, RZLine::fit(), edm::EventSetup::get(), edm::ParameterSet::getParameter(), i, MagneticField::inTesla(), PixelRecoUtilities::inversePt(), likely, Basic2DVector< T >::mag(), TrackingRegion::origin(), phi, PV3DBase< T, PVType, FrameType >::phi(), edm::ESHandle< class >::product(), RecoTauCleanerPlugins::pt, funct::sin(), AlCaHLTBitMon_QueryRunRegistry::string, theConfig, theField, theFieldWatcher, theTracker, theTrackerWatcher, theTTRecHitBuilder, theTTRecHitBuilderWatcher, PV3DBase< T, PVType, FrameType >::x(), Basic2DVector< T >::x(), PV3DBase< T, PVType, FrameType >::y(), Basic2DVector< T >::y(), PV3DBase< T, PVType, FrameType >::z(), and archive::zip.

103 {
104  int nhits = hits.size();
105  if (nhits <2) return 0;
106 
107  vector<GlobalPoint> points(nhits);
108  vector<GlobalError> errors(nhits);
109  vector<bool> isBarrel(nhits);
110 
111  if (theTrackerWatcher.check(es)) {
113  es.get<TrackerDigiGeometryRecord>().get(trackerESH);
114  theTracker = trackerESH.product();
115  }
116 
117  if (theFieldWatcher.check(es)) {
119  es.get<IdealMagneticFieldRecord>().get(fieldESH);
120  theField = fieldESH.product();
121  }
122 
125  std::string builderName = theConfig.getParameter<std::string>("TTRHBuilder");
126  es.get<TransientRecHitRecord>().get(builderName,ttrhbESH);
127  theTTRecHitBuilder = ttrhbESH.product();
128  }
129 
130 
131  for ( int i=0; i!=nhits; ++i) {
132  auto const & recHit = hits[i];
133  points[i] = GlobalPoint( recHit->globalPosition().x()-region.origin().x(),
134  recHit->globalPosition().y()-region.origin().y(),
135  recHit->globalPosition().z()-region.origin().z()
136  );
137  errors[i] = recHit->globalPositionError();
138  isBarrel[i] = recHit->detUnit()->type().isBarrel();
139  }
140 
141  CircleFromThreePoints circle = (nhits==2) ?
142  CircleFromThreePoints( GlobalPoint(0.,0.,0.), points[0], points[1]) :
143  CircleFromThreePoints(points[0],points[1],points[2]);
144 
145  float valPhi, valTip, valPt;
146 
147  int iCharge = charge(points);
148  float curvature = circle.curvature();
149 
150  if ((curvature > 1.e-4)&&
151  (likely(theField->inTesla(GlobalPoint(0.,0.,0.)).z()>0.01))) {
152  float invPt = PixelRecoUtilities::inversePt( circle.curvature(), es);
153  valPt = (invPt > 1.e-4f) ? 1.f/invPt : 1.e4f;
154  CircleFromThreePoints::Vector2D center = circle.center();
155  valTip = iCharge * (center.mag()-1.f/curvature);
156  valPhi = func_phi(center.x(), center.y(), iCharge);
157  }
158  else {
159  valPt = 1.e4f;
160  GlobalVector direction(points[1]-points[0]);
161  valPhi = direction.phi();
162  valTip = -points[0].x()*sin(valPhi) + points[0].y()*cos(valPhi);
163  }
164 
165  float valCotTheta = cotTheta(points[0],points[1]);
166  float valEta = asinh(valCotTheta);
167  float valZip = zip(valTip, valPhi, curvature, points[0],points[1]);
168 
169  PixelTrackErrorParam param(valEta, valPt);
170  float errValPt = param.errPt();
171  float errValCot = param.errCot();
172  float errValTip = param.errTip();
173  float errValPhi = param.errPhi();
174  float errValZip = param.errZip();
175 
176 
177  float chi2 = 0;
178  if (nhits > 2) {
179  RZLine rzLine(points,errors,isBarrel);
180  float cottheta, intercept, covss, covii, covsi;
181  rzLine.fit(cottheta, intercept, covss, covii, covsi);
182  chi2 = rzLine.chi2(cottheta, intercept); //FIXME: check which intercept to use!
183  }
184 
185  PixelTrackBuilder builder;
186  Measurement1D pt(valPt, errValPt);
187  Measurement1D phi(valPhi, errValPhi);
188  Measurement1D cotTheta(valCotTheta, errValCot);
189  Measurement1D tip(valTip, errValTip);
190  Measurement1D zip(valZip, errValZip);
191 
192  return builder.build(pt, phi, cotTheta, tip, zip, chi2, iCharge, hits, theField, region.origin() );
193 }
T getParameter(std::string const &) const
edm::ESWatcher< TransientRecHitRecord > theTTRecHitBuilderWatcher
int i
Definition: DBlmapReader.cc:9
GlobalPoint const & origin() const
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
edm::ESWatcher< TrackerDigiGeometryRecord > theTrackerWatcher
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:63
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
double charge(const std::vector< uint8_t > &Ampls)
tuple zip
Definition: archive.py:476
T inversePt(T curvature, const edm::EventSetup &iSetup)
T curvature(T InversePt, const edm::EventSetup &iSetup)
edm::ESWatcher< IdealMagneticFieldRecord > theFieldWatcher
T z() const
Definition: PV3DBase.h:64
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:58
const TransientTrackingRecHitBuilder * theTTRecHitBuilder
#define likely(x)
Definition: Likely.h:20
T x() const
Definition: PV3DBase.h:62
T x() const
Cartesian x coordinate.
Definition: DDAxes.h:10

Member Data Documentation

edm::ParameterSet PixelFitterByHelixProjections::theConfig
private

Definition at line 44 of file PixelFitterByHelixProjections.h.

Referenced by run().

const MagneticField* PixelFitterByHelixProjections::theField
mutableprivate

Definition at line 47 of file PixelFitterByHelixProjections.h.

Referenced by run().

edm::ESWatcher<IdealMagneticFieldRecord> PixelFitterByHelixProjections::theFieldWatcher
mutableprivate

Definition at line 51 of file PixelFitterByHelixProjections.h.

Referenced by run().

const TrackerGeometry* PixelFitterByHelixProjections::theTracker
mutableprivate

Definition at line 46 of file PixelFitterByHelixProjections.h.

Referenced by run().

edm::ESWatcher<TrackerDigiGeometryRecord> PixelFitterByHelixProjections::theTrackerWatcher
mutableprivate

Definition at line 50 of file PixelFitterByHelixProjections.h.

Referenced by run().

const TransientTrackingRecHitBuilder* PixelFitterByHelixProjections::theTTRecHitBuilder
mutableprivate

Definition at line 48 of file PixelFitterByHelixProjections.h.

Referenced by run().

edm::ESWatcher<TransientRecHitRecord> PixelFitterByHelixProjections::theTTRecHitBuilderWatcher
mutableprivate

Definition at line 52 of file PixelFitterByHelixProjections.h.

Referenced by run().