CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
L1MuBMEtaProcessor Class Reference

#include <L1MuBMEtaProcessor.h>

Public Member Functions

int eta (int id) const
 return eta values, index [0,11] More...
 
bool fineBit (int id) const
 return fine bit, index [0,11] More...
 
int id () const
 return Eta Processor identifier (0-11) More...
 
 L1MuBMEtaProcessor (const L1MuBMTrackFinder &, int id, edm::ConsumesCollector &&iC)
 constructor More...
 
void print () const
 print muon candidates found by the Eta Processor More...
 
virtual void reset ()
 reset the Eta Processor More...
 
virtual void run (int bx, const edm::Event &e, const edm::EventSetup &c)
 run the Eta Processor More...
 
const L1MuBMTrackFindertf () const
 return reference to barrel MTTF More...
 
virtual ~L1MuBMEtaProcessor ()
 destructor More...
 

Private Member Functions

void assign ()
 assign eta and etaFineBit More...
 
void receiveAddresses ()
 receive addresses (from 6 Sector Processors) More...
 
void receiveData (int bx, const edm::Event &e, const edm::EventSetup &c)
 receive data (eta trigger primitives) More...
 
void runEtaMatchingUnit (const edm::EventSetup &c)
 run Eta Matching Unit (EMU) More...
 
void runEtaTrackFinder (const edm::EventSetup &c)
 run Eta Track Finder (ETF) More...
 

Static Private Member Functions

static int quality (int id, int stat)
 get quality code; id [0,26], stat [1,3] More...
 

Private Attributes

edm::ESHandle< L1TMuonBarrelParamsbmtfParamsHandle
 
int m_address [12]
 
edm::EDGetTokenT< L1MuDTChambThContainerm_DTDigiToken
 
int m_epid
 
int m_eta [12]
 
bool m_fine [12]
 
std::vector< int > m_foundPattern
 
int m_mask
 
int m_pattern [12]
 
const L1MuBMTrackFinderm_tf
 
L1MuBMTrackm_TrackCand [12]
 
L1MuBMTrackm_TracKCand [12]
 
std::vector< const L1MuBMTrackSegEta * > m_tseta
 
L1MuDTTFMasks msks
 
L1MuBMTEtaPatternLut theEtaPatternLUT
 
L1MuBMTQualPatternLut theQualPatternLUT
 

Detailed Description

Eta Processor:

An Eta Processor consists of :

N. Neumeister CERN EP J. Troconiz UAM Madrid

Definition at line 62 of file L1MuBMEtaProcessor.h.

Constructor & Destructor Documentation

L1MuBMEtaProcessor::L1MuBMEtaProcessor ( const L1MuBMTrackFinder tf,
int  id,
edm::ConsumesCollector &&  iC 
)

constructor

Definition at line 64 of file L1MuBMEtaProcessor.cc.

References m_tseta.

64  :
66  {
67 
68  m_tseta.reserve(15);
69 
70 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const L1MuBMTrackFinder & m_tf
static edm::InputTag getBMThetaDigiInputTag()
std::vector< int > m_foundPattern
edm::EDGetTokenT< L1MuDTChambThContainer > m_DTDigiToken
std::vector< const L1MuBMTrackSegEta * > m_tseta
L1MuBMEtaProcessor::~L1MuBMEtaProcessor ( )
virtual

destructor

Definition at line 77 of file L1MuBMEtaProcessor.cc.

77 {}

Member Function Documentation

void L1MuBMEtaProcessor::assign ( )
private

assign eta and etaFineBit

Definition at line 434 of file L1MuBMEtaProcessor.cc.

References L1MuBMTEtaPatternLut::getPattern(), mps_fire::i, m_eta, m_fine, m_pattern, m_TrackCand, m_TracKCand, m_tseta, AlCaHLTBitMon_ParallelJobs::p, L1MuDTEtaPattern::position(), L1MuBMTrack::setEta(), L1MuBMTrack::setFineEtaBit(), L1MuBMTrack::setTSeta(), theEtaPatternLUT, and L1MuDTEtaPattern::wheel().

Referenced by fineBit(), and run().

434  {
435 
436  for ( int i = 0; i < 12; i++ ) {
437  if ( m_TrackCand[i] ) {
438  if ( m_eta[i] != 99 ) {
439  m_TrackCand[i]->setEta(m_eta[i]);
440  m_TracKCand[i]->setEta(m_eta[i]);
441  }
442  else {
443  // if ( i/2 != 2 ) cerr << "L1MuBMEtaProcessor: assign invalid eta" << " " << m_address[i] << endl;
444  }
445  if ( m_fine[i] ) {
448  // find all contributing track segments
450  vector<const L1MuBMTrackSegEta*> TSeta;
451  const L1MuBMTrackSegEta* ts = nullptr;
452  for ( int stat = 0; stat < 3; stat++ ) {
453  int wh = p.wheel(stat+1);
454  int pos = p.position(stat+1);
455  if ( pos == 0 ) continue;
456  ts = m_tseta[wh+2 + stat*5];
457  TSeta.push_back(ts);
458  }
459  m_TrackCand[i]->setTSeta(TSeta);
460  m_TracKCand[i]->setTSeta(TSeta);
461  }
462  }
463  }
464 
465 }
L1MuBMTrack * m_TrackCand[12]
L1MuBMTrack * m_TracKCand[12]
L1MuDTEtaPattern getPattern(int id) const
get pattern with a given ID
int position(int station) const
return position in station [1,3]
L1MuBMTEtaPatternLut theEtaPatternLUT
void setTSeta(const std::vector< const L1MuBMTrackSegEta * > &tsList)
set eta track segments used to form the muon candidate
Definition: L1MuBMTrack.cc:186
void setFineEtaBit()
set fine eta bit
Definition: L1MuBMTrack.h:153
void setEta(int eta)
set eta-code of muon candidate
Definition: L1MuBMTrack.cc:118
int wheel(int station) const
return wheel number in station [1,3]
std::vector< const L1MuBMTrackSegEta * > m_tseta
int L1MuBMEtaProcessor::eta ( int  id) const
inline

return eta values, index [0,11]

Definition at line 88 of file L1MuBMEtaProcessor.h.

References id(), and m_eta.

Referenced by Particle.Particle::__str__(), Jet.Jet::jetID(), and Jet.Jet::puJetId().

88 { return m_eta[id]; }
int id() const
return Eta Processor identifier (0-11)
bool L1MuBMEtaProcessor::fineBit ( int  id) const
inline

return fine bit, index [0,11]

Definition at line 91 of file L1MuBMEtaProcessor.h.

References assign(), id(), m_fine, quality(), receiveAddresses(), receiveData(), runEtaMatchingUnit(), and runEtaTrackFinder().

91 { return m_fine[id]; }
int id() const
return Eta Processor identifier (0-11)
int L1MuBMEtaProcessor::id ( void  ) const
inline

return Eta Processor identifier (0-11)

Definition at line 73 of file L1MuBMEtaProcessor.h.

References EnergyCorrector::c, MillePedeFileConverter_cfg::e, m_epid, print(), reset(), and run().

Referenced by eta(), fineBit(), and quality().

73 { return m_epid; }
void L1MuBMEtaProcessor::print ( void  ) const

print muon candidates found by the Eta Processor

Definition at line 137 of file L1MuBMEtaProcessor.cc.

References gather_cfg::cout, L1MuDTEtaPattern::eta(), L1MuBMTQualPatternLut::getCoarseEta(), L1MuBMTEtaPatternLut::getPattern(), mps_fire::i, L1MuDTEtaPattern::id(), m_address, m_epid, m_eta, m_fine, m_foundPattern, m_pattern, m_tseta, AlCaHLTBitMon_ParallelJobs::p, position, L1MuDTEtaPattern::quality(), quality(), relativeConstraints::station, theEtaPatternLUT, and theQualPatternLUT.

Referenced by id().

137  {
138 
139  bool empty1 = true;
140  for ( int i = 0; i < 15; i++ ) {
141  empty1 &= ( m_tseta[i] == nullptr || m_tseta[i]->empty() );
142  }
143 
144  bool empty2 = true;
145  for ( int i = 0; i < 12; i++ ) {
146  empty2 &= ( m_address[i] == 0 );
147  }
148 
149  if ( !empty1 || !empty2 ) {
150  cout << "Eta processor " << m_epid << " : " << endl;
151 
152  // print local pattern
153  if ( !empty1 ) {
154  cout << "Local pattern : " << endl;
155  for ( int i = 0; i < 15; i++ ) {
156  if ( (i+5)%5 == 0 ) cout << "station " << m_tseta[i]->station() << " : ";
157  bitset<7> pos(m_tseta[i]->position());
158  bitset<7> qua(m_tseta[i]->quality());
159  for ( int j = 6; j >= 0; j-- ) {
160  cout << pos[j]+qua[j];
161  }
162  cout << " ";
163  if ( (i+1)%5 == 0 ) cout << endl;
164  }
165  cout << "Found patterns :" << endl;
166  vector<int>::const_iterator iter;
167  for ( iter = m_foundPattern.begin(); iter != m_foundPattern.end(); iter++ ) {
169  int qualitycode = p.quality();
170  cout << "ID = " << setw(4) << p.id() << " "
171  << "eta = " << setw(3) << p.eta() << " "
172  << "quality = " << setw(2) << qualitycode << " ("
173  << quality(qualitycode,1) << " "
174  << quality(qualitycode,2) << " "
175  << quality(qualitycode,3) << ")";
176  for ( int i = 0; i < 12; i++ ) {
177  if ( m_pattern[i] == p.id() ) cout << " <--";
178  }
179  cout << endl;
180  }
181  }
182 
183  cout << "Received addresses : " << endl;
184  for ( int i = 0; i < 12; i++ ) cout << setw(3) << m_address[i] << " ";
185  cout << endl;
186 
187  if ( !empty1 ) {
188  cout << "Matched patterns : " << endl;
189  for ( int i = 0; i < 12; i++ ) {
190  if ( m_fine[i] ) {
192  int fineeta = p.eta();
193  int coarseeta = theQualPatternLUT.getCoarseEta(i/2+1,m_address[i]);
194  cout << "Index = " << setw(2) << i << ", "
195  << "address = " << setw(2) << m_address[i] << " --> "
196  << "pattern = " << setw(4) << m_pattern[i] << " "
197  << "eta (coarse) = " << setw(3) << coarseeta << " "
198  << "eta (fine) = " << setw(3) << fineeta << " "
199  << "quality = " << setw(2) << p.quality() << endl;
200  }
201  }
202  }
203 
204  cout << "Eta values and fine bits : " << endl;
205  for ( int i = 0; i < 12; i++ ) cout << setw(3) << m_eta[i] << " ";
206  cout << endl;
207  for ( int i = 0; i < 12; i++ ) cout << setw(3) << m_fine[i] << " ";
208  cout << endl;
209  }
210 
211 }
int quality() const
return quality
int getCoarseEta(int sp, int adr) const
get coarse eta value for a given sector processor [1-6] and address [1-22]
L1MuDTEtaPattern getPattern(int id) const
get pattern with a given ID
L1MuBMTEtaPatternLut theEtaPatternLUT
int id() const
return id
int eta() const
return eta
std::vector< int > m_foundPattern
static int quality(int id, int stat)
get quality code; id [0,26], stat [1,3]
static int position[264][3]
Definition: ReadPGInfo.cc:509
std::vector< const L1MuBMTrackSegEta * > m_tseta
L1MuBMTQualPatternLut theQualPatternLUT
int L1MuBMEtaProcessor::quality ( int  id,
int  stat 
)
staticprivate

get quality code; id [0,26], stat [1,3]

Definition at line 471 of file L1MuBMEtaProcessor.cc.

References id().

Referenced by fineBit(), print(), and runEtaTrackFinder().

471  {
472 
473  // quality codes as defined in CMS Note 2001/027
474  // This QualityPatterns are used to have a defined Quality-Identifier for
475  // all possible found tracks.
476  // Therefore three integer numbers ( Station 1, 2, 3 from left to right )
477  // can have numbers like 0, 1 or 2
478  // 0 ... no hit is given
479  // 1 ... a LTRG is given
480  // 2 ... a HTRG is given
481 
482  const int qualcode[27][3] = { {0,0,0},{1,0,0},{0,1,0},{0,0,1},{2,0,0},
483  {0,2,0},{0,0,2},{1,1,0},{1,0,1},{0,1,1},
484  {2,1,0},{1,2,0},{2,0,1},{1,0,2},{0,2,1},
485  {0,1,2},{2,2,0},{2,0,2},{0,2,2},{1,1,1},
486  {2,1,1},{1,2,1},{1,1,2},{2,2,1},{2,1,2},
487  {1,2,2},{2,2,2} };
488 
489  return qualcode[id][stat-1];
490 
491 }
int id() const
return Eta Processor identifier (0-11)
void L1MuBMEtaProcessor::receiveAddresses ( )
private

receive addresses (from 6 Sector Processors)

Definition at line 282 of file L1MuBMEtaProcessor.cc.

References L1MuBMTrack::address(), L1MuBMTrack::empty(), mps_fire::i, m_address, m_epid, m_tf, m_TrackCand, m_TracKCand, L1MuBMTrackFinder::sp(), L1MuBMSectorProcessor::track(), L1MuBMSectorProcessor::tracK(), L1MuBMAddressArray::trackAddressCode(), and makeMuonMisalignmentScenario::wheel.

Referenced by fineBit(), and run().

282  {
283 
284  // get track address code of all track segments
285  // 6*2 times 5 bits; valid range [1-22]
286 
287  int sector = m_epid;
288 
289  int i = 0;
290  for ( int wheel = -3; wheel <= 3; wheel++ ) {
291  if ( wheel == 0 ) continue;
292  L1MuBMSecProcId tmpspid(wheel,sector);
293  for ( int number = 0; number < 2; number++ ) {
294  const L1MuBMTrack* cand = m_tf.sp(tmpspid)->track(number);
295  const L1MuBMTrack* canD = m_tf.sp(tmpspid)->tracK(number);
296  if ( cand ) {
297  m_address[i] = cand->address().trackAddressCode();
298  if ( !cand->empty() ) {
299  m_TrackCand[i] = const_cast<L1MuBMTrack*>(cand);
300  m_TracKCand[i] = const_cast<L1MuBMTrack*>(canD);
301  }
302  i++;
303  }
304  }
305  }
306 
307 }
const L1MuBMTrackFinder & m_tf
int trackAddressCode() const
get track address code (for eta track finder)
L1MuBMTrack * m_TrackCand[12]
L1MuBMTrack * m_TracKCand[12]
L1MuBMAddressArray address() const
get address-array for this muon candidate
Definition: L1MuBMTrack.h:102
L1MuBMTrack * tracK(int id) const
return pointer to muon candidate, index [0,1]
const L1MuBMSectorProcessor * sp(const L1MuBMSecProcId &) const
get a pointer to a Sector Processor
L1MuBMTrack * track(int id) const
return pointer to muon candidate, index [0,1]
bool empty() const
is it an empty muon candidate?
Definition: L1MuBMTrack.h:96
void L1MuBMEtaProcessor::receiveData ( int  bx,
const edm::Event e,
const edm::EventSetup c 
)
private

receive data (eta trigger primitives)

Definition at line 217 of file L1MuBMEtaProcessor.cc.

References bmtfParamsHandle, L1MuDTChambThContainer::chThetaSegm(), L1TMuonBarrelParams::LUTParams::eta_lut_, edm::EventSetup::get(), edm::eventsetup::EventSetupRecord::get(), L1MuDTTFMasks::get_etsoc_chdis_st1(), L1MuDTTFMasks::get_etsoc_chdis_st2(), L1MuDTTFMasks::get_etsoc_chdis_st3(), edm::Event::getByToken(), mps_fire::i, L1TMuonBarrelParams::l1mudttfmasks, L1TMuonBarrelParams::lutparams_, m_DTDigiToken, m_epid, L1MuBMTEtaPatternLut::m_lut, L1MuBMTQualPatternLut::m_lut, m_mask, m_tseta, msks, L1MuDTChambThDigi::position(), edm::ESHandle< T >::product(), L1TMuonBarrelParams::LUTParams::qp_lut_, L1MuDTChambThDigi::quality(), theEtaPatternLUT, theQualPatternLUT, and makeMuonMisalignmentScenario::wheel.

Referenced by fineBit(), and run().

217  {
218 
219  //c.get< L1MuDTTFMasksRcd >().get( msks );
220  const L1TMuonBarrelParamsRcd& bmtfParamsRcd = c.get<L1TMuonBarrelParamsRcd>();
221  bmtfParamsRcd.get(bmtfParamsHandle);
222  const L1TMuonBarrelParams& bmtfParams = *bmtfParamsHandle.product();
223  msks = bmtfParams.l1mudttfmasks;
224  theEtaPatternLUT.m_lut = bmtfParams.lutparams_.eta_lut_; //l1mudttfetaplut; // ETF look-up table
225  theQualPatternLUT.m_lut = bmtfParams.lutparams_.qp_lut_; //l1mudttfqualplut; // EMU look-up tables
226 
228 // e.getByLabel(L1MuBMTFConfig::getBMThetaDigiInputTag(),dttrig);
229  e.getByToken(m_DTDigiToken,dttrig);
230 
231  // const int bx_offset = dttrig->correctBX();
232  int bx_offset=0;
233  bx = bx + bx_offset;
234 
235  //
236  // get 5*3 eta track segments
237  //
238  int sector = m_epid;
239  for ( int stat = 1; stat <= 3; stat++ ) {
240  for ( int wheel = -2; wheel <= 2; wheel++ ) {
241  L1MuDTChambThDigi const* tseta = dttrig->chThetaSegm(wheel,stat,sector,bx);
242  bitset<7> pos;
243  bitset<7> qual;
244 
245  int lwheel = wheel+1;
246  if ( wheel < 0 ) lwheel = wheel-1;
247 
248  bool masked = false;
249  if ( stat == 1 ) masked = msks.get_etsoc_chdis_st1(lwheel, sector);
250  if ( stat == 2 ) masked = msks.get_etsoc_chdis_st2(lwheel, sector);
251  if ( stat == 3 ) masked = msks.get_etsoc_chdis_st3(lwheel, sector);
252 
253  if ( !masked ) m_mask = false;
254 
255  if ( tseta && !masked ) {
256 
257  if ( wheel == -2 || wheel == -1 ||
258  ( wheel == 0 && (sector == 0 || sector == 3 || sector == 4 || sector == 7 || sector == 8 || sector == 11) ) ) {
259  for ( int i = 0; i < 7; i++ ) {
260  if ( tseta->position(i) ) pos.set(6-i);
261  if ( tseta->quality(i) ) qual.set(6-i);
262  }
263  } else {
264  for ( int i = 0; i < 7; i++ ) {
265  if ( tseta->position(i) ) pos.set(i);
266  if ( tseta->quality(i) ) qual.set(i);
267  }
268  }
269  }
270 
271  const L1MuBMTrackSegEta* tmpts = new L1MuBMTrackSegEta(wheel,sector,stat,pos.to_ulong(),qual.to_ulong(),bx-bx_offset);
272  m_tseta.push_back(tmpts);
273  }
274  }
275 
276 }
edm::ESHandle< L1TMuonBarrelParams > bmtfParamsHandle
bool get_etsoc_chdis_st3(int wh, int sc) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
int quality(const int i) const
L1MuBMTEtaPatternLut theEtaPatternLUT
int position(const int i) const
L1MuDTTFMasks l1mudttfmasks
void get(HolderT &iHolder) const
bool get_etsoc_chdis_st2(int wh, int sc) const
edm::EDGetTokenT< L1MuDTChambThContainer > m_DTDigiToken
L1MuDTChambThDigi const * chThetaSegm(int wheel, int stat, int sect, int bx) const
T get() const
Definition: EventSetup.h:62
std::vector< const L1MuBMTrackSegEta * > m_tseta
bool get_etsoc_chdis_st1(int wh, int sc) const
T const * product() const
Definition: ESHandle.h:86
L1MuBMTQualPatternLut theQualPatternLUT
void L1MuBMEtaProcessor::reset ( void  )
virtual

reset the Eta Processor

Definition at line 105 of file L1MuBMEtaProcessor.cc.

References mps_fire::i, m_address, m_eta, m_fine, m_foundPattern, m_mask, m_pattern, m_TrackCand, m_TracKCand, and m_tseta.

Referenced by id().

105  {
106 
107  vector<const L1MuBMTrackSegEta*>::iterator iter = m_tseta.begin();
108  while ( iter != m_tseta.end() ) {
109  if ( *iter ) {
110  delete *iter;
111  *iter = nullptr;
112  }
113  iter++;
114  }
115 
116  m_tseta.clear();
117 
118  for ( int i = 0; i < 12; i++ ) {
119  m_eta[i] = 99;
120  m_fine[i] = false;
121  m_pattern[i] = 0;
122  m_address[i] = 0;
123  m_TrackCand[i] = nullptr;
124  m_TracKCand[i] = nullptr;
125  }
126 
127  m_foundPattern.clear();
128 
129  m_mask = true;
130 
131 }
L1MuBMTrack * m_TrackCand[12]
L1MuBMTrack * m_TracKCand[12]
std::vector< int > m_foundPattern
std::vector< const L1MuBMTrackSegEta * > m_tseta
void L1MuBMEtaProcessor::run ( int  bx,
const edm::Event e,
const edm::EventSetup c 
)
virtual

run the Eta Processor

Definition at line 87 of file L1MuBMEtaProcessor.cc.

References assign(), L1MuBMTFConfig::getEtaTF(), receiveAddresses(), receiveData(), runEtaMatchingUnit(), and runEtaTrackFinder().

Referenced by id().

87  {
88 
89  if ( L1MuBMTFConfig::getEtaTF() ) {
90  receiveData(bx,e,c);
92  }
93 
96 
97  assign();
98 
99 }
void receiveData(int bx, const edm::Event &e, const edm::EventSetup &c)
receive data (eta trigger primitives)
void runEtaMatchingUnit(const edm::EventSetup &c)
run Eta Matching Unit (EMU)
void assign()
assign eta and etaFineBit
void runEtaTrackFinder(const edm::EventSetup &c)
run Eta Track Finder (ETF)
void receiveAddresses()
receive addresses (from 6 Sector Processors)
static bool getEtaTF()
void L1MuBMEtaProcessor::runEtaMatchingUnit ( const edm::EventSetup c)
private

run Eta Matching Unit (EMU)

Definition at line 364 of file L1MuBMEtaProcessor.cc.

References bmtfParamsHandle, L1MuDTEtaPattern::eta(), spr::find(), edm::EventSetup::get(), edm::eventsetup::EventSetupRecord::get(), L1MuBMTQualPatternLut::getCoarseEta(), L1MuBMTEtaPatternLut::getPattern(), L1MuBMTQualPatternLut::getQualifiedPatterns(), mps_fire::i, L1TMuonBarrelParams::lutparams_, m_address, m_eta, m_fine, m_foundPattern, L1MuBMTQualPatternLut::m_lut, m_mask, m_pattern, AlCaHLTBitMon_ParallelJobs::p, edm::ESHandle< T >::product(), L1TMuonBarrelParams::LUTParams::qp_lut_, theEtaPatternLUT, and theQualPatternLUT.

Referenced by fineBit(), and run().

364  {
365 
366  //c.get< L1MuDTQualPatternLutRcd >().get( theQualPatternLUT );
367  const L1TMuonBarrelParamsRcd& bmtfParamsRcd = c.get<L1TMuonBarrelParamsRcd>();
368  bmtfParamsRcd.get(bmtfParamsHandle);
369  const L1TMuonBarrelParams& bmtfParams = *bmtfParamsHandle.product();
370  theQualPatternLUT.m_lut = bmtfParams.lutparams_.qp_lut_; //l1mudttfqualplut; // EMU look-up tables
371 
372  // loop over all addresses
373  for ( int i = 0; i < 12; i++ ) {
374 
375  int adr = m_address[i];
376  if ( adr == 0 ) continue;
377  int sp = i/2 + 1; //sector processor [1,6]
378 
379  // assign coarse eta value
380  if ( !m_mask ) m_eta[i] = theQualPatternLUT.getCoarseEta(sp,adr);
381 
382 
383  if ( m_foundPattern.empty() ) continue;
384 
385  // get list of qualified patterns ordered by quality
386  // and compare with found patterns
387  const vector<short>& qualifiedPatterns = theQualPatternLUT.getQualifiedPatterns(sp,adr);
388  vector<short>::const_iterator iter;
389  vector<int>::const_iterator f_iter;
390  for ( iter = qualifiedPatterns.begin(); iter != qualifiedPatterns.end(); iter++ ) {
391  f_iter = find(m_foundPattern.begin(),m_foundPattern.end(),(*iter));
392  // found
393  if ( f_iter != m_foundPattern.end() ) {
395  // assign fine eta value
396  m_fine[i] = true;
397  m_eta[i] = p.eta(); // improved eta
398 ;
399  m_pattern[i] = (*f_iter);
400  break;
401  }
402  }
403 
404  }
405 
406  // if both tracks from one sector processor deliver the same track address
407  // both tracks get only a coarse eta value!
408 
409  // loop over sector processors
410  for ( int i = 0; i < 6; i++ ) {
411  int idx1 = 2*i;
412  int idx2 = 2*i+1;
413  int adr1 = m_address[idx1];
414  int adr2 = m_address[idx2];
415  if ( adr1 == 0 || adr2 == 0 ) continue;
416  if ( adr1 == adr2 && !m_mask ) {
417  // both tracks get coarse (default) eta value
418  m_eta[idx1] = theQualPatternLUT.getCoarseEta(i+1,adr1);
419  m_pattern[idx1] = 0;
420  m_fine[idx1] = false;
421  m_eta[idx2] = theQualPatternLUT.getCoarseEta(i+1,adr2);
422 
423  m_pattern[idx2] = 0;
424  m_fine[idx2] = false;
425  }
426  }
427 
428 }
edm::ESHandle< L1TMuonBarrelParams > bmtfParamsHandle
const std::vector< short > & getQualifiedPatterns(int sp, int adr) const
get list of qualified patterns for a given sector processor [1-6] and address [1-22] ...
int getCoarseEta(int sp, int adr) const
get coarse eta value for a given sector processor [1-6] and address [1-22]
L1MuDTEtaPattern getPattern(int id) const
get pattern with a given ID
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
L1MuBMTEtaPatternLut theEtaPatternLUT
int eta() const
return eta
void get(HolderT &iHolder) const
std::vector< int > m_foundPattern
T get() const
Definition: EventSetup.h:62
T const * product() const
Definition: ESHandle.h:86
L1MuBMTQualPatternLut theQualPatternLUT
void L1MuBMEtaProcessor::runEtaTrackFinder ( const edm::EventSetup c)
private

run Eta Track Finder (ETF)

Definition at line 313 of file L1MuBMEtaProcessor.cc.

References L1MuBMTEtaPatternLut::begin(), stringResolutionProvider_cfi::bin, bmtfParamsHandle, relativeConstraints::empty, L1MuBMTEtaPatternLut::end(), L1TMuonBarrelParams::LUTParams::eta_lut_, edm::EventSetup::get(), edm::eventsetup::EventSetupRecord::get(), mps_fire::i, L1MuDTEtaPattern::id(), L1TMuonBarrelParams::lutparams_, m_foundPattern, L1MuBMTEtaPatternLut::m_lut, m_tseta, listBenchmarks::pattern, L1MuDTEtaPattern::position(), edm::ESHandle< T >::product(), lumiQueryAPI::q, L1MuDTEtaPattern::quality(), quality(), relativeConstraints::station, theEtaPatternLUT, L1MuDTEtaPattern::wheel(), and makeMuonMisalignmentScenario::wheel.

Referenced by fineBit(), and run().

313  {
314 
315  //c.get< L1MuDTEtaPatternLutRcd >().get( theEtaPatternLUT );
316  const L1TMuonBarrelParamsRcd& bmtfParamsRcd = c.get<L1TMuonBarrelParamsRcd>();
317  bmtfParamsRcd.get(bmtfParamsHandle);
318  const L1TMuonBarrelParams& bmtfParams = *bmtfParamsHandle.product();
319  theEtaPatternLUT.m_lut = bmtfParams.lutparams_.eta_lut_; //l1mudttfetaplut; // ETF look-up table
320 
321  // check if there are any data
322  bool empty = true;
323  for ( int i = 0; i < 15; i++ ) {
324  empty &= m_tseta[i]->empty();
325  }
326  if ( empty ) return;
327 
328  // Pattern comparator:
329  // loop over all patterns and compare with local chamber pattern
330  // result : list of valid pattern IDs ( m_foundPattern )
332  while ( it != theEtaPatternLUT.end() ) {
333 
334  const L1MuDTEtaPattern pattern = (*it).second;
335  int qualitycode = pattern.quality();
336 
337  bool good = true;
338 
339  for ( int station = 0; station < 3; station++) {
340  int q = quality(qualitycode,station+1);
341  int wheel = pattern.wheel(station+1);
342  int bin = pattern.position(station+1);
343  if ( bin == 0 ) continue;
344  bitset<7> pos = m_tseta[wheel+2 + station*5]->position();
345  bitset<7> qual = m_tseta[wheel+2 + station*5]->quality();
346  // compare position
347  good &= pos.test(bin-1);
348  // compare quality
349  if ( q == 2 ) good &= qual.test(bin-1);
350  }
351 
352  if ( good ) m_foundPattern.push_back(pattern.id());
353 
354  it++;
355 
356  }
357 
358 }
edm::ESHandle< L1TMuonBarrelParams > bmtfParamsHandle
int quality() const
return quality
ETFLut_iter begin() const
return iterator which points to the first entry of the LUT
int position(int station) const
return position in station [1,3]
L1MuBMTEtaPatternLut theEtaPatternLUT
int id() const
return id
void get(HolderT &iHolder) const
std::vector< int > m_foundPattern
bin
set the eta bin as selection string.
static int quality(int id, int stat)
get quality code; id [0,26], stat [1,3]
T get() const
Definition: EventSetup.h:62
int wheel(int station) const
return wheel number in station [1,3]
std::vector< const L1MuBMTrackSegEta * > m_tseta
LUT::const_iterator ETFLut_iter
T const * product() const
Definition: ESHandle.h:86
ETFLut_iter end() const
return iterator which points to the one-past-last entry of the LUT
const L1MuBMTrackFinder& L1MuBMEtaProcessor::tf ( ) const
inline

return reference to barrel MTTF

Definition at line 85 of file L1MuBMEtaProcessor.h.

References m_tf.

85 { return m_tf; }
const L1MuBMTrackFinder & m_tf

Member Data Documentation

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

Definition at line 134 of file L1MuBMEtaProcessor.h.

Referenced by receiveData(), runEtaMatchingUnit(), and runEtaTrackFinder().

int L1MuBMEtaProcessor::m_address[12]
private

Definition at line 126 of file L1MuBMEtaProcessor.h.

Referenced by print(), receiveAddresses(), reset(), and runEtaMatchingUnit().

edm::EDGetTokenT<L1MuDTChambThContainer> L1MuBMEtaProcessor::m_DTDigiToken
private

Definition at line 139 of file L1MuBMEtaProcessor.h.

Referenced by receiveData().

int L1MuBMEtaProcessor::m_epid
private

Definition at line 116 of file L1MuBMEtaProcessor.h.

Referenced by id(), print(), receiveAddresses(), and receiveData().

int L1MuBMEtaProcessor::m_eta[12]
private

Definition at line 120 of file L1MuBMEtaProcessor.h.

Referenced by assign(), eta(), print(), reset(), and runEtaMatchingUnit().

bool L1MuBMEtaProcessor::m_fine[12]
private

Definition at line 121 of file L1MuBMEtaProcessor.h.

Referenced by assign(), fineBit(), print(), reset(), and runEtaMatchingUnit().

std::vector<int> L1MuBMEtaProcessor::m_foundPattern
private

Definition at line 123 of file L1MuBMEtaProcessor.h.

Referenced by print(), reset(), runEtaMatchingUnit(), and runEtaTrackFinder().

int L1MuBMEtaProcessor::m_mask
private

Definition at line 118 of file L1MuBMEtaProcessor.h.

Referenced by receiveData(), reset(), and runEtaMatchingUnit().

int L1MuBMEtaProcessor::m_pattern[12]
private

Definition at line 124 of file L1MuBMEtaProcessor.h.

Referenced by assign(), print(), reset(), and runEtaMatchingUnit().

const L1MuBMTrackFinder& L1MuBMEtaProcessor::m_tf
private

Definition at line 115 of file L1MuBMEtaProcessor.h.

Referenced by receiveAddresses(), and tf().

L1MuBMTrack* L1MuBMEtaProcessor::m_TrackCand[12]
private

Definition at line 127 of file L1MuBMEtaProcessor.h.

Referenced by assign(), receiveAddresses(), and reset().

L1MuBMTrack* L1MuBMEtaProcessor::m_TracKCand[12]
private

Definition at line 128 of file L1MuBMEtaProcessor.h.

Referenced by assign(), receiveAddresses(), and reset().

std::vector<const L1MuBMTrackSegEta*> L1MuBMEtaProcessor::m_tseta
private
L1MuDTTFMasks L1MuBMEtaProcessor::msks
private

Definition at line 135 of file L1MuBMEtaProcessor.h.

Referenced by receiveData().

L1MuBMTEtaPatternLut L1MuBMEtaProcessor::theEtaPatternLUT
private
L1MuBMTQualPatternLut L1MuBMEtaProcessor::theQualPatternLUT
private

Definition at line 137 of file L1MuBMEtaProcessor.h.

Referenced by print(), receiveData(), and runEtaMatchingUnit().