17 #include <boost/function.hpp>
26 return (fabs(
a.front().det()->position().z()) < fabs(
b.front().det()->position().z()));
31 vector<const GeomDet*>& outerDets,
32 const vector<const GeomDet*>& innerDetBrothers,
33 const vector<const GeomDet*>& outerDetBrothers)
35 theFrontDets(innerDets.
begin(), innerDets.
end()),
36 theBackDets(outerDets.
begin(), outerDets.
end()),
37 theFrontDetBrothers(innerDetBrothers.
begin(), innerDetBrothers.
end()),
38 theBackDetBrothers(outerDetBrothers.
begin(), outerDetBrothers.
end()) {
57 LogDebug(
"TkDetLayers") <<
"DEBUG INFO for Phase2EndcapRing";
59 LogDebug(
"TkDetLayers") <<
"frontDet detId,phi,z,r: " << (*it)->geographicalId().rawId() <<
" , "
60 << (*it)->surface().position().phi() <<
" , " << (*it)->surface().position().z() <<
" , "
61 << (*it)->surface().position().perp();
67 LogDebug(
"TkDetLayers") <<
"frontDet brothers detId,phi,z,r: " << (*it)->geographicalId().rawId() <<
" , "
68 << (*it)->surface().position().phi() <<
" , " << (*it)->surface().position().z() <<
" , "
69 << (*it)->surface().position().perp();
74 LogDebug(
"TkDetLayers") <<
"backDet detId,phi,z,r: " << (*it)->geographicalId().rawId() <<
" , "
75 << (*it)->surface().position().phi() <<
" , " << (*it)->surface().position().z() <<
" , "
76 << (*it)->surface().position().perp();
81 LogDebug(
"TkDetLayers") <<
"backDet brothers detId,phi,z,r: " << (*it)->geographicalId().rawId() <<
" , "
82 << (*it)->surface().position().phi() <<
" , " << (*it)->surface().position().z() <<
" , "
83 << (*it)->surface().position().perp();
92 throw DetLayerException(
"Phase2EndcapRing doesn't have GeometricSearchDet components");
98 edm::LogError(
"TkDetLayers") <<
"temporary dummy implementation of Phase2EndcapRing::compatible()!!";
99 return pair<bool, TrajectoryStateOnSurface>();
105 std::vector<DetGroup>&
result)
const {
111 std::vector<DetGroup> closestResult;
112 std::vector<DetGroup> closestBrotherResult;
113 addClosest(tsos, prop, est, crossings.
closest(), closestResult, closestBrotherResult);
114 if (closestResult.empty())
122 vector<DetGroup> closestCompleteResult;
124 std::move(closestResult),
std::move(closestBrotherResult), closestCompleteResult, 0, crossingSide);
126 vector<DetGroup> nextResult;
127 vector<DetGroup> nextBrotherResult;
130 vector<DetGroup> nextCompleteResult;
132 std::move(nextResult),
std::move(nextBrotherResult), nextCompleteResult, 0, crossingSide);
142 LogTrace(
"TkDetLayers") <<
"Number of groups : " <<
result.size() << std::endl;
143 for (
auto& grp :
result) {
146 LogTrace(
"TkDetLayers") <<
"New group in Phase2EndcapRing made by : " << std::endl;
147 for (
auto const& det : grp) {
148 LogTrace(
"TkDetLayers") <<
" geom det at r: " << det.det()->position().perp()
149 <<
" id:" << det.det()->geographicalId().rawId()
150 <<
" tsos at:" << det.trajectoryState().globalPosition() << std::endl;
164 pair<bool, double> frontPath = crossing.pathLength(*
theFrontDisk);
165 if (!frontPath.first)
168 pair<bool, double> backPath = crossing.pathLength(*
theBackDisk);
172 GlobalPoint gFrontPoint(crossing.position(frontPath.second));
173 GlobalPoint gBackPoint(crossing.position(backPath.second));
185 if (frontDist < backDist) {
197 vector<DetGroup>& brotherresult)
const {
207 return firstgroup || brothergroup;
216 vector<DetGroup>& brotherresult,
217 bool checkClosest)
const {
225 int negStartIndex = closestIndex - 1;
226 int posStartIndex = closestIndex + 1;
230 posStartIndex = closestIndex;
232 negStartIndex = closestIndex;
239 int half = sLayer.size() / 2;
240 for (
int idet = negStartIndex; idet >= negStartIndex - half; idet--) {
249 const GeomDet& neighborBrotherDet = *sBrotherLayer[binFinder.
binIndex(idet)];
250 Adder::add(neighborBrotherDet, tsos, prop, est, brotherresult);
253 for (
int idet = posStartIndex; idet < posStartIndex + half; idet++) {
262 const GeomDet& neighborBrotherDet = *sBrotherLayer[binFinder.
binIndex(idet)];
263 Adder::add(neighborBrotherDet, tsos, prop, est, brotherresult);