30 vector<const GeomDet*>& outerDets):
32 theInnerDets(innerDets),theOuterDets(outerDets)
34 theDets.assign(theInnerDets.begin(),theInnerDets.end());
35 theDets.insert(theDets.end(),theOuterDets.begin(),theOuterDets.end());
39 setPlane( planeBuilder( theDets));
40 theInnerPlane = planeBuilder( theInnerDets);
41 theOuterPlane = planeBuilder( theOuterDets);
44 sort(theDets.begin(),theDets.end(),DetZLess());
45 sort(theInnerDets.begin(),theInnerDets.end(),DetZLess());
46 sort(theOuterDets.begin(),theOuterDets.end(),DetZLess());
47 theInnerBinFinder = BinFinderType(theInnerDets.begin(), theInnerDets.end());
48 theOuterBinFinder = BinFinderType(theOuterDets.begin(), theOuterDets.end());
52 LogDebug(
"TkDetLayers") <<
"==== DEBUG TOBRod =====" ;
53 for (vector<const GeomDet*>::const_iterator
i=theInnerDets.begin();
54 i != theInnerDets.end();
i++){
55 LogDebug(
"TkDetLayers") <<
"inner TOBRod's Det pos z,perp,eta,phi: "
56 << (**i).position().z() <<
" , "
57 << (**i).position().perp() <<
" , "
58 << (**i).position().eta() <<
" , "
59 << (**i).position().phi() ;
62 for (vector<const GeomDet*>::const_iterator
i=theOuterDets.begin();
63 i != theOuterDets.end();
i++){
64 LogDebug(
"TkDetLayers") <<
"outer TOBRod's Det pos z,perp,eta,phi: "
65 << (**i).position().z() <<
" , "
66 << (**i).position().perp() <<
" , "
67 << (**i).position().eta() <<
" , "
68 << (**i).position().phi() ;
70 LogDebug(
"TkDetLayers") <<
"==== end DEBUG TOBRod =====" ;
81 const vector<const GeometricSearchDet*>&
86 pair<bool, TrajectoryStateOnSurface>
89 edm::LogError(
"TkDetLayers") <<
"temporary dummy implementation of TOBRod::compatible()!!" ;
90 return pair<bool,TrajectoryStateOnSurface>();
101 std::vector<DetGroup> &
result)
const{
105 if(! crossings.
isValid())
return;
107 std::vector<DetGroup> closestResult;
108 addClosest( tsos, prop, est, crossings.
closest(), closestResult);
109 if (closestResult.empty()){
110 std::vector<DetGroup> nextResult;
111 addClosest( tsos, prop, est, crossings.
other(), nextResult);
112 if(nextResult.empty())
return;
123 searchNeighbors( tsos, prop, est, crossings.
closest(),
window,
124 closestResult,
false);
126 std::vector<DetGroup> nextResult;
127 searchNeighbors( tsos, prop, est, crossings.
other(),
window,
145 HelixBarrelPlaneCrossingByCircle crossing( startPos, startDir,
rho, propDir);
148 std::pair<bool,double> outerPath = crossing.pathLength( *theOuterPlane);
150 GlobalPoint gOuterPoint( crossing.position(outerPath.second));
152 std::pair<bool,double> innerPath = crossing.pathLength( *theInnerPlane);
154 GlobalPoint gInnerPoint( crossing.position(innerPath.second));
157 int innerIndex = theInnerBinFinder.binIndex(gInnerPoint.z());
158 float innerDist =
std::abs( theInnerBinFinder.binPosition(innerIndex) - gInnerPoint.z());
161 int outerIndex = theOuterBinFinder.binIndex(gOuterPoint.z());
162 float outerDist =
std::abs( theOuterBinFinder.binPosition(outerIndex) - gOuterPoint.z());
165 if (innerDist < outerDist) {
181 vector<DetGroup>& result)
const
184 const vector<const GeomDet*>& sRod( subRod( crossing.
subLayerIndex()));
216 float localY = localCrossPoint.
y();
222 return (
std::abs(localY)-window) < relativeMargin*detHalfLength;
233 vector<DetGroup>& result,
234 bool checkClosest)
const
238 const vector<const GeomDet*>& sRod( subRod( crossing.
subLayerIndex()));
241 int negStartIndex = closestIndex-1;
242 int posStartIndex = closestIndex+1;
245 if (gCrossingPos.
z() < sRod[closestIndex]->surface().position().z()) {
246 posStartIndex = closestIndex;
249 negStartIndex = closestIndex;
254 for (
int idet=negStartIndex; idet >= 0; idet--) {
255 if (!
overlap( gCrossingPos, *sRod[idet], window))
break;
256 if (!
Adder::add( *sRod[idet], tsos, prop, est, result))
break;
258 for (
int idet=posStartIndex; idet < static_cast<int>(sRod.size()); idet++) {
259 if (!
overlap( gCrossingPos, *sRod[idet], window))
break;
260 if (!
Adder::add( *sRod[idet], tsos, prop, est, result))
break;
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
int closestDetIndex() const
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 PropagationDirection propagationDirection() const GCC11_FINAL
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.)
LocalPoint toLocal(const GlobalPoint &gp) const
int subLayerIndex() const
Abs< T >::type abs(const T &t)
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
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 Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const
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)
double transverseCurvature() const