CMS 3D CMS Logo

L1MuGMTSorter Class Reference

L1 Global Muon Trigger Sorter. More...

#include <L1Trigger/GlobalMuonTrigger/src/L1MuGMTSorter.h>

List of all members.

Public Member Functions

const std::vector< const
L1MuGMTExtendedCand * > & 
Cands () const
 return std::vector with all muon candidates
 L1MuGMTSorter (const L1MuGlobalMuonTrigger &)
 constructor
int numberOfCands () const
 return number of found muon candidates after sorter
void print ()
 print results after sorting
virtual void reset ()
 reset Sorter
virtual void run ()
 run Sorter
virtual ~L1MuGMTSorter ()
 destructor

Private Attributes

const L1MuGlobalMuonTriggerm_gmt
std::vector< const
L1MuGMTExtendedCand * > 
m_MuonCands


Detailed Description

L1 Global Muon Trigger Sorter.

Definition at line 43 of file L1MuGMTSorter.h.


Constructor & Destructor Documentation

L1MuGMTSorter::L1MuGMTSorter ( const L1MuGlobalMuonTrigger gmt  ) 

constructor

Definition at line 55 of file L1MuGMTSorter.cc.

References m_MuonCands.

00055                                                              :
00056       m_gmt(gmt), m_MuonCands() {
00057 
00058   m_MuonCands.reserve(4);
00059   
00060 }

L1MuGMTSorter::~L1MuGMTSorter (  )  [virtual]

destructor

Definition at line 67 of file L1MuGMTSorter.cc.

00067                               {
00068 
00069 }


Member Function Documentation

const std::vector<const L1MuGMTExtendedCand*>& L1MuGMTSorter::Cands (  )  const [inline]

return std::vector with all muon candidates

Definition at line 66 of file L1MuGMTSorter.h.

References m_MuonCands.

Referenced by L1MuGlobalMuonTrigger::produce().

00066 { return m_MuonCands; }

int L1MuGMTSorter::numberOfCands (  )  const [inline]

return number of found muon candidates after sorter

Definition at line 63 of file L1MuGMTSorter.h.

References m_MuonCands.

Referenced by print(), and L1MuGlobalMuonTrigger::produce().

00063 { return m_MuonCands.size(); }

void L1MuGMTSorter::print ( void   ) 

print results after sorting

Definition at line 186 of file L1MuGMTSorter.cc.

References iter, m_MuonCands, and numberOfCands().

Referenced by L1MuGlobalMuonTrigger::produce().

00186                           {
00187 
00188   edm::LogVerbatim("GMT_Sorter_info") << " ";
00189   edm::LogVerbatim("GMT_Sorter_info") << "Muon candidates found by the L1 Global Muon Trigger : "
00190        << numberOfCands();
00191   std::vector<const L1MuGMTExtendedCand*>::const_iterator iter = m_MuonCands.begin();
00192   while ( iter != m_MuonCands.end() ) {
00193     if ( *iter ) (*iter)->print();
00194     iter++;
00195   }
00196   edm::LogVerbatim("GMT_Sorter_info") << " ";
00197 
00198 }

void L1MuGMTSorter::reset ( void   )  [virtual]

reset Sorter

Definition at line 172 of file L1MuGMTSorter.cc.

References iter, and m_MuonCands.

Referenced by L1MuGlobalMuonTrigger::reset().

00172                           {
00173 
00174   std::vector<const L1MuGMTExtendedCand*>::iterator iter;
00175   for ( iter = m_MuonCands.begin(); iter != m_MuonCands.end(); iter++ ) {
00176     *iter = 0;
00177   }
00178   m_MuonCands.clear();
00179 
00180 } 

void L1MuGMTSorter::run ( void   )  [virtual]

run Sorter

Definition at line 79 of file L1MuGMTSorter.cc.

References L1MuGMTMerger::Cands(), count, L1MuGlobalMuonTrigger::currentReadoutRecord(), L1MuGMTConfig::Debug(), L1MuGlobalMuonTrigger::DebugBlockForFill(), iter, m_gmt, m_MuonCands, L1MuGlobalMuonTrigger::Merger(), L1MuGMTDebugBlock::SetBrlGMTCands(), L1MuGMTDebugBlock::SetFwdGMTCands(), L1MuGMTReadoutRecord::setGMTBrlCand(), L1MuGMTReadoutRecord::setGMTCand(), and L1MuGMTReadoutRecord::setGMTFwdCand().

Referenced by L1MuGlobalMuonTrigger::produce().

00079                         {
00080 
00081   std::vector<L1MuGMTExtendedCand*> mycands;
00082    std::vector<L1MuGMTExtendedCand*> my_brl_cands;
00083 
00084   std::vector<L1MuGMTExtendedCand*>::const_iterator iter;
00085   
00086   // get muon candidates from barrel Merger 
00087   const std::vector<L1MuGMTExtendedCand*>& brl_cands = m_gmt.Merger(0)->Cands();
00088   iter = brl_cands.begin();
00089   while ( iter != brl_cands.end() ) {
00090     if ( *iter && !(*iter)->empty() ) {
00091       my_brl_cands.push_back((*iter));
00092     }
00093     iter++;
00094   }
00095   // sort by rank
00096   stable_sort( my_brl_cands.begin(), my_brl_cands.end(), L1MuGMTExtendedCand::Rank() );
00097 
00098   // copy best four of brl to main sorter
00099   iter = my_brl_cands.begin();
00100   int count=0;
00101   while ( iter != my_brl_cands.end() && (count<4) ) {
00102     if ( *iter && !(*iter)->empty() ) {
00103       mycands.push_back((*iter));
00104       m_gmt.DebugBlockForFill()->SetBrlGMTCands( count, **iter) ; 
00105       m_gmt.currentReadoutRecord()->setGMTBrlCand ( count, **iter );
00106       count++;
00107    }
00108     iter++;
00109   }
00110 
00111    
00112   std::vector<L1MuGMTExtendedCand*> my_fwd_cands;
00113 
00114   // get muon candidates from forward Merger 
00115   const std::vector<L1MuGMTExtendedCand*>& fwd_cands = m_gmt.Merger(1)->Cands();
00116   iter = fwd_cands.begin();
00117   while ( iter != fwd_cands.end() ) {
00118     if ( *iter && !(*iter)->empty() ) {
00119       my_fwd_cands.push_back((*iter));
00120     }
00121     iter++;
00122   }
00123    // sort by rank
00124   stable_sort( my_fwd_cands.begin(), my_fwd_cands.end(), L1MuGMTExtendedCand::Rank() );
00125 
00126 
00127   // copy best four of fwd to main sorter
00128   iter = my_fwd_cands.begin();
00129   count=0;
00130   while ( iter != my_fwd_cands.end() && (count<4) ) {
00131     if ( *iter && !(*iter)->empty() ) {
00132       mycands.push_back((*iter));
00133       m_gmt.DebugBlockForFill()->SetFwdGMTCands( count, **iter) ; 
00134       m_gmt.currentReadoutRecord()->setGMTFwdCand ( count, **iter );
00135       count++;
00136     }
00137     iter++;
00138   }
00139 
00140 
00141   // print input data
00142   if ( L1MuGMTConfig::Debug(5) ) {
00143     edm::LogVerbatim("GMT_Sorter_info") << "GMT Sorter input: "
00144          << mycands.size();
00145     std::vector<L1MuGMTExtendedCand*>::const_iterator iter;
00146     for ( iter = mycands.begin(); iter != mycands.end(); iter++ ) {
00147       if (*iter ) (*iter)->print();
00148     }
00149   }
00150   
00151   // sort by rank
00152   stable_sort( mycands.begin(), mycands.end(), L1MuGMTExtendedCand::Rank() );
00153 
00154   // copy the best 4 candidates
00155   int number_of_cands = 0;
00156   std::vector<L1MuGMTExtendedCand*>::const_iterator iter1 = mycands.begin();
00157   while ( iter1 != mycands.end() ) {
00158     if ( *iter1 && number_of_cands < 4 ) {
00159       m_MuonCands.push_back(*iter1);
00160       m_gmt.currentReadoutRecord()->setGMTCand ( count, **iter1 );
00161       number_of_cands++;
00162     }
00163     iter1++;
00164   }  
00165 
00166 } 


Member Data Documentation

const L1MuGlobalMuonTrigger& L1MuGMTSorter::m_gmt [private]

Definition at line 70 of file L1MuGMTSorter.h.

Referenced by run().

std::vector<const L1MuGMTExtendedCand*> L1MuGMTSorter::m_MuonCands [private]

Definition at line 71 of file L1MuGMTSorter.h.

Referenced by Cands(), L1MuGMTSorter(), numberOfCands(), print(), reset(), and run().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:26:56 2009 for CMSSW by  doxygen 1.5.4