19 class DetGroupElementPerpLess {
22 return (
a.front().det()->position().perp() <
b.front().det()->position().perp());
28 vector<const GeomDet*>& outerDets,
29 vector<const GeomDet*>& innerDetBrothers,
30 vector<const GeomDet*>& outerDetBrothers)
32 theInnerDets(innerDets),
33 theOuterDets(outerDets),
34 theInnerDetBrothers(innerDetBrothers),
35 theOuterDetBrothers(outerDetBrothers) {
52 LogDebug(
"TkDetLayers") <<
"==== DEBUG Phase2OTBarrelRod =====";
54 LogDebug(
"TkDetLayers") <<
"inner Phase2OTBarrelRod's Det pos z,perp,eta,phi: " << (**i).position().z() <<
" , "
55 << (**i).position().perp() <<
" , " << (**i).position().eta() <<
" , "
56 << (**i).position().phi();
60 LogDebug(
"TkDetLayers") <<
"inner Phase2OTBarrelRod's Det Brother pos z,perp,eta,phi: " << (**i).position().z()
61 <<
" , " << (**i).position().perp() <<
" , " << (**i).position().eta() <<
" , "
62 << (**i).position().phi();
66 LogDebug(
"TkDetLayers") <<
"outer Phase2OTBarrelRod's Det pos z,perp,eta,phi: " << (**i).position().z() <<
" , "
67 << (**i).position().perp() <<
" , " << (**i).position().eta() <<
" , "
68 << (**i).position().phi();
72 LogDebug(
"TkDetLayers") <<
"outer Phase2OTBarrelRod's Det Brother pos z,perp,eta,phi: " << (**i).position().z()
73 <<
" , " << (**i).position().perp() <<
" , " << (**i).position().eta() <<
" , "
74 << (**i).position().phi();
76 LogDebug(
"TkDetLayers") <<
"==== end DEBUG Phase2OTBarrelRod =====";
83 throw DetLayerException(
"Phase2OTBarrelRod doesn't have GeometricSearchDet components");
89 edm::LogError(
"TkDetLayers") <<
"temporary dummy implementation of Phase2OTBarrelRod::compatible()!!";
90 return pair<bool, TrajectoryStateOnSurface>();
96 std::vector<DetGroup>&
result)
const {
102 std::vector<DetGroup> closestResult;
103 std::vector<DetGroup> closestBrotherResult;
104 addClosest(tsos, prop, est, crossings.
closest(), closestResult, closestBrotherResult);
105 if (closestResult.empty()) {
106 std::vector<DetGroup> nextResult;
107 std::vector<DetGroup> nextBrotherResult;
108 addClosest(tsos, prop, est, crossings.
other(), nextResult, nextBrotherResult);
109 if (nextResult.empty())
114 std::vector<DetGroup> closestCompleteResult;
116 std::move(closestResult),
std::move(closestBrotherResult), closestCompleteResult, 0, crossingSide);
117 std::vector<DetGroup> nextCompleteResult;
119 std::move(nextResult),
std::move(nextBrotherResult), nextCompleteResult, 0, crossingSide);
130 std::vector<DetGroup> closestCompleteResult;
132 std::move(closestResult),
std::move(closestBrotherResult), closestCompleteResult, 0, crossingSide);
134 std::vector<DetGroup> nextResult;
135 std::vector<DetGroup> nextBrotherResult;
138 std::vector<DetGroup> nextCompleteResult;
140 std::move(nextResult),
std::move(nextBrotherResult), nextCompleteResult, 0, crossingSide);
147 sort(
result.begin(),
result.end(), DetGroupElementPerpLess());
148 for (
auto& grp :
result) {
151 LogTrace(
"TkDetLayers") <<
"New group in Phase2OTBarrelRod made by : ";
152 for (
auto const& det : grp) {
153 LogTrace(
"TkDetLayers") <<
" geom det at r: " << det.det()->position().perp()
154 <<
" id:" << det.det()->geographicalId().rawId()
155 <<
" tsos at:" << det.trajectoryState().globalPosition();
168 std::pair<bool, double> outerPath = crossing.pathLength(*
theOuterPlane);
169 if (!outerPath.first)
171 GlobalPoint gOuterPoint(crossing.position(outerPath.second));
173 std::pair<bool, double> innerPath = crossing.pathLength(*
theInnerPlane);
174 if (!innerPath.first)
176 GlobalPoint gInnerPoint(crossing.position(innerPath.second));
186 if (innerDist < outerDist) {
198 vector<DetGroup>& brotherresult)
const {
206 return firstgroup || brothergroup;
221 constexpr
float relativeMargin = 1.01;
229 float localY = localCrossPoint.y();
246 vector<DetGroup>& brotherresult,
247 bool checkClosest)
const {
254 int negStartIndex = closestIndex - 1;
255 int posStartIndex = closestIndex + 1;
258 if (gCrossingPos.
z() < sRod[closestIndex]->surface().position().z()) {
259 posStartIndex = closestIndex;
261 negStartIndex = closestIndex;
266 for (
int idet = negStartIndex; idet >= 0; idet--) {
272 Adder::add(*sBrotherRod[idet], tsos, prop, est, brotherresult);
274 for (
int idet = posStartIndex; idet < static_cast<int>(sRod.size()); idet++) {
280 Adder::add(*sBrotherRod[idet], tsos, prop, est, brotherresult);