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
 
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 54 of file L1MuDTSectorReceiver.h.

Constructor & Destructor Documentation

◆ L1MuDTSectorReceiver()

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

◆ ~L1MuDTSectorReceiver()

L1MuDTSectorReceiver::~L1MuDTSectorReceiver ( )
virtual

destructor

Definition at line 64 of file L1MuDTSectorReceiver.cc.

64  {
65  // reset();
66 }

Member Function Documentation

◆ address2sector()

int L1MuDTSectorReceiver::address2sector ( int  adr) const
private

find the right sector for a given address

Definition at line 304 of file L1MuDTSectorReceiver.cc.

304  {
305  int sector = m_sp.id().sector();
306 
307  if (adr >= 4 && adr <= 7)
308  sector = (sector + 13) % 12; // +1
309  if (adr >= 8 && adr <= 11)
310  sector = (sector + 11) % 12; // -1
311 
312  return sector;
313 }

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

Referenced by receiveDTBXData().

◆ address2wheel()

int L1MuDTSectorReceiver::address2wheel ( int  adr) const
private

find the right wheel for a given address

Definition at line 318 of file L1MuDTSectorReceiver.cc.

318  {
319  int wheel = m_sp.id().locwheel();
320 
321  // for 2, 3, 6, 7, 10, 11
322  if ((adr / 2) % 2 == 1)
323  wheel = m_sp.id().wheel();
324 
325  return wheel;
326 }

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

Referenced by receiveDTBXData().

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

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

References L1MuDTDataBuffer::addTSphi(), l1GtPatternGenerator_cfi::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, L1MuDTSecProcId::sector(), relativeConstraints::station, makeGlobalPositionRcd_cfg::tag, L1MuDTSectorProcessor::tf(), L1MuDTSecProcId::wheel(), and makeMuonMisalignmentScenario::wheel.

Referenced by run().

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

96  {
98  e.getByToken(m_DTDigiToken, dttrig);
99 
100  L1MuDTChambPhDigi const* ts = nullptr;
101 
102  // const int bx_offset = dttrig->correctBX();
103  int bx_offset = 0;
104  bx = bx + bx_offset;
105 
106  // get DTBX phi track segments
107  int address = 0;
108  for (int station = 1; station <= 4; station++) {
109  int max_address = (station == 1) ? 2 : 12;
110  for (int reladr = 0; reladr < max_address; reladr++) {
111  address++;
112  if (m_sp.ovl() && (reladr / 2) % 2 != 0)
113  continue;
114  int wheel = address2wheel(reladr);
115  int sector = address2sector(reladr);
116  if (reladr % 2 == 0)
117  ts = dttrig->chPhiSegm1(wheel, station, sector, bx);
118  if (reladr % 2 == 1)
119  ts = dttrig->chPhiSegm2(wheel, station, sector, bx);
120  if (ts) {
121  int phi = ts->phi();
122  int phib = ts->phiB();
123  int qual = ts->code();
124  bool tag = (reladr % 2 == 1) ? true : false;
125 
126  int lwheel = m_sp.id().wheel();
127  lwheel = abs(lwheel) / lwheel * (abs(wheel) + 1);
128 
129  if (station == 1) {
130  if (msks->get_inrec_chdis_st1(lwheel, sector))
131  continue;
132  if (qual < pars->get_inrec_qual_st1(lwheel, sector))
133  continue;
134  } else if (station == 2) {
135  if (msks->get_inrec_chdis_st2(lwheel, sector))
136  continue;
137  if (qual < pars->get_inrec_qual_st2(lwheel, sector))
138  continue;
139  } else if (station == 3) {
140  if (msks->get_inrec_chdis_st3(lwheel, sector))
141  continue;
142  if (qual < pars->get_inrec_qual_st3(lwheel, sector))
143  continue;
144  } else if (station == 4) {
145  if (msks->get_inrec_chdis_st4(lwheel, sector))
146  continue;
147  if (qual < pars->get_inrec_qual_st4(lwheel, sector))
148  continue;
149  }
150 
151  if (reladr / 2 == 1 && qual < pars->get_soc_stdis_n(m_sp.id().wheel(), m_sp.id().sector()))
152  continue;
153  if (reladr / 2 == 2 && qual < pars->get_soc_stdis_wl(m_sp.id().wheel(), m_sp.id().sector()))
154  continue;
155  if (reladr / 2 == 3 && qual < pars->get_soc_stdis_zl(m_sp.id().wheel(), m_sp.id().sector()))
156  continue;
157  if (reladr / 2 == 4 && qual < pars->get_soc_stdis_wr(m_sp.id().wheel(), m_sp.id().sector()))
158  continue;
159  if (reladr / 2 == 5 && qual < pars->get_soc_stdis_zr(m_sp.id().wheel(), m_sp.id().sector()))
160  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 (m_sp.tf().config()->getTSOutOfTimeFilter() || nbx_del) {
169  int sh_phi = 12 - m_sp.tf().config()->getNbitsExtPhi();
171 
172  L1MuDTChambPhDigi const* tsPreviousBX_1 = dttrig->chPhiSegm1(wheel, station, sector, bx - 1);
173  if (tsPreviousBX_1) {
174  int phiBX = tsPreviousBX_1->phi();
175  int qualBX = tsPreviousBX_1->code();
176  if (abs((phi >> sh_phi) - (phiBX >> sh_phi)) <= tolerance && qualBX > qual)
177  skipTS = true;
178  }
179 
180  L1MuDTChambPhDigi const* tsPreviousBX_2 = dttrig->chPhiSegm2(wheel, station, sector, bx - 1);
181  if (tsPreviousBX_2) {
182  int phiBX = tsPreviousBX_2->phi();
183  int qualBX = tsPreviousBX_2->code();
184  if (abs((phi >> sh_phi) - (phiBX >> sh_phi)) <= tolerance && qualBX > qual)
185  skipTS = true;
186  }
187 
188  L1MuDTChambPhDigi const* tsNextBX_1 = dttrig->chPhiSegm1(wheel, station, sector, bx + 1);
189  if (tsNextBX_1) {
190  int phiBX = tsNextBX_1->phi();
191  int qualBX = tsNextBX_1->code();
192  if (abs((phi >> sh_phi) - (phiBX >> sh_phi)) <= tolerance && qualBX > qual)
193  skipTS = true;
194  }
195 
196  L1MuDTChambPhDigi const* tsNextBX_2 = dttrig->chPhiSegm2(wheel, station, sector, bx + 1);
197  if (tsNextBX_2) {
198  int phiBX = tsNextBX_2->phi();
199  int qualBX = tsNextBX_2->code();
200  if (abs((phi >> sh_phi) - (phiBX >> sh_phi)) <= tolerance && qualBX > qual)
201  skipTS = true;
202  }
203  }
204 
205  if (!skipTS) {
206  L1MuDTTrackSegPhi tmpts(
207  wheel, sector, station, phi, phib, static_cast<L1MuDTTrackSegPhi::TSQuality>(qual), tag, bx - bx_offset);
208  m_sp.data()->addTSphi(address - 1, tmpts);
209  }
210  }
211  }
212  }
213 }

References funct::abs(), address2sector(), address2wheel(), L1MuDTDataBuffer::addTSphi(), l1GtPatternGenerator_cfi::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(), L1MuDTSecProcId::sector(), relativeConstraints::station, makeGlobalPositionRcd_cfg::tag, L1MuDTSectorProcessor::tf(), tolerance, L1MuDTSecProcId::wheel(), and makeMuonMisalignmentScenario::wheel.

Referenced by run().

◆ reset()

void L1MuDTSectorReceiver::reset ( void  )

clear Sector Receiver

Definition at line 91 of file L1MuDTSectorReceiver.cc.

91 {}

Referenced by L1MuDTSectorProcessor::reset().

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

75  {
77  c.get<L1MuDTTFMasksRcd>().get(msks);
78 
79  // get track segments from DTBX chamber trigger
80  receiveDTBXData(bx, e, c);
81 
82  // get track segments from CSC chamber trigger
83  if (m_sp.tf().config()->overlap() && m_sp.ovl()) {
84  receiveCSCData(bx, e, c);
85  }
86 }

References l1GtPatternGenerator_cfi::bx, c, L1MuDTTrackFinder::config(), MillePedeFileConverter_cfg::e, get, m_sp, msks, L1MuDTTFConfig::overlap(), L1MuDTSectorProcessor::ovl(), pars, receiveCSCData(), receiveDTBXData(), and L1MuDTSectorProcessor::tf().

Referenced by L1MuDTSectorProcessor::run().

Member Data Documentation

◆ m_CSCTrSToken

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

Definition at line 84 of file L1MuDTSectorReceiver.h.

Referenced by receiveCSCData().

◆ m_DTDigiToken

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

Definition at line 83 of file L1MuDTSectorReceiver.h.

Referenced by receiveDTBXData().

◆ m_sp

L1MuDTSectorProcessor& L1MuDTSectorReceiver::m_sp
private

◆ msks

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

Definition at line 87 of file L1MuDTSectorReceiver.h.

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

◆ pars

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

Definition at line 86 of file L1MuDTSectorReceiver.h.

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

L1MuDTSectorProcessor::ovl
bool ovl() const
is it an overlap region Sector Processor?
Definition: L1MuDTSectorProcessor.h:83
L1MuDTTFConfig::getTSOutOfTimeWindow
int getTSOutOfTimeWindow() const
Definition: L1MuDTTFConfig.h:66
L1MuDTSectorReceiver::m_sp
L1MuDTSectorProcessor & m_sp
Definition: L1MuDTSectorReceiver.h:82
L1MuDTChambPhContainer::chPhiSegm1
L1MuDTChambPhDigi const * chPhiSegm1(int wheel, int stat, int sect, int bx) const
Definition: L1MuDTChambPhContainer.cc:67
L1MuDTTFParameters::get_soc_nbx_del
bool get_soc_nbx_del(int wh, int sc) const
Definition: L1MuDTTFParameters.cc:246
L1MuDTTFMasks::get_inrec_chdis_st1
bool get_inrec_chdis_st1(int wh, int sc) const
Definition: L1MuDTTFMasks.cc:69
L1MuDTTFConfig::getTSOutOfTimeFilter
bool getTSOutOfTimeFilter() const
Definition: L1MuDTTFConfig.h:65
relativeConstraints.station
station
Definition: relativeConstraints.py:67
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
L1MuDTTFMasksRcd
Definition: L1MuDTTFMasksRcd.h:10
L1MuDTTFConfig::overlap
bool overlap() const
Definition: L1MuDTTFConfig.h:59
edm::Handle
Definition: AssociativeIterator.h:50
L1MuDTChambPhDigi::phiB
int phiB() const
Definition: L1MuDTChambPhDigi.cc:76
L1MuDTSectorProcessor::tf
const L1MuDTTrackFinder & tf() const
return reference to barrel MTTF
Definition: L1MuDTSectorProcessor.h:77
L1MuDTChambPhContainer
Definition: L1MuDTChambPhContainer.h:33
L1MuDTSecProcId::locwheel
int locwheel() const
return physical wheel number (-2,-1,0,+1,+2)
Definition: L1MuDTSecProcId.cc:79
L1MuDTSectorReceiver::receiveCSCData
void receiveCSCData(int bx, const edm::Event &e, const edm::EventSetup &c)
receive track segment data from CSC chamber trigger
Definition: L1MuDTSectorReceiver.cc:218
L1MuDTSectorReceiver::receiveDTBXData
void receiveDTBXData(int bx, const edm::Event &e, const edm::EventSetup &c)
receive track segment data from DTBX chamber trigger
Definition: L1MuDTSectorReceiver.cc:96
L1MuDTSectorProcessor::id
const L1MuDTSecProcId & id() const
return Sector Processor identifier
Definition: L1MuDTSectorProcessor.h:74
L1MuDTSectorReceiver::address2wheel
int address2wheel(int adr) const
find the right wheel for a given address
Definition: L1MuDTSectorReceiver.cc:318
L1MuDTDataBuffer::addTSphi
void addTSphi(int adr, const L1MuDTTrackSegPhi &)
add new phi track segment to the Data Buffer
Definition: L1MuDTDataBuffer.cc:85
L1MuDTTFConfig::getCSCTrSInputTag
edm::InputTag getCSCTrSInputTag() const
Definition: L1MuDTTFConfig.h:47
L1MuDTSectorReceiver::pars
edm::ESHandle< L1MuDTTFParameters > pars
Definition: L1MuDTSectorReceiver.h:86
L1MuDTChambPhDigi::phi
int phi() const
Definition: L1MuDTChambPhDigi.cc:74
L1MuDTSecProcId::wheel
int wheel() const
return wheel number
Definition: L1MuDTSecProcId.h:55
L1MuDTSectorProcessor::data
const L1MuDTDataBuffer * data() const
return pointer to Data Buffer
Definition: L1MuDTSectorProcessor.h:86
L1MuDTTFMasks::get_inrec_chdis_st2
bool get_inrec_chdis_st2(int wh, int sc) const
Definition: L1MuDTTFMasks.cc:81
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
L1MuDTTFConfig::getEtaCanc
bool getEtaCanc() const
Definition: L1MuDTTFConfig.h:64
L1MuDTTFMasks::get_inrec_chdis_st3
bool get_inrec_chdis_st3(int wh, int sc) const
Definition: L1MuDTTFMasks.cc:93
L1MuDTTFConfig::getNbitsExtPhi
int getNbitsExtPhi() const
Definition: L1MuDTTFConfig.h:67
L1MuDTSecProcId::sector
int sector() const
return sector number
Definition: L1MuDTSecProcId.h:58
makeGlobalPositionRcd_cfg.tag
tag
Definition: makeGlobalPositionRcd_cfg.py:6
L1MuDTChambPhContainer::chPhiSegm2
L1MuDTChambPhDigi const * chPhiSegm2(int wheel, int stat, int sect, int bx) const
Definition: L1MuDTChambPhContainer.cc:78
edm::ConsumesCollector::mayConsume
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
Definition: ConsumesCollector.h:72
L1MuDTTFParameters::get_soc_csc_etacanc
bool get_soc_csc_etacanc(int wh, int sc) const
Definition: L1MuDTTFParameters.cc:258
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
L1MuDTTFConfig::getDTDigiInputTag
edm::InputTag getDTDigiInputTag() const
Definition: L1MuDTTFConfig.h:46
tolerance
const double tolerance
Definition: HGCalGeomParameters.cc:29
L1MuDTTrackFinder::config
static L1MuDTTFConfig * config()
return configuration
Definition: L1MuDTTrackFinder.h:102
get
#define get
L1MuDTTFMasks::get_inrec_chdis_st4
bool get_inrec_chdis_st4(int wh, int sc) const
Definition: L1MuDTTFMasks.cc:105
L1MuDTSectorReceiver::m_DTDigiToken
edm::EDGetTokenT< L1MuDTChambPhContainer > m_DTDigiToken
Definition: L1MuDTSectorReceiver.h:83
L1MuDTSectorReceiver::msks
edm::ESHandle< L1MuDTTFMasks > msks
Definition: L1MuDTSectorReceiver.h:87
DDAxes::phi
L1MuDTSectorReceiver::m_CSCTrSToken
edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > m_CSCTrSToken
Definition: L1MuDTSectorReceiver.h:84
CSCTriggerContainer< csctf::TrackStub >
L1MuDTSectorReceiver::address2sector
int address2sector(int adr) const
find the right sector for a given address
Definition: L1MuDTSectorReceiver.cc:304
L1MuDTTrackSegPhi
Definition: L1MuDTTrackSegPhi.h:36
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
L1MuDTTFMasks::get_inrec_chdis_csc
bool get_inrec_chdis_csc(int wh, int sc) const
Definition: L1MuDTTFMasks.cc:117
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
L1MuDTChambPhDigi::code
int code() const
Definition: L1MuDTChambPhDigi.cc:78
label
const char * label
Definition: PFTauDecayModeTools.cc:11
L1MuDTChambPhDigi
Definition: L1MuDTChambPhDigi.h:31
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
L1MuDTTFParametersRcd
Definition: L1MuDTTFParametersRcd.h:10