19 #include <boost/function.hpp>
26 vector<const GeomDet*>& outerDets,
27 vector<const GeomDet*>& innerDetBrothers,
28 vector<const GeomDet*>& outerDetBrothers):
30 theFrontDets(innerDets.
begin(),innerDets.
end()),
31 theBackDets(outerDets.
begin(),outerDets.
end()),
32 theFrontDetBrothers(innerDetBrothers.
begin(),innerDetBrothers.
end()),
33 theBackDetBrothers(outerDetBrothers.
begin(),outerDetBrothers.
end())
57 LogDebug(
"TkDetLayers") <<
"DEBUG INFO for Phase2OTEndcapRing" ;
58 for(vector<const GeomDet*>::const_iterator it=
theFrontDets.begin();
60 LogDebug(
"TkDetLayers") <<
"frontDet phi,z,r: "
61 << (*it)->surface().position().phi() <<
" , "
62 << (*it)->surface().position().z() <<
" , "
63 << (*it)->surface().position().perp() ;
66 for(vector<const GeomDet*>::const_iterator it=
theBackDets.begin();
68 LogDebug(
"TkDetLayers") <<
"backDet phi,z,r: "
69 << (*it)->surface().position().phi() <<
" , "
70 << (*it)->surface().position().z() <<
" , "
71 << (*it)->surface().position().perp() ;
81 const vector<const GeometricSearchDet*>&
84 throw DetLayerException(
"Phase2OTEndcapRing doesn't have GeometricSearchDet components");
88 pair<bool, TrajectoryStateOnSurface>
91 edm::LogError(
"TkDetLayers") <<
"temporary dummy implementation of Phase2OTEndcapRing::compatible()!!" ;
92 return pair<bool,TrajectoryStateOnSurface>();
101 std::vector<DetGroup>&
result)
const
105 if(! crossings.
isValid())
return;
108 std::vector<DetGroup> closestResult;
109 std::vector<DetGroup> closestBrotherResult;
110 addClosest( tsos, prop, est, crossings.
closest(), closestResult,closestBrotherResult);
111 if (closestResult.empty())
return;
117 closestResult, closestBrotherResult,
false);
119 vector<DetGroup> closestCompleteResult;
123 vector<DetGroup> nextResult;
124 vector<DetGroup> nextBrotherResult;
126 nextResult, nextBrotherResult,
true);
128 vector<DetGroup> nextCompleteResult;
147 pair<bool,double> frontPath = crossing.pathLength( *
theFrontDisk);
150 pair<bool,double> backPath = crossing.pathLength( *
theBackDisk);
153 GlobalPoint gFrontPoint(crossing.position(frontPath.second));
154 GlobalPoint gBackPoint( crossing.position(backPath.second));
170 if (frontDist < backDist) {
183 vector<DetGroup>& brotherresult)
const
192 return firstgroup || brothergroup;
203 vector<DetGroup>& brotherresult,
204 bool checkClosest)
const
213 int negStartIndex = closestIndex-1;
214 int posStartIndex = closestIndex+1;
218 posStartIndex = closestIndex;
221 negStartIndex = closestIndex;
228 int half = sLayer.size()/2;
229 for (
int idet=negStartIndex; idet >= negStartIndex - half; idet--) {
232 if (!
Adder::add( neighborDet, tsos, prop, est, result))
break;
234 const GeomDet & neighborBrotherDet = *sBrotherLayer[binFinder.
binIndex(idet)];
235 Adder::add( neighborBrotherDet, tsos, prop, est, brotherresult);
238 for (
int idet=posStartIndex; idet < posStartIndex + half; idet++) {
241 if (!
Adder::add( neighborDet, tsos, prop, est, result))
break;
243 const GeomDet & neighborBrotherDet = *sBrotherLayer[binFinder.
binIndex(idet)];
244 Adder::add( neighborBrotherDet, tsos, prop, est, brotherresult);
virtual const std::vector< const GeometricSearchDet * > & components() const __attribute__((cold))
Returns basic components, if any.
int closestDetIndex() const
std::vector< const GeomDet * > theFrontDetBrothers
GlobalPoint globalPosition() const
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
std::vector< const GeomDet * > theBackDetBrothers
virtual PropagationDirection propagationDirection() const final
bool addClosest(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result, std::vector< DetGroup > &brotherresult) const __attribute__((hot))
bool overlapInPhi(float phi, const GeomDet &det, float phiWindow)
virtual int binIndex(T phi) const
returns an index in the valid range for the bin that contains phi
void searchNeighbors(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, float window, std::vector< DetGroup > &result, std::vector< DetGroup > &brotherresult, bool checkClosest) const __attribute__((hot))
const GlobalPoint & position() const
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
ReferenceCountingPointer< BoundDisk > theDisk
const std::vector< const GeomDet * > & subLayer(int ind) const
std::vector< const GeomDet * > theDets
std::vector< const GeomDet * > theBackDets
int subLayerIndex() const
Abs< T >::type abs(const T &t)
static int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
Phase2OTEndcapRing(std::vector< const GeomDet * > &innerDets, std::vector< const GeomDet * > &outerDets, std::vector< const GeomDet * > &innerDetBrothers, std::vector< const GeomDet * > &outerDetBrothers)
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
const std::vector< const GeomDet * > & subLayerBrothers(int ind) const
BinFinderType theBackBinFinder
bool phiLess(float phi1, float phi2)
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))
std::vector< const GeomDet * > theFrontDets
BinFinderType theFrontBinFinder
const SubLayerCrossing & closest() const
GlobalVector globalMomentum() 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)
virtual std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const
ReferenceCountingPointer< BoundDisk > theBackDisk
PeriodicBinFinderInPhi< float > BinFinderType
SubLayerCrossings computeCrossings(const TrajectoryStateOnSurface &tsos, PropagationDirection propDir) const __attribute__((hot))
double transverseCurvature() const
void groupedCompatibleDetsV(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const __attribute__((hot))
ReferenceCountingPointer< BoundDisk > theFrontDisk