CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 override
 
 ~PixelFitterByConformalMappingAndLine () override
 
- Public Member Functions inherited from PixelFitterBase
virtual ~PixelFitterBase ()
 

Private Attributes

const MagneticFieldtheField
 
const double theFixImpactParameter
 
const TrackerGeometrytheTracker
 
const
TransientTrackingRecHitBuilder
theTTRHBuilder
 
const bool theUseFixImpactParameter
 

Detailed Description

Definition at line 13 of file PixelFitterByConformalMappingAndLine.h.

Constructor & Destructor Documentation

PixelFitterByConformalMappingAndLine::PixelFitterByConformalMappingAndLine ( const TransientTrackingRecHitBuilder ttrhBuilder,
const TrackerGeometry tracker,
const MagneticField field,
double  fixImpactParameter,
bool  useFixImpactParameter 
)
explicit
PixelFitterByConformalMappingAndLine::~PixelFitterByConformalMappingAndLine ( )
inlineoverride

Definition at line 20 of file PixelFitterByConformalMappingAndLine.h.

20 {}

Member Function Documentation

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

Implements PixelFitterBase.

Definition at line 44 of file PixelFitterByConformalMappingAndLine.cc.

References TransientTrackingRecHitBuilder::build(), PixelTrackBuilder::build(), ConformalMappingFit::charge(), RecoTauCleanerPlugins::charge, ConformalMappingFit::chi2(), RZLine::chi2(), HLT_FULL_cff::chi2, RZLine::cotTheta(), RZLine::covii(), RZLine::covss(), ConformalMappingFit::curvature(), GlobalErrorBase< T, ErrorWeightType >::czz(), ConformalMappingFit::directionPhi(), Measurement1D::error(), relativeConstraints::error, ConformalMappingFit::fixImpactParmaeter(), mps_fire::i, ConformalMappingFit::impactParameter(), RZLine::intercept(), PixelRecoUtilities::inversePt(), PixelPluginsPhase0_cfi::isBarrel, nhits, TrackingRegion::origin(), PV3DBase< T, PVType, FrameType >::perp2(), phi, point, DiDispStaMuonMonitor_cfi::pt, alignCSCRings::r, GlobalErrorBase< T, ErrorWeightType >::rerr(), sqr(), mathSSE::sqrt(), theField, theFixImpactParameter, theTTRHBuilder, theUseFixImpactParameter, HLT_FULL_cff::tip, Measurement1D::value(), PV3DBase< T, PVType, FrameType >::x(), xy(), PV3DBase< T, PVType, FrameType >::y(), z, PV3DBase< T, PVType, FrameType >::z(), and ComparisonHelper::zip().

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

Referenced by run().

const double PixelFitterByConformalMappingAndLine::theFixImpactParameter
private

Definition at line 28 of file PixelFitterByConformalMappingAndLine.h.

Referenced by run().

const TrackerGeometry* PixelFitterByConformalMappingAndLine::theTracker
private

Definition at line 26 of file PixelFitterByConformalMappingAndLine.h.

const TransientTrackingRecHitBuilder* PixelFitterByConformalMappingAndLine::theTTRHBuilder
private

Definition at line 25 of file PixelFitterByConformalMappingAndLine.h.

Referenced by run().

const bool PixelFitterByConformalMappingAndLine::theUseFixImpactParameter
private

Definition at line 29 of file PixelFitterByConformalMappingAndLine.h.

Referenced by run().