25 vector<const GeomDet*>& outerDets,
26 const vector<const GeomDet*>& innerDetBrothers,
27 const vector<const GeomDet*>& outerDetBrothers)
29 theFrontDets(innerDets.begin(), innerDets.
end()),
30 theBackDets(outerDets.begin(), outerDets.
end()),
31 theFrontDetBrothers(innerDetBrothers.begin(), innerDetBrothers.
end()),
32 theBackDetBrothers(outerDetBrothers.begin(), outerDetBrothers.
end()) {
51 LogDebug(
"TkDetLayers") <<
"DEBUG INFO for Phase2EndcapRing";
53 LogDebug(
"TkDetLayers") <<
"frontDet detId,phi,z,r: " << (*it)->geographicalId().rawId() <<
" , " 54 << (*it)->surface().position().phi() <<
" , " << (*it)->surface().position().z() <<
" , " 55 << (*it)->surface().position().perp();
61 LogDebug(
"TkDetLayers") <<
"frontDet brothers detId,phi,z,r: " << (*it)->geographicalId().rawId() <<
" , " 62 << (*it)->surface().position().phi() <<
" , " << (*it)->surface().position().z() <<
" , " 63 << (*it)->surface().position().perp();
68 LogDebug(
"TkDetLayers") <<
"backDet detId,phi,z,r: " << (*it)->geographicalId().rawId() <<
" , " 69 << (*it)->surface().position().phi() <<
" , " << (*it)->surface().position().z() <<
" , " 70 << (*it)->surface().position().perp();
75 LogDebug(
"TkDetLayers") <<
"backDet brothers detId,phi,z,r: " << (*it)->geographicalId().rawId() <<
" , " 76 << (*it)->surface().position().phi() <<
" , " << (*it)->surface().position().z() <<
" , " 77 << (*it)->surface().position().perp();
86 throw DetLayerException(
"Phase2EndcapRing doesn't have GeometricSearchDet components");
92 edm::LogError(
"TkDetLayers") <<
"temporary dummy implementation of Phase2EndcapRing::compatible()!!";
93 return pair<bool, TrajectoryStateOnSurface>();
99 std::vector<DetGroup>&
result)
const {
105 std::vector<DetGroup> closestResult;
106 std::vector<DetGroup> closestBrotherResult;
107 addClosest(tsos, prop, est, crossings.
closest(), closestResult, closestBrotherResult);
108 if (closestResult.empty())
116 vector<DetGroup> closestCompleteResult;
118 std::move(closestResult),
std::move(closestBrotherResult), closestCompleteResult, 0, crossingSide);
120 vector<DetGroup> nextResult;
121 vector<DetGroup> nextBrotherResult;
124 vector<DetGroup> nextCompleteResult;
126 std::move(nextResult),
std::move(nextBrotherResult), nextCompleteResult, 0, crossingSide);
136 LogTrace(
"TkDetLayers") <<
"Number of groups : " <<
result.size() << std::endl;
137 for (
auto& grp :
result) {
140 LogTrace(
"TkDetLayers") <<
"New group in Phase2EndcapRing made by : " << std::endl;
141 for (
auto const& det : grp) {
142 LogTrace(
"TkDetLayers") <<
" geom det at r: " << det.det()->position().perp()
143 <<
" id:" << det.det()->geographicalId().rawId()
144 <<
" tsos at:" << det.trajectoryState().globalPosition() << std::endl;
158 pair<bool, double> frontPath = crossing.pathLength(*
theFrontDisk);
159 if (!frontPath.first)
162 pair<bool, double> backPath = crossing.pathLength(*
theBackDisk);
166 GlobalPoint gFrontPoint(crossing.position(frontPath.second));
167 GlobalPoint gBackPoint(crossing.position(backPath.second));
179 if (frontDist < backDist) {
191 vector<DetGroup>& brotherresult)
const {
201 return firstgroup || brothergroup;
210 vector<DetGroup>& brotherresult,
211 bool checkClosest)
const {
219 int negStartIndex = closestIndex - 1;
220 int posStartIndex = closestIndex + 1;
224 posStartIndex = closestIndex;
226 negStartIndex = closestIndex;
233 int half = sLayer.size() / 2;
234 for (
int idet = negStartIndex; idet >= negStartIndex - half; idet--) {
243 const GeomDet& neighborBrotherDet = *sBrotherLayer[binFinder.
binIndex(idet)];
244 Adder::add(neighborBrotherDet, tsos, prop, est, brotherresult);
247 for (
int idet = posStartIndex; idet < posStartIndex + half; idet++) {
256 const GeomDet& neighborBrotherDet = *sBrotherLayer[binFinder.
binIndex(idet)];
257 Adder::add(neighborBrotherDet, tsos, prop, est, brotherresult);
void groupedCompatibleDetsV(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const override __attribute__((hot))
const std::vector< const GeometricSearchDet * > & components() const override __attribute__((cold))
Returns basic components, if any.
GeometricSearchDet::DetWithState DetWithState
int binIndex(T phi) const override
returns an index in the valid range for the bin that contains phi
std::vector< const GeomDet * > theDets
std::vector< const GeomDet * > theFrontDets
std::vector< const GeomDet * > theFrontDetBrothers
const std::vector< const GeomDet * > & subLayerBrothers(int ind) const
std::vector< const GeomDet * > theBackDets
virtual PropagationDirection propagationDirection() const final
Log< level::Error, false > LogError
bool overlapInPhi(float phi, const GeomDet &det, float phiWindow)
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
Phase2EndcapRing(std::vector< const GeomDet *> &innerDets, std::vector< const GeomDet *> &outerDets, const std::vector< const GeomDet *> &innerDetBrothers=std::vector< const GeomDet *>(), const std::vector< const GeomDet *> &outerDetBrothers=std::vector< const GeomDet *>())
GlobalPoint globalPosition() const
const GlobalPoint & position() const
int closestDetIndex() const
ReferenceCountingPointer< BoundDisk > theFrontDisk
BinFinderType theFrontBinFinder
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)
ReferenceCountingPointer< BoundDisk > theDisk
const SubLayerCrossing & closest() const
int subLayerIndex() const
std::vector< const GeomDet * > theBackDetBrothers
void searchNeighbors(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, float window, std::vector< DetGroup > &result, std::vector< DetGroup > &brotherresult, bool checkClosest) const __attribute__((hot))
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))
const SubLayerCrossing & other() const
const std::vector< const GeomDet * > & subLayer(int ind) const
bool addClosest(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result, std::vector< DetGroup > &brotherresult) const __attribute__((hot))
double transverseCurvature() const
GlobalVector globalMomentum() const
void add(std::map< std::string, TH1 *> &h, TH1 *hist)
~Phase2EndcapRing() override
PeriodicBinFinderInPhi< float > BinFinderType
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
SubLayerCrossings computeCrossings(const TrajectoryStateOnSurface &tsos, PropagationDirection propDir) const __attribute__((hot))
BinFinderType theBackBinFinder
std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const override
ReferenceCountingPointer< BoundDisk > theBackDisk