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 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 edm::EventSetup &setup) const override
 
 ~PixelFitterByConformalMappingAndLine () override
 
- Public Member Functions inherited from PixelFitterBase
virtual ~PixelFitterBase ()
 

Private Attributes

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 TransientTrackingRecHitBuilder ttrhBuilder,
const TrackerGeometry tracker,
const MagneticField field,
double  fixImpactParameter,
bool  useFixImpactParameter 
)
explicit

Definition at line 35 of file PixelFitterByConformalMappingAndLine.cc.

39  :
40  theTTRHBuilder(ttrhBuilder),
41  theTracker(tracker),
42  theField(field),
43  theFixImpactParameter(fixImpactParameter),
44  theUseFixImpactParameter(useFixImpactParameter)
45 { }
const TransientTrackingRecHitBuilder * theTTRHBuilder
PixelFitterByConformalMappingAndLine::~PixelFitterByConformalMappingAndLine ( )
inlineoverride

Member Function Documentation

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

Implements PixelFitterBase.

Definition at line 47 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(), GeomDetEnumerators::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(), GeneralSetup::setup(), sqr(), mathSSE::sqrt(), 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().

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