CMS 3D CMS Logo

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)
 receive track segment data from BBMX chamber trigger More...
 

Private Attributes

edm::ESGetToken< L1TMuonBarrelParams, L1TMuonBarrelParamsRcdm_bmtfParamsToken
 
edm::EDGetTokenT< L1MuDTChambPhContainerm_DTDigiToken
 
L1MuBMSectorProcessorm_sp
 
L1MuDTTFMasks msks
 
L1MuDTTFParameters pars
 

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::L1MuBMSectorReceiver ( L1MuBMSectorProcessor sp,
edm::ConsumesCollector &&  iC 
)

constructor

Definition at line 52 of file L1MuBMSectorReceiver.cc.

53  : m_sp(sp),
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< L1MuDTChambPhContainer > m_DTDigiToken
L1MuBMSectorProcessor & m_sp
static edm::InputTag getBMDigiInputTag()
edm::ESGetToken< L1TMuonBarrelParams, L1TMuonBarrelParamsRcd > m_bmtfParamsToken

◆ ~L1MuBMSectorReceiver()

L1MuBMSectorReceiver::~L1MuBMSectorReceiver ( )
virtual

destructor

Definition at line 60 of file L1MuBMSectorReceiver.cc.

60  {
61  // reset();
62 }

Member Function Documentation

◆ address2sector()

int L1MuBMSectorReceiver::address2sector ( int  adr) const
private

find the right sector for a given address

Definition at line 228 of file L1MuBMSectorReceiver.cc.

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

Referenced by receiveBBMXData().

228  {
229  int sector = m_sp.id().sector();
230 
231  if (adr >= 4 && adr <= 7)
232  sector = (sector + 13) % 12; // +1
233  if (adr >= 8 && adr <= 11)
234  sector = (sector + 11) % 12; // -1
235 
236  return sector;
237 }
const L1MuBMSecProcId & id() const
return Sector Processor identifier
L1MuBMSectorProcessor & m_sp
int sector() const
return sector number

◆ address2wheel()

int L1MuBMSectorReceiver::address2wheel ( int  adr) const
private

find the right wheel for a given address

Definition at line 242 of file L1MuBMSectorReceiver.cc.

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

Referenced by receiveBBMXData().

242  {
243  int wheel = m_sp.id().locwheel();
244 
245  // for 2, 3, 6, 7, 10, 11
246  if ((adr / 2) % 2 == 1)
247  wheel = m_sp.id().wheel();
248 
249  return wheel;
250 }
const L1MuBMSecProcId & id() const
return Sector Processor identifier
int wheel() const
return wheel number
int locwheel() const
return physical wheel number (-2,-1,0,+1,+2)
L1MuBMSectorProcessor & m_sp

◆ receiveBBMXData()

void L1MuBMSectorReceiver::receiveBBMXData ( int  bx,
const edm::Event e 
)
private

receive track segment data from BBMX chamber trigger

Definition at line 90 of file L1MuBMSectorReceiver.cc.

References funct::abs(), address2sector(), address2wheel(), L1MuBMDataBuffer::addTSphi(), simKBmtfDigis_cfi::bx, L1MuDTChambPhContainer::chPhiSegm1(), L1MuDTChambPhContainer::chPhiSegm2(), L1MuDTChambPhDigi::code(), L1MuBMSectorProcessor::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_inrec_qual_st1(), L1MuDTTFParameters::get_inrec_qual_st2(), L1MuDTTFParameters::get_inrec_qual_st3(), L1MuDTTFParameters::get_inrec_qual_st4(), L1MuDTTFParameters::get_soc_nbx_del(), L1MuDTTFParameters::get_soc_stdis_n(), L1MuDTTFParameters::get_soc_stdis_wl(), L1MuDTTFParameters::get_soc_stdis_wr(), L1MuDTTFParameters::get_soc_stdis_zl(), L1MuDTTFParameters::get_soc_stdis_zr(), L1MuBMTFConfig::getNbitsExtPhi(), L1MuBMTFConfig::getTSOutOfTimeFilter(), L1MuBMTFConfig::getTSOutOfTimeWindow(), L1MuBMSectorProcessor::id(), m_DTDigiToken, m_sp, msks, pars, phi, L1MuDTChambPhDigi::phi(), L1MuDTChambPhDigi::phiB(), hgcalTBTopologyTester_cfi::sector, L1MuBMSecProcId::sector(), relativeConstraints::station, makeGlobalPositionRcd_cfg::tag, tolerance, L1MuBMSecProcId::wheel(), and makeMuonMisalignmentScenario::wheel.

Referenced by run().

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

clear Sector Receiver

Definition at line 85 of file L1MuBMSectorReceiver.cc.

Referenced by L1MuBMSectorProcessor::reset().

85 {}

◆ run()

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 71 of file L1MuBMSectorReceiver.cc.

References simKBmtfDigis_cfi::bx, HltBtagPostValidation_cff::c, MillePedeFileConverter_cfg::e, L1TMuonBarrelParams::l1mudttfmasks, L1TMuonBarrelParams::l1mudttfparams, m_bmtfParamsToken, msks, pars, and receiveBBMXData().

Referenced by L1MuBMSectorProcessor::run().

71  {
72  const L1TMuonBarrelParams& bmtfParams = c.getData(m_bmtfParamsToken);
73  msks = bmtfParams.l1mudttfmasks;
74  pars = bmtfParams.l1mudttfparams;
75  //pars.print();
76  //msks.print();
77 
78  // get track segments from BBMX chamber trigger
80 }
L1MuDTTFParameters l1mudttfparams
L1MuDTTFParameters pars
L1MuDTTFMasks l1mudttfmasks
void receiveBBMXData(int bx, const edm::Event &e)
receive track segment data from BBMX chamber trigger
edm::ESGetToken< L1TMuonBarrelParams, L1TMuonBarrelParamsRcd > m_bmtfParamsToken

Member Data Documentation

◆ m_bmtfParamsToken

edm::ESGetToken<L1TMuonBarrelParams, L1TMuonBarrelParamsRcd> L1MuBMSectorReceiver::m_bmtfParamsToken
private

Definition at line 80 of file L1MuBMSectorReceiver.h.

Referenced by run().

◆ m_DTDigiToken

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

Definition at line 86 of file L1MuBMSectorReceiver.h.

Referenced by receiveBBMXData().

◆ m_sp

L1MuBMSectorProcessor& L1MuBMSectorReceiver::m_sp
private

Definition at line 78 of file L1MuBMSectorReceiver.h.

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

◆ msks

L1MuDTTFMasks L1MuBMSectorReceiver::msks
private

Definition at line 81 of file L1MuBMSectorReceiver.h.

Referenced by receiveBBMXData(), and run().

◆ pars

L1MuDTTFParameters L1MuBMSectorReceiver::pars
private

Definition at line 82 of file L1MuBMSectorReceiver.h.

Referenced by receiveBBMXData(), and run().