21 vector<const TOBRod*>& outerRods) :
22 theInnerComps(innerRods.
begin(),innerRods.
end()),
23 theOuterComps(outerRods.
begin(),outerRods.
end())
25 theComps.assign(theInnerComps.begin(),theInnerComps.end());
26 theComps.insert(theComps.end(),theOuterComps.begin(),theOuterComps.end());
28 for(vector<const GeometricSearchDet*>::const_iterator it=theComps.begin();
29 it!=theComps.end();it++){
30 theBasicComps.insert(theBasicComps.end(),
31 (**it).basicComponents().begin(),
32 (**it).basicComponents().end());
35 theInnerCylinder = cylinder( theInnerComps);
36 theOuterCylinder = cylinder( theOuterComps);
38 if (theInnerComps.size())
39 theInnerBinFinder = BinFinderType(theInnerComps.front()->position().phi(),
40 theInnerComps.size());
42 if (theOuterComps.size())
43 theOuterBinFinder = BinFinderType(theOuterComps.front()->position().phi(),
44 theOuterComps.size());
49 LogDebug(
"TkDetLayers") <<
"==== DEBUG TOBLayer =====" ;
50 LogDebug(
"TkDetLayers") <<
"innerCyl radius, thickness, lenght: "
51 << theInnerCylinder->radius() <<
" , "
52 << theInnerCylinder->bounds().thickness() <<
" , "
53 << theInnerCylinder->bounds().length() ;
55 LogDebug(
"TkDetLayers") <<
"outerCyl radius, thickness, lenght: "
56 << theOuterCylinder->radius() <<
" , "
57 << theOuterCylinder->bounds().thickness() <<
" , "
58 << theOuterCylinder->bounds().length() ;
60 LogDebug(
"TkDetLayers") <<
"Cyl radius, thickness, lenght: "
61 << specificSurface().radius() <<
" , "
62 << specificSurface().bounds().thickness() <<
" , "
63 << specificSurface().bounds().length() ;
65 for (vector<const GeometricSearchDet*>::const_iterator
i=theInnerComps.begin();
66 i != theInnerComps.end();
i++){
67 LogDebug(
"TkDetLayers") <<
"inner TOBRod pos z,perp,eta,phi: "
68 << (**i).position().z() <<
" , "
69 << (**i).position().perp() <<
" , "
70 << (**i).position().eta() <<
" , "
71 << (**i).position().phi() ;
74 for (vector<const GeometricSearchDet*>::const_iterator
i=theOuterComps.begin();
75 i != theOuterComps.end();
i++){
76 LogDebug(
"TkDetLayers") <<
"outer TOBRod pos z,perp,eta,phi: "
77 << (**i).position().z() <<
" , "
78 << (**i).position().perp() <<
" , "
79 << (**i).position().eta() <<
" , "
80 << (**i).position().phi() ;
82 LogDebug(
"TkDetLayers") <<
"==== end DEBUG TOBLayer =====" ;
86 TOBLayer::~TOBLayer(){
87 vector<const GeometricSearchDet*>::const_iterator
i;
88 for (i=theComps.begin(); i!=theComps.end(); i++) {
99 std::vector<DetGroup> &
result)
const
103 if(! crossings.
isValid())
return;
105 vector<DetGroup> closestResult;
106 addClosest( tsos, prop, est, crossings.
closest(), closestResult);
107 if (closestResult.empty()){
108 addClosest( tsos, prop, est, crossings.
other(),
result);
115 searchNeighbors( tsos, prop, est, crossings.
closest(),
window,
116 closestResult,
false);
118 vector<DetGroup> nextResult;
119 searchNeighbors( tsos, prop, est, crossings.
other(),
window,
139 propDir,*theInnerCylinder);
142 GlobalPoint gInnerPoint( innerCrossing.position());
143 int innerIndex = theInnerBinFinder.binIndex(gInnerPoint.phi());
144 float innerDist = theInnerBinFinder.binPosition(innerIndex) - gInnerPoint.
phi();
148 propDir,*theOuterCylinder);
151 GlobalPoint gOuterPoint( outerCrossing.position());
152 int outerIndex = theOuterBinFinder.binIndex(gOuterPoint.phi());
153 float outerDist = theOuterBinFinder.binPosition(outerIndex) - gOuterPoint.
phi() ;
156 innerDist *=
PhiLess()( theInnerBinFinder.binPosition(innerIndex),gInnerPoint.phi()) ? -1. : 1.;
157 outerDist *=
PhiLess()( theOuterBinFinder.binPosition(outerIndex),gOuterPoint.phi()) ? -1. : 1.;
158 if (innerDist < 0.) { innerDist += 2.*
Geom::pi();}
159 if (outerDist < 0.) { outerDist += 2.*
Geom::pi();}
162 if (innerDist < outerDist) {
174 vector<DetGroup>& result)
const
176 const vector<const GeometricSearchDet*>& sub( subLayer( crossing.
subLayerIndex()));
205 double phiWin =
min(fabs(phiStart-phi1),fabs(phiStart-phi2));
216 vector<DetGroup>& result,
217 bool checkClosest)
const
221 const vector<const GeometricSearchDet*>& sLayer( subLayer( crossing.
subLayerIndex()));
224 int negStartIndex = closestIndex-1;
225 int posStartIndex = closestIndex+1;
228 if (
PhiLess()( gCrossingPos.
phi(), sLayer[closestIndex]->surface().
phi())) {
229 posStartIndex = closestIndex;
232 negStartIndex = closestIndex;
236 const BinFinderType& binFinder = (crossing.
subLayerIndex()==0 ? theInnerBinFinder : theOuterBinFinder);
239 int quarter = sLayer.size()/4;
240 for (
int idet=negStartIndex; idet >= negStartIndex - quarter; idet--) {
242 if (!
overlap( gCrossingPos, neighborRod, window))
break;
243 if (!
Adder::add( neighborRod, tsos, prop, est, result))
break;
246 for (
int idet=posStartIndex; idet < posStartIndex + quarter; idet++) {
248 if (!
overlap( gCrossingPos, neighborRod, window))
break;
249 if (!
Adder::add( neighborRod, tsos, prop, est, result))
break;
260 const float phiOffset = 0.00034;
264 std::pair<float,float> phiRange(crossPoint.phi()-phiWin, crossPoint.phi()+phiWin);
278 BoundCylinder* TOBLayer::cylinder(
const vector<const GeometricSearchDet*>& rods)
const
280 vector<const GeomDet*>
tmp;
281 for (vector<const GeometricSearchDet*>::const_iterator it=rods.begin(); it!=rods.end(); it++) {
282 tmp.insert(tmp.end(),(*it)->basicComponents().begin(),(*it)->basicComponents().end());
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
virtual void initialize()
int closestDetIndex() const
std::pair< float, float > const & phiSpan() const
LocalPoint localPosition() const
Geom::Phi< T > phi() const
GlobalPoint globalPosition() const
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
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
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
bool rangesIntersect(const Range &a, const Range &b)
int subLayerIndex() const
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
const SubLayerCrossing & other() const
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const
static bool add(const GeometricSearchDet &det, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result)
int barrelSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop) const
returns 0 if barrel layer crossed from inside, 1 if from outside
std::vector< std::vector< double > > tmp
const SubLayerCrossing & closest() const
GlobalVector globalMomentum() const
static unsigned int const shift
float calculatePhiWindow(const MeasurementEstimator::Local2DVector &maxDistance, const TrajectoryStateOnSurface &ts, const Plane &plane)
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