22 vector<const TECPetal*>& outerPetals) :
23 theFrontComps(innerPetals.
begin(),innerPetals.
end()),
24 theBackComps(outerPetals.
begin(),outerPetals.
end())
29 for(vector<const GeometricSearchDet*>::const_iterator it=
theComps.begin();
32 (**it).basicComponents().begin(),
33 (**it).basicComponents().end());
53 LogDebug(
"TkDetLayers") <<
"DEBUG INFO for TECLayer" <<
"\n"
54 <<
"TECLayer z,perp, innerRadius, outerR: "
61 for(vector<const GeometricSearchDet*>::const_iterator it=
theFrontComps.begin();
63 LogDebug(
"TkDetLayers") <<
"frontPetal phi,z,r: "
64 << (*it)->surface().position().phi() <<
" , "
65 << (*it)->surface().position().z() <<
" , "
66 << (*it)->surface().position().perp() ;
69 for(vector<const GeometricSearchDet*>::const_iterator it=
theBackComps.begin();
71 LogDebug(
"TkDetLayers") <<
"backPetal phi,z,r: "
72 << (*it)->surface().position().phi() <<
" , "
73 << (*it)->surface().position().z() <<
" , "
74 << (*it)->surface().position().perp() ;
84 vector<const GeometricSearchDet*>::const_iterator
i;
95 std::vector<DetGroup> &
result)
const {
98 if(! crossings.
isValid())
return;
100 vector<DetGroup> closestResult;
102 LogDebug(
"TkDetLayers") <<
"in TECLayer, closestResult.size(): " << closestResult.size();
105 if(closestResult.empty()){
106 vector<DetGroup> nextResult;
108 LogDebug(
"TkDetLayers") <<
"in TECLayer, nextResult.size(): " << nextResult.size();
109 if(nextResult.empty())
return;
121 closestResult,
false);
122 vector<DetGroup> nextResult;
139 HelixForwardPlaneCrossing crossing(startPos,startDir,
rho,propDir);
141 pair<bool,double> frontPath = crossing.pathLength( *
theFrontDisk);
145 GlobalPoint gFrontPoint(crossing.position(frontPath.second));
147 <<
"in TECLayer,front crossing point: r,z,phi: ("
148 << gFrontPoint.perp() <<
","
149 << gFrontPoint.z() <<
","
150 << gFrontPoint.phi() <<
")" << endl;
158 pair<bool,double> backPath = crossing.pathLength( *
theBackDisk);
162 GlobalPoint gBackPoint( crossing.position(backPath.second));
164 <<
"in TECLayer,back crossing point: r,z,phi: ("
165 << gBackPoint.perp() <<
","
166 << gFrontPoint.z() <<
","
167 << gBackPoint.phi() <<
")" << endl;
181 if (frontDist < backDist) {
193 vector<DetGroup>&
result)
const
199 <<
"in TECLayer, adding petal at r,z,phi: ("
200 << det->position().perp() <<
","
201 << det->position().z() <<
","
202 << det->position().phi() <<
")" << endl;
213 bool checkClosest)
const
220 int negStartIndex = closestIndex-1;
221 int posStartIndex = closestIndex+1;
224 if (
PhiLess()( gCrossingPos.
phi(), sLayer[closestIndex]->position().
phi())) {
225 posStartIndex = closestIndex;
228 negStartIndex = closestIndex;
235 int half = sLayer.size()/2;
236 for (
int idet=negStartIndex; idet >= negStartIndex - half; idet--) {
238 if (!
overlap( gCrossingPos, neighborPetal, window))
break;
239 if (!
Adder::add( neighborPetal, tsos, prop, est, result))
break;
242 for (
int idet=posStartIndex; idet < posStartIndex + half; idet++) {
244 if (!
overlap( gCrossingPos, neighborPetal, window))
break;
245 if (!
Adder::add( neighborPetal, tsos, prop, est, result))
break;
253 const BoundDiskSector& diskSector =
static_cast<const BoundDiskSector&
>(gsdet.
surface());
254 pair<float,float> phiRange(phi-phiWin,phi+phiWin);
255 pair<float,float> petalPhiRange(diskSector.phi() - 0.5*diskSector.phiExtension(),
256 diskSector.phi() + 0.5*diskSector.phiExtension());
270 const BoundDiskSector& diskSector =
static_cast<const BoundDiskSector&
>(petals.front()->surface());
272 float rmin = diskSector.innerRadius();
273 float rmax = diskSector.outerRadius();
275 float theZmax(petals.front()->position().z());
276 float theZmin(theZmax);
277 for ( vector<const GeometricSearchDet*>::const_iterator
i = petals.begin();
i != petals.end();
i++ ) {
278 float zmin = (**i).position().z() - (**i).surface().bounds().thickness()/2.;
279 float zmax = (**i).position().z() + (**i).surface().bounds().thickness()/2.;
280 theZmax =
max( theZmax, zmax);
281 theZmin =
min( theZmin, zmin);
284 float zPos = (theZmax+theZmin)/2.;
289 theZmin-zPos, theZmax-zPos));
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
std::vector< const GeomDet * > theBasicComps
int closestDetIndex() const
double deltaPhi(float phi1, float phi2)
void searchNeighbors(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, float window, std::vector< DetGroup > &result, bool checkClosest) const
void setSurface(BoundDisk *cp)
Geom::Phi< T > phi() const
GlobalPoint globalPosition() const
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
ReferenceCountingPointer< BoundDisk > theFrontDisk
void groupedCompatibleDetsV(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const
virtual PropagationDirection propagationDirection() const GCC11_FINAL
virtual int binIndex(T phi) const
returns an index in the valid range for the bin that contains phi
const GlobalPoint & position() const
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop) const
bool addClosest(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result) const
std::vector< const GeometricSearchDet * > theComps
ReferenceCountingPointer< BoundDisk > theBackDisk
const T & max(const T &a, const T &b)
std::vector< const GeometricSearchDet * > theFrontComps
virtual const BoundSurface & surface() const GCC11_FINAL
The surface of the GeometricSearchDet.
bool rangesIntersect(const Range &a, const Range &b)
int subLayerIndex() const
std::vector< const GeometricSearchDet * > theBackComps
BinFinderPhi theBackBinFinder
Abs< T >::type abs(const T &t)
PeriodicBinFinderInPhi< double > BinFinderPhi
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
const std::vector< const GeometricSearchDet * > & subLayer(int ind) const
const SubLayerCrossing & other() const
SubLayerCrossings computeCrossings(const TrajectoryStateOnSurface &startingState, PropagationDirection propDir) const
virtual const Surface::PositionType & position() const
Returns position of the surface.
BinFinderPhi theFrontBinFinder
virtual BoundDisk * computeDisk(std::vector< const GeometricSearchDet * > &petals) const
static bool add(const GeometricSearchDet &det, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result)
virtual const BoundDisk & specificSurface() const GCC11_FINAL
const SubLayerCrossing & closest() const
GlobalVector globalMomentum() const
bool overlap(const GlobalPoint &gpos, const GeometricSearchDet &petal, float window) const
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
static void orderAndMergeTwoLevels(std::vector< DetGroup > &&one, std::vector< DetGroup > &&two, std::vector< DetGroup > &result, int firstIndex, int firstCrossed)
TECLayer(std::vector< const TECPetal * > &innerPetals, std::vector< const TECPetal * > &outerPetals)
double transverseCurvature() const