25 return (fabs(
a.front().det()->position().z()) < fabs(
b.front().det()->position().z()));
30 vector<const GeomDet*>& outerDets,
31 const vector<const GeomDet*>& innerDetBrothers,
32 const vector<const GeomDet*>& outerDetBrothers)
34 theFrontDets(innerDets.begin(), innerDets.
end()),
35 theBackDets(outerDets.begin(), outerDets.
end()),
36 theFrontDetBrothers(innerDetBrothers.begin(), innerDetBrothers.
end()),
37 theBackDetBrothers(outerDetBrothers.begin(), outerDetBrothers.
end()) {
56 LogDebug(
"TkDetLayers") <<
"DEBUG INFO for Phase2EndcapRing";
58 LogDebug(
"TkDetLayers") <<
"frontDet detId,phi,z,r: " << (*it)->geographicalId().rawId() <<
" , "
59 << (*it)->surface().position().phi() <<
" , " << (*it)->surface().position().z() <<
" , "
60 << (*it)->surface().position().perp();
66 LogDebug(
"TkDetLayers") <<
"frontDet brothers detId,phi,z,r: " << (*it)->geographicalId().rawId() <<
" , "
67 << (*it)->surface().position().phi() <<
" , " << (*it)->surface().position().z() <<
" , "
68 << (*it)->surface().position().perp();
73 LogDebug(
"TkDetLayers") <<
"backDet detId,phi,z,r: " << (*it)->geographicalId().rawId() <<
" , "
74 << (*it)->surface().position().phi() <<
" , " << (*it)->surface().position().z() <<
" , "
75 << (*it)->surface().position().perp();
80 LogDebug(
"TkDetLayers") <<
"backDet brothers detId,phi,z,r: " << (*it)->geographicalId().rawId() <<
" , "
81 << (*it)->surface().position().phi() <<
" , " << (*it)->surface().position().z() <<
" , "
82 << (*it)->surface().position().perp();
91 throw DetLayerException(
"Phase2EndcapRing doesn't have GeometricSearchDet components");
97 edm::LogError(
"TkDetLayers") <<
"temporary dummy implementation of Phase2EndcapRing::compatible()!!";
98 return pair<bool, TrajectoryStateOnSurface>();
104 std::vector<DetGroup>&
result)
const {
110 std::vector<DetGroup> closestResult;
111 std::vector<DetGroup> closestBrotherResult;
112 addClosest(tsos, prop, est, crossings.
closest(), closestResult, closestBrotherResult);
113 if (closestResult.empty())
121 vector<DetGroup> closestCompleteResult;
123 std::move(closestResult),
std::move(closestBrotherResult), closestCompleteResult, 0, crossingSide);
125 vector<DetGroup> nextResult;
126 vector<DetGroup> nextBrotherResult;
129 vector<DetGroup> nextCompleteResult;
131 std::move(nextResult),
std::move(nextBrotherResult), nextCompleteResult, 0, crossingSide);
141 LogTrace(
"TkDetLayers") <<
"Number of groups : " <<
result.size() << std::endl;
142 for (
auto& grp :
result) {
145 LogTrace(
"TkDetLayers") <<
"New group in Phase2EndcapRing made by : " << std::endl;
146 for (
auto const& det : grp) {
147 LogTrace(
"TkDetLayers") <<
" geom det at r: " << det.det()->position().perp()
148 <<
" id:" << det.det()->geographicalId().rawId()
149 <<
" tsos at:" << det.trajectoryState().globalPosition() << std::endl;
163 pair<bool, double> frontPath = crossing.pathLength(*
theFrontDisk);
164 if (!frontPath.first)
167 pair<bool, double> backPath = crossing.pathLength(*
theBackDisk);
171 GlobalPoint gFrontPoint(crossing.position(frontPath.second));
172 GlobalPoint gBackPoint(crossing.position(backPath.second));
184 if (frontDist < backDist) {
196 vector<DetGroup>& brotherresult)
const {
206 return firstgroup || brothergroup;
215 vector<DetGroup>& brotherresult,
216 bool checkClosest)
const {
224 int negStartIndex = closestIndex - 1;
225 int posStartIndex = closestIndex + 1;
229 posStartIndex = closestIndex;
231 negStartIndex = closestIndex;
238 int half = sLayer.size() / 2;
239 for (
int idet = negStartIndex; idet >= negStartIndex - half; idet--) {
248 const GeomDet& neighborBrotherDet = *sBrotherLayer[binFinder.
binIndex(idet)];
249 Adder::add(neighborBrotherDet, tsos, prop, est, brotherresult);
252 for (
int idet = posStartIndex; idet < posStartIndex + half; idet++) {
261 const GeomDet& neighborBrotherDet = *sBrotherLayer[binFinder.
binIndex(idet)];
262 Adder::add(neighborBrotherDet, tsos, prop, est, brotherresult);