CMS 3D CMS Logo

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< L1MuDTChambPhContainerm_DTDigiToken
 
edm::ESGetToken< L1MuDTTFMasks, L1MuDTTFMasksRcdm_msksToken
 
edm::ESGetToken< L1MuDTTFParameters, L1MuDTTFParametersRcdm_parsToken
 
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 56 of file L1MuDTSectorReceiver.h.

Constructor & Destructor Documentation

◆ L1MuDTSectorReceiver()

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

constructor

Definition at line 56 of file L1MuDTSectorReceiver.cc.

57  : m_sp(sp),
60  m_parsToken(iC.esConsumes()),
61  m_msksToken(iC.esConsumes()) {}
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const L1MuDTTrackFinder & tf() const
return reference to barrel MTTF
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
L1MuDTSectorProcessor & m_sp
edm::InputTag getDTDigiInputTag() const
const L1MuDTTFConfig * config() const
return configuration
edm::ESGetToken< L1MuDTTFParameters, L1MuDTTFParametersRcd > m_parsToken
edm::InputTag getCSCTrSInputTag() const
edm::EDGetTokenT< L1MuDTChambPhContainer > m_DTDigiToken
edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > m_CSCTrSToken
edm::ESGetToken< L1MuDTTFMasks, L1MuDTTFMasksRcd > m_msksToken

◆ ~L1MuDTSectorReceiver()

L1MuDTSectorReceiver::~L1MuDTSectorReceiver ( )
virtual

destructor

Definition at line 66 of file L1MuDTSectorReceiver.cc.

66  {
67  // reset();
68 }

Member Function Documentation

◆ address2sector()

int L1MuDTSectorReceiver::address2sector ( int  adr) const
private

find the right sector for a given address

Definition at line 306 of file L1MuDTSectorReceiver.cc.

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

Referenced by receiveDTBXData().

306  {
307  int sector = m_sp.id().sector();
308 
309  if (adr >= 4 && adr <= 7)
310  sector = (sector + 13) % 12; // +1
311  if (adr >= 8 && adr <= 11)
312  sector = (sector + 11) % 12; // -1
313 
314  return sector;
315 }
L1MuDTSectorProcessor & m_sp
int sector() const
return sector number
const L1MuDTSecProcId & id() const
return Sector Processor identifier

◆ address2wheel()

int L1MuDTSectorReceiver::address2wheel ( int  adr) const
private

find the right wheel for a given address

Definition at line 320 of file L1MuDTSectorReceiver.cc.

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

Referenced by receiveDTBXData().

320  {
321  int wheel = m_sp.id().locwheel();
322 
323  // for 2, 3, 6, 7, 10, 11
324  if ((adr / 2) % 2 == 1)
325  wheel = m_sp.id().wheel();
326 
327  return wheel;
328 }
int wheel() const
return wheel number
int locwheel() const
return physical wheel number (-2,-1,0,+1,+2)
L1MuDTSectorProcessor & m_sp
const L1MuDTSecProcId & id() const
return Sector Processor identifier

◆ receiveCSCData()

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 220 of file L1MuDTSectorReceiver.cc.

References L1MuDTDataBuffer::addTSphi(), nano_mu_digi_cff::bx, L1MuDTTrackFinder::config(), L1MuDTSectorProcessor::data(), MillePedeFileConverter_cfg::e, L1MuDTTFMasks::get_inrec_chdis_csc(), L1MuDTTFParameters::get_soc_csc_etacanc(), L1MuDTTFConfig::getCSCTrSInputTag(), L1MuDTTFConfig::getEtaCanc(), L1MuDTSectorProcessor::id(), label, m_CSCTrSToken, m_sp, msks, pars, phi, nano_mu_digi_cff::sector, L1MuDTSecProcId::sector(), ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::barrel::side(), relativeConstraints::station, nano_mu_digi_cff::subsector, makeGlobalPositionRcd_cfg::tag, L1MuDTSectorProcessor::tf(), L1MuDTSecProcId::wheel(), and makeMuonMisalignmentScenario::wheel.

Referenced by run().

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

◆ receiveDTBXData()

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 98 of file L1MuDTSectorReceiver.cc.

References funct::abs(), address2sector(), address2wheel(), L1MuDTDataBuffer::addTSphi(), nano_mu_digi_cff::bx, L1MuDTChambPhContainer::chPhiSegm1(), L1MuDTChambPhContainer::chPhiSegm2(), L1MuDTChambPhDigi::code(), L1MuDTTrackFinder::config(), L1MuDTSectorProcessor::data(), MillePedeFileConverter_cfg::e, L1MuDTTFMasks::get_inrec_chdis_st1(), L1MuDTTFMasks::get_inrec_chdis_st2(), L1MuDTTFMasks::get_inrec_chdis_st3(), L1MuDTTFMasks::get_inrec_chdis_st4(), L1MuDTTFParameters::get_soc_nbx_del(), L1MuDTTFConfig::getNbitsExtPhi(), L1MuDTTFConfig::getTSOutOfTimeFilter(), L1MuDTTFConfig::getTSOutOfTimeWindow(), L1MuDTSectorProcessor::id(), m_DTDigiToken, m_sp, msks, L1MuDTSectorProcessor::ovl(), pars, phi, L1MuDTChambPhDigi::phi(), L1MuDTChambPhDigi::phiB(), nano_mu_digi_cff::sector, L1MuDTSecProcId::sector(), relativeConstraints::station, makeGlobalPositionRcd_cfg::tag, L1MuDTSectorProcessor::tf(), tolerance, L1MuDTSecProcId::wheel(), and makeMuonMisalignmentScenario::wheel.

Referenced by run().

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

◆ reset()

void L1MuDTSectorReceiver::reset ( void  )

clear Sector Receiver

Definition at line 93 of file L1MuDTSectorReceiver.cc.

Referenced by L1MuDTSectorProcessor::reset().

93 {}

◆ run()

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 77 of file L1MuDTSectorReceiver.cc.

References nano_mu_digi_cff::bx, DummyCfis::c, L1MuDTTrackFinder::config(), MillePedeFileConverter_cfg::e, m_msksToken, m_parsToken, m_sp, msks, L1MuDTTFConfig::overlap(), L1MuDTSectorProcessor::ovl(), pars, receiveCSCData(), receiveDTBXData(), and L1MuDTSectorProcessor::tf().

Referenced by L1MuDTSectorProcessor::run().

77  {
78  pars = c.getHandle(m_parsToken);
79  msks = c.getHandle(m_msksToken);
80 
81  // get track segments from DTBX chamber trigger
82  receiveDTBXData(bx, e, c);
83 
84  // get track segments from CSC chamber trigger
85  if (m_sp.tf().config()->overlap() && m_sp.ovl()) {
86  receiveCSCData(bx, e, c);
87  }
88 }
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
const L1MuDTTrackFinder & tf() const
return reference to barrel MTTF
bool ovl() const
is it an overlap region Sector Processor?
L1MuDTSectorProcessor & m_sp
edm::ESHandle< L1MuDTTFParameters > pars
const L1MuDTTFConfig * config() const
return configuration
edm::ESGetToken< L1MuDTTFParameters, L1MuDTTFParametersRcd > m_parsToken
edm::ESHandle< L1MuDTTFMasks > msks
bool overlap() const
edm::ESGetToken< L1MuDTTFMasks, L1MuDTTFMasksRcd > m_msksToken

Member Data Documentation

◆ m_CSCTrSToken

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

Definition at line 86 of file L1MuDTSectorReceiver.h.

Referenced by receiveCSCData().

◆ m_DTDigiToken

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

Definition at line 85 of file L1MuDTSectorReceiver.h.

Referenced by receiveDTBXData().

◆ m_msksToken

edm::ESGetToken<L1MuDTTFMasks, L1MuDTTFMasksRcd> L1MuDTSectorReceiver::m_msksToken
private

Definition at line 89 of file L1MuDTSectorReceiver.h.

Referenced by run().

◆ m_parsToken

edm::ESGetToken<L1MuDTTFParameters, L1MuDTTFParametersRcd> L1MuDTSectorReceiver::m_parsToken
private

Definition at line 88 of file L1MuDTSectorReceiver.h.

Referenced by run().

◆ m_sp

L1MuDTSectorProcessor& L1MuDTSectorReceiver::m_sp
private

◆ msks

edm::ESHandle<L1MuDTTFMasks> L1MuDTSectorReceiver::msks
private

Definition at line 91 of file L1MuDTSectorReceiver.h.

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

◆ pars

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

Definition at line 90 of file L1MuDTSectorReceiver.h.

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