21 vector<const TIBRing*>& outerRings) :
22 theInnerComps(innerRings.
begin(),innerRings.
end()),
23 theOuterComps(outerRings.
begin(),outerRings.
end())
25 theComps.assign(theInnerComps.begin(),theInnerComps.end());
26 theComps.insert(theComps.end(),theOuterComps.begin(),theOuterComps.end());
29 sort(theInnerComps.begin(),theInnerComps.end(),
DetLessZ());
30 sort(theOuterComps.begin(),theOuterComps.end(),
DetLessZ());
32 for(vector<const GeometricSearchDet*>::const_iterator it=theComps.begin();
33 it!=theComps.end();it++){
34 theBasicComps.insert(theBasicComps.end(),
35 (**it).basicComponents().begin(),
36 (**it).basicComponents().end());
40 theInnerCylinder = cylinder( theInnerComps);
41 theOuterCylinder = cylinder( theOuterComps);
44 LogDebug(
"TkDetLayers") <<
"==== DEBUG TIBLayer =====" ;
45 LogDebug(
"TkDetLayers") <<
"innerCyl radius, thickness, lenght: "
46 << theInnerCylinder->radius() <<
" , "
47 << theInnerCylinder->bounds().thickness() <<
" , "
48 << theInnerCylinder->bounds().length() ;
50 LogDebug(
"TkDetLayers") <<
"outerCyl radius, thickness, lenght: "
51 << theOuterCylinder->radius() <<
" , "
52 << theOuterCylinder->bounds().thickness() <<
" , "
53 << theOuterCylinder->bounds().length() ;
55 LogDebug(
"TkDetLayers") <<
"Cyl radius, thickness, lenght: "
56 << specificSurface().radius() <<
" , "
57 << specificSurface().bounds().thickness() <<
" , "
58 << specificSurface().bounds().length() ;
60 for (vector<const GeometricSearchDet*>::const_iterator
i=theInnerComps.begin();
61 i != theInnerComps.end();
i++){
62 LogDebug(
"TkDetLayers") <<
"inner TIBRing pos z,radius,eta,phi: "
63 << (**i).position().z() <<
" , "
64 << (**i).position().perp() <<
" , "
65 << (**i).position().eta() <<
" , "
66 << (**i).position().phi() ;
69 for (vector<const GeometricSearchDet*>::const_iterator
i=theOuterComps.begin();
70 i != theOuterComps.end();
i++){
71 LogDebug(
"TkDetLayers") <<
"outer TIBRing pos z,radius,eta,phi: "
72 << (**i).position().z() <<
" , "
73 << (**i).position().perp() <<
" , "
74 << (**i).position().eta() <<
" , "
75 << (**i).position().phi() ;
91 TIBLayer::~TIBLayer(){
92 vector<const GeometricSearchDet*>::const_iterator
i;
93 for (i=theComps.begin(); i!=theComps.end(); i++) {
102 TIBLayer::cylinder(
const vector<const GeometricSearchDet*>& rings)
104 float leftPos = rings.front()->surface().position().z();
105 float rightPos = rings.back()->surface().position().z();
109 float r = frontRing.radius();
110 const Bounds& leftBounds = frontRing.bounds();
111 const Bounds& rightBounds = backRing.bounds();
117 float thick = leftBounds.
thickness() / 2;
118 float zmin = leftPos - leftBounds.
length() / 2;
119 float zmax = rightPos + rightBounds.
length() / 2;
120 float rmin = r-thick;
121 float rmax = r+thick;
122 float zpos = 0.5*(leftPos+rightPos);
126 rings.front()->surface().rotation(), scp);
136 std::vector<DetGroup> &
result)
const {
139 if(! crossings.
isValid())
return;
141 vector<DetGroup> closestResult;
142 addClosest( tsos, prop, est, crossings.
closest(), closestResult);
144 if (closestResult.empty())
return;
150 searchNeighbors( tsos, prop, est, crossings.
closest(),
window,
151 closestResult,
false);
153 vector<DetGroup> nextResult;
154 searchNeighbors( tsos, prop, est, crossings.
other(),
window,
170 propDir,*theInnerCylinder);
173 GlobalPoint gInnerPoint( innerCrossing.position());
174 int innerIndex = theInnerBinFinder.binIndex(gInnerPoint.z());
176 float innerDist = fabs( innerRing->surface().position().z() - gInnerPoint.z());
180 propDir,*theOuterCylinder);
183 GlobalPoint gOuterPoint( outerCrossing.position());
184 int outerIndex = theOuterBinFinder.binIndex(gOuterPoint.z());
186 float outerDist = fabs( outerRing->surface().position().z() - gOuterPoint.z());
189 if (innerDist < outerDist) {
201 vector<DetGroup>& result)
const
205 const vector<const GeometricSearchDet*>& sub( subLayer( crossing.
subLayerIndex()));
215 vector<DetGroup>& result,
216 bool checkClosest)
const
220 const vector<const GeometricSearchDet*>& sLayer( subLayer( crossing.
subLayerIndex()));
223 int negStartIndex = closestIndex-1;
224 int posStartIndex = closestIndex+1;
227 if (gCrossingPos.
z() < sLayer[closestIndex]->surface().position().z()) {
228 posStartIndex = closestIndex;
231 negStartIndex = closestIndex;
236 for (
int idet=negStartIndex; idet >= 0; idet--) {
238 if (!
overlap( gCrossingPos, *neighborRing, window))
break;
239 if (!
Adder::add( *neighborRing, tsos, prop, est, result))
break;
241 for (
int idet=posStartIndex; idet < static_cast<int>(sLayer.size()); idet++) {
243 if (!
overlap( gCrossingPos, *neighborRing, window))
break;
244 if (!
Adder::add( *neighborRing, tsos, prop, est, result))
break;
256 if ( fabs( crossPoint.
z()-det.
position().
z()) < (halfLength + window)) {
275 float yError = localError.y();
282 return yError + thickCorrection;
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
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
Geom::Theta< T > theta() const
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
virtual float thickness() const =0
int subLayerIndex() const
Tan< T >::type tan(const T &t)
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
const SubLayerCrossing & other() const
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const
virtual const Surface::PositionType & position() const
Returns position of the surface.
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
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