CMS 3D CMS Logo

Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

L1MuDTEUX Class Reference

#include <L1MuDTEUX.h>

Inheritance diagram for L1MuDTEUX:
L1AbstractProcessor

List of all members.

Classes

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

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 L1MuDTSectorProcessor &sp, 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 L1MuDTSectorProcessorm_sp
const L1MuDTTrackSegPhim_start
const L1MuDTTrackSegPhim_target
edm::ESHandle< L1MuDTTFParameterspars
edm::ESHandle< L1MuDTExtLuttheExtLUTs

Static Private Attributes

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

Detailed Description

Extrapolator:

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

Date:
2008/11/28 10:30:51
Revision:
1.5

N. Neumeister CERN EP

Definition at line 50 of file L1MuDTEUX.h.


Constructor & Destructor Documentation

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

constructor

Definition at line 52 of file L1MuDTEUX.cc.

References setPrecision().

                                                                                  : 
    m_sp(sp), m_seu(seu), m_id(id), 
    m_result(false), m_quality(0), m_address(15),
    m_start(0), m_target(0) {

  setPrecision();

}
L1MuDTEUX::~L1MuDTEUX ( ) [virtual]

destructor

Definition at line 66 of file L1MuDTEUX.cc.

{}

Member Function Documentation

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

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

Definition at line 102 of file L1MuDTEUX.h.

References m_address.

Referenced by operator==().

{ return m_address; }
int L1MuDTEUX::id ( void  ) const [inline]

return Extrapolation identifier

Definition at line 93 of file L1MuDTEUX.h.

References m_id.

Referenced by operator==().

{ return m_id; }
void L1MuDTEUX::load ( const L1MuDTTrackSegPhi start_ts,
const L1MuDTTrackSegPhi target_ts 
)

load data into EUX

Definition at line 192 of file L1MuDTEUX.cc.

References EX21, EX34, L1MuDTSEU::ext(), m_seu, m_start, and m_target.

                                                         {

  m_start  = start_ts;
  m_target = target_ts;

  // in case of EX34 and EX21 exchange start and target
  if ( ( m_seu.ext() == EX34 ) || ( m_seu.ext() == EX21 ) ) {
    m_start  = target_ts;
    m_target = start_ts;
  }

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

equal operator

Definition at line 76 of file L1MuDTEUX.cc.

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

                                                     {

  if ( m_id      != eux.id() )      return false;
  if ( m_result  != eux.result() )  return false;
  if ( m_quality != eux.quality() ) return false;
  if ( m_address != eux.address() ) return false;
  return true;

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

return extrapolation quality

Definition at line 99 of file L1MuDTEUX.h.

References m_quality.

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

{ return m_quality; }
void L1MuDTEUX::reset ( void  ) [virtual]

reset Extrapolator

Implements L1AbstractProcessor.

Definition at line 211 of file L1MuDTEUX.cc.

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

                      {
  
  m_result  = false;
  m_quality = 0;
  m_address = 15;

  m_start  = 0;
  m_target = 0;

}
bool L1MuDTEUX::result ( ) const [inline]

return extrapolation result

Definition at line 96 of file L1MuDTEUX.h.

References m_result.

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

{ return m_result; }
void L1MuDTEUX::run ( const edm::EventSetup c) [virtual]

run Extrapolator

Reimplemented from L1AbstractProcessor.

Definition at line 90 of file L1MuDTEUX.cc.

References abs, gather_cfg::cout, L1MuDTTFConfig::Debug(), diffTreeTool::diff, EX12, EX13, EX14, EX15, EX21, EX23, EX24, EX25, EX34, L1MuDTSEU::ext(), edm::EventSetup::get(), L1MuDTTFConfig::getopenLUTs(), L1MuDTSectorProcessor::id(), m_address, m_id, m_quality, m_result, m_seu, m_sp, m_start, m_target, nbit_phi, nbit_phib, evf::evtn::offset(), pars, L1MuDTTrackSegPhi::phi(), L1MuDTTrackSegPhi::phib(), L1MuDTTrackSegPhi::quality(), sec_mod(), L1MuDTSecProcId::sector(), L1MuDTTrackSegPhi::sector(), theExtLUTs, L1MuDTSecProcId::wheel(), and L1MuDTTrackSegPhi::wheel().

                                          {

  c.get< L1MuDTExtLutRcd >().get( theExtLUTs );
  c.get< L1MuDTTFParametersRcd >().get( pars );

  if ( L1MuDTTFConfig::Debug(4) ) cout << "Run EUX "  << m_id << endl;
  if ( L1MuDTTFConfig::Debug(4) ) cout << "start :  " << *m_start  << endl;
  if ( L1MuDTTFConfig::Debug(4) ) cout << "target : " << *m_target << endl;

  if ( m_start == 0 || m_target == 0 ) { 
    if ( L1MuDTTFConfig::Debug(4) ) cout << "Error: EUX has no data loaded" << endl;
    return;
  }

  // start sector
  int sector_st = m_start->sector();

  // target sector
  int sector_ta = m_target->sector();

  // get index of look-up table
  int lut_idx = m_seu.ext();
  if ( abs(m_target->wheel()) == 3 ) {

    switch ( m_seu.ext() ) {
      case EX13 : { lut_idx = EX15; break; }
      case EX23 : { lut_idx = EX25; break; }
      default   : { lut_idx = m_seu.ext(); break; }
    }

  }

  if ( L1MuDTTFConfig::Debug(5) ) cout << "EUX : using look-up table : "
                                       << static_cast<Extrapolation>(lut_idx)
                                       << endl;

  // Extrapolation TS quality filter
  int qcut = 0;
  if ( m_seu.ext() == EX12 ) qcut = pars->get_soc_qcut_st1(m_sp.id().wheel(), m_sp.id().sector());
  if ( m_seu.ext() == EX13 ) qcut = pars->get_soc_qcut_st1(m_sp.id().wheel(), m_sp.id().sector());
  if ( m_seu.ext() == EX14 ) qcut = pars->get_soc_qcut_st1(m_sp.id().wheel(), m_sp.id().sector());
  if ( m_seu.ext() == EX21 ) qcut = pars->get_soc_qcut_st2(m_sp.id().wheel(), m_sp.id().sector());
  if ( m_seu.ext() == EX23 ) qcut = pars->get_soc_qcut_st2(m_sp.id().wheel(), m_sp.id().sector());
  if ( m_seu.ext() == EX24 ) qcut = pars->get_soc_qcut_st2(m_sp.id().wheel(), m_sp.id().sector());
  if ( m_seu.ext() == EX34 ) qcut = pars->get_soc_qcut_st4(m_sp.id().wheel(), m_sp.id().sector());

  if ( m_start->quality() < qcut ) return;
  
  // calculate bit shift
  int sh_phi  = 12 - nbit_phi;
  int sh_phib = 10 - nbit_phib;

  int phi_target = m_target->phi() >> sh_phi;
  int phi_start  = m_start->phi()  >> sh_phi;
  int phib_start = (m_start->phib() >> sh_phib) << sh_phib;
  if ( phib_start < 0 ) phib_start += (1 << sh_phib) -1;

  // compute difference in phi
  int diff = phi_target - phi_start;

  // get low and high values from look-up table 
  // and add offset (30 degrees ) for extrapolation to adjacent sector 
  int offset = -2144 >> sh_phi;
  offset  *= sec_mod(sector_ta - sector_st);
  int low  = theExtLUTs->getLow(lut_idx,phib_start );
  int high = theExtLUTs->getHigh(lut_idx,phib_start );
  if ( low  < 0 ) low  += (1 << sh_phi) - 1;
  if ( high < 0 ) high += (1 << sh_phi) - 1;
  low  = (low  >> sh_phi) + offset;
  high = (high >> sh_phi) + offset;

  int phi_offset = phi_target - offset;
  if ( ( lut_idx == EX34 ) || ( lut_idx == EX21 ) )
    phi_offset = phi_start + offset;
  if ( phi_offset >= (1 << (nbit_phi-1)) -1 ) return;
  if ( phi_offset < -(1 << (nbit_phi-1)) +1 ) return;

  // is phi-difference within the extrapolation window?
  bool openlut = pars->get_soc_openlut_extr(m_sp.id().wheel(), m_sp.id().sector());
  if (( diff >= low && diff <= high ) || L1MuDTTFConfig::getopenLUTs() || openlut ) {
    m_result = true;
    int qual_st = m_start->quality();
    int qual_ta = m_target->quality();
    if ( m_seu.ext() == EX34 || m_seu.ext() == EX21 ) {
      m_quality = ( qual_st == 7 ) ? 0 : qual_st + 1;
    } 
    else {  
      m_quality = ( qual_ta == 7 ) ? 0 : qual_ta + 1;
    }
    m_address = m_id;
  }

  if ( L1MuDTTFConfig::Debug(5) ) cout << "diff : "   << low  << " "
                                       << diff << " " << high << " : "
                                       << m_result << " " << endl;

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

output sector numbers in the range -6 to +5

Definition at line 237 of file L1MuDTEUX.cc.

Referenced by run().

                                       {

  int new_sector = sector%12;
  if ( new_sector >= 6 )
    new_sector = new_sector - 12;
  if ( new_sector < -6 )
    new_sector = new_sector + 12;
   
  return new_sector;

}
void L1MuDTEUX::setPrecision ( ) [static]
pair< const L1MuDTTrackSegPhi *,const L1MuDTTrackSegPhi * > L1MuDTEUX::ts ( ) const

return pointer to start and target track segment

Definition at line 226 of file L1MuDTEUX.cc.

References m_start, and m_target.


Member Data Documentation

unsigned short int L1MuDTEUX::m_address [private]

Definition at line 117 of file L1MuDTEUX.h.

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

int L1MuDTEUX::m_id [private]

Definition at line 113 of file L1MuDTEUX.h.

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

unsigned short int L1MuDTEUX::m_quality [private]

Definition at line 116 of file L1MuDTEUX.h.

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

bool L1MuDTEUX::m_result [private]

Definition at line 115 of file L1MuDTEUX.h.

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

const L1MuDTSEU& L1MuDTEUX::m_seu [private]

Definition at line 112 of file L1MuDTEUX.h.

Referenced by load(), and run().

Definition at line 111 of file L1MuDTEUX.h.

Referenced by run().

Definition at line 119 of file L1MuDTEUX.h.

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

Definition at line 120 of file L1MuDTEUX.h.

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

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

Definition at line 124 of file L1MuDTEUX.h.

Referenced by run(), and setPrecision().

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

Definition at line 125 of file L1MuDTEUX.h.

Referenced by run(), and setPrecision().

Definition at line 127 of file L1MuDTEUX.h.

Referenced by run().

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

Definition at line 123 of file L1MuDTEUX.h.

Referenced by setPrecision().

Definition at line 122 of file L1MuDTEUX.h.

Referenced by run().