Skip to content

Commit

Permalink
fix ordering in Phase2OTEndcapRing
Browse files Browse the repository at this point in the history
  • Loading branch information
ebrondol committed Aug 25, 2016
1 parent 7aa3d49 commit d19b2ce
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions RecoTracker/TkDetLayers/src/Phase2OTEndcapRing.cc
Expand Up @@ -22,6 +22,14 @@ using namespace std;

typedef GeometricSearchDet::DetWithState DetWithState;

class DetGroupElementZLess {
public:
bool operator()(DetGroup a,DetGroup b)
{
return (fabs(a.front().det()->position().z()) < fabs(b.front().det()->position().z()));
}
};

Phase2OTEndcapRing::Phase2OTEndcapRing(vector<const GeomDet*>& innerDets,
vector<const GeomDet*>& outerDets,
vector<const GeomDet*>& innerDetBrothers,
Expand Down Expand Up @@ -131,6 +139,21 @@ Phase2OTEndcapRing::groupedCompatibleDetsV( const TrajectoryStateOnSurface& tsos

DetGroupMerger::orderAndMergeTwoLevels( std::move(closestCompleteResult), std::move(nextCompleteResult), result,
crossings.closestIndex(), crossingSide);

//due to propagator problems, when we add single pt sub modules, we should order them in z (endcap)
sort(result.begin(),result.end(),DetGroupElementZLess());

#ifdef EDM_ML_DEBUG
for (auto& grp : result) {
if ( grp.empty() ) continue;
LogTrace("TkDetLayers") <<"New group in Phase2OTEndcapRing made by : " << std::endl;
for (auto const & det : grp) {
LogTrace("TkDetLayers") <<" geom det at r: " << det.det()->position().perp() <<" id:" << det.det()->geographicalId().rawId()
<<" tsos at:" << det.trajectoryState().globalPosition() << std::endl;
}
}
#endif

}


Expand Down

0 comments on commit d19b2ce

Please sign in to comment.