#include "L1HitsSortHelper.h" #include #include #include "L1StsHit.h" #include "L1HitPoint.h" #include "L1Algo.h" using std::vector; L1HitsSortHelper::L1HitsSortHelper( vector &hits, vector &points, vector &indices, THitI* iStart, THitI* iStop, int nStations ): fHits(hits), fPoints(points), fIndices(indices), fStsHitsUnusedStartIndex( iStart ), fStsHitsUnusedStopIndex( iStop ), fNStations(nStations) { L1_ASSERT( hits.size() == points.size(), hits.size() << " " << points.size() ); const int NHits = hits.size(); fD.resize( NHits ); for ( int i = 0; i < NHits; i++ ) { fD[i].h = &(hits[i]); fD[i].p = &(points[i]); fD[i].i = indices[i]; } } void L1HitsSortHelper::Sort(){ for ( int iS = 0; iS < fNStations; ++iS ) { // TODO std::sort(fD.begin()+fStsHitsUnusedStartIndex[iS], fD.begin()+fStsHitsUnusedStopIndex[iS], L1HitsSortHelperData::compare); } vector hits = fHits; vector points = fPoints; const int NHits = fD.size(); for ( int i = 0; i < NHits; i++ ) { hits[i] = *fD[i].h; points[i] = *fD[i].p; fIndices[i] = fD[i].i; } fHits = hits; fPoints = points; }