CMS 3D CMS Logo

L1MuDTMuonSorter Class Reference

DT Muon Sorter:. More...

#include <L1Trigger/DTTrackFinder/src/L1MuDTMuonSorter.h>

Inheritance diagram for L1MuDTMuonSorter:

L1AbstractProcessor

List of all members.

Public Member Functions

 L1MuDTMuonSorter (const L1MuDTTrackFinder &)
 constructor
int numberOfTracks () const
 return number of found muon candidates after sorter
void print () const
 print results after sorting
virtual void reset ()
 reset Muon Sorter
virtual void run ()
 run Muon Sorter
const L1MuDTTracktrack (int id) const
 return pointer to a muon candidate
const std::vector< const
L1MuDTTrack * > & 
tracks () const
 return vector of muon candidates
virtual ~L1MuDTMuonSorter ()
 destructor

Private Member Functions

void runCOL (std::vector< L1MuDTTrack * > &) const
 run the Cancel Out Logic of the muon sorter

Static Private Member Functions

static int neighbour (const L1MuDTSecProcId &spid1, const L1MuDTSecProcId &spid2)
 find out if two Sector Processors are neighbours

Private Attributes

const L1MuDTTrackFinderm_tf
std::vector< const L1MuDTTrack * > m_TrackCands


Detailed Description

DT Muon Sorter:.

The DT Muon Sorter receives 2 muon candidates from each of the 12 Wedge Sorters and sorts out the 4 best (highest pt, highest quality) muons

Date
2007/03/30 09:05:32
Revision
1.3

N. Neumeister CERN EP

Definition at line 47 of file L1MuDTMuonSorter.h.


Constructor & Destructor Documentation

L1MuDTMuonSorter::L1MuDTMuonSorter ( const L1MuDTTrackFinder tf  ) 

constructor

Definition at line 50 of file L1MuDTMuonSorter.cc.

References m_TrackCands.

00050                                                               :
00051       m_tf(tf), m_TrackCands() {
00052 
00053   m_TrackCands.reserve(4);
00054   
00055 }

L1MuDTMuonSorter::~L1MuDTMuonSorter (  )  [virtual]

destructor

Definition at line 62 of file L1MuDTMuonSorter.cc.

00062                                     {
00063 
00064 }


Member Function Documentation

int L1MuDTMuonSorter::neighbour ( const L1MuDTSecProcId spid1,
const L1MuDTSecProcId spid2 
) [static, private]

find out if two Sector Processors are neighbours

Definition at line 300 of file L1MuDTMuonSorter.cc.

References funct::abs(), L1MuDTSecProcId::sector(), and L1MuDTSecProcId::wheel().

00301                                                               {
00302 
00303   // definition of valid topologies:
00304 
00305   //              E T A
00306   //        -----------------
00307   //   +
00308   //        ---               ---
00309   //   |   | 2 |             | 2 |
00310   // P |   |___|             |___|
00311   //   |    ---    ---    ---        ---
00312   // H |   | 1 |  | 1 |  | 1 |      | 1 |
00313   //   |   |___|  |___|  |___|      |___|
00314   // I |           ---                   ---
00315   //   |          | 2 |                 | 2 |
00316   //              |___|                 |___|
00317   //   -
00318   // result: 1      2        3          4         5    6  otherwise : -1
00319 
00320   int topology = -1;
00321 
00322   int sector1 = spid1.sector();
00323   int wheel1  = spid1.wheel();
00324 
00325   int sector2 = spid2.sector();
00326   int wheel2  = spid2.wheel();
00327 
00328   int sectordiff = (sector2 - sector1)%12;
00329   if ( sectordiff >= 6 ) sectordiff -= 12;
00330   if ( sectordiff < -6 ) sectordiff += 12;
00331 
00332   if ( abs(sectordiff) == 1 ) {
00333 
00334     if ( wheel1 == wheel2 ) topology = (sectordiff > 0) ? 1 : 2;
00335     if ( wheel1 == +1 && wheel2 == -1 )  topology = (sectordiff > 0) ? 5 : 6; 
00336     if ( ( wheel1 == -2 && wheel2 == -3 ) ||
00337          ( wheel1 == -1 && wheel2 == -2 ) ||
00338          ( wheel1 == +1 && wheel2 == +2 ) ||
00339          ( wheel1 == +2 && wheel2 == +3 ) ) topology = (sectordiff > 0) ? 3 : 4;
00340  
00341   }     
00342        
00343   return topology;     
00344 
00345 }

int L1MuDTMuonSorter::numberOfTracks (  )  const [inline]

return number of found muon candidates after sorter

Definition at line 67 of file L1MuDTMuonSorter.h.

References m_TrackCands.

Referenced by print(), and L1MuDTTrackFinder::run().

00067 { return m_TrackCands.size(); }

void L1MuDTMuonSorter::print ( void   )  const

print results after sorting

Definition at line 147 of file L1MuDTMuonSorter.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), iter, m_TrackCands, and numberOfTracks().

Referenced by L1MuDTTrackFinder::run().

00147                                    {
00148 
00149   cout << endl;
00150   cout << "Muon candidates found by the barrel MTTF : "
00151        << numberOfTracks() << endl;
00152   vector<const L1MuDTTrack*>::const_iterator iter = m_TrackCands.begin();
00153   while ( iter != m_TrackCands.end() ) {
00154     if ( *iter ) cout << *(*iter) << endl;
00155     iter++;
00156   }
00157   cout << endl;
00158 
00159 }

void L1MuDTMuonSorter::reset ( void   )  [virtual]

reset Muon Sorter

Implements L1AbstractProcessor.

Definition at line 133 of file L1MuDTMuonSorter.cc.

References iter, and m_TrackCands.

Referenced by L1MuDTTrackFinder::reset().

00133                              {
00134 
00135   m_TrackCands.clear();
00136   vector<const L1MuDTTrack*>::iterator iter;
00137   for ( iter = m_TrackCands.begin(); iter != m_TrackCands.end(); iter++ ) {
00138     *iter = 0;
00139   }
00140 
00141 }

void L1MuDTMuonSorter::run ( void   )  [virtual]

run Muon Sorter

Reimplemented from L1AbstractProcessor.

Definition at line 74 of file L1MuDTMuonSorter.cc.

References GenMuonPlsPt100GeV_cfg::cout, L1MuDTTFConfig::Debug(), lat::endl(), it, iter, m_tf, m_TrackCands, runCOL(), L1MuDTWedgeSorter::tracks(), and L1MuDTTrackFinder::ws().

Referenced by L1MuDTTrackFinder::run().

00074                            {
00075 
00076   // get track candidates from Wedge Sorters
00077   vector<L1MuDTTrack*> mycands;
00078   mycands.reserve(24);
00079   
00080   for ( int wedge = 0; wedge < 12; wedge++ ) {
00081     vector<const L1MuDTTrack*> wscand = m_tf.ws(wedge)->tracks();
00082     vector<const L1MuDTTrack*>::iterator iter = wscand.begin();
00083     while ( iter != wscand.end() ) {
00084       if ( *iter && !(*iter)->empty() ) 
00085         mycands.push_back(const_cast<L1MuDTTrack*>(*iter) );
00086       iter++;
00087     }
00088   }
00089 
00090   // print input data
00091   if ( L1MuDTTFConfig::Debug(4) ) {
00092     cout << "DT Muon Sorter input: "
00093          << mycands.size() << endl;
00094     vector<L1MuDTTrack*>::const_iterator iter;
00095     for ( iter = mycands.begin(); iter != mycands.end(); iter++ ) {
00096       if (*iter ) (*iter)->print();
00097     }
00098   }
00099  
00100   // run Cancel Out Logic
00101   runCOL(mycands);
00102 
00103   // remove disabled candidates
00104   vector<L1MuDTTrack*>::iterator it = mycands.begin();
00105   while ( it != mycands.end() ) {
00106     if ( *it && (*it)->empty() ) {
00107       mycands.erase(it);
00108       it = mycands.begin(); continue;
00109     }
00110     it++;
00111   } 
00112 
00113   // sort pt and quality
00114   stable_sort( mycands.begin(), mycands.end(), L1MuDTTrack::Rank() );
00115 
00116   // copy the best 4 candidates
00117   int number_of_tracks = 0;
00118   vector<L1MuDTTrack*>::const_iterator iter1 = mycands.begin();
00119   while ( iter1 != mycands.end() ) {
00120     if ( *iter1 && number_of_tracks < 4 ) {
00121       m_TrackCands.push_back(*iter1);
00122       number_of_tracks++;
00123     }
00124     iter1++;
00125   }  
00126 
00127 }

void L1MuDTMuonSorter::runCOL ( std::vector< L1MuDTTrack * > &   )  const [private]

run the Cancel Out Logic of the muon sorter

Referenced by run().

const L1MuDTTrack* L1MuDTMuonSorter::track ( int  id  )  const [inline]

return pointer to a muon candidate

Definition at line 70 of file L1MuDTMuonSorter.h.

References m_TrackCands.

00070 { return m_TrackCands[id]; }

const std::vector<const L1MuDTTrack*>& L1MuDTMuonSorter::tracks ( void   )  const [inline]

return vector of muon candidates

Definition at line 73 of file L1MuDTMuonSorter.h.

References m_TrackCands.

Referenced by L1MuDTTrackFinder::run().

00073 { return m_TrackCands; }


Member Data Documentation

const L1MuDTTrackFinder& L1MuDTMuonSorter::m_tf [private]

Definition at line 85 of file L1MuDTMuonSorter.h.

Referenced by run().

std::vector<const L1MuDTTrack*> L1MuDTMuonSorter::m_TrackCands [private]

Definition at line 86 of file L1MuDTMuonSorter.h.

Referenced by L1MuDTMuonSorter(), numberOfTracks(), print(), reset(), run(), track(), and tracks().


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