33 float operator()(
float a,
float b)
const {
return 0.5 * (b +
a); }
36 void fillBoundaries(std::vector<const TECWedge*>
const& dets, std::vector<float>& boundaries) {
37 boundaries.resize(dets.size());
42 std::adjacent_difference(boundaries.begin(), boundaries.end(), boundaries.begin(),
Mean());
45 inline int findBin(std::vector<float>
const& boundaries,
float r) {
46 return std::lower_bound(boundaries.begin() + 1, boundaries.end(),
r) - boundaries.begin() - 1;
49 void fillPars(std::vector<const TECWedge*>
const& dets, std::vector<CompositeTECPetal::WedgePar>& pars) {
50 for (
auto gsdet : dets) {
54 float thetaWedgeMin = wedgeSector.
innerRadius() / wedgeMaxZ;
55 float thetaWedgeMax = wedgeSector.
outerRadius() / wedgeMinZ;
66 auto tsRadius = gpos.
perp();
67 auto rmin =
std::max(0.
f, tsRadius - ymax);
69 auto rmax = (tsRadius +
ymax);
80 CompositeTECPetal::CompositeTECPetal(vector<const TECWedge*>& innerWedges, vector<const TECWedge*>& outerWedges)
82 theComps.assign(theFrontComps.begin(), theFrontComps.end());
83 theComps.insert(theComps.end(), theBackComps.begin(), theBackComps.end());
85 details::fillBoundaries(theFrontComps, theFrontBoundaries);
86 details::fillBoundaries(theBackComps, theBackBoundaries);
87 details::fillPars(theFrontComps, theFrontPars);
88 details::fillPars(theBackComps, theBackPars);
90 for (vector<const GeometricSearchDet*>::const_iterator it = theComps.begin(); it != theComps.end(); it++) {
91 theBasicComps.insert(theBasicComps.end(), (**it).basicComponents().begin(), (**it).basicComponents().end());
98 vector<const TECWedge*> allWedges;
99 allWedges.assign(innerWedges.begin(), innerWedges.end());
100 allWedges.insert(allWedges.end(), outerWedges.begin(), outerWedges.end());
107 LogDebug(
"TkDetLayers") <<
"DEBUG INFO for CompositeTECPetal";
109 for (
auto it = theFrontComps.begin(); it != theFrontComps.end(); it++) {
110 LogDebug(
"TkDetLayers") <<
"frontWedge phi,z,r: " << (*it)->surface().position().phi() <<
" , "
111 << (*it)->surface().position().z() <<
" , " << (*it)->surface().position().perp();
114 for (
auto it = theBackComps.begin(); it != theBackComps.end(); it++) {
115 LogDebug(
"TkDetLayers") <<
"backWedge phi,z,r: " << (*it)->surface().position().phi() <<
" , "
116 << (*it)->surface().position().z() <<
" , " << (*it)->surface().position().perp();
122 vector<const GeometricSearchDet*>::const_iterator
i;
131 edm::LogError(
"TkDetLayers") <<
"temporary dummy implementation of CompositeTECPetal::compatible()!!";
132 return pair<bool, TrajectoryStateOnSurface>();
138 std::vector<DetGroup>&
result)
const {
139 vector<DetGroup> closestResult;
146 LogDebug(
"TkDetLayers") <<
"in TECPetal, closestResult.size(): " << closestResult.size();
148 if (closestResult.empty()) {
149 vector<DetGroup> nextResult;
151 LogDebug(
"TkDetLayers") <<
"in TECPetal, nextResult.size(): " << nextResult.size();
152 if (nextResult.empty())
165 vector<DetGroup> nextResult;
184 if (!frontPath.first)
194 LogDebug(
"TkDetLayers") <<
"in TECPetal,front crossing : r,z,phi: (" << gFrontPoint.perp() <<
"," << gFrontPoint.z()
195 <<
"," << gFrontPoint.phi() <<
")";
197 LogDebug(
"TkDetLayers") <<
"in TECPetal,back crossing r,z,phi: (" << gBackPoint.perp() <<
"," << gBackPoint.z() <<
","
198 << gBackPoint.phi() <<
")";
200 int frontIndex =
findBin(gFrontPoint.perp(), 0);
203 int backIndex =
findBin(gBackPoint.perp(), 1);
210 if (frontDist < backDist) {
221 vector<DetGroup>&
result)
const {
224 LogDebug(
"TkDetLayers") <<
"in TECPetal, adding Wedge at r,z,phi: (" << det->position().perp() <<
","
225 << det->position().z() <<
"," << det->position().phi() <<
")";
226 LogDebug(
"TkDetLayers") <<
"wedge comps size: " << det->basicComponents().size();
237 bool checkClosest)
const {
241 int negStartIndex = closestIndex - 1;
242 int posStartIndex = closestIndex + 1;
247 if (gCrossingPos.
perp2() < detR * detR) {
248 posStartIndex = closestIndex;
250 negStartIndex = closestIndex;
260 for (
int idet = negStartIndex; idet >= 0; idet--) {
266 if (!
Adder::add(neighborWedge, tsos, prop, est, result))
270 for (
int idet = posStartIndex; idet < theSize; idet++) {
276 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
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const =0
GlobalPoint globalPosition() const
void groupedCompatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const override __attribute__((hot))
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))
virtual PropagationDirection propagationDirection() const final
~CompositeTECPetal() override __attribute__((cold))
Log< level::Error, false > LogError
const Plane & surface() const
The nominal surface of the GeomDet.
DiskSectorBounds const & bounds() const
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
std::pair< bool, double > pathLength(const Plane &plane) override
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
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)
static int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
float thickness() const override
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::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const override __attribute__((cold))
std::vector< WedgePar > theBackPars
const SubLayerCrossing & closest() const
GlobalVector globalMomentum() const
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
static void orderAndMergeTwoLevels(std::vector< DetGroup > &&one, std::vector< DetGroup > &&two, std::vector< DetGroup > &result, int firstIndex, int firstCrossed)
PositionType position(double s) const override
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
const PositionType & position() const
std::vector< float > theBackBoundaries
std::vector< const TECWedge * > theBackComps
std::vector< WedgePar > theFrontPars
double transverseCurvature() const