CMS 3D CMS Logo

L1MuDTExtrapolationUnit Class Reference

Extrapolation Unit:. More...

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

Inheritance diagram for L1MuDTExtrapolationUnit:

L1AbstractProcessor

List of all members.

Public Types

typedef std::pair
< Extrapolation, unsigned int
SEUId
typedef std::map< SEUId,
L1MuDTSEU *, std::less< SEUId > > 
SEUmap

Public Member Functions

unsigned short int getAddress (Extrapolation ext, unsigned int startAdr, int id) const
 get extrapolation address from a given ERS
const std::bitset< 12 > & getEXTable (Extrapolation ext, unsigned int startAdr) const
 get Extrapolator table for a given SEU
const std::bitset< 12 > & getQSTable (Extrapolation ext, unsigned int startAdr) const
 get Quality Sorter table for a given SEU
unsigned short int getQuality (Extrapolation ext, unsigned int startAdr, int id) const
 get extrapolation quality from a given ERS
 L1MuDTExtrapolationUnit (const L1MuDTSectorProcessor &)
 constructor
int numberOfExt () const
 return number of successful extrapolations
void print (int level=0) const
 print all successful extrapolations
void reset (Extrapolation ext, unsigned int startAdr, unsigned int relAdr)
 reset a single extrapolation
virtual void reset ()
 reset Extrapolation Unit
virtual void run (const edm::EventSetup &c)
 run Extrapolation Unit
virtual ~L1MuDTExtrapolationUnit ()
 destructor

Static Public Member Functions

static std::pair< int, intwhich_ext (Extrapolation ext)
 return station of start and target track segment for a given extrapolation

Private Attributes

SEUmap m_SEUs
const L1MuDTSectorProcessorm_sp


Detailed Description

Extrapolation Unit:.

The Extrapolation Unit attempts to join track segment pairs of different stations. it contains 12 Single Extrapolation Units to perform all extrapolations in its own wheel and 6 Single Extrapolation Units to perform all extrapolations in the adjacent wheel (next wheel neighbour)

Date
2008/02/18 17:38:04
Revision
1.4

N. Neumeister CERN EP

Definition at line 52 of file L1MuDTExtrapolationUnit.h.


Member Typedef Documentation

typedef std::pair<Extrapolation, unsigned int> L1MuDTExtrapolationUnit::SEUId

Definition at line 56 of file L1MuDTExtrapolationUnit.h.

typedef std::map<SEUId, L1MuDTSEU*, std::less<SEUId> > L1MuDTExtrapolationUnit::SEUmap

Definition at line 57 of file L1MuDTExtrapolationUnit.h.


Constructor & Destructor Documentation

L1MuDTExtrapolationUnit::L1MuDTExtrapolationUnit ( const L1MuDTSectorProcessor sp  ) 

constructor

Definition at line 54 of file L1MuDTExtrapolationUnit.cc.

References GenMuonPlsPt100GeV_cfg::cout, L1MuDTTFConfig::Debug(), lat::endl(), EX12, EX13, EX14, EX21, EX23, EX24, EX34, m_SEUs, and MAX_EXT.

00054                                                                                 :
00055                     m_sp(sp), m_SEUs() {
00056 
00057   for ( int ext_idx = 0; ext_idx < MAX_EXT; ext_idx++ ) {
00058   
00059     Extrapolation ext = static_cast<Extrapolation>(ext_idx);   
00060 
00061     if ( ext == EX12 || ext == EX13 || ext == EX14 ||
00062          ext == EX21 || ext == EX23 || ext == EX24 || ext == EX34 ) {
00063          
00064       unsigned int maxaddr = 4;   
00065       
00066       if ( ext == EX12 || ext == EX13 || ext == EX14 ) maxaddr = 2;
00067 
00068       for ( unsigned int startAddress = 0; startAddress < maxaddr; startAddress++ ) {
00069         SEUId id = make_pair(ext, startAddress);
00070         m_SEUs[id] = new L1MuDTSEU(sp,ext,startAddress);
00071         if ( L1MuDTTFConfig::Debug(6) ) cout << "  creating SEU " << ext << " " << startAddress << endl;
00072       }  
00073     }
00074   }
00075 
00076 }

L1MuDTExtrapolationUnit::~L1MuDTExtrapolationUnit (  )  [virtual]

destructor

Definition at line 83 of file L1MuDTExtrapolationUnit.cc.

References iter, and m_SEUs.

00083                                                   {
00084 
00085   for ( SEUmap::iterator iter = m_SEUs.begin(); iter != m_SEUs.end(); iter++ ) {
00086     delete (*iter).second;
00087     (*iter).second = 0;
00088   }
00089   m_SEUs.clear();
00090 
00091 }


Member Function Documentation

unsigned short int L1MuDTExtrapolationUnit::getAddress ( Extrapolation  ext,
unsigned int  startAdr,
int  id 
) const

get extrapolation address from a given ERS

Definition at line 185 of file L1MuDTExtrapolationUnit.cc.

References iter, and m_SEUs.

00185                                                                                                              {
00186 
00187   // get extrapolation address from ERS 
00188   // startAdr = 0, 1  : own wheel
00189   // startAdr = 2, 3  : next wheel neighbour
00190 
00191   assert( startAdr >= 0 && startAdr <= 3 );
00192   assert( id == 0 || id == 1 );
00193   
00194   unsigned short int address = 15;
00195   
00196   SEUId seuid = make_pair(ext, startAdr);
00197   SEUmap::const_iterator iter = m_SEUs.find(seuid);
00198   if ( iter != m_SEUs.end() ) address = ((*iter).second)->ers()->address(id);
00199 
00200   return address;
00201 
00202 }

const bitset< 12 > & L1MuDTExtrapolationUnit::getEXTable ( Extrapolation  ext,
unsigned int  startAdr 
) const

get Extrapolator table for a given SEU

Definition at line 231 of file L1MuDTExtrapolationUnit.cc.

References m_SEUs.

Referenced by run().

00231                                                                                                     {
00232 
00233   // startAdr = 0, 1  : own wheel
00234   // startAdr = 2, 3  : next wheel neighbour
00235 
00236   assert( startAdr >= 0 && startAdr <= 3 );
00237   
00238   SEUId seuid = make_pair(ext, startAdr);
00239   return m_SEUs[seuid]->exTable();
00240 
00241 }

const bitset< 12 > & L1MuDTExtrapolationUnit::getQSTable ( Extrapolation  ext,
unsigned int  startAdr 
) const

get Quality Sorter table for a given SEU

Definition at line 247 of file L1MuDTExtrapolationUnit.cc.

References m_SEUs.

Referenced by L1MuDTTrackAssembler::run().

00247                                                                                                     {
00248 
00249   // startAdr = 0, 1  : own wheel
00250   // startAdr = 2, 3  : next wheel neighbour
00251 
00252   assert( startAdr >= 0 && startAdr <= 3 );
00253   
00254   SEUId seuid = make_pair(ext, startAdr);
00255   return m_SEUs[seuid]->qsTable();
00256 
00257 }

unsigned short int L1MuDTExtrapolationUnit::getQuality ( Extrapolation  ext,
unsigned int  startAdr,
int  id 
) const

get extrapolation quality from a given ERS

Definition at line 208 of file L1MuDTExtrapolationUnit.cc.

References iter, and m_SEUs.

00208                                                                                                              {
00209 
00210   // get extrapolation quality from ERS 
00211   // startAdr = 0, 1  : own wheel
00212   // startAdr = 2, 3  : next wheel neighbour
00213 
00214   assert( startAdr >= 0 && startAdr <= 3 );
00215   assert( id == 0 || id == 1 );
00216   
00217   unsigned short int quality = 0;
00218 
00219   SEUId seuid = make_pair(ext, startAdr);
00220   SEUmap::const_iterator iter = m_SEUs.find(seuid);
00221   if ( iter != m_SEUs.end() ) quality = ((*iter).second)->ers()->quality(id);
00222 
00223   return quality;
00224   
00225 }

int L1MuDTExtrapolationUnit::numberOfExt (  )  const

return number of successful extrapolations

Definition at line 263 of file L1MuDTExtrapolationUnit.cc.

References iter, and m_SEUs.

Referenced by L1MuDTSectorProcessor::run().

00263                                                {
00264 
00265   int number = 0;
00266   SEUmap::const_iterator iter;
00267   for ( iter = m_SEUs.begin(); iter != m_SEUs.end(); iter++ ) {
00268     number += ((*iter).second)->numberOfExt();
00269   }
00270  
00271   return number;
00272 
00273 }

void L1MuDTExtrapolationUnit::print ( int  level = 0  )  const

print all successful extrapolations

Definition at line 279 of file L1MuDTExtrapolationUnit.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), L1MuDTSectorProcessor::id(), m_SEUs, and m_sp.

Referenced by L1MuDTSectorProcessor::run().

00279                                                    {
00280 
00281   SEUmap::const_iterator iter_seu;
00282 
00283   if ( level == 0 ) {
00284     for ( iter_seu = m_SEUs.begin(); iter_seu != m_SEUs.end(); iter_seu++ ) {
00285       vector<L1MuDTEUX*> vec_eux = ((*iter_seu).second)->eux();
00286       vector<L1MuDTEUX*>::const_iterator iter_eux;
00287       for ( iter_eux  = vec_eux.begin(); 
00288             iter_eux != vec_eux.end(); iter_eux++ ) {
00289         if ( (*iter_eux)->result() ) {
00290           cout << ((*iter_seu).second)->ext() << " "
00291                << ((*iter_seu).second)->tsId() << " " 
00292                << (*iter_eux)->id() << endl; 
00293           cout << "start  : " << *(*iter_eux)->ts().first << endl;
00294           cout << "target : " << *(*iter_eux)->ts().second << endl;
00295           cout << "result : " << "quality = " << (*iter_eux)->quality() << '\t' 
00296                               << "address = " << (*iter_eux)->address() << endl;
00297         }
00298       }
00299     }
00300   }
00301 
00302   //
00303   // print all results from Extrapolator and Quality Sorter
00304   //
00305   if ( level == 1 ) {
00306     cout << "Results from Extrapolator and Quality Sorter of " << m_sp.id()
00307          << " : \n" << endl;
00308 
00309     cout << "             EXT            QSU      " << endl;
00310     cout << "  S E U   11            11           " << endl;
00311     cout << "          109876543210  109876543210 " << endl;
00312     cout << "-------------------------------------" << endl;     
00313     for ( iter_seu = m_SEUs.begin(); iter_seu != m_SEUs.end(); iter_seu++ ) {
00314 
00315       cout << ((*iter_seu).second)->ext() << "_ "
00316            << ((*iter_seu).second)->tsId() << ": "
00317            << ((*iter_seu).second)->exTable() << "  "
00318            << ((*iter_seu).second)->qsTable() << endl; 
00319 
00320     }
00321   
00322     cout << endl;
00323   }
00324 
00325 }

void L1MuDTExtrapolationUnit::reset ( Extrapolation  ext,
unsigned int  startAdr,
unsigned int  relAdr 
)

reset a single extrapolation

Definition at line 170 of file L1MuDTExtrapolationUnit.cc.

References iter, and m_SEUs.

00170                                                                                                  {
00171 
00172   assert( startAdr >= 0 && startAdr <= 3 );
00173   assert( relAdr >= 0 && relAdr <= 12 );
00174 
00175   SEUId seuid = make_pair(ext, startAdr);
00176   SEUmap::const_iterator iter = m_SEUs.find(seuid);
00177   if ( iter != m_SEUs.end() ) ((*iter).second)->reset(relAdr);
00178 
00179 }

void L1MuDTExtrapolationUnit::reset ( void   )  [virtual]

reset Extrapolation Unit

Implements L1AbstractProcessor.

Definition at line 157 of file L1MuDTExtrapolationUnit.cc.

References iter, and m_SEUs.

Referenced by L1MuDTSectorProcessor::reset(), and run().

00157                                     {
00158 
00159   SEUmap::const_iterator iter; 
00160   for ( iter = m_SEUs.begin(); iter != m_SEUs.end(); iter++ ) {
00161     ((*iter).second)->reset();
00162   }
00163 
00164 }

void L1MuDTExtrapolationUnit::run ( const edm::EventSetup c  )  [virtual]

run Extrapolation Unit

Reimplemented from L1AbstractProcessor.

Definition at line 101 of file L1MuDTExtrapolationUnit.cc.

References GenMuonPlsPt100GeV_cfg::cout, L1MuDTSectorProcessor::data(), L1MuDTTFConfig::Debug(), L1MuDTTrackSegPhi::empty(), lat::endl(), EX12, EX21, L1MuDTSEU::ext(), getEXTable(), L1MuDTDataBuffer::getTSphi(), L1MuDTTFConfig::getUseEX21(), iter, m_SEUs, m_sp, reset(), L1AbstractProcessor::run(), L1MuDTSEU::tsId(), and which_ext().

Referenced by L1MuDTSectorProcessor::run().

00101                                                         {
00102 
00103   SEUmap::const_iterator iter;
00104   for ( iter = m_SEUs.begin(); iter != m_SEUs.end(); iter++ ) {
00105 
00106     pair<int,int> ext_pair = which_ext(((*iter).second)->ext());
00107     int start = ext_pair.first;
00108 
00109     const L1MuDTTrackSegPhi* ts = 0;
00110 
00111     //get start track segment
00112     ts = m_sp.data()->getTSphi(start, ((*iter).second)->tsId() );
00113 
00114     if ( ts != 0 && !ts->empty() ) {
00115       ((*iter).second)->load(ts);
00116       ((*iter).second)->run(c);
00117     }
00118 
00119   }
00120 
00121   //
00122   // use EX21 to cross-check EX12
00123   //
00124   if ( L1MuDTTFConfig::getUseEX21() ) {
00125 
00126     // search for EX12 + EX21 single extrapolation units
00127     for ( unsigned int startAdr = 0; startAdr < 2; startAdr++ ) {
00128     
00129       bitset<12> extab12 = this->getEXTable( EX12, startAdr );
00130       bitset<12> extab21 = this->getEXTable( EX21, startAdr );
00131 
00132       for ( int eux = 0; eux < 12; eux++ ) {
00133         if ( extab12.test(eux) && !extab21.test(eux) ) {
00134           reset(EX12,startAdr,eux); 
00135           if ( L1MuDTTFConfig::Debug(6) ) {
00136             SEUId seuid = make_pair(EX12, startAdr);
00137             L1MuDTSEU* SEU12 = m_SEUs[seuid];
00138             cout << "  EX12 - EX21 mismatch : "
00139                  << " EX12 : " << extab12 << " , " 
00140                  << " EX21 : " << extab21 << endl
00141                  << "  Cancel: " << SEU12->ext()
00142                  << " start addr = " << SEU12->tsId()
00143                  << " target addr = " << eux << endl;
00144           }  
00145         }
00146       }
00147 
00148     }
00149   }
00150 
00151 }

pair< int, int > L1MuDTExtrapolationUnit::which_ext ( Extrapolation  ext  )  [static]

return station of start and target track segment for a given extrapolation

Definition at line 333 of file L1MuDTExtrapolationUnit.cc.

References EX12, EX13, EX14, EX15, EX16, EX21, EX23, EX24, EX25, EX26, EX34, EX56, MAX_EXT, source, and target.

Referenced by L1MuDTSEU::run(), and run().

00333                                                                   {
00334 
00335   int source = 0;
00336   int target = 0;
00337 
00338   assert( ext >= 0 && ext < MAX_EXT );
00339 
00340   switch ( ext ) {
00341     case EX12 : { source = 1; target = 2; break; }
00342     case EX13 : { source = 1; target = 3; break; }
00343     case EX14 : { source = 1; target = 4; break; }
00344     case EX21 : { source = 1; target = 2; break; }
00345     case EX23 : { source = 2; target = 3; break; }
00346     case EX24 : { source = 2; target = 4; break; }
00347     case EX34 : { source = 3; target = 4; break; }
00348     case EX15 : { source = 1; target = 3; break; }
00349     case EX16 : { source = 1; target = 4; break; }
00350     case EX25 : { source = 2; target = 3; break; }
00351     case EX26 : { source = 2; target = 4; break; }
00352     case EX56 : { source = 3; target = 4; break; }
00353   }
00354 
00355   return pair<int,int>(source,target);
00356 
00357 }


Member Data Documentation

SEUmap L1MuDTExtrapolationUnit::m_SEUs [mutable, private]

Definition at line 99 of file L1MuDTExtrapolationUnit.h.

Referenced by getAddress(), getEXTable(), getQSTable(), getQuality(), L1MuDTExtrapolationUnit(), numberOfExt(), print(), reset(), run(), and ~L1MuDTExtrapolationUnit().

const L1MuDTSectorProcessor& L1MuDTExtrapolationUnit::m_sp [private]

Definition at line 97 of file L1MuDTExtrapolationUnit.h.

Referenced by print(), and run().


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