CMS 3D CMS Logo

PixelFitterByHelixProjections Class Reference

#include <RecoPixelVertexing/PixelTrackFitting/interface/PixelFitterByHelixProjections.h>

Inheritance diagram for PixelFitterByHelixProjections:

PixelFitter

List of all members.

Public Member Functions

 PixelFitterByHelixProjections (const edm::ParameterSet &cfg)
virtual reco::Trackrun (const edm::EventSetup &es, const std::vector< const TrackingRecHit * > &hits, const TrackingRegion &region) const
virtual ~PixelFitterByHelixProjections ()

Private Member Functions

int charge (const std::vector< GlobalPoint > &points) const
float cotTheta (const GlobalPoint &pinner, const GlobalPoint &pouter) const
double errTip2 (float apt, float eta) const
double errZip2 (float apt, float eta) const
float phi (float xC, float yC, int charge) const
float pt (float curvature) const
float zip (float d0, float curv, const GlobalPoint &pinner, const GlobalPoint &pouter) const

Private Attributes

edm::ParameterSet theConfig
const MagneticFieldtheField
const TrackerGeometrytheTracker
const
TransientTrackingRecHitBuilder
theTTRecHitBuilder


Detailed Description

Definition at line 19 of file PixelFitterByHelixProjections.h.


Constructor & Destructor Documentation

PixelFitterByHelixProjections::PixelFitterByHelixProjections ( const edm::ParameterSet cfg  ) 

Definition at line 38 of file PixelFitterByHelixProjections.cc.

00040  : theConfig(cfg), theTracker(0), theField(0), theTTRecHitBuilder(0) { }

virtual PixelFitterByHelixProjections::~PixelFitterByHelixProjections (  )  [inline, virtual]

Definition at line 22 of file PixelFitterByHelixProjections.h.

00022 {}


Member Function Documentation

int PixelFitterByHelixProjections::charge ( const std::vector< GlobalPoint > &  points  )  const [private]

Referenced by run().

float PixelFitterByHelixProjections::cotTheta ( const GlobalPoint pinner,
const GlobalPoint pouter 
) const [private]

Definition at line 136 of file PixelFitterByHelixProjections.cc.

References e, PV3DBase< T, PVType, FrameType >::perp(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by run().

00138 {
00139    float dr = outer.perp()-inner.perp();
00140    float dz = outer.z()-inner.z();
00141    return (fabs(dr) > 1.e-3) ? dz/dr : 0;
00142 }

double PixelFitterByHelixProjections::errTip2 ( float  apt,
float  eta 
) const [private]

Definition at line 195 of file PixelFitterByHelixProjections.cc.

References err, p1, p2, and pt().

Referenced by run().

00196 {
00197   float pt = (apt <= 10.) ? apt : 10.;
00198   double p1=0, p2=0;
00199   float feta = fabs(eta);
00200   if (feta<=0.8)
00201     {
00202       p1=5.9e-3;
00203       p2=4.7e-3;
00204     }
00205   else if (feta <=1.6){
00206     p1 = 4.9e-3;
00207     p2 = 7.1e-3;
00208   }
00209   else {
00210     p1 = 6.4e-3;
00211     p2 = 1.0e-2;
00212   }
00213   float err=0;
00214   if (pt != 0) err = (p1 + p2/pt);
00215   return err*err;
00216 }

double PixelFitterByHelixProjections::errZip2 ( float  apt,
float  eta 
) const [private]

Definition at line 169 of file PixelFitterByHelixProjections.cc.

References p1, p2, p3, p4, and pt().

Referenced by run().

00170 {
00171   double ziperr=0;
00172   float pt = (apt <= 10.) ? apt: 10.;
00173   double p1=0, p2=0,p3=0,p4=0;
00174   float feta = fabs(eta);
00175   if (feta<=0.8){
00176     p1 = 0.12676e-1;
00177     p2 = -0.22411e-2;
00178     p3 = 0.2987e-3;
00179     p4 = -0.12779e-4;
00180   } else if (feta <=1.6){
00181     p1 = 0.24047e-1;
00182     p2 = -0.66935e-2;
00183     p3 = 0.88111e-3;
00184     p4 = -0.38482e-4;
00185   } else {
00186     p1 = 0.56084e-1;
00187     p2 = -0.13960e-1;
00188     p3 = 0.15744e-2;
00189     p4 = -0.60757e-4;
00190   }
00191   ziperr = p1 + p2*pt + p3*pt*pt +p4*pt*pt*pt;
00192   return ziperr*ziperr;
00193 }

float PixelFitterByHelixProjections::phi ( float  xC,
float  yC,
int  charge 
) const [private]

Definition at line 144 of file PixelFitterByHelixProjections.cc.

Referenced by run().

00144                                                                             {
00145   float phiC = 0.;
00146 
00147   if (charge>0) phiC = atan2(xC,-yC);
00148   else phiC = atan2(-xC,yC);
00149 
00150   return phiC;
00151 }

float PixelFitterByHelixProjections::pt ( float  curvature  )  const [private]

Referenced by errTip2(), errZip2(), and run().

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

Implements PixelFitter.

Definition at line 42 of file PixelFitterByHelixProjections.cc.

References TransientTrackingRecHitBuilder::build(), PixelTrackBuilder::build(), CircleFromThreePoints::center(), charge(), RZLine::chi2(), cotTheta(), PixelRecoUtilities::curvature(), CircleFromThreePoints::curvature(), e4, HLT_VtxMuL3::errors, errTip2(), errZip2(), RZLine::fit(), edm::EventSetup::get(), edm::ParameterSet::getParameter(), PixelRecoUtilities::inversePt(), Basic2DVector< T >::mag(), phi(), edm::ESHandle< T >::product(), pt(), funct::sqrt(), theConfig, theField, theTracker, theTTRecHitBuilder, tip, Basic2DVector< T >::x(), Basic2DVector< T >::y(), and zip().

00046 {
00047   int nhits = hits.size();
00048   if (nhits <2) return 0;
00049 
00050   vector<GlobalPoint> points;
00051   vector<GlobalError> errors;
00052   vector<bool> isBarrel;
00053   
00054   if (!theField || !theTracker || !theTTRecHitBuilder) {
00055 
00056     edm::ESHandle<TrackerGeometry> trackerESH;
00057     es.get<TrackerDigiGeometryRecord>().get(trackerESH);
00058     theTracker = trackerESH.product();
00059 
00060     edm::ESHandle<MagneticField> fieldESH;
00061     es.get<IdealMagneticFieldRecord>().get(fieldESH);
00062     theField = fieldESH.product();
00063 
00064     edm::ESHandle<TransientTrackingRecHitBuilder> ttrhbESH;
00065 //    std::string builderName = "WithoutRefit";
00066 //    std::string builderName = "TTRHBuilder4PixelTriplets";
00067     std::string builderName = theConfig.getParameter<std::string>("TTRHBuilder");
00068     es.get<TransientRecHitRecord>().get(builderName,ttrhbESH);
00069     theTTRecHitBuilder = ttrhbESH.product();
00070 
00071   }
00072 
00073   for ( vector<const TrackingRecHit*>::const_iterator ih = hits.begin(); ih != hits.end(); ih++) {
00074 
00075 //    const GeomDet * det = theTracker->idToDet( (**ih).geographicalId());
00076 //    GlobalPoint p = det->surface().toGlobal( (**ih).localPosition());
00077 
00078     TransientTrackingRecHit::RecHitPointer recHit = theTTRecHitBuilder->build(*ih);
00079     points.push_back( recHit->globalPosition());
00080     errors.push_back( recHit->globalPositionError());
00081     isBarrel.push_back( recHit->detUnit()->type().isBarrel() );
00082   }
00083 
00084   CircleFromThreePoints circle = (nhits==2) ?
00085         CircleFromThreePoints( GlobalPoint(0.,0.,0.), points[0], points[1]) :
00086         CircleFromThreePoints(points[0],points[1],points[2]); 
00087 
00088   int charge = PixelFitterByHelixProjections::charge(points);
00089   float curvature = circle.curvature();
00090 
00091   float invPt = PixelRecoUtilities::inversePt( circle.curvature(), es);
00092   float valPt = (invPt > 1.e-4) ? 1./invPt : 1.e4;
00093   float errPt = 0.055*valPt + 0.017*valPt*valPt;
00094 
00095   CircleFromThreePoints::Vector2D center = circle.center();
00096   float valTip = charge * (center.mag()-1/curvature);
00097   float errTip = sqrt(errTip2(valPt, points.back().eta()));
00098 
00099   float valPhi = PixelFitterByHelixProjections::phi(center.x(), center.y(), charge);
00100   float errPhi = 0.002;
00101 
00102   float valZip = zip(valTip, curvature, points[0],points[1]);
00103   float errZip = sqrt(errZip2(valPt, points.back().eta()));
00104 
00105   float valCotTheta = PixelFitterByHelixProjections::cotTheta(points[0],points[1]);
00106   float errCotTheta = 0.002;
00107 
00108   float chi2 = 0;
00109   if (nhits > 2) {
00110     RZLine rzLine(points,errors,isBarrel);
00111     float cottheta, intercept, covss, covii, covsi; 
00112     rzLine.fit(cottheta, intercept, covss, covii, covsi);
00113     chi2 = rzLine.chi2(cottheta, intercept);         //FIXME: check which intercept to use!
00114   }
00115 
00116   PixelTrackBuilder builder;
00117   Measurement1D pt(valPt, errPt);
00118   Measurement1D phi(valPhi, errPhi);
00119   Measurement1D cotTheta(valCotTheta, errCotTheta);
00120   Measurement1D tip(valTip, errTip);
00121   Measurement1D zip(valZip, errZip);
00122 
00123   return builder.build(pt, phi, cotTheta, tip, zip, chi2, charge, hits, theField);
00124 }

float PixelFitterByHelixProjections::zip ( float  d0,
float  curv,
const GlobalPoint pinner,
const GlobalPoint pouter 
) const [private]

Definition at line 153 of file PixelFitterByHelixProjections.cc.

References PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::perp2(), r1, r2, and PV3DBase< T, PVType, FrameType >::z().

Referenced by run().

00155 {
00156 //phi = asin(r*rho/2) with asin(x) ~= x+x**3/(2*3)
00157   float rho3 = curv*curv*curv;
00158   float r1 = pinner.perp();
00159   double phi1 = r1*curv/2 + pinner.perp2()*r1*rho3/48.;
00160   float r2 = pouter.perp();
00161   double phi2 = r2*curv/2 + pouter.perp2()*r2*rho3/48.;
00162   double z1 = pinner.z();
00163   double z2 = pouter.z();
00164 
00165   return z1 - phi1/(phi1-phi2)*(z1-z2);
00166 }


Member Data Documentation

edm::ParameterSet PixelFitterByHelixProjections::theConfig [private]

Definition at line 38 of file PixelFitterByHelixProjections.h.

Referenced by run().

const MagneticField* PixelFitterByHelixProjections::theField [mutable, private]

Definition at line 41 of file PixelFitterByHelixProjections.h.

Referenced by run().

const TrackerGeometry* PixelFitterByHelixProjections::theTracker [mutable, private]

Definition at line 40 of file PixelFitterByHelixProjections.h.

Referenced by run().

const TransientTrackingRecHitBuilder* PixelFitterByHelixProjections::theTTRecHitBuilder [mutable, private]

Definition at line 42 of file PixelFitterByHelixProjections.h.

Referenced by run().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:30:02 2009 for CMSSW by  doxygen 1.5.4