CMS 3D CMS Logo

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...
 
void reset () override
 reset Extrapolator More...
 
bool result () const
 return extrapolation result More...
 
void run (const edm::EventSetup &c) override
 run Extrapolator More...
 
std::pair< const L1MuBMTrackSegPhi *, const L1MuBMTrackSegPhi * > ts () const
 return pointer to start and target track segment More...
 
 ~L1MuBMEUX () override
 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

edm::ESHandle< L1TMuonBarrelParamsbmtfParamsHandle
 
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 const short nbit_phi = 12
 
unsigned const short nbit_phib = 10
 
L1MuDTTFParameters pars
 
const int theExtFilter = 1
 
L1MuBMLUTHandlertheExtLUTs
 

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 52 of file L1MuBMEUX.h.

Constructor & Destructor Documentation

◆ L1MuBMEUX()

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

constructor

Definition at line 50 of file L1MuBMEUX.cc.

51  : m_sp(sp),
52  m_seu(seu),
53  m_id(id),
54  m_result(false),
55  m_quality(0),
56  m_address(15),
57  m_start(nullptr),
58  m_target(nullptr),

◆ ~L1MuBMEUX()

L1MuBMEUX::~L1MuBMEUX ( )
override

destructor

Definition at line 67 of file L1MuBMEUX.cc.

67 {}

Member Function Documentation

◆ address()

unsigned short int L1MuBMEUX::address ( ) const
inline

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

Definition at line 103 of file L1MuBMEUX.h.

103 { return m_address; }

References m_address.

Referenced by operator==().

◆ id()

int L1MuBMEUX::id ( void  ) const
inline

return Extrapolation identifier

Definition at line 94 of file L1MuBMEUX.h.

94 { return m_id; }

References m_id.

Referenced by operator==().

◆ load()

void L1MuBMEUX::load ( const L1MuBMTrackSegPhi start_ts,
const L1MuBMTrackSegPhi target_ts 
)

load data into EUX

Definition at line 223 of file L1MuBMEUX.cc.

223  {
224  m_start = start_ts;
225  m_target = target_ts;
226 
227  // in case of EX34 and EX21 exchange start and target
228  if ((m_seu.ext() == EX34) || (m_seu.ext() == EX21)) {
229  m_start = target_ts;
230  m_target = start_ts;
231  }
232 }

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

◆ operator==()

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

equal operator

Definition at line 76 of file L1MuBMEUX.cc.

76  {
77  if (m_id != eux.id())
78  return false;
79  if (m_result != eux.result())
80  return false;
81  if (m_quality != eux.quality())
82  return false;
83  if (m_address != eux.address())
84  return false;
85  return true;
86 }

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

◆ quality()

unsigned int L1MuBMEUX::quality ( void  ) const
inline

return extrapolation quality

Definition at line 100 of file L1MuBMEUX.h.

100 { return m_quality; }

References m_quality.

Referenced by operator==().

◆ reset()

void L1MuBMEUX::reset ( void  )
overridevirtual

reset Extrapolator

Implements L1AbstractProcessor.

Definition at line 238 of file L1MuBMEUX.cc.

238  {
239  m_result = false;
240  m_quality = 0;
241  m_address = 15;
242 
243  m_start = nullptr;
244  m_target = nullptr;
245 }

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

◆ result()

bool L1MuBMEUX::result ( ) const
inline

return extrapolation result

Definition at line 97 of file L1MuBMEUX.h.

97 { return m_result; }

References m_result.

Referenced by operator==().

◆ run()

void L1MuBMEUX::run ( const edm::EventSetup c)
overridevirtual

run Extrapolator

< ext look-up tables

Reimplemented from L1AbstractProcessor.

Definition at line 91 of file L1MuBMEUX.cc.

91  {
92  //c.get< L1MuDTExtLutRcd >().get( theExtLUTs );
93  // c.get< L1MuDTTFParametersRcd >().get( pars );
94 
95  const L1TMuonBarrelParamsRcd& bmtfParamsRcd = c.get<L1TMuonBarrelParamsRcd>();
96  bmtfParamsRcd.get(bmtfParamsHandle);
97  const L1TMuonBarrelParams& bmtfParams = *bmtfParamsHandle.product();
98 
99  pars = bmtfParams.l1mudttfparams;
100  theExtLUTs = new L1MuBMLUTHandler(bmtfParams);
101 
102  if (L1MuBMTFConfig::Debug(4))
103  cout << "Run EUX " << m_id << endl;
104  if (L1MuBMTFConfig::Debug(4))
105  cout << "start : " << *m_start << endl;
106  if (L1MuBMTFConfig::Debug(4))
107  cout << "target : " << *m_target << endl;
108 
109  if (m_start == nullptr || m_target == nullptr) {
110  if (L1MuBMTFConfig::Debug(4))
111  cout << "Error: EUX has no data loaded" << endl;
112  delete theExtLUTs;
113  return;
114  }
115 
116  // start sector
117  int sector_st = m_start->sector();
118 
119  // target sector
120  int sector_ta = m_target->sector();
121 
122  // get index of look-up table
123  int lut_idx = m_seu.ext();
124  if (abs(m_target->wheel()) == 3) {
125  switch (m_seu.ext()) {
126  case EX13: {
127  lut_idx = EX15;
128  break;
129  }
130  case EX23: {
131  lut_idx = EX25;
132  break;
133  }
134  default: {
135  lut_idx = m_seu.ext();
136  break;
137  }
138  }
139  }
140 
141  if (L1MuBMTFConfig::Debug(5))
142  cout << "EUX : using look-up table : " << static_cast<Extrapolation>(lut_idx) << endl;
143 
144  // Extrapolation TS quality filter
145  int qcut = 0;
146  if (m_seu.ext() == EX12)
147  qcut = pars.get_soc_qcut_st1(m_sp.id().wheel(), m_sp.id().sector());
148  if (m_seu.ext() == EX13)
149  qcut = pars.get_soc_qcut_st1(m_sp.id().wheel(), m_sp.id().sector());
150  if (m_seu.ext() == EX14)
151  qcut = pars.get_soc_qcut_st1(m_sp.id().wheel(), m_sp.id().sector());
152  if (m_seu.ext() == EX21)
153  qcut = pars.get_soc_qcut_st2(m_sp.id().wheel(), m_sp.id().sector());
154  if (m_seu.ext() == EX23)
155  qcut = pars.get_soc_qcut_st2(m_sp.id().wheel(), m_sp.id().sector());
156  if (m_seu.ext() == EX24)
157  qcut = pars.get_soc_qcut_st2(m_sp.id().wheel(), m_sp.id().sector());
158  if (m_seu.ext() == EX34)
159  qcut = pars.get_soc_qcut_st4(m_sp.id().wheel(), m_sp.id().sector());
160 
161  if (m_start->quality() < qcut) {
162  delete theExtLUTs;
163  return;
164  }
165  // calculate bit shift
166  int sh_phi = 12 - nbit_phi;
167  int sh_phib = 10 - nbit_phib;
168 
169  int phi_target = m_target->phi() >> sh_phi;
170  int phi_start = m_start->phi() >> sh_phi;
171  int phib_start = (m_start->phib() >> sh_phib) << sh_phib;
172  if (phib_start < 0)
173  phib_start += (1 << sh_phib) - 1;
174 
175  // compute difference in phi
176  int diff = phi_target - phi_start;
177 
178  // get low and high values from look-up table
179  // and add offset (30 degrees ) for extrapolation to adjacent sector
180  int offset = -2144 >> sh_phi;
181  offset *= sec_mod(sector_ta - sector_st);
182  int low = theExtLUTs->getLow(lut_idx, phib_start);
183  int high = theExtLUTs->getHigh(lut_idx, phib_start);
184  if (low < 0)
185  low += (1 << sh_phi) - 1;
186  if (high < 0)
187  high += (1 << sh_phi) - 1;
188  low = (low >> sh_phi) + offset;
189  high = (high >> sh_phi) + offset;
190 
191  int phi_offset = phi_target - offset;
192  if ((lut_idx == EX34) || (lut_idx == EX21))
193  phi_offset = phi_start + offset;
194  if (phi_offset >= (1 << (nbit_phi - 1)) - 1) {
195  delete theExtLUTs;
196  return;
197  }
198  if (phi_offset < -(1 << (nbit_phi - 1)) + 1) {
199  delete theExtLUTs;
200  return;
201  }
202  // is phi-difference within the extrapolation window?
203  bool openlut = pars.get_soc_openlut_extr(m_sp.id().wheel(), m_sp.id().sector());
204  if ((diff >= low && diff <= high) || L1MuBMTFConfig::getopenLUTs() || openlut) {
205  m_result = true;
206  int qual_st = m_start->quality();
207  int qual_ta = m_target->quality();
208  if (m_seu.ext() == EX34 || m_seu.ext() == EX21) {
209  m_quality = (qual_st == 7) ? 0 : qual_st + 1;
210  } else {
211  m_quality = (qual_ta == 7) ? 0 : qual_ta + 1;
212  }
213  m_address = m_id;
214  }
215  delete theExtLUTs;
216  if (L1MuBMTFConfig::Debug(5))
217  cout << "diff : " << low << " " << diff << " " << high << " : " << m_result << " " << endl;
218 }

References funct::abs(), bmtfParamsHandle, c, gather_cfg::cout, L1MuBMTFConfig::Debug(), change_name::diff, EX12, EX13, EX14, EX15, EX21, EX23, EX24, EX25, EX34, L1MuBMSEU::ext(), edm::eventsetup::EventSetupRecordImplementation< T >::get(), L1MuDTTFParameters::get_soc_openlut_extr(), L1MuDTTFParameters::get_soc_qcut_st1(), L1MuDTTFParameters::get_soc_qcut_st2(), L1MuDTTFParameters::get_soc_qcut_st4(), L1MuBMLUTHandler::getHigh(), L1MuBMLUTHandler::getLow(), L1MuBMTFConfig::getopenLUTs(), LaserClient_cfi::high, L1MuBMSectorProcessor::id(), L1TMuonBarrelParams::l1mudttfparams, LaserClient_cfi::low, 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(), edm::ESHandle< T >::product(), L1MuBMTrackSegPhi::quality(), sec_mod(), L1MuBMSecProcId::sector(), L1MuBMTrackSegPhi::sector(), theExtLUTs, L1MuBMSecProcId::wheel(), and L1MuBMTrackSegPhi::wheel().

◆ sec_mod()

int L1MuBMEUX::sec_mod ( int  sector) const
private

output sector numbers in the range -6 to +5

Definition at line 258 of file L1MuBMEUX.cc.

258  {
259  int new_sector = sector % 12;
260  if (new_sector >= 6)
261  new_sector = new_sector - 12;
262  if (new_sector < -6)
263  new_sector = new_sector + 12;
264 
265  return new_sector;
266 }

Referenced by run().

◆ ts()

pair< const L1MuBMTrackSegPhi *, const L1MuBMTrackSegPhi * > L1MuBMEUX::ts ( ) const

return pointer to start and target track segment

Definition at line 250 of file L1MuBMEUX.cc.

250  {
251  return pair<const L1MuBMTrackSegPhi*, const L1MuBMTrackSegPhi*>(m_start, m_target);
252 }

References m_start, and m_target.

Member Data Documentation

◆ bmtfParamsHandle

edm::ESHandle<L1TMuonBarrelParams> L1MuBMEUX::bmtfParamsHandle
private

Definition at line 121 of file L1MuBMEUX.h.

Referenced by run().

◆ m_address

unsigned short int L1MuBMEUX::m_address
private

Definition at line 116 of file L1MuBMEUX.h.

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

◆ m_id

int L1MuBMEUX::m_id
private

Definition at line 112 of file L1MuBMEUX.h.

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

◆ m_quality

unsigned short int L1MuBMEUX::m_quality
private

Definition at line 115 of file L1MuBMEUX.h.

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

◆ m_result

bool L1MuBMEUX::m_result
private

Definition at line 114 of file L1MuBMEUX.h.

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

◆ m_seu

const L1MuBMSEU& L1MuBMEUX::m_seu
private

Definition at line 111 of file L1MuBMEUX.h.

Referenced by load(), and run().

◆ m_sp

const L1MuBMSectorProcessor& L1MuBMEUX::m_sp
private

Definition at line 110 of file L1MuBMEUX.h.

Referenced by run().

◆ m_start

const L1MuBMTrackSegPhi* L1MuBMEUX::m_start
private

Definition at line 118 of file L1MuBMEUX.h.

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

◆ m_target

const L1MuBMTrackSegPhi* L1MuBMEUX::m_target
private

Definition at line 119 of file L1MuBMEUX.h.

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

◆ nbit_phi

unsigned const short L1MuBMEUX::nbit_phi = 12
private

Definition at line 126 of file L1MuBMEUX.h.

Referenced by run().

◆ nbit_phib

unsigned const short L1MuBMEUX::nbit_phib = 10
private

Definition at line 127 of file L1MuBMEUX.h.

Referenced by run().

◆ pars

L1MuDTTFParameters L1MuBMEUX::pars
private

Definition at line 130 of file L1MuBMEUX.h.

Referenced by run().

◆ theExtFilter

const int L1MuBMEUX::theExtFilter = 1
private

Definition at line 125 of file L1MuBMEUX.h.

◆ theExtLUTs

L1MuBMLUTHandler* L1MuBMEUX::theExtLUTs
private

Definition at line 124 of file L1MuBMEUX.h.

Referenced by run().

L1MuBMEUX::m_address
unsigned short int m_address
Definition: L1MuBMEUX.h:116
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
change_name.diff
diff
Definition: change_name.py:13
L1MuBMEUX::pars
L1MuDTTFParameters pars
Definition: L1MuBMEUX.h:130
L1MuBMEUX::sec_mod
int sec_mod(int) const
output sector numbers in the range -6 to +5
Definition: L1MuBMEUX.cc:258
L1MuBMLUTHandler::getHigh
int getHigh(int ext_ind, int address) const
get high_value for a given address
Definition: L1MuBMLUTHandler.cc:261
EX13
Definition: L1MuDTExtParam.h:22
L1MuDTTFParameters::get_soc_openlut_extr
bool get_soc_openlut_extr(int wh, int sc) const
Definition: L1MuDTTFParameters.cc:270
gather_cfg.cout
cout
Definition: gather_cfg.py:144
L1TMuonBarrelParams::l1mudttfparams
L1MuDTTFParameters l1mudttfparams
Definition: L1TMuonBarrelParams.h:65
L1MuBMLUTHandler::getLow
int getLow(int ext_ind, int address) const
get low_value for a given address
Definition: L1MuBMLUTHandler.cc:247
L1MuBMLUTHandler
Definition: L1MuBMLUTHandler.h:26
L1MuBMEUX::m_quality
unsigned short int m_quality
Definition: L1MuBMEUX.h:115
L1MuBMEUX::m_target
const L1MuBMTrackSegPhi * m_target
Definition: L1MuBMEUX.h:119
L1MuBMSecProcId::sector
int sector() const
return sector number
Definition: L1MuBMSecProcId.h:58
L1MuBMSecProcId::wheel
int wheel() const
return wheel number
Definition: L1MuBMSecProcId.h:55
EX34
Definition: L1MuDTExtParam.h:22
L1MuBMEUX::m_sp
const L1MuBMSectorProcessor & m_sp
Definition: L1MuBMEUX.h:110
L1MuBMTFConfig::getNbitsExtPhi
static int getNbitsExtPhi()
Definition: L1MuBMTFConfig.h:68
L1MuBMTrackSegPhi::quality
int quality() const
return quality code
Definition: L1MuBMTrackSegPhi.h:103
EX15
Definition: L1MuDTExtParam.h:22
L1MuBMTFConfig::getExtTSFilter
static int getExtTSFilter()
Definition: L1MuBMTFConfig.h:62
L1MuBMTrackSegPhi::wheel
int wheel() const
return wheel
Definition: L1MuBMTrackSegPhi.h:85
L1MuDTTFParameters::get_soc_qcut_st4
unsigned short int get_soc_qcut_st4(int wh, int sc) const
Definition: L1MuDTTFParameters.cc:210
L1MuBMEUX::result
bool result() const
return extrapolation result
Definition: L1MuBMEUX.h:97
L1MuBMTFConfig::Debug
static bool Debug()
Definition: L1MuBMTFConfig.h:54
EX21
Definition: L1MuDTExtParam.h:22
L1MuBMTFConfig::getopenLUTs
static bool getopenLUTs()
Definition: L1MuBMTFConfig.h:63
L1MuBMEUX::nbit_phib
unsigned const short nbit_phib
Definition: L1MuBMEUX.h:127
L1MuBMEUX::m_id
int m_id
Definition: L1MuBMEUX.h:112
L1MuBMSectorProcessor::id
const L1MuBMSecProcId & id() const
return Sector Processor identifier
Definition: L1MuBMSectorProcessor.h:75
EX23
Definition: L1MuDTExtParam.h:22
EX12
Definition: L1MuDTExtParam.h:22
L1MuBMEUX::m_seu
const L1MuBMSEU & m_seu
Definition: L1MuBMEUX.h:111
L1MuBMEUX::bmtfParamsHandle
edm::ESHandle< L1TMuonBarrelParams > bmtfParamsHandle
Definition: L1MuBMEUX.h:121
EX25
Definition: L1MuDTExtParam.h:22
EX24
Definition: L1MuDTExtParam.h:22
L1MuBMSEU::ext
Extrapolation ext() const
return extrapolation type
Definition: L1MuBMSEU.h:78
L1MuBMEUX::id
int id() const
return Extrapolation identifier
Definition: L1MuBMEUX.h:94
L1MuBMEUX::m_start
const L1MuBMTrackSegPhi * m_start
Definition: L1MuBMEUX.h:118
L1MuBMEUX::address
unsigned short int address() const
return extrapolation address (0-11) (address = 15 indicates negative ext. result)
Definition: L1MuBMEUX.h:103
L1MuBMTrackSegPhi::phib
int phib() const
return phib
Definition: L1MuBMTrackSegPhi.h:100
L1MuDTTFParameters::get_soc_qcut_st2
unsigned short int get_soc_qcut_st2(int wh, int sc) const
Definition: L1MuDTTFParameters.cc:198
L1MuBMEUX::theExtFilter
const int theExtFilter
Definition: L1MuBMEUX.h:125
LaserClient_cfi.high
high
Definition: LaserClient_cfi.py:50
L1MuBMTFConfig::getNbitsExtPhib
static int getNbitsExtPhib()
Definition: L1MuBMTFConfig.h:69
L1MuBMEUX::quality
unsigned int quality() const
return extrapolation quality
Definition: L1MuBMEUX.h:100
L1MuBMEUX::theExtLUTs
L1MuBMLUTHandler * theExtLUTs
Definition: L1MuBMEUX.h:124
edm::eventsetup::EventSetupRecordImplementation::get
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
Definition: EventSetupRecordImplementation.h:74
L1TMuonBarrelParams
Definition: L1TMuonBarrelParams.h:23
EX14
Definition: L1MuDTExtParam.h:22
L1MuBMTrackSegPhi::sector
int sector() const
return sector
Definition: L1MuBMTrackSegPhi.h:88
L1MuBMTrackSegPhi::phi
int phi() const
return phi
Definition: L1MuBMTrackSegPhi.h:97
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
L1MuDTTFParameters::get_soc_qcut_st1
unsigned short int get_soc_qcut_st1(int wh, int sc) const
Definition: L1MuDTTFParameters.cc:186
LaserClient_cfi.low
low
Definition: LaserClient_cfi.py:52
L1MuBMEUX::nbit_phi
unsigned const short nbit_phi
Definition: L1MuBMEUX.h:126
L1TMuonBarrelParamsRcd
Definition: L1TMuonBarrelParamsRcd.h:13
L1MuBMEUX::m_result
bool m_result
Definition: L1MuBMEUX.h:114