11 edm::LogInfo(
"CtfSpecialSeedGenerator|GenericTripletGenerator") <<
"Constructing GenericTripletGenerator";
22 if (
layers.numberOfLayersInSet() != 3)
24 <<
"You are using " <<
layers.numberOfLayersInSet() <<
" layers in set instead of 3 ";
25 std::map<float, OrderedHitTriplet> radius_triplet_map;
29 auto middleHits =
region.hits(
ls[1]);
34 for (
auto iOuterHit = outerHits.begin(); iOuterHit != outerHits.end(); iOuterHit++) {
35 for (
auto iMiddleHit = middleHits.begin(); iMiddleHit != middleHits.end(); iMiddleHit++) {
36 for (
auto iInnerHit = innerHits.begin(); iInnerHit != innerHits.end(); iInnerHit++) {
45 std::pair<bool, float> val_radius =
qualityFilter(oht, radius_triplet_map,
ls);
46 if (val_radius.first) {
52 radius_triplet_map.insert(std::make_pair(val_radius.second, oht));
63 const std::map<float, OrderedHitTriplet>&
map,
69 std::vector<const TrackingRecHit*> ohttrh;
70 ohttrh.push_back(&(*(oht.
inner())));
71 ohttrh.push_back(&(*(oht.
middle())));
72 ohttrh.push_back(&(*(oht.
outer())));
73 std::vector<const TrackingRecHit*>::const_iterator ioht;
76 float limit_phi_distance1 =
sqrt((middlepos.
x() - outerpos.
x()) * (middlepos.
x() - outerpos.
x()) +
77 (middlepos.
y() - outerpos.
y()) * (middlepos.
y() - outerpos.
y())) /
79 float limit_phi_distance2 =
sqrt((middlepos.
x() - innerpos.
x()) * (middlepos.
x() - innerpos.
x()) +
80 (middlepos.
y() - innerpos.
y()) * (middlepos.
y() - innerpos.
y())) /
84 if (fabs(outerpos.
phi() - middlepos.
phi()) > fabs(atan(limit_phi_distance1)) ||
85 fabs(innerpos.
phi() - middlepos.
phi()) > fabs(atan(limit_phi_distance2))) {
87 return std::make_pair(
false, 0.);
107 FastCircle circle(innerpos, middlepos, outerpos);
108 if (circle.
rho() < 200 && circle.
rho() != 0)
109 return std::make_pair(
false, circle.
rho());
112 std::map<float, OrderedHitTriplet>::const_iterator
lower_bound =
map.lower_bound((1 - 0.01) * circle.
rho());
113 std::map<float, OrderedHitTriplet>::const_iterator
upper_bound =
map.upper_bound((1 + 0.01) * circle.
rho());
114 std::map<float, OrderedHitTriplet>::const_iterator iter;
117 std::vector<const TrackingRecHit*> curtrh;
118 curtrh.push_back(&*(iter->second.inner()));
119 curtrh.push_back(&*(iter->second.middle()));
120 curtrh.push_back(&*(iter->second.outer()));
121 std::vector<const TrackingRecHit*>::const_iterator curiter;
122 for (curiter = curtrh.begin(); curiter != curtrh.end(); curiter++) {
123 for (ioht = ohttrh.begin(); ioht != ohttrh.end(); ioht++) {
124 if ((*ioht)->geographicalId() == (*curiter)->geographicalId() &&
125 ((*ioht)->localPosition() - (*curiter)->localPosition()).
mag() < 1
e-5)
130 return std::make_pair(
false, circle.
rho());
133 return std::make_pair(
true, circle.
rho());
SeedingHitSet::ConstRecHitPointer SeedingHit
OrderedHitTriplets hitTriplets
Geom::Phi< T > phi() const
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
BaseTrackerRecHit const * ConstRecHitPointer
MiddleRecHit middle() const
const OrderedSeedingHits & run(const TrackingRegion ®ion, const edm::Event &ev, const edm::EventSetup &es) override
std::pair< bool, float > qualityFilter(const OrderedHitTriplet &oht, const std::map< float, OrderedHitTriplet > &map, const SeedingLayerSetsHits::SeedingLayerSet &ls) const
Log< level::Info, false > LogInfo
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
OuterRecHit outer() const
GenericTripletGenerator(const edm::ParameterSet &conf, edm::ConsumesCollector &iC)
InnerRecHit inner() const