16 const std::vector<int>&
charges,
22 thePropagatorAlong(propagatorAlong),
23 thePropagatorOpposite(propagatorOpposite),
24 theSetMomentum(momFromPSet),
26 theErrorRescaling(errorRescaling) {}
32 std::vector<TrajectorySeed*> seeds;
33 if (hits.
size() == 3) {
37 seeds.push_back(seed);
39 for (std::vector<int>::const_iterator iCh =
theCharges.begin(); iCh !=
theCharges.end(); iCh++) {
42 seeds.push_back(seed);
46 }
else if (hits.
size() == 2) {
50 seeds.push_back(seed);
52 for (std::vector<int>::const_iterator iCh =
theCharges.begin(); iCh !=
theCharges.end(); iCh++) {
55 seeds.push_back(seed);
60 <<
" Wrong number of hits in Set: " << hits.
size() <<
", should be 2 or 3 ";
70 if (hits.
size() != 3) {
72 <<
"call to SeedFromGenericPairOrTriplet::seedFromTriplet with " << hits.
size() <<
" hits ";
75 auto innerHit = hits[0];
76 auto middleHit = hits[1];
77 auto outerHit = hits[2];
82 LogDebug(
"SeedFromGenericPairOrTriplet")
83 <<
"Using the following hits: outer(r, phi, theta) " << outerHit->geographicalId().subdetId() <<
" (" 84 << outer.
perp() <<
", " << outer.
phi() <<
"," << outer.
theta() <<
") " 85 << middleHit->geographicalId().subdetId() <<
" middle (" << middle.
perp() <<
", " << middle.
phi() <<
"," 86 << middle.
theta() <<
") " << innerHit->geographicalId().subdetId() <<
" inner (" << inner.
perp() <<
", " 87 << inner.
phi() <<
"," << inner.
theta() <<
") " 88 <<
" (x, y, z) outer (" << inner.
x() <<
", " << inner.
y() <<
", " << inner.
z() <<
") middle (" 89 << middle.
x() <<
", " << middle.
y() <<
", " << middle.
z() <<
")";
93 SeedingHitSet newSet(sdir ? hits[1] : hits[0], sdir ? hits[2] : hits[1]);
100 int momentumSign = 1;
104 std::vector<const BaseTrackerRecHit*> trHits;
106 LogDebug(
"SeedFromGenericPairOrTriplet") <<
"Seed from outsideIn alongMomentum OR insideOut oppositeToMomentum";
108 secondPoint = &middle;
110 trHits.push_back(outerHit);
111 trHits.push_back(middleHit);
115 LogDebug(
"SeedFromGenericPairOrTriplet") <<
"Seed from outsideIn oppositeToMomentum OR insideOut alongMomentum";
117 secondPoint = &middle;
119 trHits.push_back(innerHit);
120 trHits.push_back(middleHit);
128 LogDebug(
"SeedFromGenericPairOrTriplet") <<
"originalStartingState " << originalStartingState;
142 if (!
qualityFilter(momentumSign * originalStartingState.momentum()))
146 buildSeed(momentumSign * originalStartingState.momentum(), originalStartingState.charge(), trHits,
dir);
154 if (hits.
size() != 2) {
156 <<
"call to SeedFromGenericPairOrTriplet::seedFromPair with " << hits.
size() <<
" hits ";
158 auto innerHit = hits[0];
159 auto outerHit = hits[1];
162 LogDebug(
"SeedFromGenericPairOrTriplet")
163 <<
"Using the following hits: outer(r, phi, theta) (" << outer.
perp() <<
", " << outer.
phi() <<
"," 164 << outer.
theta() <<
") inner (" << inner.
perp() <<
", " << inner.
phi() <<
"," << inner.
theta() <<
")";
167 int momentumSign = 1;
170 std::vector<const BaseTrackerRecHit*> trHits;
173 LogDebug(
"SeedFromGenericPairOrTriplet") <<
"Seed from outsideIn alongMomentum OR insideOut oppositeToMomentum";
175 secondPoint = &
inner;
178 trHits.push_back(outerHit);
179 trHits.push_back(innerHit);
181 LogDebug(
"SeedFromGenericPairOrTriplet") <<
"Seed from outsideIn oppositeToMomentum OR insideOut alongMomentum";
183 secondPoint = &
outer;
187 trHits.push_back(innerHit);
188 trHits.push_back(outerHit);
208 std::vector<const BaseTrackerRecHit*>& trHits,
217 LogDebug(
"SeedFromGenericPairOrTriplet")
218 <<
"Using the following hits: first(r, phi, theta) (" << first.
perp() <<
", " << first.
phi() <<
"," 219 << first.
theta() <<
") second (" << second.
perp() <<
", " << second.
phi() <<
"," << second.
theta() <<
")";
222 auto transHit = trHits[0];
223 LocalVector lmom = transHit->surface()->toLocal(momentum);
227 transHit->localPosition().x(),
228 transHit->localPosition().y(),
229 lmom.
z() > 0. ? 1. : -1.);
233 (1. + (lmom.
x() / lmom.
z()) * (lmom.
x() / lmom.
z())),
234 (1. + (lmom.
y() / lmom.
z()) * (lmom.
y() / lmom.
z())),
235 1. / momentum.
mag());
241 auto transHit2 = trHits[1];
246 LogDebug(
"SeedFromGenericPairOrTriplet") <<
"first propagation failed";
251 LogDebug(
"SeedFromGenericPairOrTriplet") <<
"first update failed";
254 LogDebug(
"SeedFromGenericPairOrTriplet") <<
"starting TSOS " << seedTSOS;
260 for (
auto ihits = trHits.begin(); ihits != trHits.end(); ihits++) {
295 if (hits.
size() == 3) {
296 std::vector<GlobalPoint> gPoints;
297 unsigned int nHits = hits.
size();
298 for (
unsigned int iHit = 0; iHit < nHits; ++iHit)
299 gPoints.push_back(hits[iHit]->globalPosition());
300 unsigned int subid = (*hits[0]).geographicalId().subdetId();
302 LogDebug(
"SeedFromGenericPairOrTriplet")
303 <<
"In the endcaps we cannot decide if hits are aligned with only phi and z";
306 FastCircle circle(gPoints[0], gPoints[1], gPoints[2]);
307 if (circle.
rho() < 500 && circle.
rho() != 0) {
308 LogDebug(
"SeedFromGenericPairOrTriplet") <<
"Seed qualityFilter rejected because rho = " << circle.
rho();
void rescaleError(double factor)
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
static constexpr auto TEC
const Propagator * thePropagatorAlong
int nominalValue() const
The nominal field value for this map in kGauss.
TrajectorySeed * seedFromPair(const SeedingHitSet &hits, const PropagationDirection &dir, const NavigationDirection &seedDir, int charge=-1) const
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Geom::Phi< T > phi() const
const Plane & surface() const
The nominal surface of the GeomDet.
Geom::Theta< T > theta() const
U second(std::pair< T, U > const &p)
std::vector< int > theCharges
void update(const LocalTrajectoryParameters &p, const SurfaceType &aSurface, const MagneticField *field, SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
TrajectorySeed * seedFromTriplet(const SeedingHitSet &hits, const PropagationDirection &dir, const NavigationDirection &seedDir, const edm::EventSetup &iSetup, int charge=-1) const
std::vector< TrajectorySeed * > seed(const SeedingHitSet &hits, const PropagationDirection &dir, const NavigationDirection &seedDir, const edm::EventSetup &iSetup)
SeedFromGenericPairOrTriplet(const MagneticField *mf, const TrackerGeometry *geom, const TransientTrackingRecHitBuilder *builder, const Propagator *propagatorAlong, const Propagator *propagatorOpposite, const std::vector< int > &charges, bool momFromPSet, double errorRescaling)
bool qualityFilter(const SeedingHitSet &hits) const
TrajectorySeed * buildSeed(const GlobalVector &momentum, int charge, std::vector< const BaseTrackerRecHit * > &trHits, const PropagationDirection &dir) const
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
const MagneticField * theMagfield
unsigned int size() const
const TrackerGeomDet * idToDet(DetId) const override
charges
only generated particles of these IDs are considered
const Propagator * thePropagatorOpposite
static constexpr auto TID
const TrackerGeometry * theTracker
Basic3DVector unit() const