31 vector<const GeomDet*>& outerDets,
32 vector<const GeomDet*>& innerDetBrothers,
33 vector<const GeomDet*>& outerDetBrothers):
35 theInnerDets(innerDets),theOuterDets(outerDets),theInnerDetBrothers(innerDetBrothers),theOuterDetBrothers(outerDetBrothers)
60 LogDebug(
"TkDetLayers") <<
"==== DEBUG Phase2OTBarrelRod =====" ;
61 for (vector<const GeomDet*>::const_iterator
i=
theInnerDets.begin();
63 LogDebug(
"TkDetLayers") <<
"inner Phase2OTBarrelRod's Det pos z,perp,eta,phi: "
64 << (**i).position().z() <<
" , "
65 << (**i).position().perp() <<
" , "
66 << (**i).position().eta() <<
" , "
67 << (**i).position().phi() ;
70 for (vector<const GeomDet*>::const_iterator
i=
theOuterDets.begin();
72 LogDebug(
"TkDetLayers") <<
"outer Phase2OTBarrelRod's Det pos z,perp,eta,phi: "
73 << (**i).position().z() <<
" , "
74 << (**i).position().perp() <<
" , "
75 << (**i).position().eta() <<
" , "
76 << (**i).position().phi() ;
78 LogDebug(
"TkDetLayers") <<
"==== end DEBUG Phase2OTBarrelRod =====" ;
89 const vector<const GeometricSearchDet*>&
91 throw DetLayerException(
"Phase2OTBarrelRod doesn't have GeometricSearchDet components");
94 pair<bool, TrajectoryStateOnSurface>
97 edm::LogError(
"TkDetLayers") <<
"temporary dummy implementation of Phase2OTBarrelRod::compatible()!!" ;
98 return pair<bool,TrajectoryStateOnSurface>();
109 std::vector<DetGroup> &
result)
const{
113 if(! crossings.
isValid())
return;
115 std::vector<DetGroup> closestResult;
116 std::vector<DetGroup> closestBrotherResult;
117 addClosest( tsos, prop, est, crossings.
closest(), closestResult, closestBrotherResult);
118 if (closestResult.empty()){
119 std::vector<DetGroup> nextResult;
120 std::vector<DetGroup> nextBrotherResult;
121 addClosest( tsos, prop, est, crossings.
other(), nextResult, nextBrotherResult);
122 if(nextResult.empty())
return;
126 std::vector<DetGroup> closestCompleteResult;
129 std::vector<DetGroup> nextCompleteResult;
142 closestResult, closestBrotherResult,
false);
144 std::vector<DetGroup> closestCompleteResult;
148 std::vector<DetGroup> nextResult;
149 std::vector<DetGroup> nextBrotherResult;
151 nextResult, nextBrotherResult,
true);
153 std::vector<DetGroup> nextCompleteResult;
174 std::pair<bool,double> outerPath = crossing.pathLength( *
theOuterPlane);
176 GlobalPoint gOuterPoint( crossing.position(outerPath.second));
178 std::pair<bool,double> innerPath = crossing.pathLength( *
theInnerPlane);
180 GlobalPoint gInnerPoint( crossing.position(innerPath.second));
191 if (innerDist < outerDist) {
208 vector<DetGroup>& brotherresult)
const
217 tsos, prop, est, brotherresult);
219 return firstgroup || brothergroup;
250 float localY = localCrossPoint.
y();
256 return (
std::abs(localY)-window) < relativeMargin*detHalfLength;
269 vector<DetGroup>& brotherresult,
270 bool checkClosest)
const
278 int negStartIndex = closestIndex-1;
279 int posStartIndex = closestIndex+1;
282 if (gCrossingPos.
z() < sRod[closestIndex]->surface().position().z()) {
283 posStartIndex = closestIndex;
286 negStartIndex = closestIndex;
291 for (
int idet=negStartIndex; idet >= 0; idet--) {
292 if (!
overlap( gCrossingPos, *sRod[idet], window))
break;
293 if (!
Adder::add( *sRod[idet], tsos, prop, est, result))
break;
295 Adder::add( *sBrotherRod[idet], tsos, prop, est, brotherresult);
297 for (
int idet=posStartIndex; idet < static_cast<int>(sRod.size()); idet++) {
298 if (!
overlap( gCrossingPos, *sRod[idet], window))
break;
299 if (!
Adder::add( *sRod[idet], tsos, prop, est, result))
break;
301 Adder::add( *sBrotherRod[idet], tsos, prop, est, brotherresult);
Phase2OTBarrelRod(std::vector< const GeomDet * > &innerDets, std::vector< const GeomDet * > &outerDets, std::vector< const GeomDet * > &innerDetBrothers, std::vector< const GeomDet * > &outerDetBrothers) __attribute__((cold))
static int barrelSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
returns 0 if barrel layer crossed from inside, 1 if from outside
virtual float length() const =0
virtual PropagationDirection propagationDirection() const
int closestDetIndex() const
BinFinderType theOuterBinFinder
~Phase2OTBarrelRod() __attribute__((cold))
GlobalPoint globalPosition() const
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
const Bounds & bounds() const
const Plane & surface() const
The nominal surface of the GeomDet.
virtual T binPosition(int ind) const
the middle of the bin.
std::vector< const GeomDet * > theDets
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
const Surface::PositionType & position() const
The position (origin of the R.F.)
void groupedCompatibleDetsV(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const __attribute__((hot))
BinFinderType theInnerBinFinder
LocalPoint toLocal(const GlobalPoint &gp) const
int subLayerIndex() const
Abs< T >::type abs(const T &t)
std::vector< const GeomDet * > theOuterDetBrothers
virtual std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const __attribute__((cold))
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
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))
GenericBinFinderInZ< float, GeomDet > BinFinderType
virtual const std::vector< const GeometricSearchDet * > & components() const __attribute__((cold))
Returns basic components, if any.
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))
const std::vector< const GeomDet * > & subRodBrothers(int ind) const
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const
ReferenceCountingPointer< Plane > theOuterPlane
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const __attribute__((hot))
void setPlane(Plane *plane)
Set the rod's plane.
SubLayerCrossings computeCrossings(const TrajectoryStateOnSurface &tsos, PropagationDirection propDir) const __attribute__((hot))
const SubLayerCrossing & closest() const
GlobalVector globalMomentum() const
ReferenceCountingPointer< Plane > theInnerPlane
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
virtual int binIndex(T z) const
returns an index in the valid range for the bin closest to Z
static void orderAndMergeTwoLevels(std::vector< DetGroup > &&one, std::vector< DetGroup > &&two, std::vector< DetGroup > &result, int firstIndex, int firstCrossed)
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))
const std::vector< const GeomDet * > & subRod(int ind) const
std::vector< const GeomDet * > theOuterDets
std::vector< const GeomDet * > theInnerDets
std::vector< const GeomDet * > theInnerDetBrothers
double transverseCurvature() const