CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
PixelFitterByConformalMappingAndLine Class Reference

#include <PixelFitterByConformalMappingAndLine.h>

Inheritance diagram for PixelFitterByConformalMappingAndLine:
PixelFitter

Public Member Functions

 PixelFitterByConformalMappingAndLine (const edm::ParameterSet &cfg)
 
 PixelFitterByConformalMappingAndLine ()
 
virtual reco::Trackrun (const edm::EventSetup &es, const std::vector< const TrackingRecHit * > &hits, const TrackingRegion &region) const
 
virtual ~PixelFitterByConformalMappingAndLine ()
 
- Public Member Functions inherited from PixelFitter
virtual reco::Trackrun (const edm::Event &ev, const edm::EventSetup &es, const std::vector< const TrackingRecHit * > &hits, const TrackingRegion &region) const
 
virtual ~PixelFitter ()
 

Private Attributes

edm::ParameterSet theConfig
 

Detailed Description

Definition at line 12 of file PixelFitterByConformalMappingAndLine.h.

Constructor & Destructor Documentation

PixelFitterByConformalMappingAndLine::PixelFitterByConformalMappingAndLine ( const edm::ParameterSet cfg)

Definition at line 40 of file PixelFitterByConformalMappingAndLine.cc.

PixelFitterByConformalMappingAndLine::PixelFitterByConformalMappingAndLine ( )

Definition at line 44 of file PixelFitterByConformalMappingAndLine.cc.

45 { }
virtual PixelFitterByConformalMappingAndLine::~PixelFitterByConformalMappingAndLine ( )
inlinevirtual

Definition at line 16 of file PixelFitterByConformalMappingAndLine.h.

16 { }

Member Function Documentation

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

Reimplemented from PixelFitter.

Definition at line 47 of file PixelFitterByConformalMappingAndLine.cc.

References PixelTrackBuilder::build(), DeDxDiscriminatorTools::charge(), ConformalMappingFit::charge(), RZLine::chi2(), ConformalMappingFit::chi2(), ConformalMappingFit::curvature(), GlobalErrorBase< T, ErrorWeightType >::czz(), ConformalMappingFit::directionPhi(), error, Measurement1D::error(), benchmark_cfg::errors, edm::ParameterSet::exists(), RZLine::fit(), ConformalMappingFit::fixImpactParmaeter(), edm::EventSetup::get(), edm::ParameterSet::getParameter(), i, ConformalMappingFit::impactParameter(), PixelRecoUtilities::inversePt(), TrackingRegion::origin(), PV3DBase< T, PVType, FrameType >::perp2(), phi, point, edm::ESHandle< class >::product(), alignCSCRings::r, GlobalErrorBase< T, ErrorWeightType >::rerr(), funct::sqr(), mathSSE::sqrt(), theConfig, patCandidatesForDimuonsSequences_cff::tracker, Measurement1D::value(), PV3DBase< T, PVType, FrameType >::x(), create_public_lumi_plots::xy, PV3DBase< T, PVType, FrameType >::y(), detailsBasic3DVector::z, and PV3DBase< T, PVType, FrameType >::z().

51 {
52 
53  int nhits = hits.size();
54 
55  vector<GlobalPoint> points;
56  vector<GlobalError> errors;
57  vector<bool> isBarrel;
58 
59 
61  es.get<TrackerDigiGeometryRecord>().get(tracker);
62 
64  es.get<IdealMagneticFieldRecord>().get(field);
65 
67  string ttrhBuilderName = theConfig.getParameter<std::string>("TTRHBuilder");
68  es.get<TransientRecHitRecord>().get( ttrhBuilderName, ttrhBuilder);
69 
70  for (vector<const TrackingRecHit*>::const_iterator ih=hits.begin(); ih!=hits.end(); ih++) {
71  TransientTrackingRecHit::RecHitPointer recHit = ttrhBuilder->build(*ih);
72  points.push_back( recHit->globalPosition() );
73  errors.push_back( recHit->globalPositionError() );
74  isBarrel.push_back( recHit->detUnit()->type().isBarrel() );
75  }
76 
77 // if (useMultScatt) {
78 // MultipleScatteringParametrisation ms(hits[i].layer());
79 // float cotTheta = (p.z()-zVtx)/p.perp();
80 // err += sqr( ms( pt, cotTheta, PixelRecoPointRZ(0.,zVtx) ) );
81 // }
82 
83  //
84  // simple fit to get pt, phi0 used for precise calcul.
85  //
86  typedef ConformalMappingFit::PointXY PointXY;
87  vector<PointXY> xy; vector<float> errRPhi2;
88  for (int i=0; i < nhits; ++i) {
89  const GlobalPoint & point = points[i];
90  xy.push_back(PointXY( point.x()-region.origin().x(), point.y()-region.origin().y()));
91  float phiErr2 = errors[i].phierr(point);
92  errRPhi2.push_back( point.perp2()*phiErr2);
93  }
94  ConformalMappingFit parabola(xy, errRPhi2);
95  if (theConfig.exists("fixImpactParameter"))
96  parabola.fixImpactParmaeter(theConfig.getParameter<double>("fixImpactParameter"));
97  else if (nhits < 3) parabola.fixImpactParmaeter(0.);
98 
99 
100  Measurement1D curv = parabola.curvature();
101  float invPt = PixelRecoUtilities::inversePt( curv.value(), es);
102  float valPt = (invPt > 1.e-4) ? 1./invPt : 1.e4;
103  float errPt =PixelRecoUtilities::inversePt(curv.error(), es) * sqr(valPt);
104  Measurement1D pt (valPt,errPt);
105  Measurement1D phi = parabola.directionPhi();
106  Measurement1D tip = parabola.impactParameter();
107 
108  //
109  // precalculate theta to correct errors:
110  //
111  vector<float> r(nhits),z(nhits),errZ(nhits);
112  float simpleCot = ( points.back().z()-points.front().z() )/ (points.back().perp() - points.front().perp() );
113  for (int i=0; i< nhits; ++i) {
114  const GlobalPoint & point = points[i];
115  const GlobalError & error = errors[i];
116  r[i] = sqrt( sqr(point.x()-region.origin().x()) + sqr(point.y()-region.origin().y()) );
118  z[i] = point.z()-region.origin().z();
119  errZ[i] = (isBarrel[i]) ? sqrt(error.czz()) : sqrt( error.rerr(point) )*simpleCot;
120  }
121 
122  //
123  // line fit (R-Z plane)
124  //
125  RZLine rzLine(r,z,errZ);
126  float cottheta, intercept, covss, covii, covsi;
127  rzLine.fit(cottheta, intercept, covss, covii, covsi);
128 
129 //
130 // parameters for track builder
131 //
132  Measurement1D zip(intercept, sqrt(covii));
133  Measurement1D cotTheta(cottheta, sqrt(covss));
134  float chi2 = parabola.chi2() + rzLine.chi2(cottheta, intercept);
135  int charge = parabola.charge();
136 
137 
138  PixelTrackBuilder builder;
139  return builder.build(pt, phi, cotTheta, tip, zip, chi2, charge, hits, field.product(), region.origin());
140 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
virtual GlobalPoint origin() const =0
T y() const
Definition: PV3DBase.h:62
bool exists(std::string const &parameterName) const
checks if a parameter exists
double error() const
Definition: Measurement1D.h:30
T perp2() const
Definition: PV3DBase.h:70
double charge(const std::vector< uint8_t > &Ampls)
double double double z
T inversePt(T curvature, const edm::EventSetup &iSetup)
T sqrt(T t)
Definition: SSEVec.h:46
T z() const
Definition: PV3DBase.h:63
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
Definition: RZLine.h:8
T rerr(const GlobalPoint &aPoint) const
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
double value() const
Definition: Measurement1D.h:28
Square< F >::type sqr(const F &f)
Definition: Square.h:13
T x() const
Definition: PV3DBase.h:61
*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
Definition: DDAxes.h:10

Member Data Documentation

edm::ParameterSet PixelFitterByConformalMappingAndLine::theConfig
private

Definition at line 22 of file PixelFitterByConformalMappingAndLine.h.

Referenced by run().