34 extraHitPhiToleranceForPreFiltering(cfg.getParameter<double>(
"extraHitPhiToleranceForPreFiltering")),
35 theNSigma(cfg.getParameter<double>(
"nSigma")),
36 theChi2Cut(cfg.getParameter<double>(
"chi2Cut")) {}
45 const std::vector<SeedingLayerSetsHits::SeedingLayer>& thirdLayers) {
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++) {
86 GlobalPoint
p1((*ip).inner()->globalPosition() -
shift);
87 GlobalPoint
p2((*ip).outer()->globalPosition() -
shift);
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()));
99 double cosTheta = fabs(line.cotLine()) /
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);
117 rRange =
Range(radius - halfThickness, radius + halfThickness);
122 float zMin = zLayer - halfThickness;
123 float zMax = zLayer + halfThickness;
125 GlobalPoint p3_a =
p2 + dr * (zMin -
p2.z()) / dr.
z();
126 GlobalPoint p3_b =
p2 + dr * (zMax -
p2.z()) / dr.
z();
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) {
150 GlobalPoint p3((*th)->globalPosition() -
shift);
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);
176 bool chi2Cut = (predictionRPhi.chi2() <
theChi2Cut);
177 if (inside && ptCut && chi2Cut) {
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";
float originRBound() const
bounds the particle vertex in the transverse plane
std::vector< Hit > hits(float phiMin, float phiMax) const
GlobalPoint const & origin() const
const BoundSurface & surface() const final
GeometricSearchDet interface.
PixelRecoRange< T > & sort()
const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
virtual Location location() const =0
Which part of the detector (barrel, endcap)
PixelRecoRange< float > Range
Geom::Phi< T > phi() const
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
const Bounds & bounds() const
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
constexpr std::array< uint8_t, layerIndexSize > layer
tuple extraHitRZtolerance
~PixelTripletNoTipGenerator() override
virtual float thickness() const =0
bool getData(T &iHolder) const
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > fieldToken_
float extraHitRZtolerance
tuple extraHitRPhitolerance
T inversePt(T curvature, const MagneticField &field)
SeedingHitSet::ConstRecHitPointer Hit
BaseTrackerRecHit const * Hit
float extraHitPhiToleranceForPreFiltering
std::unique_ptr< HitPairGeneratorFromLayerPair > thePairGenerator
virtual const Surface::PositionType & position() const
Returns position of the surface.
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
float ptMin() const
minimal pt of interest
static unsigned int const shift
PixelTripletNoTipGenerator(const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
unsigned int size() const override
tuple size
Write out results.