55 template <
class T>
inline T sqr(
T t) {
return t*
t;}
67 result[0] = localPosition().x();
77 AlgebraicMatrix KFBasedPixelFitter::MyBeamSpotHit::projectionMatrix()
const
87 thePropagatorLabel(cfg.getParameter<std::
string>(
"propagator")),
88 thePropagatorOppositeLabel(cfg.getParameter<std::
string>(
"propagatorOpposite")),
89 theUseBeamSpot(cfg.getParameter<bool>(
"useBeamSpotConstraint")),
90 theTTRHBuilderName(cfg.getParameter<std::
string>(
"TTRHBuilder"))
98 const std::vector<const TrackingRecHit * > & hits,
101 int nhits = hits.size();
102 if (nhits <2)
return 0;
118 std::vector<GlobalPoint> points(nhits);
119 points[0] = tracker->idToDet(hits[0]->geographicalId())->toGlobal(hits[0]->localPosition());
120 points[1] = tracker->idToDet(hits[1]->geographicalId())->toGlobal(hits[1]->localPosition());
121 points[2] = tracker->idToDet(hits[2]->geographicalId())->toGlobal(hits[2]->localPosition());
132 float valPt = 1.f/invPt;
133 float chargeTmp = (points[1].x()-points[0].x())*(points[2].
y()-points[1].y())
134 - (points[1].
y()-points[0].y())*(points[2].
x()-points[1].x());
135 charge = (chargeTmp>0) ? -1 : 1;
136 float valPhi = (charge>0) ? std::atan2(circle.
center().
x(),-circle.
center().
y()) : std::atan2(-circle.
center().
x(),circle.
center().
y());
142 initMom *= 10000./initMom.
perp();
144 theta = initMom.
theta();
152 float sin2th =
sqr(
sin(theta));
155 float zErr = vertexErr.
czz();
156 float transverseErr = vertexErr.
cxx();
157 C[3][3] = transverseErr;
158 C[4][4] = zErr*sin2th + transverseErr*(1-sin2th);
172 DetId outerDetId = 0;
174 for (
unsigned int iHit = 0; iHit < hits.size(); iHit++) {
176 if (iHit==0) outerState = propagator->propagate(fts,tracker->idToDet(hit->
geographicalId())->surface());
179 if (!state.
isValid())
return 0;
182 outerState = updator.update(state, *recHit);
183 if (!outerState.
isValid())
return 0;
192 DetId innerDetId = 0;
194 for (
int iHit = 2; iHit >= 0; --iHit) {
198 if (!state.
isValid())
return 0;
201 innerState = updator.update(state, *recHit);
202 if (!innerState.
isValid())
return 0;
208 if (!impactPointState.
isValid())
return 0;
218 MyBeamSpotHit bsrh(*beamSpot, &bsgd);
219 impactPointState = updator.update(impactPointState, bsrh);
221 if (!impactPointState.
isValid())
return 0;
224 int ndof = 2*hits.size()-5;
float originRBound() const
bounds the particle vertex in the transverse plane
void rescaleError(double factor)
T getParameter(std::string const &) const
std::string thePropagatorLabel
TrackCharge charge() const
GlobalPoint const & origin() const
const CurvilinearTrajectoryError & curvilinearError() const
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
GlobalPoint globalPosition() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
Geom::Theta< T > theta() const
T inversePt(T curvature, const edm::EventSetup &iSetup)
const SurfaceType & surface() const
CLHEP::HepMatrix AlgebraicMatrix
const T & max(const T &a, const T &b)
static PlanePointer build(Args &&...args)
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
double BeamWidthX() const
beam width X
T y() const
Cartesian y coordinate.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
float originZBound() const
bounds the particle vertex in the longitudinal plane
std::shared_ptr< TrackingRecHit const > RecHitPointer
CLHEP::HepVector AlgebraicVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
double sigmaZ() const
sigma z
float ptMin() const
minimal pt of interest
GlobalVector globalMomentum() const
Square< F >::type sqr(const F &f)
CLHEP::HepSymMatrix AlgebraicSymMatrix
const RotationType & rotation() const
virtual reco::Track * run(const edm::Event &ev, const edm::EventSetup &es, const std::vector< const TrackingRecHit * > &hits, const TrackingRegion ®ion) const
DetId geographicalId() const
std::string thePropagatorOppositeLabel
const PositionType & position() const
std::string theTTRHBuilderName
T x() const
Cartesian x coordinate.
Global3DVector GlobalVector