CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
L1MuBMEUX Class Reference

#include <L1MuBMEUX.h>

Inheritance diagram for L1MuBMEUX:
L1AbstractProcessor

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) More...
 
int id () const
 return Extrapolation identifier More...
 
 L1MuBMEUX (const L1MuBMSectorProcessor &sp, const L1MuBMSEU &seu, int id)
 constructor More...
 
void load (const L1MuBMTrackSegPhi *start_ts, const L1MuBMTrackSegPhi *target_ts)
 load data into EUX More...
 
bool operator== (const L1MuBMEUX &) const
 equal operator More...
 
unsigned int quality () const
 return extrapolation quality More...
 
virtual void reset ()
 reset Extrapolator More...
 
bool result () const
 return extrapolation result More...
 
virtual void run (const edm::EventSetup &c)
 run Extrapolator More...
 
std::pair< const
L1MuBMTrackSegPhi *, const
L1MuBMTrackSegPhi * > 
ts () const
 return pointer to start and target track segment More...
 
virtual ~L1MuBMEUX ()
 destructor More...
 
- Public Member Functions inherited from L1AbstractProcessor
virtual void run ()
 run processor logic More...
 
virtual void run ()
 run processor logic More...
 
virtual ~L1AbstractProcessor ()
 destructor More...
 
virtual ~L1AbstractProcessor ()
 destructor More...
 

Private Member Functions

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

Private Attributes

unsigned short int m_address
 
int m_id
 
unsigned short int m_quality
 
bool m_result
 
const L1MuBMSEUm_seu
 
const L1MuBMSectorProcessorm_sp
 
const L1MuBMTrackSegPhim_start
 
const L1MuBMTrackSegPhim_target
 
unsigned short const nbit_phi = 12
 
unsigned short const nbit_phib = 10
 
edm::ESHandle< L1MuDTTFParameterspars
 
int const theExtFilter = 1
 
edm::ESHandle< L1MuDTExtLuttheExtLUTs
 

Detailed Description

Extrapolator:

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

N. Neumeister CERN EP

Definition at line 48 of file L1MuBMEUX.h.

Constructor & Destructor Documentation

L1MuBMEUX::L1MuBMEUX ( const L1MuBMSectorProcessor sp,
const L1MuBMSEU seu,
int  id 
)

constructor

Definition at line 50 of file L1MuBMEUX.cc.

50  :
51  m_sp(sp), m_seu(seu), m_id(id),
52  m_result(false), m_quality(0), m_address(15),
53  m_start(0), m_target(0),
57 {
58 }
const L1MuBMSEU & m_seu
Definition: L1MuBMEUX.h:107
static int getNbitsExtPhi()
static int getNbitsExtPhib()
static int getExtTSFilter()
int m_id
Definition: L1MuBMEUX.h:108
unsigned short int m_address
Definition: L1MuBMEUX.h:112
const L1MuBMTrackSegPhi * m_target
Definition: L1MuBMEUX.h:115
const L1MuBMTrackSegPhi * m_start
Definition: L1MuBMEUX.h:114
const L1MuBMSectorProcessor & m_sp
Definition: L1MuBMEUX.h:106
int const theExtFilter
Definition: L1MuBMEUX.h:118
bool m_result
Definition: L1MuBMEUX.h:110
unsigned short const nbit_phi
Definition: L1MuBMEUX.h:119
unsigned short const nbit_phib
Definition: L1MuBMEUX.h:120
unsigned short int m_quality
Definition: L1MuBMEUX.h:111
L1MuBMEUX::~L1MuBMEUX ( )
virtual

destructor

Definition at line 65 of file L1MuBMEUX.cc.

65 {}

Member Function Documentation

unsigned short int L1MuBMEUX::address ( ) const
inline

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

Definition at line 97 of file L1MuBMEUX.h.

References m_address.

Referenced by operator==().

97 { return m_address; }
unsigned short int m_address
Definition: L1MuBMEUX.h:112
int L1MuBMEUX::id ( void  ) const
inline

return Extrapolation identifier

Definition at line 88 of file L1MuBMEUX.h.

References m_id.

Referenced by operator==().

88 { return m_id; }
int m_id
Definition: L1MuBMEUX.h:108
void L1MuBMEUX::load ( const L1MuBMTrackSegPhi start_ts,
const L1MuBMTrackSegPhi target_ts 
)

load data into EUX

Definition at line 191 of file L1MuBMEUX.cc.

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

192  {
193 
194  m_start = start_ts;
195  m_target = target_ts;
196 
197  // in case of EX34 and EX21 exchange start and target
198  if ( ( m_seu.ext() == EX34 ) || ( m_seu.ext() == EX21 ) ) {
199  m_start = target_ts;
200  m_target = start_ts;
201  }
202 
203 }
Extrapolation ext() const
return extrapolation type
Definition: L1MuBMSEU.h:80
const L1MuBMSEU & m_seu
Definition: L1MuBMEUX.h:107
const L1MuBMTrackSegPhi * m_target
Definition: L1MuBMEUX.h:115
const L1MuBMTrackSegPhi * m_start
Definition: L1MuBMEUX.h:114
bool L1MuBMEUX::operator== ( const L1MuBMEUX eux) const

equal operator

Definition at line 75 of file L1MuBMEUX.cc.

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

75  {
76 
77  if ( m_id != eux.id() ) return false;
78  if ( m_result != eux.result() ) return false;
79  if ( m_quality != eux.quality() ) return false;
80  if ( m_address != eux.address() ) return false;
81  return true;
82 
83 }
int m_id
Definition: L1MuBMEUX.h:108
unsigned short int m_address
Definition: L1MuBMEUX.h:112
int id() const
return Extrapolation identifier
Definition: L1MuBMEUX.h:88
bool result() const
return extrapolation result
Definition: L1MuBMEUX.h:91
bool m_result
Definition: L1MuBMEUX.h:110
unsigned int quality() const
return extrapolation quality
Definition: L1MuBMEUX.h:94
unsigned short int address() const
return extrapolation address (0-11) (address = 15 indicates negative ext. result) ...
Definition: L1MuBMEUX.h:97
unsigned short int m_quality
Definition: L1MuBMEUX.h:111
unsigned int L1MuBMEUX::quality ( void  ) const
inline

return extrapolation quality

Definition at line 94 of file L1MuBMEUX.h.

References m_quality.

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

94 { return m_quality; }
unsigned short int m_quality
Definition: L1MuBMEUX.h:111
void L1MuBMEUX::reset ( void  )
virtual

reset Extrapolator

Implements L1AbstractProcessor.

Definition at line 210 of file L1MuBMEUX.cc.

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

210  {
211 
212  m_result = false;
213  m_quality = 0;
214  m_address = 15;
215 
216  m_start = 0;
217  m_target = 0;
218 
219 }
unsigned short int m_address
Definition: L1MuBMEUX.h:112
const L1MuBMTrackSegPhi * m_target
Definition: L1MuBMEUX.h:115
const L1MuBMTrackSegPhi * m_start
Definition: L1MuBMEUX.h:114
bool m_result
Definition: L1MuBMEUX.h:110
unsigned short int m_quality
Definition: L1MuBMEUX.h:111
bool L1MuBMEUX::result ( ) const
inline

return extrapolation result

Definition at line 91 of file L1MuBMEUX.h.

References m_result.

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

91 { return m_result; }
bool m_result
Definition: L1MuBMEUX.h:110
void L1MuBMEUX::run ( const edm::EventSetup c)
virtual

run Extrapolator

Reimplemented from L1AbstractProcessor.

Definition at line 89 of file L1MuBMEUX.cc.

References funct::abs(), gather_cfg::cout, L1MuBMTFConfig::Debug(), mps_update::diff, EX12, EX13, EX14, EX15, EX21, EX23, EX24, EX25, EX34, L1MuBMSEU::ext(), edm::EventSetup::get(), L1MuBMTFConfig::getopenLUTs(), L1MuBMSectorProcessor::id(), m_address, m_id, m_quality, m_result, m_seu, m_sp, m_start, m_target, nbit_phi, nbit_phib, hltrates_dqm_sourceclient-live_cfg::offset, pars, L1MuBMTrackSegPhi::phi(), L1MuBMTrackSegPhi::phib(), L1MuBMTrackSegPhi::quality(), sec_mod(), L1MuBMSecProcId::sector(), L1MuBMTrackSegPhi::sector(), theExtLUTs, L1MuBMSecProcId::wheel(), and L1MuBMTrackSegPhi::wheel().

89  {
90 
91  c.get< L1MuDTExtLutRcd >().get( theExtLUTs );
92  c.get< L1MuDTTFParametersRcd >().get( pars );
93 
94  if ( L1MuBMTFConfig::Debug(4) ) cout << "Run EUX " << m_id << endl;
95  if ( L1MuBMTFConfig::Debug(4) ) cout << "start : " << *m_start << endl;
96  if ( L1MuBMTFConfig::Debug(4) ) cout << "target : " << *m_target << endl;
97 
98  if ( m_start == 0 || m_target == 0 ) {
99  if ( L1MuBMTFConfig::Debug(4) ) cout << "Error: EUX has no data loaded" << endl;
100  return;
101  }
102 
103  // start sector
104  int sector_st = m_start->sector();
105 
106  // target sector
107  int sector_ta = m_target->sector();
108 
109  // get index of look-up table
110  int lut_idx = m_seu.ext();
111  if ( abs(m_target->wheel()) == 3 ) {
112 
113  switch ( m_seu.ext() ) {
114  case EX13 : { lut_idx = EX15; break; }
115  case EX23 : { lut_idx = EX25; break; }
116  default : { lut_idx = m_seu.ext(); break; }
117  }
118 
119  }
120 
121  if ( L1MuBMTFConfig::Debug(5) ) cout << "EUX : using look-up table : "
122  << static_cast<Extrapolation>(lut_idx)
123  << endl;
124 
125  // Extrapolation TS quality filter
126  int qcut = 0;
127  if ( m_seu.ext() == EX12 ) qcut = pars->get_soc_qcut_st1(m_sp.id().wheel(), m_sp.id().sector());
128  if ( m_seu.ext() == EX13 ) qcut = pars->get_soc_qcut_st1(m_sp.id().wheel(), m_sp.id().sector());
129  if ( m_seu.ext() == EX14 ) qcut = pars->get_soc_qcut_st1(m_sp.id().wheel(), m_sp.id().sector());
130  if ( m_seu.ext() == EX21 ) qcut = pars->get_soc_qcut_st2(m_sp.id().wheel(), m_sp.id().sector());
131  if ( m_seu.ext() == EX23 ) qcut = pars->get_soc_qcut_st2(m_sp.id().wheel(), m_sp.id().sector());
132  if ( m_seu.ext() == EX24 ) qcut = pars->get_soc_qcut_st2(m_sp.id().wheel(), m_sp.id().sector());
133  if ( m_seu.ext() == EX34 ) qcut = pars->get_soc_qcut_st4(m_sp.id().wheel(), m_sp.id().sector());
134 
135  if ( m_start->quality() < qcut ) return;
136 
137  // calculate bit shift
138  int sh_phi = 12 - nbit_phi;
139  int sh_phib = 10 - nbit_phib;
140 
141  int phi_target = m_target->phi() >> sh_phi;
142  int phi_start = m_start->phi() >> sh_phi;
143  int phib_start = (m_start->phib() >> sh_phib) << sh_phib;
144  if ( phib_start < 0 ) phib_start += (1 << sh_phib) -1;
145 
146  // compute difference in phi
147  int diff = phi_target - phi_start;
148 
149  // get low and high values from look-up table
150  // and add offset (30 degrees ) for extrapolation to adjacent sector
151  int offset = -2144 >> sh_phi;
152  offset *= sec_mod(sector_ta - sector_st);
153  int low = theExtLUTs->getLow(lut_idx,phib_start );
154  int high = theExtLUTs->getHigh(lut_idx,phib_start );
155  if ( low < 0 ) low += (1 << sh_phi) - 1;
156  if ( high < 0 ) high += (1 << sh_phi) - 1;
157  low = (low >> sh_phi) + offset;
158  high = (high >> sh_phi) + offset;
159 
160  int phi_offset = phi_target - offset;
161  if ( ( lut_idx == EX34 ) || ( lut_idx == EX21 ) )
162  phi_offset = phi_start + offset;
163  if ( phi_offset >= (1 << (nbit_phi-1)) -1 ) return;
164  if ( phi_offset < -(1 << (nbit_phi-1)) +1 ) return;
165 
166  // is phi-difference within the extrapolation window?
167  bool openlut = pars->get_soc_openlut_extr(m_sp.id().wheel(), m_sp.id().sector());
168  if (( diff >= low && diff <= high ) || L1MuBMTFConfig::getopenLUTs() || openlut ) {
169  m_result = true;
170  int qual_st = m_start->quality();
171  int qual_ta = m_target->quality();
172  if ( m_seu.ext() == EX34 || m_seu.ext() == EX21 ) {
173  m_quality = ( qual_st == 7 ) ? 0 : qual_st + 1;
174  }
175  else {
176  m_quality = ( qual_ta == 7 ) ? 0 : qual_ta + 1;
177  }
178  m_address = m_id;
179  }
180 
181  if ( L1MuBMTFConfig::Debug(5) ) cout << "diff : " << low << " "
182  << diff << " " << high << " : "
183  << m_result << " " << endl;
184 
185 }
Extrapolation ext() const
return extrapolation type
Definition: L1MuBMSEU.h:80
const L1MuBMSEU & m_seu
Definition: L1MuBMEUX.h:107
edm::ESHandle< L1MuDTExtLut > theExtLUTs
Definition: L1MuBMEUX.h:117
static bool getopenLUTs()
int wheel() const
return wheel
int m_id
Definition: L1MuBMEUX.h:108
unsigned short int m_address
Definition: L1MuBMEUX.h:112
const L1MuBMTrackSegPhi * m_target
Definition: L1MuBMEUX.h:115
list diff
Definition: mps_update.py:85
int sec_mod(int) const
output sector numbers in the range -6 to +5
Definition: L1MuBMEUX.cc:236
const L1MuBMTrackSegPhi * m_start
Definition: L1MuBMEUX.h:114
int sector() const
return sector number
int phib() const
return phib
const L1MuBMSectorProcessor & m_sp
Definition: L1MuBMEUX.h:106
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Extrapolation
const L1MuBMSecProcId & id() const
return Sector Processor identifier
int phi() const
return phi
const T & get() const
Definition: EventSetup.h:56
bool m_result
Definition: L1MuBMEUX.h:110
static bool Debug()
unsigned short const nbit_phi
Definition: L1MuBMEUX.h:119
unsigned short const nbit_phib
Definition: L1MuBMEUX.h:120
unsigned short int m_quality
Definition: L1MuBMEUX.h:111
tuple cout
Definition: gather_cfg.py:145
edm::ESHandle< L1MuDTTFParameters > pars
Definition: L1MuBMEUX.h:122
int sector() const
return sector
int quality() const
return quality code
int wheel() const
return wheel number
int L1MuBMEUX::sec_mod ( int  sector) const
private

output sector numbers in the range -6 to +5

Definition at line 236 of file L1MuBMEUX.cc.

Referenced by run().

236  {
237 
238  int new_sector = sector%12;
239  if ( new_sector >= 6 )
240  new_sector = new_sector - 12;
241  if ( new_sector < -6 )
242  new_sector = new_sector + 12;
243 
244  return new_sector;
245 
246 }
pair< const L1MuBMTrackSegPhi *,const L1MuBMTrackSegPhi * > L1MuBMEUX::ts ( ) const

return pointer to start and target track segment

Definition at line 225 of file L1MuBMEUX.cc.

References m_start, and m_target.

225  {
226 
227  return pair<const L1MuBMTrackSegPhi*, const L1MuBMTrackSegPhi*>(m_start,m_target);
228 
229 }
const L1MuBMTrackSegPhi * m_target
Definition: L1MuBMEUX.h:115
const L1MuBMTrackSegPhi * m_start
Definition: L1MuBMEUX.h:114

Member Data Documentation

unsigned short int L1MuBMEUX::m_address
private

Definition at line 112 of file L1MuBMEUX.h.

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

int L1MuBMEUX::m_id
private

Definition at line 108 of file L1MuBMEUX.h.

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

unsigned short int L1MuBMEUX::m_quality
private

Definition at line 111 of file L1MuBMEUX.h.

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

bool L1MuBMEUX::m_result
private

Definition at line 110 of file L1MuBMEUX.h.

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

const L1MuBMSEU& L1MuBMEUX::m_seu
private

Definition at line 107 of file L1MuBMEUX.h.

Referenced by load(), and run().

const L1MuBMSectorProcessor& L1MuBMEUX::m_sp
private

Definition at line 106 of file L1MuBMEUX.h.

Referenced by run().

const L1MuBMTrackSegPhi* L1MuBMEUX::m_start
private

Definition at line 114 of file L1MuBMEUX.h.

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

const L1MuBMTrackSegPhi* L1MuBMEUX::m_target
private

Definition at line 115 of file L1MuBMEUX.h.

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

unsigned short const L1MuBMEUX::nbit_phi = 12
private

Definition at line 119 of file L1MuBMEUX.h.

Referenced by run().

unsigned short const L1MuBMEUX::nbit_phib = 10
private

Definition at line 120 of file L1MuBMEUX.h.

Referenced by run().

edm::ESHandle< L1MuDTTFParameters > L1MuBMEUX::pars
private

Definition at line 122 of file L1MuBMEUX.h.

Referenced by run().

int const L1MuBMEUX::theExtFilter = 1
private

Definition at line 118 of file L1MuBMEUX.h.

edm::ESHandle< L1MuDTExtLut > L1MuBMEUX::theExtLUTs
private

Definition at line 117 of file L1MuBMEUX.h.

Referenced by run().