19 const std::vector<int>& charges,
21 double errorRescaling):theMagfield(mf), theTracker(geom), theBuilder(builder), thePropagatorAlong(propagatorAlong), thePropagatorOpposite(propagatorOpposite), theSetMomentum(momFromPSet), theCharges(charges), theErrorRescaling(errorRescaling){}
28 std::vector<TrajectorySeed*> seeds;
29 if (hits.
size() == 3) {
32 if (seed) seeds.push_back(seed);
36 if(seed) seeds.push_back(seed);
40 }
else if (hits.
size() == 2){
43 if (seed) seeds.push_back(seed);
47 if (seed) seeds.push_back(seed);
51 throw cms::Exception(
"CombinatorialSeedGeneratorForCosmics") <<
" Wrong number of hits in Set: "
52 << hits.
size() <<
", should be 2 or 3 ";
61 if (hits.
size() != 3) {
63 "call to SeedFromGenericPairOrTriplet::seedFromTriplet with " << hits.
size() <<
" hits ";
73 LogDebug(
"SeedFromGenericPairOrTriplet") <<
75 <<
", " << outer.
phi()
76 <<
"," << outer.
theta()
78 << middle.
perp() <<
", "
79 << middle.
phi() <<
","
80 << middle.
theta() <<
") "
83 <<
", " << inner.
phi()
84 <<
"," << inner.
theta() <<
") "
85 <<
" (x, y, z) outer ("
88 << inner.
z() <<
") middle ("
108 int momentumSign = 1;
112 std::vector<const TrackingRecHit*> trHits;
114 LogDebug(
"SeedFromGenericPairOrTriplet")
115 <<
"Seed from outsideIn alongMomentum OR insideOut oppositeToMomentum";
117 secondPoint = &middle;
119 trHits.push_back(outerHit);
120 trHits.push_back(middleHit);
124 LogDebug(
"SeedFromGenericPairOrTriplet")
125 <<
"Seed from outsideIn oppositeToMomentum OR insideOut alongMomentum";
127 secondPoint = &middle;
129 trHits.push_back(innerHit);
130 trHits.push_back(middleHit);
135 FastHelix helix(*thirdPoint, *secondPoint, *firstPoint, iSetup);
137 LogDebug(
"SeedFromGenericPairOrTriplet") <<
"originalStartingState " << originalStartingState;
160 if (hits.
size() != 2) {
162 "call to SeedFromGenericPairOrTriplet::seedFromPair with " << hits.
size() <<
" hits ";
168 LogDebug(
"SeedFromGenericPairOrTriplet") <<
169 "Using the following hits: outer(r, phi, theta) (" << outer.
perp()
170 <<
", " << outer.
phi()
171 <<
"," << outer.
theta()
174 <<
", " << inner.
phi()
175 <<
"," << inner.
theta() <<
")";
178 int momentumSign = 1;
181 std::vector<const TrackingRecHit*> trHits;
184 LogDebug(
"SeedFromGenericPairOrTriplet")
185 <<
"Seed from outsideIn alongMomentum OR insideOut oppositeToMomentum";
187 secondPoint = &
inner;
190 trHits.push_back(outerHit);
191 trHits.push_back(innerHit);
193 LogDebug(
"SeedFromGenericPairOrTriplet")
194 <<
"Seed from outsideIn oppositeToMomentum OR insideOut alongMomentum";
196 secondPoint = &
outer;
200 trHits.push_back(innerHit);
201 trHits.push_back(outerHit);
221 std::vector<const TrackingRecHit*>& trHits,
229 LogDebug(
"SeedFromGenericPairOrTriplet") <<
230 "Using the following hits: first(r, phi, theta) (" << first.
perp()
231 <<
", " << first.
phi()
232 <<
"," << first.
theta()
235 <<
", " << second.
phi()
236 <<
"," << second.
theta() <<
")";
240 LocalVector lmom = transHit->surface()->toLocal(momentum);
242 lmom.
x()/lmom.
z(),lmom.
y()/lmom.
z(),
243 transHit->localPosition().x(),
244 transHit->localPosition().y(),
248 (1.+(lmom.
x()/lmom.
z())*(lmom.
x()/lmom.
z())),
249 (1.+(lmom.
y()/lmom.
z())*(lmom.
y()/lmom.
z())),
261 LogDebug(
"SeedFromGenericPairOrTriplet") <<
"first propagation failed";
266 LogDebug(
"SeedFromGenericPairOrTriplet") <<
"first update failed";
269 LogDebug(
"SeedFromGenericPairOrTriplet") <<
"starting TSOS " << seedTSOS ;
275 std::vector<const TrackingRecHit*>::const_iterator ihits;
276 for (ihits = trHits.begin(); ihits != trHits.end(); ihits++){
313 std::vector<GlobalPoint> gPoints;
314 unsigned int nHits = hits.
size();
315 for (
unsigned int iHit = 0; iHit < nHits; ++iHit) gPoints.push_back(hits[iHit]->globalPosition());
316 unsigned int subid=(*hits[0]).geographicalId().subdetId();
318 LogDebug(
"SeedFromGenericPairOrTriplet")
319 <<
"In the endcaps we cannot decide if hits are aligned with only phi and z";
325 if (circle.
rho() < 500 && circle.
rho() != 0) {
326 LogDebug(
"SeedFromGenericPairOrTriplet") <<
327 "Seed qualityFilter rejected because rho = " << circle.
rho();
338 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