36 theChi2Cut(
cfg.getParameter<double>(
"chi2Cut")) {}
45 const std::vector<SeedingLayerSetsHits::SeedingLayer>& thirdLayers) {
55 double errorXY =
region.originRBound();
60 OrderedHitPairs::const_iterator ip;
68 if (!firstLayer || !secondLayer)
71 int size = thirdLayers.size();
74 for (
int il = 0; il <=
size - 1; il++) {
75 thirdHitMap[il] = &(*theLayerCache)(thirdLayers[il],
region);
85 for (ip = pairs.begin(); ip != pairs.end(); ip++) {
96 double msRPhi1 = sigma1RPhi(pt_p1p2,
line.cotLine(), 0.f);
97 double msRPhi2 = sigma2RPhi(pt_p1p2,
line.cotLine(), point1);
98 double sinTheta = 1 /
sqrt(1 +
sqr(
line.cotLine()));
101 double p1_errorRPhi =
sqrt(
sqr((*ip).inner()->errorGlobalRPhi()) +
sqr(msRPhi1) +
sqr(errorXY));
102 double p2_errorRPhi =
sqrt(
sqr((*ip).outer()->errorGlobalRPhi()) +
sqr(msRPhi2) +
sqr(errorXY));
106 for (
int il = 0; il <=
size - 1; il++) {
110 double msRPhi3 = sigma3RPhi(pt_p1p2,
line.cotLine(), point2);
122 float zMin = zLayer - halfThickness;
123 float zMax = zLayer + halfThickness;
127 if (zLayer * p3_a.
z() < 0)
132 double displacment =
shift.perp();
133 GlobalPoint crossing1 = predictionRPhi.crossing(rRange.min() - displacment) +
shift;
134 GlobalPoint crossing2 = predictionRPhi.crossing(rRange.max() + displacment) +
shift;
135 float c1_phi = crossing1.
phi();
136 float c2_phi = crossing2.
phi();
138 swap(c1_phi, c2_phi);
139 if (c2_phi - c1_phi >
M_PI) {
141 swap(c1_phi, c2_phi);
144 c1_phi -= extraAngle;
145 c2_phi += extraAngle;
146 vector<Hit> thirdHits = thirdHitMap[il]->
hits(c1_phi, c2_phi);
148 typedef vector<Hit>::const_iterator IH;
149 for (IH th = thirdHits.begin(), eh = thirdHits.end(); th < eh; ++th) {
151 double p3_errorRPhi =
sqrt(
sqr((*th)->errorGlobalRPhi()) +
sqr(msRPhi3) +
sqr(errorXY));
153 predictionRPhi.add(
p3, p3_errorRPhi);
155 double curvature = predictionRPhi.curvature();
158 sqrt(
sqr((*ip).inner()->errorGlobalR()) +
sqr(msRPhi1 / cosTheta)),
159 sqrt(
sqr((*ip).inner()->errorGlobalZ()) +
sqr(msRPhi1 / sinTheta)),
160 (*ip).outer()->globalPosition(),
161 sqrt(
sqr((*ip).outer()->errorGlobalR()) +
sqr(msRPhi2 / cosTheta)),
162 sqrt(
sqr((*ip).outer()->errorGlobalZ()) +
sqr(msRPhi2 / sinTheta)),
166 zPrediction((*th)->globalPosition(),
sqrt(
sqr((*th)->errorGlobalR())) +
sqr(msRPhi3 / cosTheta));
168 double z3Hit = (*th)->globalPosition().z();
171 Range hitZRange(z3Hit - z3HitError, z3Hit + z3HitError);
172 bool inside = hitZRange.hasIntersection(
zRange);
175 bool ptCut = (predictionRPhi.curvature() -
theNSigma * predictionRPhi.errorCurvature() < curvatureMS);
180 edm::LogError(
"TooManyTriplets") <<
" number of triples exceed maximum. no triplets produced.";
181 delete[] thirdHitMap;
186 predictionRPhi.remove(
p3, p3_errorRPhi);
190 delete[] thirdHitMap;
197 const std::vector<const DetLayer*>& thirdLayerDetLayer,
198 const int nThirdLayers) {
199 throw cms::Exception(
"Error") <<
"PixelTripletNoTipGenerator::hitTriplets is not implemented \n";
virtual const Surface::PositionType & position() const
Returns position of the surface.
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const BoundSurface & surface() const final
GeometricSearchDet interface.
PixelRecoRange< T > & sort()
const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
Geom::Phi< T > phi() const
extraHitPhiToleranceForPreFiltering
Global3DPoint GlobalPoint
void hitTriplets(const TrackingRegion ®ion, OrderedHitTriplets &trs, const edm::Event &ev, const edm::EventSetup &es, const SeedingLayerSetsHits::SeedingLayerSet &pairLayers, const std::vector< SeedingLayerSetsHits::SeedingLayer > &thirdLayers) override
Log< level::Error, false > LogError
edm::ESGetToken< MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecord > msmakerToken_
void swap(Association< C > &lhs, Association< C > &rhs)
T curvature(T InversePt, const MagneticField &field)
const unsigned int theMaxElement
~PixelTripletNoTipGenerator() override
virtual float thickness() const =0
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > fieldToken_
float extraHitRZtolerance
T inversePt(T curvature, const MagneticField &field)
std::vector< Hit > hits(float phiMin, float phiMax) const
SeedingHitSet::ConstRecHitPointer Hit
BaseTrackerRecHit const * Hit
float extraHitPhiToleranceForPreFiltering
PixelRecoRange< float > Range
std::unique_ptr< HitPairGeneratorFromLayerPair > thePairGenerator
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
static unsigned int const shift
PixelTripletNoTipGenerator(const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
const Bounds & bounds() const