16 const std::vector<int>& charges,
18 double errorRescaling):theMagfield(mf), theTracker(geom), theBuilder(builder), thePropagatorAlong(propagatorAlong), thePropagatorOpposite(propagatorOpposite), theSetMomentum(momFromPSet), theCharges(charges), theErrorRescaling(errorRescaling){}
25 std::vector<TrajectorySeed*> seeds;
26 if (hits.
size() == 3) {
29 if (seed) seeds.push_back(seed);
33 if(seed) seeds.push_back(seed);
37 }
else if (hits.
size() == 2){
40 if (seed) seeds.push_back(seed);
44 if (seed) seeds.push_back(seed);
48 throw cms::Exception(
"CombinatorialSeedGeneratorForCosmics") <<
" Wrong number of hits in Set: "
49 << hits.
size() <<
", should be 2 or 3 ";
58 if (hits.
size() != 3) {
60 "call to SeedFromGenericPairOrTriplet::seedFromTriplet with " << hits.
size() <<
" hits ";
70 LogDebug(
"SeedFromGenericPairOrTriplet") <<
72 <<
", " << outer.
phi()
73 <<
"," << outer.
theta()
75 << middle.
perp() <<
", "
76 << middle.
phi() <<
","
77 << middle.
theta() <<
") "
80 <<
", " << inner.
phi()
81 <<
"," << inner.
theta() <<
") "
82 <<
" (x, y, z) outer ("
85 << inner.
z() <<
") middle ("
105 int momentumSign = 1;
109 std::vector<const TrackingRecHit*> trHits;
111 LogDebug(
"SeedFromGenericPairOrTriplet")
112 <<
"Seed from outsideIn alongMomentum OR insideOut oppositeToMomentum";
114 secondPoint = &middle;
116 trHits.push_back(outerHit);
117 trHits.push_back(middleHit);
121 LogDebug(
"SeedFromGenericPairOrTriplet")
122 <<
"Seed from outsideIn oppositeToMomentum OR insideOut alongMomentum";
124 secondPoint = &middle;
126 trHits.push_back(innerHit);
127 trHits.push_back(middleHit);
132 FastHelix helix(*thirdPoint, *secondPoint, *firstPoint, iSetup);
134 LogDebug(
"SeedFromGenericPairOrTriplet") <<
"originalStartingState " << originalStartingState;
157 if (hits.
size() != 2) {
159 "call to SeedFromGenericPairOrTriplet::seedFromPair with " << hits.
size() <<
" hits ";
165 LogDebug(
"SeedFromGenericPairOrTriplet") <<
166 "Using the following hits: outer(r, phi, theta) (" << outer.
perp()
167 <<
", " << outer.
phi()
168 <<
"," << outer.
theta()
171 <<
", " << inner.
phi()
172 <<
"," << inner.
theta() <<
")";
175 int momentumSign = 1;
178 std::vector<const TrackingRecHit*> trHits;
181 LogDebug(
"SeedFromGenericPairOrTriplet")
182 <<
"Seed from outsideIn alongMomentum OR insideOut oppositeToMomentum";
184 secondPoint = &
inner;
187 trHits.push_back(outerHit);
188 trHits.push_back(innerHit);
190 LogDebug(
"SeedFromGenericPairOrTriplet")
191 <<
"Seed from outsideIn oppositeToMomentum OR insideOut alongMomentum";
193 secondPoint = &
outer;
197 trHits.push_back(innerHit);
198 trHits.push_back(outerHit);
218 std::vector<const TrackingRecHit*>& trHits,
226 LogDebug(
"SeedFromGenericPairOrTriplet") <<
227 "Using the following hits: first(r, phi, theta) (" << first.
perp()
228 <<
", " << first.
phi()
229 <<
"," << first.
theta()
232 <<
", " << second.
phi()
233 <<
"," << second.
theta() <<
")";
237 LocalVector lmom = transHit->surface()->toLocal(momentum);
239 lmom.
x()/lmom.
z(),lmom.
y()/lmom.
z(),
240 transHit->localPosition().x(),
241 transHit->localPosition().y(),
245 (1.+(lmom.
x()/lmom.
z())*(lmom.
x()/lmom.
z())),
246 (1.+(lmom.
y()/lmom.
z())*(lmom.
y()/lmom.
z())),
258 LogDebug(
"SeedFromGenericPairOrTriplet") <<
"first propagation failed";
263 LogDebug(
"SeedFromGenericPairOrTriplet") <<
"first update failed";
266 LogDebug(
"SeedFromGenericPairOrTriplet") <<
"starting TSOS " << seedTSOS ;
272 std::vector<const TrackingRecHit*>::const_iterator ihits;
273 for (ihits = trHits.begin(); ihits != trHits.end(); ihits++){
310 std::vector<GlobalPoint> gPoints;
311 unsigned int nHits = hits.
size();
312 for (
unsigned int iHit = 0; iHit < nHits; ++iHit) gPoints.push_back(hits[iHit]->globalPosition());
313 unsigned int subid=(*hits[0]).geographicalId().subdetId();
315 LogDebug(
"SeedFromGenericPairOrTriplet")
316 <<
"In the endcaps we cannot decide if hits are aligned with only phi and z";
322 if (circle.
rho() < 500 && circle.
rho() != 0) {
323 LogDebug(
"SeedFromGenericPairOrTriplet") <<
324 "Seed qualityFilter rejected because rho = " << circle.
rho();
335 if (momentum.
perp() <
theP)
return false;
void rescaleError(double factor)
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
FTS stateAtVertex() const
void update(const LocalTrajectoryParameters &p, const Surface &aSurface, const MagneticField *field, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
const Propagator * thePropagatorAlong
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
TrajectoryStateTransform theTransformer
TrackCharge charge() const
Geom::Theta< T > theta() const
U second(std::pair< T, U > const &p)
std::vector< int > theCharges
const TransientTrackingRecHitBuilder * theBuilder
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
TrajectorySeed * seedFromTriplet(const SeedingHitSet &hits, const PropagationDirection &dir, const NavigationDirection &seedDir, const edm::EventSetup &iSetup, int charge=-1) const
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
virtual const GeomDet * idToDet(DetId) const
GlobalVector momentum() const
TrajectorySeed * buildSeed(const GlobalVector &momentum, int charge, std::vector< const TrackingRecHit * > &trHits, const PropagationDirection &dir) const
virtual TrajectoryStateOnSurface propagate(const FreeTrajectoryState &, const Surface &) 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
unsigned int size() const
void add(TransientTrackingRecHit::ConstRecHitPointer pHit)
DetId geographicalId() const
virtual LocalPoint localPosition() const =0
const Propagator * thePropagatorOpposite
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
const TrackerGeometry * theTracker