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 ("
91 SeedingHitSet newSet(sdir ? hits[1] : hits[0], sdir ? hits[2] : hits[1]);
103 std::vector<const TrackingRecHit*> trHits;
105 LogDebug(
"SeedFromGenericPairOrTriplet")
106 <<
"Seed from outsideIn alongMomentum OR insideOut oppositeToMomentum";
108 secondPoint = &middle;
110 trHits.push_back(outerHit);
111 trHits.push_back(middleHit);
115 LogDebug(
"SeedFromGenericPairOrTriplet")
116 <<
"Seed from outsideIn oppositeToMomentum OR insideOut alongMomentum";
118 secondPoint = &middle;
120 trHits.push_back(innerHit);
121 trHits.push_back(middleHit);
126 FastHelix helix(*thirdPoint, *secondPoint, *firstPoint, iSetup);
128 LogDebug(
"SeedFromGenericPairOrTriplet") <<
"originalStartingState " << originalStartingState;
151 if (hits.
size() != 2) {
153 "call to SeedFromGenericPairOrTriplet::seedFromPair with " << hits.
size() <<
" hits ";
159 LogDebug(
"SeedFromGenericPairOrTriplet") <<
160 "Using the following hits: outer(r, phi, theta) (" << outer.
perp()
161 <<
", " << outer.
phi()
162 <<
"," << outer.
theta()
165 <<
", " << inner.
phi()
166 <<
"," << inner.
theta() <<
")";
169 int momentumSign = 1;
172 std::vector<const TrackingRecHit*> trHits;
175 LogDebug(
"SeedFromGenericPairOrTriplet")
176 <<
"Seed from outsideIn alongMomentum OR insideOut oppositeToMomentum";
178 secondPoint = &
inner;
181 trHits.push_back(outerHit);
182 trHits.push_back(innerHit);
184 LogDebug(
"SeedFromGenericPairOrTriplet")
185 <<
"Seed from outsideIn oppositeToMomentum OR insideOut alongMomentum";
187 secondPoint = &
outer;
191 trHits.push_back(innerHit);
192 trHits.push_back(outerHit);
212 std::vector<const TrackingRecHit*>& trHits,
220 LogDebug(
"SeedFromGenericPairOrTriplet") <<
221 "Using the following hits: first(r, phi, theta) (" << first.
perp()
222 <<
", " << first.
phi()
223 <<
"," << first.
theta()
226 <<
", " << second.
phi()
227 <<
"," << second.
theta() <<
")";
231 LocalVector lmom = transHit->surface()->toLocal(momentum);
233 lmom.
x()/lmom.
z(),lmom.
y()/lmom.
z(),
234 transHit->localPosition().x(),
235 transHit->localPosition().y(),
239 (1.+(lmom.
x()/lmom.
z())*(lmom.
x()/lmom.
z())),
240 (1.+(lmom.
y()/lmom.
z())*(lmom.
y()/lmom.
z())),
252 LogDebug(
"SeedFromGenericPairOrTriplet") <<
"first propagation failed";
257 LogDebug(
"SeedFromGenericPairOrTriplet") <<
"first update failed";
260 LogDebug(
"SeedFromGenericPairOrTriplet") <<
"starting TSOS " << seedTSOS ;
266 std::vector<const TrackingRecHit*>::const_iterator ihits;
267 for (ihits = trHits.begin(); ihits != trHits.end(); ihits++){
303 std::vector<GlobalPoint> gPoints;
304 unsigned int nHits = hits.
size();
305 for (
unsigned int iHit = 0; iHit < nHits; ++iHit) gPoints.push_back(hits[iHit]->globalPosition());
306 unsigned int subid=(*hits[0]).geographicalId().subdetId();
308 LogDebug(
"SeedFromGenericPairOrTriplet")
309 <<
"In the endcaps we cannot decide if hits are aligned with only phi and z";
315 if (circle.
rho() < 500 && circle.
rho() != 0) {
316 LogDebug(
"SeedFromGenericPairOrTriplet") <<
317 "Seed qualityFilter rejected because rho = " << circle.
rho();
328 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
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
const BoundPlane & surface() const
The nominal surface of the GeomDet.
unsigned int size() const
DetId geographicalId() const
virtual LocalPoint localPosition() const =0
const Propagator * thePropagatorOpposite
const TrackerGeometry * theTracker