21 theComps.assign(theInnerComps.begin(), theInnerComps.end());
22 theComps.insert(theComps.end(), theOuterComps.begin(), theOuterComps.end());
24 for (vector<const GeometricSearchDet*>::const_iterator it = theComps.begin(); it != theComps.end(); it++) {
25 theBasicComps.insert(theBasicComps.end(), (**it).basicComponents().begin(), (**it).basicComponents().end());
28 theInnerCylinder = cylinder(theInnerComps);
29 theOuterCylinder = cylinder(theOuterComps);
31 if (!theInnerComps.empty())
32 theInnerBinFinder =
BinFinderType(theInnerComps.front()->position().phi(), theInnerComps.size());
34 if (!theOuterComps.empty())
35 theOuterBinFinder =
BinFinderType(theOuterComps.front()->position().phi(), theOuterComps.size());
40 LogDebug(
"TkDetLayers") <<
"==== DEBUG TBPLayer =====";
41 LogDebug(
"TkDetLayers") <<
"innerCyl radius, thickness, lenght: " << theInnerCylinder->radius() <<
" , " 42 << theInnerCylinder->bounds().thickness() <<
" , " << theInnerCylinder->bounds().length();
44 LogDebug(
"TkDetLayers") <<
"outerCyl radius, thickness, lenght: " << theOuterCylinder->radius() <<
" , " 45 << theOuterCylinder->bounds().thickness() <<
" , " << theOuterCylinder->bounds().length();
47 LogDebug(
"TkDetLayers") <<
"Cyl radius, thickness, lenght: " << specificSurface().radius() <<
" , " 48 << specificSurface().bounds().thickness() <<
" , " << specificSurface().bounds().length();
50 for (vector<const GeometricSearchDet*>::const_iterator
i = theInnerComps.begin();
i != theInnerComps.end();
i++) {
51 LogDebug(
"TkDetLayers") <<
"inner Rod pos z,perp,eta,phi: " << (**i).position().z() <<
" , " 52 << (**i).position().perp() <<
" , " << (**i).position().eta() <<
" , " 53 << (**i).position().phi();
56 for (vector<const GeometricSearchDet*>::const_iterator
i = theOuterComps.begin();
i != theOuterComps.end();
i++) {
57 LogDebug(
"TkDetLayers") <<
"outer Rod pos z,perp,eta,phi: " << (**i).position().z() <<
" , " 58 << (**i).position().perp() <<
" , " << (**i).position().eta() <<
" , " 59 << (**i).position().phi();
61 LogDebug(
"TkDetLayers") <<
"==== end DEBUG TBPLayer =====";
67 vector<const GeomDet*>
tmp;
68 for (vector<const GeometricSearchDet*>::const_iterator it = rods.begin(); it != rods.end(); it++) {
69 tmp.insert(
tmp.end(), (*it)->basicComponents().begin(), (*it)->basicComponents().end());
77 int innerIndex = theInnerBinFinder.binIndex(gInnerPoint.
barePhi());
78 float innerDist = theInnerBinFinder.binPosition(innerIndex) - gInnerPoint.
barePhi();
80 int outerIndex = theOuterBinFinder.binIndex(gOuterPoint.
barePhi());
81 float outerDist = theOuterBinFinder.binPosition(outerIndex) - gOuterPoint.
barePhi();
85 if (innerDist < 0.
f) {
88 if (outerDist < 0.
f) {
92 return std::make_tuple(innerDist < outerDist, innerIndex, outerIndex);
107 bool checkClosest)
const {
111 auto gphi = gCrossingPos.
barePhi();
113 const vector<const GeometricSearchDet*>& sLayer(subLayer(crossing.
subLayerIndex()));
116 int negStartIndex = closestIndex - 1;
117 int posStartIndex = closestIndex + 1;
120 if (
Geom::phiLess(gphi, sLayer[closestIndex]->surface().phi())) {
121 posStartIndex = closestIndex;
123 negStartIndex = closestIndex;
130 int quarter = sLayer.size() / 4;
131 for (
int idet = negStartIndex; idet >= negStartIndex - quarter; idet--) {
139 for (
int idet = posStartIndex; idet < posStartIndex + quarter; idet++) {
int binIndex(T phi) const override
returns an index in the valid range for the bin that contains phi
virtual void initialize()
std::tuple< bool, int, int > computeIndexes(GlobalPoint gInnerPoint, GlobalPoint gOuterPoint) const override __attribute__((hot))
void searchNeighbors(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, float window, std::vector< DetGroup > &result, bool checkClosest) const override __attribute__((hot))
void construct() __attribute__((cold))
~TBPLayer() override __attribute__((cold))
const GlobalPoint & position() const
int closestDetIndex() const
def window(xmin, xmax, ymin, ymax, x=0, y=0, width=100, height=100, xlogbase=None, ylogbase=None, minusInfinity=-1000, flipx=False, flipy=True)
bool overlap(float phi, const GeometricSearchDet &gsdet, float phiWin)
int subLayerIndex() const
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
bool phiLess(float phi1, float phi2)
void add(std::map< std::string, TH1 *> &h, TH1 *hist)
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const override __attribute__((hot))
BoundCylinder * cylinder(const std::vector< const GeometricSearchDet *> &rods) const __attribute__((cold))
GeometricSearchDet::DetWithState DetWithState