17 #include <boost/function.hpp> 18 #include <boost/bind.hpp> 34 float operator()(
float a,
float b)
const {
return 0.5 * (b +
a); }
37 void fillBoundaries(std::vector<const TECWedge*>
const& dets, std::vector<float>& boundaries) {
38 boundaries.resize(dets.size());
43 std::adjacent_difference(boundaries.begin(), boundaries.end(), boundaries.begin(),
Mean());
46 inline int findBin(std::vector<float>
const& boundaries,
float r) {
47 return std::lower_bound(boundaries.begin() + 1, boundaries.end(),
r) - boundaries.begin() - 1;
50 void fillPars(std::vector<const TECWedge*>
const& dets, std::vector<CompositeTECPetal::WedgePar>& pars) {
51 for (
auto gsdet : dets) {
55 float thetaWedgeMin = wedgeSector.
innerRadius() / wedgeMaxZ;
56 float thetaWedgeMax = wedgeSector.
outerRadius() / wedgeMinZ;
67 auto tsRadius = gpos.
perp();
68 auto rmin =
std::max(0.
f, tsRadius - ymax);
70 auto rmax = (tsRadius +
ymax);
91 for (vector<const GeometricSearchDet*>::const_iterator it =
theComps.begin(); it !=
theComps.end(); it++) {
99 vector<const TECWedge*> allWedges;
100 allWedges.assign(innerWedges.begin(), innerWedges.end());
101 allWedges.insert(allWedges.end(), outerWedges.begin(), outerWedges.end());
108 LogDebug(
"TkDetLayers") <<
"DEBUG INFO for CompositeTECPetal";
111 LogDebug(
"TkDetLayers") <<
"frontWedge phi,z,r: " << (*it)->surface().position().phi() <<
" , " 112 << (*it)->surface().position().z() <<
" , " << (*it)->surface().position().perp();
116 LogDebug(
"TkDetLayers") <<
"backWedge phi,z,r: " << (*it)->surface().position().phi() <<
" , " 117 << (*it)->surface().position().z() <<
" , " << (*it)->surface().position().perp();
123 vector<const GeometricSearchDet*>::const_iterator
i;
132 edm::LogError(
"TkDetLayers") <<
"temporary dummy implementation of CompositeTECPetal::compatible()!!";
133 return pair<bool, TrajectoryStateOnSurface>();
139 std::vector<DetGroup>&
result)
const {
140 vector<DetGroup> closestResult;
147 LogDebug(
"TkDetLayers") <<
"in TECPetal, closestResult.size(): " << closestResult.size();
149 if (closestResult.empty()) {
150 vector<DetGroup> nextResult;
152 LogDebug(
"TkDetLayers") <<
"in TECPetal, nextResult.size(): " << nextResult.size();
153 if (nextResult.empty())
166 vector<DetGroup> nextResult;
185 if (!frontPath.first)
195 LogDebug(
"TkDetLayers") <<
"in TECPetal,front crossing : r,z,phi: (" << gFrontPoint.perp() <<
"," << gFrontPoint.z()
196 <<
"," << gFrontPoint.phi() <<
")";
198 LogDebug(
"TkDetLayers") <<
"in TECPetal,back crossing r,z,phi: (" << gBackPoint.perp() <<
"," << gBackPoint.z() <<
"," 199 << gBackPoint.phi() <<
")";
201 int frontIndex =
findBin(gFrontPoint.perp(), 0);
204 int backIndex =
findBin(gBackPoint.perp(), 1);
211 if (frontDist < backDist) {
222 vector<DetGroup>&
result)
const {
225 LogDebug(
"TkDetLayers") <<
"in TECPetal, adding Wedge at r,z,phi: (" << det->position().perp() <<
"," 226 << det->position().z() <<
"," << det->position().phi() <<
")";
227 LogDebug(
"TkDetLayers") <<
"wedge comps size: " << det->basicComponents().size();
238 bool checkClosest)
const {
242 int negStartIndex = closestIndex - 1;
243 int posStartIndex = closestIndex + 1;
248 if (gCrossingPos.
perp2() < detR * detR) {
249 posStartIndex = closestIndex;
251 negStartIndex = closestIndex;
261 for (
int idet = negStartIndex; idet >= 0; idet--) {
267 if (!
Adder::add(neighborWedge, tsos, prop, est, result))
271 for (
int idet = posStartIndex; idet < theSize; idet++) {
277 if (!
Adder::add(neighborWedge, tsos, prop, est, result))
std::vector< float > theFrontBoundaries
int findBin(float R, int layer) const
WedgePar const & findPar(int index, int diskSectorType) const
float innerRadius() const
bool addClosest(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result) const __attribute__((hot))
int closestDetIndex() const
void groupedCompatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const override __attribute__((hot))
CompositeTECPetal(std::vector< const TECWedge * > &innerWedges, std::vector< const TECWedge * > &outerWedges) __attribute__((cold))
GlobalPoint globalPosition() const
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))
~CompositeTECPetal() override __attribute__((cold))
const Plane & surface() const
The nominal surface of the GeomDet.
DiskSectorBounds const & bounds() const
const GlobalPoint & position() const
std::pair< bool, double > pathLength(const Plane &plane) override
GeometricSearchDet::DetWithState DetWithState
virtual PropagationDirection propagationDirection() const final
float outerRadius() const
int subLayerIndex() const
const std::vector< const TECWedge * > & subLayer(int ind) const
SubLayerCrossings computeCrossings(const TrajectoryStateOnSurface &tsos, PropagationDirection propDir) const __attribute__((hot))
Abs< T >::type abs(const T &t)
ReferenceCountingPointer< BoundDiskSector > theDiskSector
static int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
float thickness() const override
std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const override __attribute__((cold))
def window(xmin, xmax, ymin, ymax, x=0, y=0, width=100, height=100, xlogbase=None, ylogbase=None, minusInfinity=-1000, flipx=False, flipy=True)
static float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) __attribute__((hot))
const SubLayerCrossing & other() const
static bool add(const GeometricSearchDet &det, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) __attribute__((hot))
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
ReferenceCountingPointer< BoundDiskSector > theFrontSector
std::vector< const TECWedge * > theFrontComps
virtual const Surface::PositionType & position() const
Returns position of the surface.
ReferenceCountingPointer< BoundDiskSector > theBackSector
std::vector< WedgePar > theBackPars
const SubLayerCrossing & closest() const
GlobalVector globalMomentum() const
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const =0
std::vector< const GeomDet * > theBasicComps
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
const PositionType & position() const
PositionType position(double s) const override
std::vector< float > theBackBoundaries
std::vector< const TECWedge * > theBackComps
std::vector< WedgePar > theFrontPars
double transverseCurvature() const