32 float theZmax(petals.front()->position().z());
33 float theZmin(theZmax);
34 for (
auto i = petals.begin();
i != petals.end();
i++) {
35 float zmin = (**i).position().z() - (**i).surface().bounds().thickness() / 2.;
36 float zmax = (**i).position().z() + (**i).surface().bounds().thickness() / 2.;
41 float zPos = (theZmax + theZmin) / 2.;
52 theFrontComps(innerPetals.begin(), innerPetals.
end()),
53 theBackComps(outerPetals.begin(), outerPetals.
end()) {
57 for (vector<const GeometricSearchDet*>::const_iterator it =
theComps.begin(); it !=
theComps.end(); it++) {
75 LogDebug(
"TkDetLayers") <<
"DEBUG INFO for TECLayer" 77 <<
"TECLayer z,perp, innerRadius, outerR: " << this->
position().
z() <<
" , " 82 LogDebug(
"TkDetLayers") <<
"frontPetal phi,z,r: " << (*it)->surface().position().phi() <<
" , " 83 << (*it)->surface().position().z() <<
" , " << (*it)->surface().position().perp();
87 LogDebug(
"TkDetLayers") <<
"backPetal phi,z,r: " << (*it)->surface().position().phi() <<
" , " 88 << (*it)->surface().position().z() <<
" , " << (*it)->surface().position().perp();
102 std::vector<DetGroup>&
result)
const {
108 vector<DetGroup> closestResult;
110 LogDebug(
"TkDetLayers") <<
"in TECLayer, closestResult.size(): " << closestResult.size();
113 if (closestResult.empty()) {
114 vector<DetGroup> nextResult;
116 LogDebug(
"TkDetLayers") <<
"in TECLayer, nextResult.size(): " << nextResult.size();
117 if (nextResult.empty())
128 vector<DetGroup> nextResult;
145 pair<bool, double> frontPath = crossing.pathLength(*
theFrontDisk);
146 if (!frontPath.first)
149 GlobalPoint gFrontPoint(crossing.position(frontPath.second));
151 LogDebug(
"TkDetLayers") <<
"in TECLayer,front crossing point: r,z,phi: (" << gFrontPoint.perp() <<
"," 152 << gFrontPoint.z() <<
"," << gFrontPoint.phi() <<
")" << endl;
157 pair<bool, double> backPath = crossing.pathLength(*
theBackDisk);
161 GlobalPoint gBackPoint(crossing.position(backPath.second));
162 LogDebug(
"TkDetLayers") <<
"in TECLayer,back crossing point: r,z,phi: (" << gBackPoint.perp() <<
"," 163 << gFrontPoint.z() <<
"," << gBackPoint.phi() <<
")" << endl;
172 if (frontDist < backDist) {
183 vector<DetGroup>&
result)
const {
187 LogDebug(
"TkDetLayers") <<
"in TECLayer, adding petal at r,z,phi: (" << det->position().perp() <<
"," 188 << det->position().z() <<
"," << det->position().phi() <<
")" << endl;
196 pair<float, float> phiRange(
phi - phiWin,
phi + phiWin);
211 bool checkClosest)
const {
213 auto gphi = gCrossingPos.
barePhi();
218 int negStartIndex = closestIndex - 1;
219 int posStartIndex = closestIndex + 1;
223 posStartIndex = closestIndex;
225 negStartIndex = closestIndex;
232 int half = sLayer.size() / 2;
233 for (
int idet = negStartIndex; idet >= negStartIndex - half; idet--) {
234 const auto& neighborPetal = *sLayer[binFinder.
binIndex(idet)];
241 for (
int idet = posStartIndex; idet < posStartIndex + half; idet++) {
242 const auto& neighborPetal = *sLayer[binFinder.
binIndex(idet)];
std::vector< const TECPetal * > theBackComps
virtual const Surface::PositionType & position() const
Returns position of the surface.
std::vector< const GeomDet * > theBasicComps
int binIndex(T phi) const override
returns an index in the valid range for the bin that contains phi
const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
GeometricSearchDet::DetWithState DetWithState
void setSurface(BoundDisk *cp)
virtual PropagationDirection propagationDirection() const final
ReferenceCountingPointer< BoundDisk > theFrontDisk
virtual const BoundDiskSector & specificSurface() const final
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
std::vector< const GeometricSearchDet * > theComps
void searchNeighbors(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, float window, std::vector< DetGroup > &result, bool checkClosest) const __attribute__((hot))
ReferenceCountingPointer< BoundDisk > theBackDisk
bool addClosest(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result) const __attribute__((hot))
TECLayer(std::vector< const TECPetal *> &innerPetals, std::vector< const TECPetal *> &outerPetals) __attribute__((cold))
float innerRadius() const
SubLayerCrossings computeCrossings(const TrajectoryStateOnSurface &startingState, PropagationDirection propDir) const __attribute__((hot))
GlobalPoint globalPosition() const
const GlobalPoint & position() const
int closestDetIndex() const
BinFinderPhi theBackBinFinder
Abs< T >::type abs(const T &t)
static int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
def window(xmin, xmax, ymin, ymax, x=0, y=0, width=100, height=100, xlogbase=None, ylogbase=None, minusInfinity=-1000, flipx=False, flipy=True)
float outerRadius() const
const SubLayerCrossing & closest() const
void groupedCompatibleDetsV(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const override __attribute__((hot))
int subLayerIndex() const
bool phiLess(float phi1, float phi2)
static bool add(const GeometricSearchDet &det, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) __attribute__((hot))
bool rangesIntersect(const Range &a, const Range &b)
const SubLayerCrossing & other() const
BoundDisk * computeDisk(const std::vector< const T *> &structures)
BinFinderPhi theFrontBinFinder
double transverseCurvature() const
GlobalVector globalMomentum() const
float phiHalfExtension() const
void add(std::map< std::string, TH1 *> &h, TH1 *hist)
virtual const BoundDisk & specificSurface() const final
static void orderAndMergeTwoLevels(std::vector< DetGroup > &&one, std::vector< DetGroup > &&two, std::vector< DetGroup > &result, int firstIndex, int firstCrossed)
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
std::vector< const TECPetal * > theFrontComps
PeriodicBinFinderInPhi< float > BinFinderPhi
~TECLayer() override __attribute__((cold))
const std::vector< const TECPetal * > & subLayer(int ind) const