9 using namespace ctfseeding;
14 edm::LogInfo(
"CtfSpecialSeedGenerator|GenericTripletGenerator") <<
"Constructing GenericTripletGenerator";
28 std::map<float, OrderedHitTriplet> radius_triplet_map;
30 auto innerHits = region.
hits(e, es,
ls[0]);
32 auto middleHits = region.
hits(e, es,
ls[1]);
34 auto outerHits = region.
hits(e, es,
ls[2]);
37 for (
auto iOuterHit = outerHits.begin(); iOuterHit != outerHits.end(); iOuterHit++){
38 for (
auto iMiddleHit = middleHits.begin(); iMiddleHit != middleHits.end(); iMiddleHit++){
39 for (
auto iInnerHit = innerHits.begin(); iInnerHit != innerHits.end(); iInnerHit++){
48 std::pair<bool,float> val_radius =
qualityFilter(oht,radius_triplet_map,
ls);
49 if (val_radius.first){
55 radius_triplet_map.insert(std::make_pair(val_radius.second,oht));
66 const std::map<float, OrderedHitTriplet>& map,
72 std::vector<const TrackingRecHit*> ohttrh;
73 ohttrh.push_back(&(*(oht.
inner()))); ohttrh.push_back(&(*(oht.
middle()))); ohttrh.push_back(&(*(oht.
outer())));
74 std::vector<const TrackingRecHit*>::const_iterator ioht;
77 float limit_phi_distance1 =
sqrt((middlepos.
x()-outerpos.
x())*(middlepos.
x()-outerpos.
x()) +
78 (middlepos.
y()-outerpos.
y())*(middlepos.
y()-outerpos.
y()))/middlepos.
mag();
79 float limit_phi_distance2 =
sqrt((middlepos.
x()-innerpos.
x())*(middlepos.
x()-innerpos.
x()) +
80 (middlepos.
y()-innerpos.
y())*(middlepos.
y()-innerpos.
y()))/innerpos.
mag();
83 if (fabs(outerpos.
phi()-middlepos.
phi())>fabs(atan(limit_phi_distance1)) ||
84 fabs(innerpos.
phi()-middlepos.
phi())>fabs(atan(limit_phi_distance2)) ) {
86 return std::make_pair(
false, 0.);
106 FastCircle circle(innerpos, middlepos, outerpos);
107 if (circle.
rho() < 200 && circle.
rho() != 0)
return std::make_pair(
false, circle.
rho());
110 std::map<float, OrderedHitTriplet>::const_iterator lower_bound = map.lower_bound((1-0.01)*circle.
rho());
111 std::map<float, OrderedHitTriplet>::const_iterator upper_bound = map.upper_bound((1+0.01)*circle.
rho());
112 std::map<float, OrderedHitTriplet>::const_iterator iter;
113 for (iter = lower_bound; iter != upper_bound && iter->first <= upper_bound->first; iter++){
115 std::vector<const TrackingRecHit*> curtrh;
116 curtrh.push_back(&*(iter->second.inner()));curtrh.push_back(&*(iter->second.middle()));curtrh.push_back(&*(iter->second.outer()));
117 std::vector<const TrackingRecHit*>::const_iterator curiter;
118 for (curiter = curtrh.begin(); curiter != curtrh.end(); curiter++){
119 for (ioht = ohttrh.begin(); ioht != ohttrh.end(); ioht++){
120 if ((*ioht)->geographicalId()==(*curiter)->geographicalId() &&
121 ((*ioht)->localPosition()-(*curiter)->localPosition()).
mag()<1
e-5) shared++;
124 if (shared>1)
return std::make_pair(
false, circle.
rho());
127 return std::make_pair(
true,circle.
rho());
unsigned short numberOfLayersInSet() const
Get number of layers in each SeedingLayerSets.
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
OrderedHitTriplets hitTriplets
MiddleRecHit middle() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Geom::Phi< T > phi() const
virtual Hits hits(const edm::Event &ev, const edm::EventSetup &es, const SeedingLayerSetsHits::SeedingLayer &layer) const =0
get hits from layer compatible with region constraints
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
InnerRecHit inner() const
BaseTrackerRecHit const * ConstRecHitPointer
std::pair< bool, float > qualityFilter(const OrderedHitTriplet &oht, const std::map< float, OrderedHitTriplet > &map, const SeedingLayerSetsHits::SeedingLayerSet &ls) const
BaseTrackerRecHit const * SeedingHit
GenericTripletGenerator(const edm::ParameterSet &conf, edm::ConsumesCollector &iC)
virtual const OrderedSeedingHits & run(const TrackingRegion ®ion, const edm::Event &ev, const edm::EventSetup &es)
OuterRecHit outer() const