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)
 
virtual std::unique_ptr< reco::Trackrun (const std::vector< const TrackingRecHit * > &hits, const TrackingRegion &region) const override
 
virtual ~PixelFitterByConformalMappingAndLine ()
 
- 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 13 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 36 of file PixelFitterByConformalMappingAndLine.cc.

virtual PixelFitterByConformalMappingAndLine::~PixelFitterByConformalMappingAndLine ( )
inlinevirtual

Definition at line 16 of file PixelFitterByConformalMappingAndLine.h.

References hfClusterShapes_cfi::hits, and run().

16 { }

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 50 of file PixelFitterByConformalMappingAndLine.cc.

References TransientTrackingRecHitBuilder::build(), PixelTrackBuilder::build(), ConformalMappingFit::charge(), ALCARECOTkAlJpsiMuMu_cff::charge, HiEvtPlane_cfi::chi2, ConformalMappingFit::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, 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().

53 {
54 
55  int nhits = hits.size();
56 
57  vector<GlobalPoint> points;
58  vector<GlobalError> errors;
59  vector<bool> isBarrel;
60 
61 
62  for (vector<const TrackingRecHit*>::const_iterator ih=hits.begin(); ih!=hits.end(); ih++) {
64  points.push_back( recHit->globalPosition() );
65  errors.push_back( recHit->globalPositionError() );
66  isBarrel.push_back( recHit->detUnit()->type().isBarrel() );
67  }
68 
69 // if (useMultScatt) {
70 // MultipleScatteringParametrisation ms(hits[i].layer());
71 // float cotTheta = (p.z()-zVtx)/p.perp();
72 // err += sqr( ms( pt, cotTheta, PixelRecoPointRZ(0.,zVtx) ) );
73 // }
74 
75  //
76  // simple fit to get pt, phi0 used for precise calcul.
77  //
78  typedef ConformalMappingFit::PointXY PointXY;
79  vector<PointXY> xy; vector<float> errRPhi2;
80  for (int i=0; i < nhits; ++i) {
81  const GlobalPoint & point = points[i];
82  xy.push_back(PointXY( point.x()-region.origin().x(), point.y()-region.origin().y()));
83  float phiErr2 = errors[i].phierr(point);
84  errRPhi2.push_back( point.perp2()*phiErr2);
85  }
86  ConformalMappingFit parabola(xy, errRPhi2);
88  parabola.fixImpactParmaeter(theFixImpactParameter);
89  else if (nhits < 3) parabola.fixImpactParmaeter(0.);
90 
91 
92  Measurement1D curv = parabola.curvature();
93  float invPt = PixelRecoUtilities::inversePt( curv.value(), *theES);
94  float valPt = (invPt > 1.e-4) ? 1./invPt : 1.e4;
95  float errPt =PixelRecoUtilities::inversePt(curv.error(), *theES) * sqr(valPt);
96  Measurement1D pt (valPt,errPt);
97  Measurement1D phi = parabola.directionPhi();
98  Measurement1D tip = parabola.impactParameter();
99 
100  //
101  // precalculate theta to correct errors:
102  //
103  vector<float> r(nhits),z(nhits),errZ(nhits);
104  float simpleCot = ( points.back().z()-points.front().z() )/ (points.back().perp() - points.front().perp() );
105  for (int i=0; i< nhits; ++i) {
106  const GlobalPoint & point = points[i];
107  const GlobalError & error = errors[i];
108  r[i] = sqrt( sqr(point.x()-region.origin().x()) + sqr(point.y()-region.origin().y()) );
110  z[i] = point.z()-region.origin().z();
111  errZ[i] = (isBarrel[i]) ? sqrt(error.czz()) : sqrt( error.rerr(point) )*simpleCot;
112  }
113 
114  //
115  // line fit (R-Z plane)
116  //
117  RZLine rzLine(r,z,errZ);
118 
119 //
120 // parameters for track builder
121 //
122  Measurement1D zip(rzLine.intercept(), sqrt(rzLine.covii()));
123  Measurement1D cotTheta(rzLine.cotTheta(), sqrt(rzLine.covss()));
124  float chi2 = parabola.chi2() + rzLine.chi2();
125  int charge = parabola.charge();
126 
127 
128  PixelTrackBuilder builder;
129  return std::unique_ptr<reco::Track>(builder.build(pt, phi, cotTheta, tip, zip, chi2, charge, hits, theField, region.origin()));
130 }
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 20 of file PixelFitterByConformalMappingAndLine.h.

Referenced by run().

const MagneticField* PixelFitterByConformalMappingAndLine::theField
private

Definition at line 23 of file PixelFitterByConformalMappingAndLine.h.

Referenced by run().

const double PixelFitterByConformalMappingAndLine::theFixImpactParameter
private

Definition at line 24 of file PixelFitterByConformalMappingAndLine.h.

Referenced by run().

const TrackerGeometry* PixelFitterByConformalMappingAndLine::theTracker
private

Definition at line 22 of file PixelFitterByConformalMappingAndLine.h.

const TransientTrackingRecHitBuilder* PixelFitterByConformalMappingAndLine::theTTRHBuilder
private

Definition at line 21 of file PixelFitterByConformalMappingAndLine.h.

Referenced by run().

const bool PixelFitterByConformalMappingAndLine::theUseFixImpactParameter
private

Definition at line 25 of file PixelFitterByConformalMappingAndLine.h.

Referenced by run().