25 computeDisk( vector<const T*>& petals) {
34 float theZmax(petals.front()->position().z());
35 float theZmin(theZmax);
36 for (
auto i = petals.begin();
i != petals.end();
i++ ) {
37 float zmin = (**i).position().z() - (**i).surface().bounds().thickness()/2.;
38 float zmax = (**i).position().z() + (**i).surface().bounds().thickness()/2.;
39 theZmax =
max( theZmax, zmax);
40 theZmin =
min( theZmin, zmin);
43 float zPos = (theZmax+theZmin)/2.;
48 theZmin-zPos, theZmax-zPos));
57 vector<const TECPetal*>& outerPetals) :
59 theFrontComps(innerPetals.
begin(),innerPetals.
end()),
60 theBackComps(outerPetals.
begin(),outerPetals.
end())
65 for(vector<const GeometricSearchDet*>::const_iterator it=
theComps.begin();
68 (**it).basicComponents().begin(),
69 (**it).basicComponents().end());
89 LogDebug(
"TkDetLayers") <<
"DEBUG INFO for TECLayer" <<
"\n"
90 <<
"TECLayer z,perp, innerRadius, outerR: "
99 LogDebug(
"TkDetLayers") <<
"frontPetal phi,z,r: "
100 << (*it)->surface().position().phi() <<
" , "
101 << (*it)->surface().position().z() <<
" , "
102 << (*it)->surface().position().perp() ;
107 LogDebug(
"TkDetLayers") <<
"backPetal phi,z,r: "
108 << (*it)->surface().position().phi() <<
" , "
109 << (*it)->surface().position().z() <<
" , "
110 << (*it)->surface().position().perp() ;
130 std::vector<DetGroup> &
result)
const {
133 if(! crossings.
isValid())
return;
135 vector<DetGroup> closestResult;
137 LogDebug(
"TkDetLayers") <<
"in TECLayer, closestResult.size(): " << closestResult.size();
140 if(closestResult.empty()){
141 vector<DetGroup> nextResult;
143 LogDebug(
"TkDetLayers") <<
"in TECLayer, nextResult.size(): " << nextResult.size();
144 if(nextResult.empty())
return;
156 closestResult,
false);
157 vector<DetGroup> nextResult;
176 pair<bool,double> frontPath = crossing.pathLength( *
theFrontDisk);
180 GlobalPoint gFrontPoint(crossing.position(frontPath.second));
183 <<
"in TECLayer,front crossing point: r,z,phi: ("
184 << gFrontPoint.perp() <<
","
185 << gFrontPoint.z() <<
","
186 << gFrontPoint.phi() <<
")" << endl;
194 pair<bool,double> backPath = crossing.pathLength( *
theBackDisk);
198 GlobalPoint gBackPoint( crossing.position(backPath.second));
200 <<
"in TECLayer,back crossing point: r,z,phi: ("
201 << gBackPoint.perp() <<
","
202 << gFrontPoint.z() <<
","
203 << gBackPoint.phi() <<
")" << endl;
217 if (frontDist < backDist) {
229 vector<DetGroup>&
result)
const
235 <<
"in TECLayer, adding petal at r,z,phi: ("
236 << det->position().perp() <<
","
237 << det->position().z() <<
","
238 << det->position().phi() <<
")" << endl;
249 pair<float,float> phiRange(phi-phiWin,phi+phiWin);
265 bool checkClosest)
const
268 auto gphi = gCrossingPos.
barePhi();
273 int negStartIndex = closestIndex-1;
274 int posStartIndex = closestIndex+1;
278 posStartIndex = closestIndex;
281 negStartIndex = closestIndex;
288 int half = sLayer.size()/2;
289 for (
int idet=negStartIndex; idet >= negStartIndex - half; idet--) {
290 const auto & neighborPetal = *sLayer[binFinder.
binIndex(idet)];
291 if (!
overlap( gphi, neighborPetal, window))
break;
292 if (!
Adder::add( neighborPetal, tsos, prop, est, result))
break;
295 for (
int idet=posStartIndex; idet < posStartIndex + half; idet++) {
296 const auto & neighborPetal = *sLayer[binFinder.
binIndex(idet)];
297 if (!
overlap( gphi, neighborPetal, window))
break;
298 if (!
Adder::add( neighborPetal, tsos, prop, est, result))
break;
std::vector< const TECPetal * > theBackComps
float innerRadius() const
virtual PropagationDirection propagationDirection() const
std::vector< const GeomDet * > theBasicComps
int closestDetIndex() const
virtual const BoundSurface & surface() const
The surface of the GeometricSearchDet.
void setSurface(BoundDisk *cp)
GlobalPoint globalPosition() const
float phiHalfExtension() const
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
ReferenceCountingPointer< BoundDisk > theFrontDisk
virtual const BoundDiskSector & specificSurface() const final
const std::vector< const TECPetal * > & subLayer(int ind) const
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
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
std::vector< const GeometricSearchDet * > theComps
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))
ReferenceCountingPointer< BoundDisk > theBackDisk
bool addClosest(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result) const __attribute__((hot))
SubLayerCrossings computeCrossings(const TrajectoryStateOnSurface &startingState, PropagationDirection propDir) const __attribute__((hot))
float outerRadius() const
bool rangesIntersect(const Range &a, const Range &b)
int subLayerIndex() const
virtual const BoundDisk & specificSurface() const
~TECLayer() __attribute__((cold))
BinFinderPhi theBackBinFinder
Abs< T >::type abs(const T &t)
static int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
TECLayer(std::vector< const TECPetal * > &innerPetals, std::vector< const TECPetal * > &outerPetals) __attribute__((cold))
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
const SubLayerCrossing & other() const
static bool add(const GeometricSearchDet &det, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) __attribute__((hot))
virtual const Surface::PositionType & position() const
Returns position of the surface.
BinFinderPhi theFrontBinFinder
Geom::Phi< T > phi() const
const SubLayerCrossing & closest() const
GlobalVector globalMomentum() const
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
void groupedCompatibleDetsV(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const __attribute__((hot))
static void orderAndMergeTwoLevels(std::vector< DetGroup > &&one, std::vector< DetGroup > &&two, std::vector< DetGroup > &result, int firstIndex, int firstCrossed)
std::vector< const TECPetal * > theFrontComps
PeriodicBinFinderInPhi< float > BinFinderPhi
double transverseCurvature() const