8 using namespace ctfseeding;
13 theLsb(conf.getParameter<edm::
ParameterSet>(
"LayerPSet")){
14 edm::LogInfo(
"CtfSpecialSeedGenerator|GenericTripletGenerator") <<
"Constructing GenericTripletGenerator";
32 SeedingLayerSets::const_iterator iLss;
33 std::map<float, OrderedHitTriplet> radius_triplet_map;
34 for (iLss = lss.begin(); iLss != lss.end(); iLss++){
37 throw cms::Exception(
"CtfSpecialSeedGenerator") <<
"You are using " << ls.size() <<
" layers in set instead of 3 ";
39 std::vector<SeedingHit> innerHits = region.
hits(e, es, &ls[0]);
41 std::vector<SeedingHit> middleHits = region.
hits(e, es, &ls[1]);
43 std::vector<SeedingHit> outerHits = region.
hits(e, es, &ls[2]);
46 std::vector<SeedingHit>::const_iterator iOuterHit;
47 for (iOuterHit = outerHits.begin(); iOuterHit != outerHits.end(); iOuterHit++){
48 std::vector<SeedingHit>::const_iterator iMiddleHit;
49 for (iMiddleHit = middleHits.begin(); iMiddleHit != middleHits.end(); iMiddleHit++){
50 std::vector<SeedingHit>::const_iterator iInnerHit;
51 for (iInnerHit = innerHits.begin(); iInnerHit != innerHits.end(); iInnerHit++){
60 std::pair<bool,float> val_radius =
qualityFilter(oht,radius_triplet_map,ls);
61 if (val_radius.first){
67 radius_triplet_map.insert(std::make_pair(val_radius.second,oht));
78 const std::map<float, OrderedHitTriplet>&
map,
84 std::vector<const TrackingRecHit*> ohttrh;
85 ohttrh.push_back(&(*(oht.
inner()))); ohttrh.push_back(&(*(oht.
middle()))); ohttrh.push_back(&(*(oht.
outer())));
86 std::vector<const TrackingRecHit*>::const_iterator ioht;
89 float limit_phi_distance1 =
sqrt((middlepos.
x()-outerpos.
x())*(middlepos.
x()-outerpos.
x()) +
90 (middlepos.
y()-outerpos.
y())*(middlepos.
y()-outerpos.
y()))/middlepos.
mag();
91 float limit_phi_distance2 =
sqrt((middlepos.
x()-innerpos.
x())*(middlepos.
x()-innerpos.
x()) +
92 (middlepos.
y()-innerpos.
y())*(middlepos.
y()-innerpos.
y()))/innerpos.
mag();
95 if (fabs(outerpos.
phi()-middlepos.
phi())>fabs(atan(limit_phi_distance1)) ||
96 fabs(innerpos.
phi()-middlepos.
phi())>fabs(atan(limit_phi_distance2)) ) {
98 return std::make_pair(
false, 0.);
118 FastCircle circle(innerpos, middlepos, outerpos);
119 if (circle.
rho() < 200 && circle.
rho() != 0)
return std::make_pair(
false, circle.
rho());
122 std::map<float, OrderedHitTriplet>::const_iterator lower_bound = map.lower_bound((1-0.01)*circle.
rho());
123 std::map<float, OrderedHitTriplet>::const_iterator upper_bound = map.upper_bound((1+0.01)*circle.
rho());
124 std::map<float, OrderedHitTriplet>::const_iterator iter;
125 for (iter = lower_bound; iter != upper_bound && iter->first <= upper_bound->first; iter++){
127 std::vector<const TrackingRecHit*> curtrh;
128 curtrh.push_back(&*(iter->second.inner()));curtrh.push_back(&*(iter->second.middle()));curtrh.push_back(&*(iter->second.outer()));
129 std::vector<const TrackingRecHit*>::const_iterator curiter;
130 for (curiter = curtrh.begin(); curiter != curtrh.end(); curiter++){
131 for (ioht = ohttrh.begin(); ioht != ohttrh.end(); ioht++){
132 if ((*ioht)->geographicalId()==(*curiter)->geographicalId() &&
133 ((*ioht)->localPosition()-(*curiter)->localPosition()).
mag()<1
e-5) shared++;
136 if (shared>1)
return std::make_pair(
false, circle.
rho());
139 return std::make_pair(
true,circle.
rho());
GenericTripletGenerator(const edm::ParameterSet &conf)
SeedingLayerSetsBuilder theLsb
const OuterRecHit & outer() const
OrderedHitTriplets hitTriplets
virtual Hits hits(const edm::Event &ev, const edm::EventSetup &es, const ctfseeding::SeedingLayer *layer) const =0
get hits from layer compatible with region constraints
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Geom::Phi< T > phi() const
const InnerRecHit & inner() const
const MiddleRecHit & middle() const
std::pair< bool, float > qualityFilter(const OrderedHitTriplet &oht, const std::map< float, OrderedHitTriplet > &map, const ctfseeding::SeedingLayers &ls) const
ctfseeding::SeedingLayerSets init(const edm::EventSetup &es)
ctfseeding::SeedingLayerSets layers(const edm::EventSetup &es) const
TransientTrackingRecHit::ConstRecHitPointer SeedingHit
virtual const OrderedSeedingHits & run(const TrackingRegion ®ion, const edm::Event &ev, const edm::EventSetup &es)
std::vector< SeedingLayer > SeedingLayers
std::vector< std::vector< SeedingLayer > > SeedingLayerSets