CMS 3D CMS Logo

L1MuDTEUX Class Reference

Extrapolator:. More...

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

Inheritance diagram for L1MuDTEUX:

L1AbstractProcessor

List of all members.

Public Member Functions

unsigned short int address () const
 return extrapolation address (0-11) (address = 15 indicates negative ext. result)
int id () const
 return Extrapolation identifier
 L1MuDTEUX (const L1MuDTSEU &seu, int id)
 constructor
void load (const L1MuDTTrackSegPhi *start_ts, const L1MuDTTrackSegPhi *target_ts)
 load data into EUX
bool operator== (const L1MuDTEUX &) const
 equal operator
unsigned int quality () const
 return extrapolation quality
virtual void reset ()
 reset Extrapolator
bool result () const
 return extrapolation result
virtual void run (const edm::EventSetup &c)
 run Extrapolator
std::pair< const
L1MuDTTrackSegPhi *, const
L1MuDTTrackSegPhi * > 
ts () const
 return pointer to start and target track segment
virtual ~L1MuDTEUX ()
 destructor

Static Public Member Functions

static void setPrecision ()
 set precision of phi and phib

Private Member Functions

int sec_mod (int) const
 output sector numbers in the range -6 to +5

Private Attributes

unsigned short int m_address
int m_id
unsigned short int m_quality
bool m_result
const L1MuDTSEUm_seu
const L1MuDTTrackSegPhim_start
const L1MuDTTrackSegPhim_target
edm::ESHandle< L1MuDTExtLuttheExtLUTs

Static Private Attributes

static unsigned short nbit_phi = 12
static unsigned short nbit_phib = 10
static int theExtFilter = 1

Classes

class  EUX_Comp
 helper class for finding the best and second best extrapolation More...


Detailed Description

Extrapolator:.

The Extrapolator receives a start and a target track segment and performs the actual extrapolation

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

N. Neumeister CERN EP

Definition at line 48 of file L1MuDTEUX.h.


Constructor & Destructor Documentation

L1MuDTEUX::L1MuDTEUX ( const L1MuDTSEU seu,
int  id 
)

constructor

Definition at line 49 of file L1MuDTEUX.cc.

References setPrecision().

00049                                                  : 
00050     m_seu(seu), m_id(id), 
00051     m_result(false), m_quality(0), m_address(15),
00052     m_start(0), m_target(0) {
00053 
00054   setPrecision();
00055 
00056 }

L1MuDTEUX::~L1MuDTEUX (  )  [virtual]

destructor

Definition at line 63 of file L1MuDTEUX.cc.

00063 {}


Member Function Documentation

unsigned short int L1MuDTEUX::address ( void   )  const [inline]

return extrapolation address (0-11) (address = 15 indicates negative ext. result)

Definition at line 100 of file L1MuDTEUX.h.

References m_address.

Referenced by operator==().

00100 { return m_address; }

int L1MuDTEUX::id ( void   )  const [inline]

return Extrapolation identifier

Definition at line 91 of file L1MuDTEUX.h.

References m_id.

Referenced by operator==().

00091 { return m_id; }

void L1MuDTEUX::load ( const L1MuDTTrackSegPhi start_ts,
const L1MuDTTrackSegPhi target_ts 
)

load data into EUX

Definition at line 183 of file L1MuDTEUX.cc.

References funct::abs(), EX21, EX34, L1MuDTSEU::ext(), m_seu, m_start, m_target, and L1MuDTTrackSegPhi::wheel().

00184                                                          {
00185 
00186   m_start  = start_ts;
00187   m_target = target_ts;
00188 
00189   // in case of EX34 and EX21 exchange start and target
00190   if ( ( m_seu.ext() == EX34 && abs(target_ts->wheel()) != 3 ) || ( m_seu.ext() == EX21 ) ) {
00191     m_start  = target_ts;
00192     m_target = start_ts;
00193   }
00194 
00195 }

bool L1MuDTEUX::operator== ( const L1MuDTEUX eux  )  const

equal operator

Definition at line 73 of file L1MuDTEUX.cc.

References address(), id(), m_address, m_id, m_quality, m_result, quality(), and result().

00073                                                      {
00074 
00075   if ( m_id      != eux.id() )      return false;
00076   if ( m_result  != eux.result() )  return false;
00077   if ( m_quality != eux.quality() ) return false;
00078   if ( m_address != eux.address() ) return false;
00079   return true;
00080 
00081 }

unsigned int L1MuDTEUX::quality ( void   )  const [inline]

return extrapolation quality

Definition at line 97 of file L1MuDTEUX.h.

References m_quality.

Referenced by L1MuDTEUX::EUX_Comp::operator()(), and operator==().

00097 { return m_quality; }

void L1MuDTEUX::reset ( void   )  [virtual]

reset Extrapolator

Implements L1AbstractProcessor.

Definition at line 202 of file L1MuDTEUX.cc.

References m_address, m_quality, m_result, m_start, and m_target.

00202                       {
00203   
00204   m_result  = false;
00205   m_quality = 0;
00206   m_address = 15;
00207 
00208   m_start  = 0;
00209   m_target = 0;
00210 
00211 }

bool L1MuDTEUX::result (  )  const [inline]

return extrapolation result

Definition at line 94 of file L1MuDTEUX.h.

References m_result.

Referenced by L1MuDTEUX::EUX_Comp::operator()(), and operator==().

00094 { return m_result; }

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

run Extrapolator

Reimplemented from L1AbstractProcessor.

Definition at line 87 of file L1MuDTEUX.cc.

References funct::abs(), GenMuonPlsPt100GeV_cfg::cout, L1MuDTTFConfig::Debug(), diff, lat::endl(), EX13, EX14, EX15, EX16, EX21, EX23, EX24, EX25, EX26, EX34, EX56, L1MuDTSEU::ext(), edm::EventSetup::get(), L1MuDTTFConfig::getopenLUTs(), WenuSkim_TriggerBit_cff::high, m_address, m_id, m_quality, m_result, m_seu, m_start, m_target, nbit_phi, nbit_phib, offset, L1MuDTTrackSegPhi::phi(), L1MuDTTrackSegPhi::phib(), L1MuDTTrackSegPhi::quality(), sec_mod(), L1MuDTTrackSegPhi::sector(), theExtFilter, theExtLUTs, and L1MuDTTrackSegPhi::wheel().

00087                                           {
00088 
00089   c.get< L1MuDTExtLutRcd >().get( theExtLUTs );
00090 
00091   if ( L1MuDTTFConfig::Debug(4) ) cout << "Run EUX "  << m_id << endl;
00092   if ( L1MuDTTFConfig::Debug(4) ) cout << "start :  " << *m_start  << endl;
00093   if ( L1MuDTTFConfig::Debug(4) ) cout << "target : " << *m_target << endl;
00094 
00095   if ( m_start == 0 || m_target == 0 ) { 
00096     cout << "Error: EUX has no data loaded" << endl;
00097     return;
00098   }
00099 
00100   // start sector
00101   int sector_st = m_start->sector();
00102 
00103   // target sector
00104   int sector_ta = m_target->sector();
00105 
00106   // get index of look-up table
00107   int lut_idx = m_seu.ext();
00108   if ( abs(m_target->wheel()) == 3 ) {
00109 
00110     switch ( m_seu.ext() ) {
00111       case EX13 : { lut_idx = EX15; break; }
00112       case EX14 : { lut_idx = EX16; break; }
00113       case EX23 : { lut_idx = EX25; break; }
00114       case EX24 : { lut_idx = EX26; break; }
00115       case EX34 : { lut_idx = EX56; break; }
00116       default   : { lut_idx = m_seu.ext(); break; }
00117     }
00118 
00119   }
00120 
00121   if ( L1MuDTTFConfig::Debug(5) ) cout << "EUX : using look-up table : "
00122                                        << static_cast<Extrapolation>(lut_idx)
00123                                        << endl;
00124 
00125   // Extrapolation TS quality filter
00126   switch ( theExtFilter ) {
00127     default : { break; }
00128   }
00129   
00130   // calculate bit shift
00131   int sh_phi  = 12 - nbit_phi;
00132   int sh_phib = 10 - nbit_phib;
00133 
00134   int phi_target = m_target->phi() >> sh_phi;
00135   int phi_start  = m_start->phi()  >> sh_phi;
00136   int phib_start = (m_start->phib() >> sh_phib) << sh_phib;
00137   if ( phib_start < 0 ) phib_start += (1 << sh_phib) -1;
00138 
00139   // compute difference in phi
00140   int diff = phi_target - phi_start;
00141 
00142   // get low and high values from look-up table 
00143   // and add offset (30 degrees ) for extrapolation to adjacent sector 
00144   int offset = -2144 >> sh_phi;
00145   offset  *= sec_mod(sector_ta - sector_st);
00146   int low  = theExtLUTs->getLow(lut_idx,phib_start );
00147   int high = theExtLUTs->getHigh(lut_idx,phib_start );
00148   if ( low  < 0 ) low  += (1 << sh_phi) - 1;
00149   if ( high < 0 ) high += (1 << sh_phi) - 1;
00150   low  = (low  >> sh_phi) + offset;
00151   high = (high >> sh_phi) + offset;
00152 
00153   int phi_offset = phi_target - offset;
00154   if ( ( lut_idx == EX34 ) || ( lut_idx == EX21 ) )
00155     phi_offset = phi_start + offset;
00156   if ( phi_offset >= (1 << (nbit_phi-1)) -1 ) return;
00157   if ( phi_offset < -(1 << (nbit_phi-1)) +1 ) return;
00158 
00159   // is phi-difference within the extrapolation window?
00160   if (( diff >= low && diff <= high ) || L1MuDTTFConfig::getopenLUTs() ) {
00161     m_result = true;
00162     int qual_st = m_start->quality();
00163     int qual_ta = m_target->quality();
00164     if ( m_seu.ext() == EX34 || m_seu.ext() == EX21 ) {
00165       m_quality = ( qual_st == 7 ) ? 0 : qual_st + 1;
00166     } 
00167     else {  
00168       m_quality = ( qual_ta == 7 ) ? 0 : qual_ta + 1;
00169     }
00170     m_address = m_id;
00171   }
00172 
00173   if ( L1MuDTTFConfig::Debug(5) ) cout << "diff : "   << low  << " "
00174                                        << diff << " " << high << " : "
00175                                        << m_result << " " << endl;
00176 
00177 }

int L1MuDTEUX::sec_mod ( int  sector  )  const [private]

output sector numbers in the range -6 to +5

Definition at line 228 of file L1MuDTEUX.cc.

Referenced by run().

00228                                        {
00229 
00230   int new_sector = sector%12;
00231   if ( new_sector >= 6 )
00232     new_sector = new_sector - 12;
00233   if ( new_sector < -6 )
00234     new_sector = new_sector + 12;
00235    
00236   return new_sector;
00237 
00238 }

void L1MuDTEUX::setPrecision (  )  [static]

set precision of phi and phib

Definition at line 245 of file L1MuDTEUX.cc.

References L1MuDTTFConfig::getExtTSFilter(), L1MuDTTFConfig::getNbitsExtPhi(), L1MuDTTFConfig::getNbitsExtPhib(), nbit_phi, nbit_phib, and theExtFilter.

Referenced by L1MuDTEUX().

pair< const L1MuDTTrackSegPhi *,const L1MuDTTrackSegPhi * > L1MuDTEUX::ts (  )  const

return pointer to start and target track segment

Definition at line 217 of file L1MuDTEUX.cc.

References m_start, and m_target.


Member Data Documentation

unsigned short int L1MuDTEUX::m_address [private]

Definition at line 114 of file L1MuDTEUX.h.

Referenced by address(), operator==(), reset(), and run().

int L1MuDTEUX::m_id [private]

Definition at line 110 of file L1MuDTEUX.h.

Referenced by id(), operator==(), and run().

unsigned short int L1MuDTEUX::m_quality [private]

Definition at line 113 of file L1MuDTEUX.h.

Referenced by operator==(), quality(), reset(), and run().

bool L1MuDTEUX::m_result [private]

Definition at line 112 of file L1MuDTEUX.h.

Referenced by operator==(), reset(), result(), and run().

const L1MuDTSEU& L1MuDTEUX::m_seu [private]

Definition at line 109 of file L1MuDTEUX.h.

Referenced by load(), and run().

const L1MuDTTrackSegPhi* L1MuDTEUX::m_start [private]

Definition at line 116 of file L1MuDTEUX.h.

Referenced by load(), reset(), run(), and ts().

const L1MuDTTrackSegPhi* L1MuDTEUX::m_target [private]

Definition at line 117 of file L1MuDTEUX.h.

Referenced by load(), reset(), run(), and ts().

unsigned short int L1MuDTEUX::nbit_phi = 12 [static, private]

Definition at line 121 of file L1MuDTEUX.h.

Referenced by run(), and setPrecision().

unsigned short int L1MuDTEUX::nbit_phib = 10 [static, private]

Definition at line 122 of file L1MuDTEUX.h.

Referenced by run(), and setPrecision().

int L1MuDTEUX::theExtFilter = 1 [static, private]

Definition at line 120 of file L1MuDTEUX.h.

Referenced by run(), and setPrecision().

edm::ESHandle< L1MuDTExtLut > L1MuDTEUX::theExtLUTs [private]

Definition at line 119 of file L1MuDTEUX.h.

Referenced by 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