32 template <
class T>
T sqr(
T t) {
return t*
t;}
38 double fixImpactParameter,
39 bool useFixImpactParameter):
40 theTTRHBuilder(ttrhBuilder),
43 theFixImpactParameter(fixImpactParameter),
44 theUseFixImpactParameter(useFixImpactParameter)
48 const std::vector<const TrackingRecHit * > &
hits,
53 int nhits = hits.size();
55 vector<GlobalPoint>
points;
56 vector<GlobalError>
errors;
60 for (vector<const TrackingRecHit*>::const_iterator ih=hits.begin(); ih!=hits.end(); ih++) {
62 points.push_back( recHit->globalPosition() );
63 errors.push_back( recHit->globalPositionError() );
64 isBarrel.push_back( recHit->detUnit()->type().isBarrel() );
77 vector<PointXY>
xy; vector<float> errRPhi2;
80 xy.push_back(PointXY( point.
x()-region.
origin().
x(), point.
y()-region.
origin().
y()));
81 float phiErr2 = errors[
i].phierr(point);
82 errRPhi2.push_back( point.
perp2()*phiErr2);
92 float valPt = (invPt > 1.e-4) ? 1./invPt : 1.
e4;
101 vector<float>
r(nhits),
z(nhits),
errZ(nhits);
102 float simpleCot = ( points.back().z()-points.front().z() )/ (points.back().perp() - points.front().perp() );
109 errZ[
i] = (isBarrel[
i]) ?
sqrt(error.
czz()) :
sqrt( error.
rerr(point) )*simpleCot;
127 return std::unique_ptr<reco::Track>(builder.
build(pt, phi, cotTheta, tip, zip, chi2, charge, hits,
theField, region.
origin()));
GlobalPoint const & origin() const
bool isBarrel(GeomDetEnumerators::SubDetector m)
def setup(process, global_tag, zero_tesla=False)
T inversePt(T curvature, const edm::EventSetup &iSetup)
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
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
std::shared_ptr< TrackingRecHit const > RecHitPointer
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
T rerr(const GlobalPoint &aPoint) const
*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