CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
L1MuDTEUX Class Reference

#include <L1MuDTEUX.h>

Inheritance diagram for L1MuDTEUX:
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...
 
 L1MuDTEUX (const L1MuDTSectorProcessor &sp, const L1MuDTSEU &seu, int id)
 constructor More...
 
void load (const L1MuDTTrackSegPhi *start_ts, const L1MuDTTrackSegPhi *target_ts)
 load data into EUX More...
 
bool operator== (const L1MuDTEUX &) 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 L1MuDTTrackSegPhi *, const L1MuDTTrackSegPhi * > ts () const
 return pointer to start and target track segment More...
 
 ~L1MuDTEUX () 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

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
 
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 L1MuDTEUX.h.

Constructor & Destructor Documentation

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

constructor

Definition at line 51 of file L1MuDTEUX.cc.

51  :
52  m_sp(sp), m_seu(seu), m_id(id),
53  m_result(false), m_quality(0), m_address(15),
54  m_start(nullptr), m_target(nullptr),
56  nbit_phi(sp.tf().config()->getNbitsExtPhi()),
58 {
59 }
int getExtTSFilter() const
bool m_result
Definition: L1MuDTEUX.h:110
const L1MuDTSEU & m_seu
Definition: L1MuDTEUX.h:107
unsigned short const nbit_phib
Definition: L1MuDTEUX.h:120
unsigned short const nbit_phi
Definition: L1MuDTEUX.h:119
int const theExtFilter
Definition: L1MuDTEUX.h:118
int getNbitsExtPhib() const
static L1MuDTTFConfig * config()
return configuration
const L1MuDTTrackSegPhi * m_target
Definition: L1MuDTEUX.h:115
unsigned short int m_quality
Definition: L1MuDTEUX.h:111
const L1MuDTSectorProcessor & m_sp
Definition: L1MuDTEUX.h:106
const L1MuDTTrackFinder & tf() const
return reference to barrel MTTF
int m_id
Definition: L1MuDTEUX.h:108
const L1MuDTTrackSegPhi * m_start
Definition: L1MuDTEUX.h:114
unsigned short int m_address
Definition: L1MuDTEUX.h:112
int getNbitsExtPhi() const
L1MuDTEUX::~L1MuDTEUX ( )
override

destructor

Definition at line 66 of file L1MuDTEUX.cc.

66 {}

Member Function Documentation

unsigned short int L1MuDTEUX::address ( ) const
inline

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

Definition at line 97 of file L1MuDTEUX.h.

References m_address, and sec_mod().

Referenced by operator==().

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

return Extrapolation identifier

Definition at line 88 of file L1MuDTEUX.h.

References m_id.

Referenced by operator==().

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

load data into EUX

Definition at line 193 of file L1MuDTEUX.cc.

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

194  {
195 
196  m_start = start_ts;
197  m_target = target_ts;
198 
199  // in case of EX34 and EX21 exchange start and target
200  if ( ( m_seu.ext() == EX34 ) || ( m_seu.ext() == EX21 ) ) {
201  m_start = target_ts;
202  m_target = start_ts;
203  }
204 
205 }
Extrapolation ext() const
return extrapolation type
Definition: L1MuDTSEU.h:80
const L1MuDTSEU & m_seu
Definition: L1MuDTEUX.h:107
const L1MuDTTrackSegPhi * m_target
Definition: L1MuDTEUX.h:115
const L1MuDTTrackSegPhi * m_start
Definition: L1MuDTEUX.h:114
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().

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

return extrapolation quality

Definition at line 94 of file L1MuDTEUX.h.

References m_quality.

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

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

reset Extrapolator

Implements L1AbstractProcessor.

Definition at line 212 of file L1MuDTEUX.cc.

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

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

return extrapolation result

Definition at line 91 of file L1MuDTEUX.h.

References m_result.

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

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

run Extrapolator

Reimplemented from L1AbstractProcessor.

Definition at line 90 of file L1MuDTEUX.cc.

References funct::abs(), L1MuDTTrackFinder::config(), gather_cfg::cout, L1MuDTTFConfig::Debug(), diffTreeTool::diff, EX12, EX13, EX14, EX15, EX21, EX23, EX24, EX25, EX34, L1MuDTSEU::ext(), edm::EventSetup::get(), L1MuDTTFParameters::get_soc_openlut_extr(), L1MuDTTFParameters::get_soc_qcut_st1(), L1MuDTTFParameters::get_soc_qcut_st2(), L1MuDTTFParameters::get_soc_qcut_st4(), L1MuDTExtLut::getHigh(), L1MuDTExtLut::getLow(), L1MuDTTFConfig::getopenLUTs(), L1MuDTSectorProcessor::id(), m_address, m_id, m_quality, m_result, m_seu, m_sp, m_start, m_target, nbit_phi, nbit_phib, PFRecoTauDiscriminationByIsolation_cfi::offset, pars, L1MuDTTrackSegPhi::phi(), L1MuDTTrackSegPhi::phib(), L1MuDTTrackSegPhi::quality(), sec_mod(), L1MuDTSecProcId::sector(), L1MuDTTrackSegPhi::sector(), L1MuDTSectorProcessor::tf(), theExtLUTs, L1MuDTSecProcId::wheel(), and L1MuDTTrackSegPhi::wheel().

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

output sector numbers in the range -6 to +5

Definition at line 238 of file L1MuDTEUX.cc.

Referenced by address(), and run().

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

return pointer to start and target track segment

Definition at line 227 of file L1MuDTEUX.cc.

References m_start, and m_target.

227  {
228 
229  return pair<const L1MuDTTrackSegPhi*, const L1MuDTTrackSegPhi*>(m_start,m_target);
230 
231 }
const L1MuDTTrackSegPhi * m_target
Definition: L1MuDTEUX.h:115
const L1MuDTTrackSegPhi * m_start
Definition: L1MuDTEUX.h:114

Member Data Documentation

unsigned short int L1MuDTEUX::m_address
private

Definition at line 112 of file L1MuDTEUX.h.

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

int L1MuDTEUX::m_id
private

Definition at line 108 of file L1MuDTEUX.h.

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

unsigned short int L1MuDTEUX::m_quality
private

Definition at line 111 of file L1MuDTEUX.h.

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

bool L1MuDTEUX::m_result
private

Definition at line 110 of file L1MuDTEUX.h.

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

const L1MuDTSEU& L1MuDTEUX::m_seu
private

Definition at line 107 of file L1MuDTEUX.h.

Referenced by load(), and run().

const L1MuDTSectorProcessor& L1MuDTEUX::m_sp
private

Definition at line 106 of file L1MuDTEUX.h.

Referenced by run().

const L1MuDTTrackSegPhi* L1MuDTEUX::m_start
private

Definition at line 114 of file L1MuDTEUX.h.

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

const L1MuDTTrackSegPhi* L1MuDTEUX::m_target
private

Definition at line 115 of file L1MuDTEUX.h.

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

unsigned short const L1MuDTEUX::nbit_phi = 12
private

Definition at line 119 of file L1MuDTEUX.h.

Referenced by run().

unsigned short const L1MuDTEUX::nbit_phib = 10
private

Definition at line 120 of file L1MuDTEUX.h.

Referenced by run().

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

Definition at line 122 of file L1MuDTEUX.h.

Referenced by run().

int const L1MuDTEUX::theExtFilter = 1
private

Definition at line 118 of file L1MuDTEUX.h.

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

Definition at line 117 of file L1MuDTEUX.h.

Referenced by run().