CMS 3D CMS Logo

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

#include <L1MuDTSectorReceiver.h>

Public Member Functions

 L1MuDTSectorReceiver (L1MuDTSectorProcessor &, edm::ConsumesCollector &&iC)
 constructor More...
 
void reset ()
 clear Sector Receiver More...
 
void run (int bx, const edm::Event &e, const edm::EventSetup &c)
 receive track segment data from the DTBX and CSC chamber triggers More...
 
virtual ~L1MuDTSectorReceiver ()
 destructor More...
 

Private Member Functions

int address2sector (int adr) const
 find the right sector for a given address More...
 
int address2wheel (int adr) const
 find the right wheel for a given address More...
 
void receiveCSCData (int bx, const edm::Event &e, const edm::EventSetup &c)
 receive track segment data from CSC chamber trigger More...
 
void receiveDTBXData (int bx, const edm::Event &e, const edm::EventSetup &c)
 receive track segment data from DTBX chamber trigger More...
 

Private Attributes

edm::EDGetTokenT
< CSCTriggerContainer
< csctf::TrackStub > > 
m_CSCTrSToken
 
edm::EDGetTokenT
< L1MuDTChambPhContainer
m_DTDigiToken
 
L1MuDTSectorProcessorm_sp
 
edm::ESHandle< L1MuDTTFMasksmsks
 
edm::ESHandle< L1MuDTTFParameterspars
 

Detailed Description

Sector Receiver:

The Sector Receiver receives track segment data from the DTBX and CSC chamber triggers and stores it into the Data Buffer

N. Neumeister CERN EP J. Troconiz UAM Madrid

Definition at line 53 of file L1MuDTSectorReceiver.h.

Constructor & Destructor Documentation

L1MuDTSectorReceiver::L1MuDTSectorReceiver ( L1MuDTSectorProcessor sp,
edm::ConsumesCollector &&  iC 
)

constructor

Definition at line 55 of file L1MuDTSectorReceiver.cc.

References L1MuDTTFConfig::getCSCTrSInputTag(), diffTwoXMLs::label, and m_CSCTrSToken.

55  :
56  m_sp(sp),
58 {
59  if (L1MuDTTFConfig::getCSCTrSInputTag().label() != "none" )
61 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
L1MuDTSectorProcessor & m_sp
static edm::InputTag getDTDigiInputTag()
edm::EDGetTokenT< L1MuDTChambPhContainer > m_DTDigiToken
edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > m_CSCTrSToken
static edm::InputTag getCSCTrSInputTag()
L1MuDTSectorReceiver::~L1MuDTSectorReceiver ( )
virtual

destructor

Definition at line 67 of file L1MuDTSectorReceiver.cc.

67  {
68 
69 // reset();
70 
71 }

Member Function Documentation

int L1MuDTSectorReceiver::address2sector ( int  adr) const
private

find the right sector for a given address

Definition at line 295 of file L1MuDTSectorReceiver.cc.

References L1MuDTSectorProcessor::id(), m_sp, and L1MuDTSecProcId::sector().

Referenced by receiveDTBXData().

295  {
296 
297  int sector = m_sp.id().sector();
298 
299  if ( adr >= 4 && adr <= 7 ) sector = (sector+13)%12; // +1
300  if ( adr >= 8 && adr <= 11 ) sector = (sector+11)%12; // -1
301 
302  return sector;
303 
304 }
L1MuDTSectorProcessor & m_sp
int sector() const
return sector number
const L1MuDTSecProcId & id() const
return Sector Processor identifier
int L1MuDTSectorReceiver::address2wheel ( int  adr) const
private

find the right wheel for a given address

Definition at line 310 of file L1MuDTSectorReceiver.cc.

References L1MuDTSectorProcessor::id(), L1MuDTSecProcId::locwheel(), m_sp, and L1MuDTSecProcId::wheel().

Referenced by receiveDTBXData().

310  {
311 
312  int wheel = m_sp.id().locwheel();
313 
314  // for 2, 3, 6, 7, 10, 11
315  if ( (adr/2)%2 == 1 ) wheel = m_sp.id().wheel();
316 
317  return wheel;
318 
319 }
L1MuDTSectorProcessor & m_sp
const L1MuDTSecProcId & id() const
return Sector Processor identifier
int locwheel() const
return physical wheel number (-2,-1,0,+1,+2)
int wheel() const
return wheel number
void L1MuDTSectorReceiver::receiveCSCData ( int  bx,
const edm::Event e,
const edm::EventSetup c 
)
private

receive track segment data from CSC chamber trigger

Definition at line 224 of file L1MuDTSectorReceiver.cc.

References L1MuDTDataBuffer::addTSphi(), L1MuDTSectorProcessor::data(), edm::Event::getByToken(), L1MuDTTFConfig::getCSCTrSInputTag(), L1MuDTTFConfig::getEtaCanc(), L1MuDTSectorProcessor::id(), diffTwoXMLs::label, m_CSCTrSToken, m_sp, msks, pars, phi, L1MuDTSecProcId::sector(), relativeConstraints::station, GlobalPosition_Frontier_DevDB_cff::tag, and L1MuDTSecProcId::wheel().

Referenced by run().

224  {
225 
226  if ( (L1MuDTTFConfig::getCSCTrSInputTag()).label() == "none" ) return;
227 
228  if ( bx < -6 || bx > 6 ) return;
229 
231  e.getByToken(m_CSCTrSToken,csctrig);
232 
233  const int bxCSC = 6;
234 
235  vector<csctf::TrackStub> csc_list;
236  vector<csctf::TrackStub>::const_iterator csc_iter;
237 
238  int station = 1; // only ME13
239  int wheel = m_sp.id().wheel();
240  int side = ( wheel == 3 ) ? 1 : 2;
241  int sector = m_sp.id().sector();
242  int csc_sector = ( sector == 0 ) ? 6 : (sector+1)/2;
243  int subsector = ( sector%2 == 0 ) ? 2 : 1;
244 
245  csc_list = csctrig->get(side,station,csc_sector,subsector,bxCSC+bx);
246  int ncsc = 0;
247  for ( csc_iter = csc_list.begin(); csc_iter != csc_list.end(); csc_iter++ ) {
248  bool etaFlag = ( csc_iter->etaPacked() > 17 );
249  int qualCSC = csc_iter->getQuality();
250 
251  // convert CSC quality code to DTBX quality code
252  unsigned int qual = 7;
253  if ( qualCSC == 2 ) qual = 0;
254  if ( qualCSC == 6 ) qual = 1;
255  if ( qualCSC == 7 ) qual = 2;
256  if ( qualCSC == 8 ) qual = 2;
257  if ( qualCSC == 9 ) qual = 3;
258  if ( qualCSC == 10 ) qual = 3;
259  if ( qualCSC == 11 ) qual = 4;
260  if ( qualCSC == 12 ) qual = 5;
261  if ( qualCSC == 13 ) qual = 5;
262  if ( qualCSC == 14 ) qual = 6;
263  if ( qualCSC == 15 ) qual = 6;
264  if ( qual == 7 ) continue;
265 
266  // convert CSC phi to DTBX phi
267  int phi = csc_iter->phiPacked();
268  if ( phi > 2047 ) phi -= 4096;
269  if ( phi < -2048 || phi > 2047 ) continue;
270 
271  if ( msks->get_inrec_chdis_csc(m_sp.id().wheel(), m_sp.id().sector()) ) continue;
272  if ( qual < pars->get_soc_qual_csc(m_sp.id().wheel(), m_sp.id().sector()) ) continue;
273  if ( pars->get_soc_csc_etacanc(m_sp.id().wheel(), m_sp.id().sector()) && etaFlag ) continue;
274  if ( L1MuDTTFConfig::getEtaCanc() && etaFlag ) continue;
275 
276  if ( ncsc < 2 ) {
277  int address = 16 + ncsc;
278  bool tag = (ncsc == 1 ) ? true : false;
279  L1MuDTTrackSegPhi tmpts(wheel,sector,station+2,phi,0,
280  static_cast<L1MuDTTrackSegPhi::TSQuality>(qual),
281  tag,bx,etaFlag);
282  m_sp.data()->addTSphi(address,tmpts);
283  ncsc++;
284  }
285  // else cout << "too many CSC track segments!" << endl;
286  }
287 
288 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
L1MuDTSectorProcessor & m_sp
int sector() const
return sector number
const L1MuDTDataBuffer * data() const
return pointer to Data Buffer
edm::ESHandle< L1MuDTTFParameters > pars
edm::ESHandle< L1MuDTTFMasks > msks
const L1MuDTSecProcId & id() const
return Sector Processor identifier
static bool getEtaCanc()
void addTSphi(int adr, const L1MuDTTrackSegPhi &)
add new phi track segment to the Data Buffer
edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > m_CSCTrSToken
int wheel() const
return wheel number
static edm::InputTag getCSCTrSInputTag()
void L1MuDTSectorReceiver::receiveDTBXData ( int  bx,
const edm::Event e,
const edm::EventSetup c 
)
private

receive track segment data from DTBX chamber trigger

Definition at line 108 of file L1MuDTSectorReceiver.cc.

References funct::abs(), address2sector(), address2wheel(), L1MuDTDataBuffer::addTSphi(), L1MuDTChambPhDigi::code(), L1MuDTSectorProcessor::data(), edm::Event::getByToken(), L1MuDTTFConfig::getNbitsExtPhi(), L1MuDTTFConfig::getTSOutOfTimeFilter(), L1MuDTTFConfig::getTSOutOfTimeWindow(), L1MuDTSectorProcessor::id(), m_DTDigiToken, m_sp, msks, L1MuDTSectorProcessor::ovl(), pars, phi, L1MuDTChambPhDigi::phi(), L1MuDTChambPhDigi::phiB(), L1MuDTSecProcId::sector(), relativeConstraints::station, GlobalPosition_Frontier_DevDB_cff::tag, and L1MuDTSecProcId::wheel().

Referenced by run().

108  {
109 
111  e.getByToken(m_DTDigiToken,dttrig);
112 
113  L1MuDTChambPhDigi const* ts=0;
114 
115  // const int bx_offset = dttrig->correctBX();
116  int bx_offset=0;
117  bx = bx + bx_offset;
118 
119  // get DTBX phi track segments
120  int address = 0;
121  for ( int station = 1; station <= 4; station++ ) {
122  int max_address = (station == 1) ? 2 : 12;
123  for (int reladr =0; reladr < max_address; reladr++) {
124  address++;
125  if ( m_sp.ovl() && (reladr/2)%2 != 0 ) continue;
126  int wheel = address2wheel(reladr);
127  int sector = address2sector(reladr);
128  if ( reladr%2 == 0 ) ts = dttrig->chPhiSegm1(wheel,station,sector,bx);
129  if ( reladr%2 == 1 ) ts = dttrig->chPhiSegm2(wheel,station,sector,bx);
130  if ( ts ) {
131  int phi = ts->phi();
132  int phib = ts->phiB();
133  int qual = ts->code();
134  bool tag = (reladr%2 == 1) ? true : false;
135 
136  int lwheel = m_sp.id().wheel();
137  lwheel = abs(lwheel)/lwheel*(abs(wheel)+1);
138 
139  if ( station == 1 ) {
140  if ( msks->get_inrec_chdis_st1(lwheel, sector) ) continue;
141  if ( qual < pars->get_inrec_qual_st1(lwheel, sector) ) continue;
142  }
143  else if ( station == 2 ) {
144  if ( msks->get_inrec_chdis_st2(lwheel, sector) ) continue;
145  if ( qual < pars->get_inrec_qual_st2(lwheel, sector) ) continue;
146  }
147  else if ( station == 3 ) {
148  if ( msks->get_inrec_chdis_st3(lwheel, sector) ) continue;
149  if ( qual < pars->get_inrec_qual_st3(lwheel, sector) ) continue;
150  }
151  else if ( station == 4 ) {
152  if ( msks->get_inrec_chdis_st4(lwheel, sector) ) continue;
153  if ( qual < pars->get_inrec_qual_st4(lwheel, sector) ) continue;
154  }
155 
156  if ( reladr/2 == 1 && qual < pars->get_soc_stdis_n(m_sp.id().wheel(), m_sp.id().sector()) ) continue;
157  if ( reladr/2 == 2 && qual < pars->get_soc_stdis_wl(m_sp.id().wheel(), m_sp.id().sector()) ) continue;
158  if ( reladr/2 == 3 && qual < pars->get_soc_stdis_zl(m_sp.id().wheel(), m_sp.id().sector()) ) continue;
159  if ( reladr/2 == 4 && qual < pars->get_soc_stdis_wr(m_sp.id().wheel(), m_sp.id().sector()) ) continue;
160  if ( reladr/2 == 5 && qual < pars->get_soc_stdis_zr(m_sp.id().wheel(), m_sp.id().sector()) ) continue;
161 
162  //
163  // out-of-time TS filter (compare TS at +-1 bx)
164  //
165  bool skipTS = false;
166 
167  bool nbx_del = pars->get_soc_nbx_del(m_sp.id().wheel(), m_sp.id().sector());
168  if ( L1MuDTTFConfig::getTSOutOfTimeFilter() || nbx_del ) {
169 
170  int sh_phi = 12 - L1MuDTTFConfig::getNbitsExtPhi();
171  int tolerance = L1MuDTTFConfig::getTSOutOfTimeWindow();
172 
173  L1MuDTChambPhDigi const * tsPreviousBX_1 = dttrig->chPhiSegm1(wheel,station,sector,bx-1);
174  if ( tsPreviousBX_1 ) {
175  int phiBX = tsPreviousBX_1->phi();
176  int qualBX = tsPreviousBX_1->code();
177  if ( abs( (phi >> sh_phi) - (phiBX >> sh_phi) ) <= tolerance &&
178  qualBX > qual ) skipTS = true;
179  }
180 
181  L1MuDTChambPhDigi const * tsPreviousBX_2 = dttrig->chPhiSegm2(wheel,station,sector,bx-1);
182  if ( tsPreviousBX_2 ) {
183  int phiBX = tsPreviousBX_2->phi();
184  int qualBX = tsPreviousBX_2->code();
185  if ( abs( (phi >> sh_phi) - (phiBX >> sh_phi) ) <= tolerance &&
186  qualBX > qual ) skipTS = true;
187  }
188 
189  L1MuDTChambPhDigi const * tsNextBX_1 = dttrig->chPhiSegm1(wheel,station,sector,bx+1);
190  if ( tsNextBX_1 ) {
191  int phiBX = tsNextBX_1->phi();
192  int qualBX = tsNextBX_1->code();
193  if ( abs( (phi >> sh_phi) - (phiBX >> sh_phi) ) <= tolerance &&
194  qualBX > qual ) skipTS = true;
195  }
196 
197  L1MuDTChambPhDigi const * tsNextBX_2 = dttrig->chPhiSegm2(wheel,station,sector,bx+1);
198  if ( tsNextBX_2 ) {
199  int phiBX = tsNextBX_2->phi();
200  int qualBX = tsNextBX_2->code();
201  if ( abs( (phi >> sh_phi) - (phiBX >> sh_phi) ) <= tolerance &&
202  qualBX > qual ) skipTS = true;
203  }
204 
205  }
206 
207  if ( !skipTS ) {
208  L1MuDTTrackSegPhi tmpts(wheel,sector,station,phi,phib,
209  static_cast<L1MuDTTrackSegPhi::TSQuality>(qual),
210  tag,bx-bx_offset);
211  m_sp.data()->addTSphi(address-1,tmpts);
212  }
213  }
214 
215  }
216  }
217 
218 }
int address2sector(int adr) const
find the right sector for a given address
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
L1MuDTSectorProcessor & m_sp
static int getNbitsExtPhi()
static bool getTSOutOfTimeFilter()
int sector() const
return sector number
const L1MuDTDataBuffer * data() const
return pointer to Data Buffer
edm::ESHandle< L1MuDTTFParameters > pars
edm::ESHandle< L1MuDTTFMasks > msks
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const L1MuDTSecProcId & id() const
return Sector Processor identifier
int address2wheel(int adr) const
find the right wheel for a given address
static int getTSOutOfTimeWindow()
void addTSphi(int adr, const L1MuDTTrackSegPhi &)
add new phi track segment to the Data Buffer
edm::EDGetTokenT< L1MuDTChambPhContainer > m_DTDigiToken
int wheel() const
return wheel number
bool ovl() const
is it an overlap region Sector Processor?
void L1MuDTSectorReceiver::reset ( void  )

clear Sector Receiver

Definition at line 100 of file L1MuDTSectorReceiver.cc.

Referenced by L1MuDTSectorProcessor::reset().

100  {
101 
102 }
void L1MuDTSectorReceiver::run ( int  bx,
const edm::Event e,
const edm::EventSetup c 
)

receive track segment data from the DTBX and CSC chamber triggers

Definition at line 81 of file L1MuDTSectorReceiver.cc.

References edm::EventSetup::get(), m_sp, msks, L1MuDTTFConfig::overlap(), L1MuDTSectorProcessor::ovl(), pars, receiveCSCData(), and receiveDTBXData().

Referenced by L1MuDTSectorProcessor::run().

81  {
82 
83  c.get< L1MuDTTFParametersRcd >().get( pars );
84  c.get< L1MuDTTFMasksRcd >().get( msks );
85 
86  // get track segments from DTBX chamber trigger
87  receiveDTBXData(bx, e, c);
88 
89  // get track segments from CSC chamber trigger
90  if ( L1MuDTTFConfig::overlap() && m_sp.ovl() ) {
91  receiveCSCData(bx, e, c);
92  }
93 
94 }
void receiveCSCData(int bx, const edm::Event &e, const edm::EventSetup &c)
receive track segment data from CSC chamber trigger
void receiveDTBXData(int bx, const edm::Event &e, const edm::EventSetup &c)
receive track segment data from DTBX chamber trigger
L1MuDTSectorProcessor & m_sp
static bool overlap()
edm::ESHandle< L1MuDTTFParameters > pars
edm::ESHandle< L1MuDTTFMasks > msks
const T & get() const
Definition: EventSetup.h:55
bool ovl() const
is it an overlap region Sector Processor?

Member Data Documentation

edm::EDGetTokenT<CSCTriggerContainer<csctf::TrackStub> > L1MuDTSectorReceiver::m_CSCTrSToken
private

Definition at line 87 of file L1MuDTSectorReceiver.h.

Referenced by L1MuDTSectorReceiver(), and receiveCSCData().

edm::EDGetTokenT<L1MuDTChambPhContainer> L1MuDTSectorReceiver::m_DTDigiToken
private

Definition at line 86 of file L1MuDTSectorReceiver.h.

Referenced by receiveDTBXData().

L1MuDTSectorProcessor& L1MuDTSectorReceiver::m_sp
private
edm::ESHandle< L1MuDTTFMasks > L1MuDTSectorReceiver::msks
private

Definition at line 90 of file L1MuDTSectorReceiver.h.

Referenced by receiveCSCData(), receiveDTBXData(), and run().

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

Definition at line 89 of file L1MuDTSectorReceiver.h.

Referenced by receiveCSCData(), receiveDTBXData(), and run().