24 theComps.assign(theInnerComps.begin(),theInnerComps.end());
25 theComps.insert(theComps.end(),theOuterComps.begin(),theOuterComps.end());
27 for(vector<const GeometricSearchDet*>::const_iterator it=theComps.begin();
28 it!=theComps.end();it++){
29 theBasicComps.insert(theBasicComps.end(),
30 (**it).basicComponents().begin(),
31 (**it).basicComponents().end());
34 theInnerCylinder = cylinder( theInnerComps);
35 theOuterCylinder = cylinder( theOuterComps);
37 if (theInnerComps.size())
38 theInnerBinFinder =
BinFinderType(theInnerComps.front()->position().phi(),
39 theInnerComps.size());
41 if (theOuterComps.size())
42 theOuterBinFinder =
BinFinderType(theOuterComps.front()->position().phi(),
43 theOuterComps.size());
48 LogDebug(
"TkDetLayers") <<
"==== DEBUG TBPLayer =====" ;
49 LogDebug(
"TkDetLayers") <<
"innerCyl radius, thickness, lenght: " 50 << theInnerCylinder->radius() <<
" , " 51 << theInnerCylinder->bounds().thickness() <<
" , " 52 << theInnerCylinder->bounds().length() ;
54 LogDebug(
"TkDetLayers") <<
"outerCyl radius, thickness, lenght: " 55 << theOuterCylinder->radius() <<
" , " 56 << theOuterCylinder->bounds().thickness() <<
" , " 57 << theOuterCylinder->bounds().length() ;
59 LogDebug(
"TkDetLayers") <<
"Cyl radius, thickness, lenght: " 60 << specificSurface().radius() <<
" , " 61 << specificSurface().bounds().thickness() <<
" , " 62 << specificSurface().bounds().length() ;
64 for (vector<const GeometricSearchDet*>::const_iterator
i=theInnerComps.begin();
65 i != theInnerComps.end();
i++){
66 LogDebug(
"TkDetLayers") <<
"inner Rod pos z,perp,eta,phi: " 67 << (**i).position().z() <<
" , " 68 << (**i).position().perp() <<
" , " 69 << (**i).position().eta() <<
" , " 70 << (**i).position().phi() ;
73 for (vector<const GeometricSearchDet*>::const_iterator
i=theOuterComps.begin();
74 i != theOuterComps.end();
i++){
75 LogDebug(
"TkDetLayers") <<
"outer Rod pos z,perp,eta,phi: " 76 << (**i).position().z() <<
" , " 77 << (**i).position().perp() <<
" , " 78 << (**i).position().eta() <<
" , " 79 << (**i).position().phi() ;
81 LogDebug(
"TkDetLayers") <<
"==== end DEBUG TBPLayer =====" ;
89 vector<const GeomDet*>
tmp;
90 for (vector<const GeometricSearchDet*>::const_iterator it=rods.begin(); it!=rods.end(); it++) {
91 tmp.insert(tmp.end(),(*it)->basicComponents().begin(),(*it)->basicComponents().end());
100 int innerIndex = theInnerBinFinder.binIndex(gInnerPoint.
barePhi());
101 float innerDist = theInnerBinFinder.binPosition(innerIndex) - gInnerPoint.
barePhi();
103 int outerIndex = theOuterBinFinder.binIndex(gOuterPoint.
barePhi());
104 float outerDist = theOuterBinFinder.binPosition(outerIndex) - gOuterPoint.
barePhi() ;
107 innerDist *=
PhiLess()( theInnerBinFinder.binPosition(innerIndex),gInnerPoint.
barePhi()) ? -1.
f : 1.
f;
108 outerDist *=
PhiLess()( theOuterBinFinder.binPosition(outerIndex),gOuterPoint.
barePhi()) ? -1.
f : 1.
f;
112 return std::make_tuple(innerDist < outerDist,innerIndex, outerIndex);
132 bool checkClosest)
const {
136 auto gphi = gCrossingPos.
barePhi();
138 const vector<const GeometricSearchDet*>& sLayer( subLayer( crossing.
subLayerIndex()));
141 int negStartIndex = closestIndex-1;
142 int posStartIndex = closestIndex+1;
145 if (
PhiLess()( gphi, sLayer[closestIndex]->surface().phi())) {
146 posStartIndex = closestIndex;
149 negStartIndex = closestIndex;
156 int quarter = sLayer.size()/4;
157 for (
int idet=negStartIndex; idet >= negStartIndex - quarter; idet--) {
159 if (!
overlap( gphi, neighborRod, window))
break;
160 if (!
Adder::add( neighborRod, tsos, prop, est, result))
break;
163 for (
int idet=posStartIndex; idet < posStartIndex + quarter; idet++) {
165 if (!
overlap( gphi, neighborRod, window))
break;
166 if (!
Adder::add( neighborRod, tsos, prop, est, result))
break;
void searchNeighbors(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, float window, std::vector< DetGroup > &result, bool checkClosest) const __attribute__((hot))
~TBPLayer() __attribute__((cold))
virtual void initialize()
int closestDetIndex() const
BoundCylinder * cylinder(const std::vector< const GeometricSearchDet * > &rods) const __attribute__((cold))
virtual int binIndex(T phi) const
returns an index in the valid range for the bin that contains phi
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
const GlobalPoint & position() const
void construct() __attribute__((cold))
int subLayerIndex() const
def window(xmin, xmax, ymin, ymax, x=0, y=0, width=100, height=100, xlogbase=None, ylogbase=None, minusInfinity=-1000, flipx=False, flipy=True)
bool overlap(float phi, const GeometricSearchDet &gsdet, float phiWin)
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
std::vector< std::vector< double > > tmp
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const __attribute__((hot))
std::tuple< bool, int, int > computeIndexes(GlobalPoint gInnerPoint, GlobalPoint gOuterPoint) const __attribute__((hot))
GeometricSearchDet::DetWithState DetWithState