51 m_tf(tf), m_wsid(id), m_TrackCands(3) {
77 vector<L1MuBMTrack*> wedgecands;
78 wedgecands.reserve(12);
82 if (
wheel == 0 )
continue;
84 for (
int number = 0; number < 2; number++ ) {
86 if ( cand && !cand->
empty() ) {
95 if ( adr != 15 ) reject &= ( (adr/2)%2 == 0 );
98 if ( !reject ) wedgecands.push_back(const_cast<L1MuBMTrack*>(cand));
105 cout <<
"Wedge Sorter " <<
m_wsid <<
" input: " 106 << wedgecands.size() << endl;
107 vector<L1MuBMTrack*>::const_iterator iter;
108 for ( iter = wedgecands.begin(); iter != wedgecands.end(); iter++ ) {
109 if (*iter ) (*iter)->print();
117 vector<L1MuBMTrack*>::iterator it = wedgecands.begin();
118 while ( it != wedgecands.end() ) {
119 if ( *it && (*it)->empty() ) {
120 wedgecands.erase(it);
121 it = wedgecands.begin();
continue;
127 partial_sort_copy( wedgecands.begin(), wedgecands.end(),
132 cout <<
"Wedge Sorter " <<
m_wsid <<
" output: " << endl;
133 vector<const L1MuBMTrack*>::const_iterator iter;
136 if (*iter) (*iter)->print();
148 vector<const L1MuBMTrack*>::iterator iter;
162 cout <<
"Muon candidates found in Wedge Sorter " <<
m_wsid <<
" : " << endl;
163 vector<const L1MuBMTrack*>::const_iterator iter =
m_TrackCands.begin();
165 if ( *iter )
cout << *(*iter) <<
" found in " 166 << (*iter)->spid() << endl;
179 vector<const L1MuBMTrack*>::const_iterator iter =
m_TrackCands.begin();
181 if ( *iter && !(*iter)->empty() )
return true;
200 typedef vector<L1MuBMTrack*>::iterator TI;
201 for ( TI iter1 = cands.begin(); iter1 != cands.end(); iter1++ ) {
202 if ( *iter1 ==
nullptr )
continue;
203 if ( (*iter1)->empty() )
continue;
205 int qual1 = (*iter1)->quality();
206 for ( TI iter2 = cands.begin(); iter2 != cands.end(); iter2++ ) {
207 if ( *iter2 ==
nullptr )
continue;
208 if ( *iter1 == *iter2 )
continue;
209 if ( (*iter2)->empty() )
continue;
211 int qual2 = (*iter2)->quality();
212 if ( sp1 == sp2 )
continue;
214 int adr_shift = ( sp2.
wheel() == -1 ) ? 0 : 2;
217 int adr1 = (*iter1)->address(
stat);
218 int adr2 = (*iter2)->address(
stat);
219 if ( adr1 == 15 || adr2 == 15 )
continue;
220 if ( (adr2/2)%2 == 1 )
continue;
221 if ( adr1 == adr2 + adr_shift ) countTS++;
224 if ( qual1 < qual2 ) {
226 cout <<
"Wedge Sorter cancel : "; (*iter1)->print();
233 cout <<
"Wedge Sorter cancel : "; (*iter2)->print();
256 int sector1 = spid1.
sector();
257 int wheel1 = spid1.
wheel();
259 int sector2 = spid2.
sector();
260 int wheel2 = spid2.
wheel();
262 if ( sector1 == sector2 ) {
264 if ( ( wheel1 == -2 && wheel2 == -3 ) ||
265 ( wheel1 == -1 && wheel2 == -2 ) ||
266 ( wheel1 == +1 && wheel2 == -1 ) ||
267 ( wheel1 == +1 && wheel2 == +2 ) ||
268 ( wheel1 == +2 && wheel2 == +3 ) ) neigh =
true;
~L1MuBMWedgeSorter() override
destructor
void reset() override
reset Wedge Sorter
std::vector< const L1MuBMTrack * > m_TrackCands
L1MuBMAddressArray address() const
get address-array for this muon candidate
bool anyTrack() const
are there any non-empty muon candidates in the Wedge Sorter?
L1MuBMWedgeSorter(const L1MuBMTrackFinder &, int id)
constructor
int sector() const
return sector number
static bool neighbour(const L1MuBMSecProcId &spid1, const L1MuBMSecProcId &spid2)
find out if two Sector Processors are neighbours in the same wedge
const L1MuBMSectorProcessor * sp(const L1MuBMSecProcId &) const
get a pointer to a Sector Processor
L1MuBMTrack * track(int id) const
return pointer to muon candidate, index [0,1]
const L1MuBMTrackFinder & m_tf
static bool rank(const L1MuBMTrack *first, const L1MuBMTrack *second)
define a rank for muon candidates
void print() const
print results after sorting
bool empty() const
is it an empty muon candidate?
void runCOL(std::vector< L1MuBMTrack * > &) const
run the Cancel Out Logic of the wedge sorter
void run() override
run Wedge Sorter
int wheel() const
return wheel number