23 void TBPLayer::construct() {
24 theComps.assign(theInnerComps.begin(),theInnerComps.end());
25 theComps.insert(theComps.end(),theOuterComps.begin(),theOuterComps.end());
27 for(vector<const GeometricSearchDet*>::const_iterator it=theComps.begin();
28 it!=theComps.end();it++){
29 theBasicComps.insert(theBasicComps.end(),
30 (**it).basicComponents().begin(),
31 (**it).basicComponents().end());
34 theInnerCylinder = cylinder( theInnerComps);
35 theOuterCylinder = cylinder( theOuterComps);
37 if (theInnerComps.size())
38 theInnerBinFinder = BinFinderType(theInnerComps.front()->position().phi(),
39 theInnerComps.size());
41 if (theOuterComps.size())
42 theOuterBinFinder = BinFinderType(theOuterComps.front()->position().phi(),
43 theOuterComps.size());
48 LogDebug(
"TkDetLayers") <<
"==== DEBUG TBPLayer =====" ;
49 LogDebug(
"TkDetLayers") <<
"innerCyl radius, thickness, lenght: "
50 << theInnerCylinder->radius() <<
" , "
51 << theInnerCylinder->bounds().thickness() <<
" , "
52 << theInnerCylinder->bounds().length() ;
54 LogDebug(
"TkDetLayers") <<
"outerCyl radius, thickness, lenght: "
55 << theOuterCylinder->radius() <<
" , "
56 << theOuterCylinder->bounds().thickness() <<
" , "
57 << theOuterCylinder->bounds().length() ;
59 LogDebug(
"TkDetLayers") <<
"Cyl radius, thickness, lenght: "
60 << specificSurface().radius() <<
" , "
61 << specificSurface().bounds().thickness() <<
" , "
62 << specificSurface().bounds().length() ;
64 for (vector<const GeometricSearchDet*>::const_iterator
i=theInnerComps.begin();
65 i != theInnerComps.end();
i++){
66 LogDebug(
"TkDetLayers") <<
"inner Rod pos z,perp,eta,phi: "
67 << (**i).position().z() <<
" , "
68 << (**i).position().perp() <<
" , "
69 << (**i).position().eta() <<
" , "
70 << (**i).position().phi() ;
73 for (vector<const GeometricSearchDet*>::const_iterator
i=theOuterComps.begin();
74 i != theOuterComps.end();
i++){
75 LogDebug(
"TkDetLayers") <<
"outer Rod pos z,perp,eta,phi: "
76 << (**i).position().z() <<
" , "
77 << (**i).position().perp() <<
" , "
78 << (**i).position().eta() <<
" , "
79 << (**i).position().phi() ;
81 LogDebug(
"TkDetLayers") <<
"==== end DEBUG TBPLayer =====" ;
85 TBPLayer::~TBPLayer(){}
87 BoundCylinder* TBPLayer::cylinder(
const vector<const GeometricSearchDet*>& rods)
const
89 vector<const GeomDet*>
tmp;
90 for (vector<const GeometricSearchDet*>::const_iterator it=rods.begin(); it!=rods.end(); it++) {
91 tmp.insert(tmp.end(),(*it)->basicComponents().begin(),(*it)->basicComponents().end());
99 std::tuple<bool,int,int> TBPLayer::computeIndexes(
GlobalPoint gInnerPoint,
GlobalPoint gOuterPoint)
const {
100 int innerIndex = theInnerBinFinder.binIndex(gInnerPoint.
barePhi());
101 float innerDist = theInnerBinFinder.binPosition(innerIndex) - gInnerPoint.
barePhi();
103 int outerIndex = theOuterBinFinder.binIndex(gOuterPoint.
barePhi());
104 float outerDist = theOuterBinFinder.binPosition(outerIndex) - gOuterPoint.
barePhi() ;
107 innerDist *=
PhiLess()( theInnerBinFinder.binPosition(innerIndex),gInnerPoint.
barePhi()) ? -1.
f : 1.
f;
108 outerDist *=
PhiLess()( theOuterBinFinder.binPosition(outerIndex),gOuterPoint.
barePhi()) ? -1.
f : 1.
f;
112 return std::make_tuple(innerDist < outerDist,innerIndex, outerIndex);
132 bool checkClosest)
const {
136 auto gphi = gCrossingPos.
barePhi();
138 const vector<const GeometricSearchDet*>& sLayer( subLayer( crossing.
subLayerIndex()));
141 int negStartIndex = closestIndex-1;
142 int posStartIndex = closestIndex+1;
145 if (
PhiLess()( gphi, sLayer[closestIndex]->surface().
phi())) {
146 posStartIndex = closestIndex;
149 negStartIndex = closestIndex;
153 const BinFinderType& binFinder = (crossing.
subLayerIndex()==0 ? theInnerBinFinder : theOuterBinFinder);
156 int quarter = sLayer.size()/4;
157 for (
int idet=negStartIndex; idet >= negStartIndex - quarter; idet--) {
159 if (!
overlap( gphi, neighborRod, window))
break;
160 if (!
Adder::add( neighborRod, tsos, prop, est, result))
break;
163 for (
int idet=posStartIndex; idet < posStartIndex + quarter; idet++) {
165 if (!
overlap( gphi, neighborRod, window))
break;
166 if (!
Adder::add( neighborRod, tsos, prop, est, result))
break;
virtual void initialize()
int closestDetIndex() const
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
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
int subLayerIndex() const
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
bool overlap(float phi, const GeometricSearchDet &gsdet, float phiWin)
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
std::vector< std::vector< double > > tmp
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState