CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PixelFitterByConformalMappingAndLine Class Reference

#include <PixelFitterByConformalMappingAndLine.h>

Inheritance diagram for PixelFitterByConformalMappingAndLine:
PixelFitterBase

Public Member Functions

 PixelFitterByConformalMappingAndLine (const edm::EventSetup *es, const TransientTrackingRecHitBuilder *ttrhBuilder, const TrackerGeometry *tracker, const MagneticField *field, double fixImpactParameter, bool useFixImpactParameter)
 
std::unique_ptr< reco::Trackrun (const std::vector< const TrackingRecHit * > &hits, const TrackingRegion &region) const override
 
 ~PixelFitterByConformalMappingAndLine () override
 
- Public Member Functions inherited from PixelFitterBase
virtual reco::Trackrun (const edm::EventSetup &es, const std::vector< const TrackingRecHit * > &hits, const TrackingRegion &region) const
 
virtual reco::Trackrun (const edm::Event &ev, const edm::EventSetup &es, const std::vector< const TrackingRecHit * > &hits, const TrackingRegion &region) const
 
virtual ~PixelFitterBase ()
 

Private Attributes

const edm::EventSetuptheES
 
const MagneticFieldtheField
 
const double theFixImpactParameter
 
const TrackerGeometrytheTracker
 
const TransientTrackingRecHitBuildertheTTRHBuilder
 
const bool theUseFixImpactParameter
 

Detailed Description

Definition at line 14 of file PixelFitterByConformalMappingAndLine.h.

Constructor & Destructor Documentation

PixelFitterByConformalMappingAndLine::PixelFitterByConformalMappingAndLine ( const edm::EventSetup es,
const TransientTrackingRecHitBuilder ttrhBuilder,
const TrackerGeometry tracker,
const MagneticField field,
double  fixImpactParameter,
bool  useFixImpactParameter 
)
explicit

Definition at line 35 of file PixelFitterByConformalMappingAndLine.cc.

PixelFitterByConformalMappingAndLine::~PixelFitterByConformalMappingAndLine ( )
inlineoverride

Definition at line 17 of file PixelFitterByConformalMappingAndLine.h.

References hfClusterShapes_cfi::hits, and run().

17 { }

Member Function Documentation

std::unique_ptr< reco::Track > PixelFitterByConformalMappingAndLine::run ( const std::vector< const TrackingRecHit * > &  hits,
const TrackingRegion region 
) const
overridevirtual

Reimplemented from PixelFitterBase.

Definition at line 49 of file PixelFitterByConformalMappingAndLine.cc.

References TransientTrackingRecHitBuilder::build(), PixelTrackBuilder::build(), ConformalMappingFit::charge(), ALCARECOTkAlJpsiMuMu_cff::charge, ConformalMappingFit::chi2(), vertices_cff::chi2, RZLine::chi2(), RZLine::cotTheta(), RZLine::covii(), RZLine::covss(), ConformalMappingFit::curvature(), GlobalErrorBase< T, ErrorWeightType >::czz(), ConformalMappingFit::directionPhi(), vertexPlots::e4, Measurement1D::error(), relativeConstraints::error, benchmark_cfg::errors, fftjetvertexadder_cfi::errZ, ConformalMappingFit::fixImpactParmaeter(), mps_fire::i, ConformalMappingFit::impactParameter(), RZLine::intercept(), PixelRecoUtilities::inversePt(), gedGsfElectrons_cfi::isBarrel, nhits, TrackingRegion::origin(), PV3DBase< T, PVType, FrameType >::perp2(), phi, point, hiPixelPairStep_cff::points, EnergyCorrector::pt, alignCSCRings::r, rpcPointValidation_cfi::recHit, GlobalErrorBase< T, ErrorWeightType >::rerr(), sqr(), mathSSE::sqrt(), theES, theField, theFixImpactParameter, theTTRHBuilder, theUseFixImpactParameter, btvTracks_cfi::tip, Measurement1D::value(), PV3DBase< T, PVType, FrameType >::x(), geometryCSVtoXML::xy, PV3DBase< T, PVType, FrameType >::y(), z, PV3DBase< T, PVType, FrameType >::z(), and ComparisonHelper::zip().

Referenced by ~PixelFitterByConformalMappingAndLine().

52 {
53 
54  int nhits = hits.size();
55 
56  vector<GlobalPoint> points;
57  vector<GlobalError> errors;
58  vector<bool> isBarrel;
59 
60 
61  for (vector<const TrackingRecHit*>::const_iterator ih=hits.begin(); ih!=hits.end(); ih++) {
63  points.push_back( recHit->globalPosition() );
64  errors.push_back( recHit->globalPositionError() );
65  isBarrel.push_back( recHit->detUnit()->type().isBarrel() );
66  }
67 
68 // if (useMultScatt) {
69 // MultipleScatteringParametrisation ms(hits[i].layer());
70 // float cotTheta = (p.z()-zVtx)/p.perp();
71 // err += sqr( ms( pt, cotTheta, PixelRecoPointRZ(0.,zVtx) ) );
72 // }
73 
74  //
75  // simple fit to get pt, phi0 used for precise calcul.
76  //
77  typedef ConformalMappingFit::PointXY PointXY;
78  vector<PointXY> xy; vector<float> errRPhi2;
79  for (int i=0; i < nhits; ++i) {
80  const GlobalPoint & point = points[i];
81  xy.push_back(PointXY( point.x()-region.origin().x(), point.y()-region.origin().y()));
82  float phiErr2 = errors[i].phierr(point);
83  errRPhi2.push_back( point.perp2()*phiErr2);
84  }
85  ConformalMappingFit parabola(xy, errRPhi2);
87  parabola.fixImpactParmaeter(theFixImpactParameter);
88  else if (nhits < 3) parabola.fixImpactParmaeter(0.);
89 
90 
91  Measurement1D curv = parabola.curvature();
92  float invPt = PixelRecoUtilities::inversePt( curv.value(), *theES);
93  float valPt = (invPt > 1.e-4) ? 1./invPt : 1.e4;
94  float errPt =PixelRecoUtilities::inversePt(curv.error(), *theES) * sqr(valPt);
95  Measurement1D pt (valPt,errPt);
96  Measurement1D phi = parabola.directionPhi();
97  Measurement1D tip = parabola.impactParameter();
98 
99  //
100  // precalculate theta to correct errors:
101  //
102  vector<float> r(nhits),z(nhits),errZ(nhits);
103  float simpleCot = ( points.back().z()-points.front().z() )/ (points.back().perp() - points.front().perp() );
104  for (int i=0; i< nhits; ++i) {
105  const GlobalPoint & point = points[i];
106  const GlobalError & error = errors[i];
107  r[i] = sqrt( sqr(point.x()-region.origin().x()) + sqr(point.y()-region.origin().y()) );
109  z[i] = point.z()-region.origin().z();
110  errZ[i] = (isBarrel[i]) ? sqrt(error.czz()) : sqrt( error.rerr(point) )*simpleCot;
111  }
112 
113  //
114  // line fit (R-Z plane)
115  //
116  RZLine rzLine(r,z,errZ);
117 
118 //
119 // parameters for track builder
120 //
121  Measurement1D zip(rzLine.intercept(), sqrt(rzLine.covii()));
122  Measurement1D cotTheta(rzLine.cotTheta(), sqrt(rzLine.covss()));
123  float chi2 = parabola.chi2() + rzLine.chi2();
124  int charge = parabola.charge();
125 
126 
127  PixelTrackBuilder builder;
128  return std::unique_ptr<reco::Track>(builder.build(pt, phi, cotTheta, tip, zip, chi2, charge, hits, theField, region.origin()));
129 }
GlobalPoint const & origin() const
T y() const
Definition: PV3DBase.h:63
double error() const
Definition: Measurement1D.h:30
T perp2() const
Definition: PV3DBase.h:71
T inversePt(T curvature, const edm::EventSetup &iSetup)
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
T sqrt(T t)
Definition: SSEVec.h:18
T z() const
Definition: PV3DBase.h:64
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
std::shared_ptr< TrackingRecHit const > RecHitPointer
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
Definition: RZLine.h:12
T rerr(const GlobalPoint &aPoint) const
double value() const
Definition: Measurement1D.h:28
T x() const
Definition: PV3DBase.h:62
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
const TransientTrackingRecHitBuilder * theTTRHBuilder

Member Data Documentation

const edm::EventSetup* PixelFitterByConformalMappingAndLine::theES
private

Definition at line 21 of file PixelFitterByConformalMappingAndLine.h.

Referenced by run().

const MagneticField* PixelFitterByConformalMappingAndLine::theField
private

Definition at line 24 of file PixelFitterByConformalMappingAndLine.h.

Referenced by run().

const double PixelFitterByConformalMappingAndLine::theFixImpactParameter
private

Definition at line 25 of file PixelFitterByConformalMappingAndLine.h.

Referenced by run().

const TrackerGeometry* PixelFitterByConformalMappingAndLine::theTracker
private

Definition at line 23 of file PixelFitterByConformalMappingAndLine.h.

const TransientTrackingRecHitBuilder* PixelFitterByConformalMappingAndLine::theTTRHBuilder
private

Definition at line 22 of file PixelFitterByConformalMappingAndLine.h.

Referenced by run().

const bool PixelFitterByConformalMappingAndLine::theUseFixImpactParameter
private

Definition at line 26 of file PixelFitterByConformalMappingAndLine.h.

Referenced by run().