test
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
L1MuBMSectorReceiver Class Reference

#include <L1MuBMSectorReceiver.h>

Public Member Functions

 L1MuBMSectorReceiver (L1MuBMSectorProcessor &, 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 BBMX and CSC chamber triggers More...
 
virtual ~L1MuBMSectorReceiver ()
 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 receiveBBMXData (int bx, const edm::Event &e, const edm::EventSetup &c)
 receive track segment data from BBMX chamber trigger More...
 
void receiveCSCData (int bx, const edm::Event &e, const edm::EventSetup &c)
 receive track segment data from CSC chamber trigger More...
 

Private Attributes

edm::ESHandle
< L1TMuonBarrelParams
bmtfParamsHandle
 
edm::EDGetTokenT
< L1MuDTChambPhContainer
m_DTDigiToken
 
L1MuBMSectorProcessorm_sp
 
L1MuDTTFMasks msks
 
edm::ESHandle< L1MuDTTFParameterspars
 

Detailed Description

Sector Receiver:

The Sector Receiver receives track segment data from the BBMX 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 L1MuBMSectorReceiver.h.

Constructor & Destructor Documentation

L1MuBMSectorReceiver::L1MuBMSectorReceiver ( L1MuBMSectorProcessor sp,
edm::ConsumesCollector &&  iC 
)

constructor

Definition at line 52 of file L1MuBMSectorReceiver.cc.

52  :
53  m_sp(sp),
55 
56 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< L1MuDTChambPhContainer > m_DTDigiToken
L1MuBMSectorProcessor & m_sp
static edm::InputTag getBMDigiInputTag()
L1MuBMSectorReceiver::~L1MuBMSectorReceiver ( )
virtual

destructor

Definition at line 62 of file L1MuBMSectorReceiver.cc.

62  {
63 
64 // reset();
65 
66 }

Member Function Documentation

int L1MuBMSectorReceiver::address2sector ( int  adr) const
private

find the right sector for a given address

Definition at line 313 of file L1MuBMSectorReceiver.cc.

References L1MuBMSectorProcessor::id(), m_sp, and L1MuBMSecProcId::sector().

Referenced by receiveBBMXData().

313  {
314 
315  int sector = m_sp.id().sector();
316 
317  if ( adr >= 4 && adr <= 7 ) sector = (sector+13)%12; // +1
318  if ( adr >= 8 && adr <= 11 ) sector = (sector+11)%12; // -1
319 
320  return sector;
321 
322 }
int sector() const
return sector number
L1MuBMSectorProcessor & m_sp
const L1MuBMSecProcId & id() const
return Sector Processor identifier
int L1MuBMSectorReceiver::address2wheel ( int  adr) const
private

find the right wheel for a given address

Definition at line 328 of file L1MuBMSectorReceiver.cc.

References L1MuBMSectorProcessor::id(), L1MuBMSecProcId::locwheel(), m_sp, and L1MuBMSecProcId::wheel().

Referenced by receiveBBMXData().

328  {
329 
330  int wheel = m_sp.id().locwheel();
331 
332  // for 2, 3, 6, 7, 10, 11
333  if ( (adr/2)%2 == 1 ) wheel = m_sp.id().wheel();
334 
335  return wheel;
336 
337 }
L1MuBMSectorProcessor & m_sp
const L1MuBMSecProcId & 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 L1MuBMSectorReceiver::receiveBBMXData ( int  bx,
const edm::Event e,
const edm::EventSetup c 
)
private

receive track segment data from BBMX chamber trigger

Definition at line 109 of file L1MuBMSectorReceiver.cc.

References funct::abs(), address2sector(), address2wheel(), L1MuBMDataBuffer::addTSphi(), L1MuDTChambPhDigi::code(), L1MuBMSectorProcessor::data(), L1MuDTTFMasks::get_inrec_chdis_st1(), L1MuDTTFMasks::get_inrec_chdis_st2(), L1MuDTTFMasks::get_inrec_chdis_st3(), L1MuDTTFMasks::get_inrec_chdis_st4(), edm::Event::getByToken(), L1MuBMTFConfig::getNbitsExtPhi(), L1MuBMTFConfig::getTSOutOfTimeFilter(), L1MuBMTFConfig::getTSOutOfTimeWindow(), L1MuBMSectorProcessor::id(), m_DTDigiToken, m_sp, msks, pars, phi, L1MuDTChambPhDigi::phi(), L1MuDTChambPhDigi::phiB(), L1MuBMSecProcId::sector(), relativeConstraints::station, GlobalPosition_Frontier_DevDB_cff::tag, and L1MuBMSecProcId::wheel().

Referenced by run().

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

receive track segment data from CSC chamber trigger

void L1MuBMSectorReceiver::reset ( void  )

clear Sector Receiver

Definition at line 101 of file L1MuBMSectorReceiver.cc.

Referenced by L1MuBMSectorProcessor::reset().

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

receive track segment data from the BBMX and CSC chamber triggers

Definition at line 76 of file L1MuBMSectorReceiver.cc.

References bmtfParamsHandle, edm::EventSetup::get(), edm::eventsetup::EventSetupRecord::get(), L1TMuonBarrelParams::l1mudttfmasks, msks, pars, edm::ESHandle< class >::product(), and receiveBBMXData().

Referenced by L1MuBMSectorProcessor::run().

76  {
77 
78  c.get< L1MuDTTFParametersRcd >().get( pars );
79  //c.get< L1MuDTTFMasksRcd >().get( msks );
80 
81  const L1TMuonBarrelParamsRcd& bmtfParamsRcd = c.get<L1TMuonBarrelParamsRcd>();
82  bmtfParamsRcd.get(bmtfParamsHandle);
83  const L1TMuonBarrelParams& bmtfParams = *bmtfParamsHandle.product();
84  msks = bmtfParams.l1mudttfmasks;
85  //msks.print();
86 
87  // get track segments from BBMX chamber trigger
88  receiveBBMXData(bx, e, c);
89 
90  // get track segments from CSC chamber trigger
91  //if ( L1MuBMTFConfig::overlap() && m_sp.ovl() ) {
92  //receiveCSCData(bx, e, c);
93  //}
94 
95 }
edm::ESHandle< L1MuDTTFParameters > pars
L1MuDTTFMasks l1mudttfmasks
void get(HolderT &iHolder) const
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
edm::ESHandle< L1TMuonBarrelParams > bmtfParamsHandle
void receiveBBMXData(int bx, const edm::Event &e, const edm::EventSetup &c)
receive track segment data from BBMX chamber trigger

Member Data Documentation

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

Definition at line 87 of file L1MuBMSectorReceiver.h.

Referenced by run().

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

Definition at line 92 of file L1MuBMSectorReceiver.h.

Referenced by receiveBBMXData().

L1MuBMSectorProcessor& L1MuBMSectorReceiver::m_sp
private

Definition at line 85 of file L1MuBMSectorReceiver.h.

Referenced by address2sector(), address2wheel(), and receiveBBMXData().

L1MuDTTFMasks L1MuBMSectorReceiver::msks
private

Definition at line 88 of file L1MuBMSectorReceiver.h.

Referenced by receiveBBMXData(), and run().

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

Definition at line 90 of file L1MuBMSectorReceiver.h.

Referenced by receiveBBMXData(), and run().