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 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 13 of file PixelFitterByConformalMappingAndLine.h.

Constructor & Destructor Documentation

◆ PixelFitterByConformalMappingAndLine()

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

◆ ~PixelFitterByConformalMappingAndLine()

PixelFitterByConformalMappingAndLine::~PixelFitterByConformalMappingAndLine ( )
inlineoverride

Definition at line 20 of file PixelFitterByConformalMappingAndLine.h.

20 {}

Member Function Documentation

◆ run()

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(), ALCARECOTkAlJpsiMuMu_cff::charge, hltPixelTracks_cff::chi2, ConformalMappingFit::chi2(), RZLine::chi2(), RZLine::cotTheta(), RZLine::covii(), RZLine::covss(), ConformalMappingFit::curvature(), ConformalMappingFit::directionPhi(), vertexPlots::e4, Measurement1D::error(), relativeConstraints::error, debug_messages_cfi::errors, fftjetvertexadder_cfi::errZ, ConformalMappingFit::fixImpactParmaeter(), hfClusterShapes_cfi::hits, mps_fire::i, ConformalMappingFit::impactParameter(), RZLine::intercept(), PixelRecoUtilities::inversePt(), PixelPluginsPhase0_cfi::isBarrel, nhits, phi, point, hiPixelPairStep_cff::points, DiDispStaMuonMonitor_cfi::pt, alignCSCRings::r, rpcPointValidation_cfi::recHit, HLT_2022v15_cff::region, sqr(), mathSSE::sqrt(), theField, theFixImpactParameter, theTTRHBuilder, theUseFixImpactParameter, qcdUeDQM_cfi::tip, Measurement1D::value(), geometryCSVtoXML::xy, 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 }
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
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 inversePt(T curvature, const MagneticField &field)
std::shared_ptr< TrackingRecHit const > RecHitPointer
Definition: RZLine.h:12
double value() const
Definition: Measurement1D.h:25
double error() const
Definition: Measurement1D.h:27
Definition: errors.py:1
*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

◆ theField

const MagneticField* PixelFitterByConformalMappingAndLine::theField
private

Definition at line 27 of file PixelFitterByConformalMappingAndLine.h.

Referenced by run().

◆ theFixImpactParameter

const double PixelFitterByConformalMappingAndLine::theFixImpactParameter
private

Definition at line 28 of file PixelFitterByConformalMappingAndLine.h.

Referenced by run().

◆ theTracker

const TrackerGeometry* PixelFitterByConformalMappingAndLine::theTracker
private

Definition at line 26 of file PixelFitterByConformalMappingAndLine.h.

◆ theTTRHBuilder

const TransientTrackingRecHitBuilder* PixelFitterByConformalMappingAndLine::theTTRHBuilder
private

Definition at line 25 of file PixelFitterByConformalMappingAndLine.h.

Referenced by run().

◆ theUseFixImpactParameter

const bool PixelFitterByConformalMappingAndLine::theUseFixImpactParameter
private

Definition at line 29 of file PixelFitterByConformalMappingAndLine.h.

Referenced by run().