55 m_gmt(gmt), m_MuonCands() {
80 std::vector<L1MuGMTExtendedCand*> mycands;
81 std::vector<L1MuGMTExtendedCand*> my_brl_cands;
83 std::vector<L1MuGMTExtendedCand*>::const_iterator iter;
86 const std::vector<L1MuGMTExtendedCand*>& brl_cands =
m_gmt.
Merger(0)->
Cands();
87 iter = brl_cands.begin();
88 while ( iter != brl_cands.end() ) {
89 if ( *iter && !(*iter)->empty() ) {
90 my_brl_cands.push_back((*iter));
97 stable_sort( my_brl_cands.begin(), my_brl_cands.end(), rankFunction );
100 iter = my_brl_cands.begin();
102 while ( iter != my_brl_cands.end() && (count<4) ) {
103 if ( *iter && !(*iter)->empty() ) {
104 mycands.push_back((*iter));
113 std::vector<L1MuGMTExtendedCand*> my_fwd_cands;
116 const std::vector<L1MuGMTExtendedCand*>& fwd_cands =
m_gmt.
Merger(1)->
Cands();
117 iter = fwd_cands.begin();
118 while ( iter != fwd_cands.end() ) {
119 if ( *iter && !(*iter)->empty() ) {
120 my_fwd_cands.push_back((*iter));
125 stable_sort( my_fwd_cands.begin(), my_fwd_cands.end(), rankFunction );
129 iter = my_fwd_cands.begin();
131 while ( iter != my_fwd_cands.end() && (count<4) ) {
132 if ( *iter && !(*iter)->empty() ) {
133 mycands.push_back((*iter));
146 std::vector<L1MuGMTExtendedCand*>::const_iterator iter;
147 for ( iter = mycands.begin(); iter != mycands.end(); iter++ ) {
148 if (*iter ) (*iter)->print();
153 stable_sort( mycands.begin(), mycands.end(), rankFunction );
156 int number_of_cands = 0;
157 std::vector<L1MuGMTExtendedCand*>::const_iterator iter1 = mycands.begin();
158 while ( iter1 != mycands.end() ) {
159 if ( *iter1 && number_of_cands < 4 ) {
175 std::vector<const L1MuGMTExtendedCand*>::iterator iter;
190 edm::LogVerbatim(
"GMT_Sorter_info") <<
"Muon candidates found by the L1 Global Muon Trigger : " 192 std::vector<const L1MuGMTExtendedCand*>::const_iterator iter =
m_MuonCands.begin();
194 if ( *iter ) (*iter)->print();
void setGMTBrlCand(int nr, L1MuGMTExtendedCand const &cand)
set GMT barrel candidate
L1MuGMTSorter(const L1MuGlobalMuonTrigger &)
constructor
virtual void reset()
reset Sorter
void setGMTFwdCand(int nr, L1MuGMTExtendedCand const &cand)
set GMT forward candidate
std::vector< const L1MuGMTExtendedCand * > m_MuonCands
virtual ~L1MuGMTSorter()
destructor
void SetBrlGMTCands(int idx, L1MuGMTExtendedCand const &cand)
Set brl GMT Cands.
virtual void run()
run Sorter
U second(std::pair< T, U > const &p)
const L1MuGMTMerger * Merger(int id) const
return pointer to Merger
void print()
print results after sorting
static bool compareRank(const L1MuGMTExtendedCand *first, const L1MuGMTExtendedCand *second)
define a rank for muon candidates
void SetFwdGMTCands(int idx, L1MuGMTExtendedCand const &cand)
Set fwd GMT Cands.
const std::vector< L1MuGMTExtendedCand * > & Cands() const
return std::vector with all muon candidates
void setGMTCand(int nr, L1MuGMTExtendedCand const &cand)
set GMT candidate (does not store rank)
L1MuGMTDebugBlock * DebugBlockForFill() const
for debug: return the debug block (in order to fill it)
int numberOfCands() const
return number of found muon candidates after sorter
const L1MuGlobalMuonTrigger & m_gmt
L1MuGMTReadoutRecord * currentReadoutRecord() const
return a reference to the current record in the ring buffer