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 short const nbit_phi = 12
 
unsigned short const nbit_phib = 10
 
L1MuDTTFParameters pars
 
int const 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 ( 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(nullptr), m_target(nullptr),
57 {
58 }
const L1MuBMSEU & m_seu
Definition: L1MuBMEUX.h:111
static int getNbitsExtPhi()
static int getNbitsExtPhib()
static int getExtTSFilter()
int m_id
Definition: L1MuBMEUX.h:112
unsigned short int m_address
Definition: L1MuBMEUX.h:116
const L1MuBMTrackSegPhi * m_target
Definition: L1MuBMEUX.h:119
const L1MuBMTrackSegPhi * m_start
Definition: L1MuBMEUX.h:118
const L1MuBMSectorProcessor & m_sp
Definition: L1MuBMEUX.h:110
int const theExtFilter
Definition: L1MuBMEUX.h:125
bool m_result
Definition: L1MuBMEUX.h:114
unsigned short const nbit_phi
Definition: L1MuBMEUX.h:126
unsigned short const nbit_phib
Definition: L1MuBMEUX.h:127
unsigned short int m_quality
Definition: L1MuBMEUX.h:115
L1MuBMEUX::~L1MuBMEUX ( )
override

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

References m_address, and sec_mod().

Referenced by operator==().

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

return Extrapolation identifier

Definition at line 92 of file L1MuBMEUX.h.

References m_id.

Referenced by operator==().

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

load data into EUX

Definition at line 207 of file L1MuBMEUX.cc.

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

208  {
209 
210  m_start = start_ts;
211  m_target = target_ts;
212 
213  // in case of EX34 and EX21 exchange start and target
214  if ( ( m_seu.ext() == EX34 ) || ( m_seu.ext() == EX21 ) ) {
215  m_start = target_ts;
216  m_target = start_ts;
217  }
218 
219 }
Extrapolation ext() const
return extrapolation type
Definition: L1MuBMSEU.h:80
const L1MuBMSEU & m_seu
Definition: L1MuBMEUX.h:111
const L1MuBMTrackSegPhi * m_target
Definition: L1MuBMEUX.h:119
const L1MuBMTrackSegPhi * m_start
Definition: L1MuBMEUX.h:118
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:112
unsigned short int m_address
Definition: L1MuBMEUX.h:116
int id() const
return Extrapolation identifier
Definition: L1MuBMEUX.h:92
bool result() const
return extrapolation result
Definition: L1MuBMEUX.h:95
bool m_result
Definition: L1MuBMEUX.h:114
unsigned int quality() const
return extrapolation quality
Definition: L1MuBMEUX.h:98
unsigned short int address() const
return extrapolation address (0-11) (address = 15 indicates negative ext. result) ...
Definition: L1MuBMEUX.h:101
unsigned short int m_quality
Definition: L1MuBMEUX.h:115
unsigned int L1MuBMEUX::quality ( void  ) const
inline

return extrapolation quality

Definition at line 98 of file L1MuBMEUX.h.

References m_quality.

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

98 { return m_quality; }
unsigned short int m_quality
Definition: L1MuBMEUX.h:115
void L1MuBMEUX::reset ( void  )
overridevirtual

reset Extrapolator

Implements L1AbstractProcessor.

Definition at line 226 of file L1MuBMEUX.cc.

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

226  {
227 
228  m_result = false;
229  m_quality = 0;
230  m_address = 15;
231 
232  m_start = nullptr;
233  m_target = nullptr;
234 
235 }
unsigned short int m_address
Definition: L1MuBMEUX.h:116
const L1MuBMTrackSegPhi * m_target
Definition: L1MuBMEUX.h:119
const L1MuBMTrackSegPhi * m_start
Definition: L1MuBMEUX.h:118
bool m_result
Definition: L1MuBMEUX.h:114
unsigned short int m_quality
Definition: L1MuBMEUX.h:115
bool L1MuBMEUX::result ( ) const
inline

return extrapolation result

Definition at line 95 of file L1MuBMEUX.h.

References m_result.

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

95 { return m_result; }
bool m_result
Definition: L1MuBMEUX.h:114
void L1MuBMEUX::run ( const edm::EventSetup c)
overridevirtual

run Extrapolator

< ext look-up tables

Reimplemented from L1AbstractProcessor.

Definition at line 89 of file L1MuBMEUX.cc.

References funct::abs(), bmtfParamsHandle, gather_cfg::cout, L1MuBMTFConfig::Debug(), diffTreeTool::diff, EX12, EX13, EX14, EX15, EX21, EX23, EX24, EX25, EX34, L1MuBMSEU::ext(), edm::EventSetup::get(), edm::eventsetup::EventSetupRecord::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(), L1MuBMSectorProcessor::id(), L1TMuonBarrelParams::l1mudttfparams, m_address, m_id, m_quality, m_result, m_seu, m_sp, m_start, m_target, nbit_phi, nbit_phib, PFRecoTauDiscriminationByIsolation_cfi::offset, pars, L1MuBMTrackSegPhi::phi(), L1MuBMTrackSegPhi::phib(), edm::ESHandle< T >::product(), 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  const L1TMuonBarrelParamsRcd& bmtfParamsRcd = c.get<L1TMuonBarrelParamsRcd>();
95  bmtfParamsRcd.get(bmtfParamsHandle);
96  const L1TMuonBarrelParams& bmtfParams = *bmtfParamsHandle.product();
97 
98  pars = bmtfParams.l1mudttfparams;
99  theExtLUTs = new L1MuBMLUTHandler(bmtfParams);
100 
101 
102  if ( L1MuBMTFConfig::Debug(4) ) cout << "Run EUX " << m_id << endl;
103  if ( L1MuBMTFConfig::Debug(4) ) cout << "start : " << *m_start << endl;
104  if ( L1MuBMTFConfig::Debug(4) ) cout << "target : " << *m_target << endl;
105 
106  if ( m_start == nullptr || m_target == nullptr ) {
107  if ( L1MuBMTFConfig::Debug(4) ) cout << "Error: EUX has no data loaded" << endl;
108  delete theExtLUTs;
109  return;
110  }
111 
112  // start sector
113  int sector_st = m_start->sector();
114 
115  // target sector
116  int sector_ta = m_target->sector();
117 
118  // get index of look-up table
119  int lut_idx = m_seu.ext();
120  if ( abs(m_target->wheel()) == 3 ) {
121 
122  switch ( m_seu.ext() ) {
123  case EX13 : { lut_idx = EX15; break; }
124  case EX23 : { lut_idx = EX25; break; }
125  default : { lut_idx = m_seu.ext(); break; }
126  }
127 
128  }
129 
130  if ( L1MuBMTFConfig::Debug(5) ) cout << "EUX : using look-up table : "
131  << static_cast<Extrapolation>(lut_idx)
132  << endl;
133 
134  // Extrapolation TS quality filter
135  int qcut = 0;
136  if ( m_seu.ext() == EX12 ) qcut = pars.get_soc_qcut_st1(m_sp.id().wheel(), m_sp.id().sector());
137  if ( m_seu.ext() == EX13 ) qcut = pars.get_soc_qcut_st1(m_sp.id().wheel(), m_sp.id().sector());
138  if ( m_seu.ext() == EX14 ) qcut = pars.get_soc_qcut_st1(m_sp.id().wheel(), m_sp.id().sector());
139  if ( m_seu.ext() == EX21 ) qcut = pars.get_soc_qcut_st2(m_sp.id().wheel(), m_sp.id().sector());
140  if ( m_seu.ext() == EX23 ) qcut = pars.get_soc_qcut_st2(m_sp.id().wheel(), m_sp.id().sector());
141  if ( m_seu.ext() == EX24 ) qcut = pars.get_soc_qcut_st2(m_sp.id().wheel(), m_sp.id().sector());
142  if ( m_seu.ext() == EX34 ) qcut = pars.get_soc_qcut_st4(m_sp.id().wheel(), m_sp.id().sector());
143 
144  if ( m_start->quality() < qcut ) {
145  delete theExtLUTs;
146  return;
147  }
148  // calculate bit shift
149  int sh_phi = 12 - nbit_phi;
150  int sh_phib = 10 - nbit_phib;
151 
152  int phi_target = m_target->phi() >> sh_phi;
153  int phi_start = m_start->phi() >> sh_phi;
154  int phib_start = (m_start->phib() >> sh_phib) << sh_phib;
155  if ( phib_start < 0 ) phib_start += (1 << sh_phib) -1;
156 
157  // compute difference in phi
158  int diff = phi_target - phi_start;
159 
160  // get low and high values from look-up table
161  // and add offset (30 degrees ) for extrapolation to adjacent sector
162  int offset = -2144 >> sh_phi;
163  offset *= sec_mod(sector_ta - sector_st);
164  int low = theExtLUTs->getLow(lut_idx,phib_start );
165  int high = theExtLUTs->getHigh(lut_idx,phib_start );
166  if ( low < 0 ) low += (1 << sh_phi) - 1;
167  if ( high < 0 ) high += (1 << sh_phi) - 1;
168  low = (low >> sh_phi) + offset;
169  high = (high >> sh_phi) + offset;
170 
171  int phi_offset = phi_target - offset;
172  if ( ( lut_idx == EX34 ) || ( lut_idx == EX21 ) )
173  phi_offset = phi_start + offset;
174  if ( phi_offset >= (1 << (nbit_phi-1)) -1 ) {
175  delete theExtLUTs;
176  return;
177  }
178  if ( phi_offset < -(1 << (nbit_phi-1)) +1 ) {
179  delete theExtLUTs;
180  return;
181  }
182  // is phi-difference within the extrapolation window?
183  bool openlut = pars.get_soc_openlut_extr(m_sp.id().wheel(), m_sp.id().sector());
184  if (( diff >= low && diff <= high ) || L1MuBMTFConfig::getopenLUTs() || openlut ) {
185  m_result = true;
186  int qual_st = m_start->quality();
187  int qual_ta = m_target->quality();
188  if ( m_seu.ext() == EX34 || m_seu.ext() == EX21 ) {
189  m_quality = ( qual_st == 7 ) ? 0 : qual_st + 1;
190  }
191  else {
192  m_quality = ( qual_ta == 7 ) ? 0 : qual_ta + 1;
193  }
194  m_address = m_id;
195  }
196  delete theExtLUTs;
197  if ( L1MuBMTFConfig::Debug(5) ) cout << "diff : " << low << " "
198  << diff << " " << high << " : "
199  << m_result << " " << endl;
200 
201 }
Extrapolation ext() const
return extrapolation type
Definition: L1MuBMSEU.h:80
const L1MuBMSEU & m_seu
Definition: L1MuBMEUX.h:111
L1MuBMLUTHandler * theExtLUTs
Definition: L1MuBMEUX.h:124
L1MuDTTFParameters l1mudttfparams
static bool getopenLUTs()
int wheel() const
return wheel
int m_id
Definition: L1MuBMEUX.h:112
unsigned short int m_address
Definition: L1MuBMEUX.h:116
int getLow(int ext_ind, int address) const
get low_value for a given address
const L1MuBMTrackSegPhi * m_target
Definition: L1MuBMEUX.h:119
L1MuDTTFParameters pars
Definition: L1MuBMEUX.h:130
int getHigh(int ext_ind, int address) const
get high_value for a given address
int sec_mod(int) const
output sector numbers in the range -6 to +5
Definition: L1MuBMEUX.cc:252
const L1MuBMTrackSegPhi * m_start
Definition: L1MuBMEUX.h:118
unsigned short int get_soc_qcut_st1(int wh, int sc) const
int sector() const
return sector number
int phib() const
return phib
edm::ESHandle< L1TMuonBarrelParams > bmtfParamsHandle
Definition: L1MuBMEUX.h:121
const L1MuBMSectorProcessor & m_sp
Definition: L1MuBMEUX.h:110
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
unsigned short int get_soc_qcut_st2(int wh, int sc) const
bool get_soc_openlut_extr(int wh, int sc) const
bool m_result
Definition: L1MuBMEUX.h:114
static bool Debug()
unsigned short const nbit_phi
Definition: L1MuBMEUX.h:126
T get() const
Definition: EventSetup.h:68
unsigned short const nbit_phib
Definition: L1MuBMEUX.h:127
unsigned short int m_quality
Definition: L1MuBMEUX.h:115
unsigned short int get_soc_qcut_st4(int wh, int sc) const
T const * product() const
Definition: ESHandle.h:84
int sector() const
return sector
bool get(HolderT &iHolder) const
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 252 of file L1MuBMEUX.cc.

Referenced by address(), and run().

252  {
253 
254  int new_sector = sector%12;
255  if ( new_sector >= 6 )
256  new_sector = new_sector - 12;
257  if ( new_sector < -6 )
258  new_sector = new_sector + 12;
259 
260  return new_sector;
261 
262 }
pair< const L1MuBMTrackSegPhi *,const L1MuBMTrackSegPhi * > L1MuBMEUX::ts ( ) const

return pointer to start and target track segment

Definition at line 241 of file L1MuBMEUX.cc.

References m_start, and m_target.

241  {
242 
243  return pair<const L1MuBMTrackSegPhi*, const L1MuBMTrackSegPhi*>(m_start,m_target);
244 
245 }
const L1MuBMTrackSegPhi * m_target
Definition: L1MuBMEUX.h:119
const L1MuBMTrackSegPhi * m_start
Definition: L1MuBMEUX.h:118

Member Data Documentation

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

Definition at line 121 of file L1MuBMEUX.h.

Referenced by run().

unsigned short int L1MuBMEUX::m_address
private

Definition at line 116 of file L1MuBMEUX.h.

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

int L1MuBMEUX::m_id
private

Definition at line 112 of file L1MuBMEUX.h.

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

unsigned short int L1MuBMEUX::m_quality
private

Definition at line 115 of file L1MuBMEUX.h.

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

bool L1MuBMEUX::m_result
private

Definition at line 114 of file L1MuBMEUX.h.

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

const L1MuBMSEU& L1MuBMEUX::m_seu
private

Definition at line 111 of file L1MuBMEUX.h.

Referenced by load(), and run().

const L1MuBMSectorProcessor& L1MuBMEUX::m_sp
private

Definition at line 110 of file L1MuBMEUX.h.

Referenced by run().

const L1MuBMTrackSegPhi* L1MuBMEUX::m_start
private

Definition at line 118 of file L1MuBMEUX.h.

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

const L1MuBMTrackSegPhi* L1MuBMEUX::m_target
private

Definition at line 119 of file L1MuBMEUX.h.

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

unsigned short const L1MuBMEUX::nbit_phi = 12
private

Definition at line 126 of file L1MuBMEUX.h.

Referenced by run().

unsigned short const L1MuBMEUX::nbit_phib = 10
private

Definition at line 127 of file L1MuBMEUX.h.

Referenced by run().

L1MuDTTFParameters L1MuBMEUX::pars
private

Definition at line 130 of file L1MuBMEUX.h.

Referenced by run().

int const L1MuBMEUX::theExtFilter = 1
private

Definition at line 125 of file L1MuBMEUX.h.

L1MuBMLUTHandler* L1MuBMEUX::theExtLUTs
private

Definition at line 124 of file L1MuBMEUX.h.

Referenced by run().