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
l1t::MicroGMTCancelOutUnit Class Reference

#include <MicroGMTCancelOutUnit.h>

Public Member Functions

 MicroGMTCancelOutUnit (const edm::ParameterSet &)
 
void setCancelOutBits (GMTInternalWedges &, tftype, cancelmode)
 Cancel out between sectors/wedges in one track finder. More...
 
void setCancelOutBitsOverlapBarrel (GMTInternalWedges &, GMTInternalWedges &, cancelmode)
 Cancel-out between overlap and barrel track finders. More...
 
void setCancelOutBitsOverlapEndcap (GMTInternalWedges &, GMTInternalWedges &, cancelmode)
 Cancel-out between overlap and endcap track finders. More...
 
virtual ~MicroGMTCancelOutUnit ()
 

Private Member Functions

void getCoordinateCancelBits (std::vector< std::shared_ptr< GMTInternalMuon >> &, std::vector< std::shared_ptr< GMTInternalMuon >> &)
 Compares all muons from coll1 with all muons from coll2 and sets the cancel-bits based on eta/phi coordinates. More...
 
void getTrackAddrCancelBits (std::vector< std::shared_ptr< GMTInternalMuon >> &, std::vector< std::shared_ptr< GMTInternalMuon >> &)
 Compares all muons from coll1 with all muons from coll2 and sets the cancel-bits based on track addresses. More...
 

Private Attributes

MicroGMTMatchQualLUT m_boNegMatchQualLUT
 
MicroGMTMatchQualLUT m_boPosMatchQualLUT
 
MicroGMTMatchQualLUT m_brlSingleMatchQualLUT
 
MicroGMTMatchQualLUT m_foNegMatchQualLUT
 
MicroGMTMatchQualLUT m_foPosMatchQualLUT
 
MicroGMTMatchQualLUT m_fwdNegSingleMatchQualLUT
 
MicroGMTMatchQualLUT m_fwdPosSingleMatchQualLUT
 
std::map< int,
MicroGMTMatchQualLUT * > 
m_lutDict
 
MicroGMTMatchQualLUT m_ovlNegSingleMatchQualLUT
 
MicroGMTMatchQualLUT m_ovlPosSingleMatchQualLUT
 

Detailed Description

Definition at line 12 of file MicroGMTCancelOutUnit.h.

Constructor & Destructor Documentation

l1t::MicroGMTCancelOutUnit::MicroGMTCancelOutUnit ( const edm::ParameterSet iConfig)
explicit

Definition at line 5 of file MicroGMTCancelOutUnit.cc.

References l1t::bmtf, l1t::emtf_neg, l1t::emtf_pos, m_boNegMatchQualLUT, m_boPosMatchQualLUT, m_brlSingleMatchQualLUT, m_foNegMatchQualLUT, m_foPosMatchQualLUT, m_fwdNegSingleMatchQualLUT, m_fwdPosSingleMatchQualLUT, m_lutDict, m_ovlNegSingleMatchQualLUT, m_ovlPosSingleMatchQualLUT, l1t::omtf_neg, and l1t::omtf_pos.

5  :
10  m_brlSingleMatchQualLUT(iConfig, "BrlSingle", cancel_t::bmtf_bmtf),
11  m_ovlPosSingleMatchQualLUT(iConfig, "OvlPosSingle", cancel_t::omtf_omtf_pos),
12  m_ovlNegSingleMatchQualLUT(iConfig, "OvlNegSingle", cancel_t::omtf_omtf_neg),
13  m_fwdPosSingleMatchQualLUT(iConfig, "FwdPosSingle", cancel_t::emtf_emtf_pos),
14  m_fwdNegSingleMatchQualLUT(iConfig, "FwdNegSingle", cancel_t::emtf_emtf_neg)
15  {
25 }
MicroGMTMatchQualLUT m_brlSingleMatchQualLUT
MicroGMTMatchQualLUT m_boPosMatchQualLUT
MicroGMTMatchQualLUT m_foNegMatchQualLUT
MicroGMTMatchQualLUT m_fwdPosSingleMatchQualLUT
MicroGMTMatchQualLUT m_ovlPosSingleMatchQualLUT
std::map< int, MicroGMTMatchQualLUT * > m_lutDict
MicroGMTMatchQualLUT m_boNegMatchQualLUT
MicroGMTMatchQualLUT m_fwdNegSingleMatchQualLUT
MicroGMTMatchQualLUT m_ovlNegSingleMatchQualLUT
MicroGMTMatchQualLUT m_foPosMatchQualLUT
l1t::MicroGMTCancelOutUnit::~MicroGMTCancelOutUnit ( )
virtual

Definition at line 27 of file MicroGMTCancelOutUnit.cc.

28 {
29 
30 }

Member Function Documentation

void l1t::MicroGMTCancelOutUnit::getCoordinateCancelBits ( std::vector< std::shared_ptr< GMTInternalMuon >> &  coll1,
std::vector< std::shared_ptr< GMTInternalMuon >> &  coll2 
)
private

Compares all muons from coll1 with all muons from coll2 and sets the cancel-bits based on eta/phi coordinates.

Definition at line 133 of file MicroGMTCancelOutUnit.cc.

References funct::abs(), dPhi(), l1t::MicroGMTMatchQualLUT::getDeltaEtaWidth(), l1t::MicroGMTMatchQualLUT::getDeltaPhiWidth(), l1t::MicroGMTMatchQualLUT::lookup(), m_lutDict, and match().

Referenced by setCancelOutBits(), setCancelOutBitsOverlapBarrel(), and setCancelOutBitsOverlapEndcap().

134 {
135  if (coll1.size() == 0 || coll2.size() == 0) {
136  return;
137  }
138  MicroGMTMatchQualLUT* matchLUT = m_lutDict.at((*coll1.begin())->trackFinderType()+(*coll2.begin())->trackFinderType()*10);
139 
140  for (auto mu_w1 = coll1.begin(); mu_w1 != coll1.end(); ++mu_w1) {
141  for (auto mu_w2 = coll2.begin(); mu_w2 != coll2.end(); ++mu_w2) {
142  // The LUT for cancellation takes reduced width phi and eta, we need the LSBs
143  int dPhiMask = (1 << matchLUT->getDeltaPhiWidth()) - 1;
144  int dEtaMask = (1 << matchLUT->getDeltaEtaWidth()) - 1;
145 
146  // temporary fix to take processor offset into account...
147  int dPhi = (*mu_w1)->hwGlobalPhi() - (*mu_w2)->hwGlobalPhi();
148  if (dPhi > 338) dPhi -= 576; // shifts dPhi to [-pi, pi) in integer scale
149  dPhi = std::abs(dPhi);
150  int dEta = std::abs((*mu_w1)->hwEta() - (*mu_w2)->hwEta());
151  // check first if the delta is within the LSBs that the LUT takes, otherwise the distance
152  // is greater than what we want to cancel -> 15(int) is max => 15*0.01 = 0.15 (rad)
153  if (dEta < 15 && dPhi < 15) {
154  int match = matchLUT->lookup(dEta & dEtaMask, dPhi & dPhiMask);
155  if((*mu_w1)->hwPt() < (*mu_w2)->hwPt() && match == 1) {
156  (*mu_w2)->setHwCancelBit(1);
157  } else if (match == 1) {
158  (*mu_w1)->setHwCancelBit(1);
159  }
160  }
161  }
162  }
163 }
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::map< int, MicroGMTMatchQualLUT * > m_lutDict
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
void l1t::MicroGMTCancelOutUnit::getTrackAddrCancelBits ( std::vector< std::shared_ptr< GMTInternalMuon >> &  coll1,
std::vector< std::shared_ptr< GMTInternalMuon >> &  coll2 
)
private

Compares all muons from coll1 with all muons from coll2 and sets the cancel-bits based on track addresses.

Definition at line 166 of file MicroGMTCancelOutUnit.cc.

Referenced by setCancelOutBits(), setCancelOutBitsOverlapBarrel(), and setCancelOutBitsOverlapEndcap().

167 {
168  // not entirely clear how to do.. just a hook for now
169 }
void l1t::MicroGMTCancelOutUnit::setCancelOutBits ( GMTInternalWedges wedges,
tftype  trackFinder,
cancelmode  mode 
)

Cancel out between sectors/wedges in one track finder.

Definition at line 33 of file MicroGMTCancelOutUnit.cc.

References l1t::bmtf, l1t::coordinate, getCoordinateCancelBits(), getTrackAddrCancelBits(), and RPCpg::mu.

Referenced by L1TMicroGMTProducer::produce().

34 {
35  std::vector<std::shared_ptr<GMTInternalMuon>> coll1;
36  coll1.reserve(3);
37  std::vector<std::shared_ptr<GMTInternalMuon>> coll2;
38  coll2.reserve(3);
39  int maxWedges = 6;
40  if (trackFinder == bmtf) {
41  maxWedges = 12;
42  }
43  for (int currentWedge = 0; currentWedge < maxWedges; ++currentWedge) {
44  for (auto mu : wedges.at(currentWedge)) {
45  coll1.push_back(mu);
46  }
47  // handle wrap around: max "wedge" has to be compared to first "wedge"
48  int neighbourWedge = (currentWedge + 1) % maxWedges;
49  for (auto mu : wedges.at(neighbourWedge)) {
50  coll2.push_back(mu);
51  }
53  getCoordinateCancelBits(coll1, coll2);
54  } else {
55  getTrackAddrCancelBits(coll1, coll2);
56  }
57 
58  coll1.clear();
59  coll2.clear();
60  }
61 }
void getTrackAddrCancelBits(std::vector< std::shared_ptr< GMTInternalMuon >> &, std::vector< std::shared_ptr< GMTInternalMuon >> &)
Compares all muons from coll1 with all muons from coll2 and sets the cancel-bits based on track addre...
void getCoordinateCancelBits(std::vector< std::shared_ptr< GMTInternalMuon >> &, std::vector< std::shared_ptr< GMTInternalMuon >> &)
Compares all muons from coll1 with all muons from coll2 and sets the cancel-bits based on eta/phi coo...
const int mu
Definition: Constants.h:22
void l1t::MicroGMTCancelOutUnit::setCancelOutBitsOverlapBarrel ( GMTInternalWedges omtfSectors,
GMTInternalWedges bmtfWedges,
cancelmode  mode 
)

Cancel-out between overlap and barrel track finders.

Definition at line 64 of file MicroGMTCancelOutUnit.cc.

References l1t::coordinate, getCoordinateCancelBits(), getTrackAddrCancelBits(), and i.

Referenced by L1TMicroGMTProducer::produce().

65 {
66  // overlap sector collection
67  std::vector<std::shared_ptr<GMTInternalMuon>> coll1;
68  coll1.reserve(3);
69  // barrel wedge collection with 4 wedges
70  std::vector<std::shared_ptr<GMTInternalMuon>> coll2;
71  coll2.reserve(12);
72 
73  for (int currentSector = 0; currentSector < 6; ++currentSector) {
74  for (auto omtfMuon : omtfSectors.at(currentSector)) {
75  coll1.push_back(omtfMuon);
76  }
77  // BMTF | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 0 |
78  // OMTF | 0 | 1 | 2 | 3 | 4 | 5 |
79  // cancel OMTF sector x with corresponding BMTF wedge + the two on either side;
80  // e.g. OMTF 0 with BMTF 0, 1, 2, 3, OMTF 2 with BMTF 4, 5, 6, 7 etc.
81  for (int i = 0; i < 4; ++i) {
82  int currentWedge = (currentSector * 2 + i) % 12;
83  for (auto bmtfMuon : bmtfWedges.at(currentWedge)) {
84  coll2.push_back(bmtfMuon);
85  }
86  }
88  getCoordinateCancelBits(coll1, coll2);
89  } else {
90  getTrackAddrCancelBits(coll1, coll2);
91  }
92  coll1.clear();
93  coll2.clear();
94  }
95 }
int i
Definition: DBlmapReader.cc:9
void getTrackAddrCancelBits(std::vector< std::shared_ptr< GMTInternalMuon >> &, std::vector< std::shared_ptr< GMTInternalMuon >> &)
Compares all muons from coll1 with all muons from coll2 and sets the cancel-bits based on track addre...
void getCoordinateCancelBits(std::vector< std::shared_ptr< GMTInternalMuon >> &, std::vector< std::shared_ptr< GMTInternalMuon >> &)
Compares all muons from coll1 with all muons from coll2 and sets the cancel-bits based on eta/phi coo...
void l1t::MicroGMTCancelOutUnit::setCancelOutBitsOverlapEndcap ( GMTInternalWedges omtfSectors,
GMTInternalWedges emtfSectors,
cancelmode  mode 
)

Cancel-out between overlap and endcap track finders.

Definition at line 98 of file MicroGMTCancelOutUnit.cc.

References l1t::coordinate, getCoordinateCancelBits(), getTrackAddrCancelBits(), and i.

Referenced by L1TMicroGMTProducer::produce().

99 {
100  // overlap sector collection
101  std::vector<std::shared_ptr<GMTInternalMuon>> coll1;
102  coll1.reserve(3);
103  // endcap sector collection with 3 sectors
104  std::vector<std::shared_ptr<GMTInternalMuon>> coll2;
105  coll2.reserve(9);
106 
107  for (int curOmtfSector = 0; curOmtfSector < 6; ++curOmtfSector) {
108  for (auto omtfMuon : omtfSectors.at(curOmtfSector)) {
109  coll1.push_back(omtfMuon);
110  }
111  // OMTF | 0 | 1 | 2 | 3 | 4 | 5 |
112  // EMTF | 0 | 1 | 2 | 3 | 4 | 5 |
113  // cancel OMTF sector x with corresponding EMTF sector + the ones on either side;
114  // e.g. OMTF 1 with EMTF 0, 1, 2; OMTF 0 with EMTF 5, 0, 1 etc.
115  for (int i = 0; i < 3; ++i) {
116  // handling the wrap around: adding 5 because 0 has to be compared to 5
117  int curEmtfSector = ((curOmtfSector + 5) + i) % 6;
118  for (auto emtfMuon : emtfSectors.at(curEmtfSector)) {
119  coll2.push_back(emtfMuon);
120  }
121  }
122  if (mode == cancelmode::coordinate) {
123  getCoordinateCancelBits(coll1, coll2);
124  } else {
125  getTrackAddrCancelBits(coll1, coll2);
126  }
127  coll1.clear();
128  coll2.clear();
129  }
130 }
int i
Definition: DBlmapReader.cc:9
void getTrackAddrCancelBits(std::vector< std::shared_ptr< GMTInternalMuon >> &, std::vector< std::shared_ptr< GMTInternalMuon >> &)
Compares all muons from coll1 with all muons from coll2 and sets the cancel-bits based on track addre...
void getCoordinateCancelBits(std::vector< std::shared_ptr< GMTInternalMuon >> &, std::vector< std::shared_ptr< GMTInternalMuon >> &)
Compares all muons from coll1 with all muons from coll2 and sets the cancel-bits based on eta/phi coo...

Member Data Documentation

MicroGMTMatchQualLUT l1t::MicroGMTCancelOutUnit::m_boNegMatchQualLUT
private

Definition at line 29 of file MicroGMTCancelOutUnit.h.

Referenced by MicroGMTCancelOutUnit().

MicroGMTMatchQualLUT l1t::MicroGMTCancelOutUnit::m_boPosMatchQualLUT
private

Definition at line 28 of file MicroGMTCancelOutUnit.h.

Referenced by MicroGMTCancelOutUnit().

MicroGMTMatchQualLUT l1t::MicroGMTCancelOutUnit::m_brlSingleMatchQualLUT
private

Definition at line 32 of file MicroGMTCancelOutUnit.h.

Referenced by MicroGMTCancelOutUnit().

MicroGMTMatchQualLUT l1t::MicroGMTCancelOutUnit::m_foNegMatchQualLUT
private

Definition at line 31 of file MicroGMTCancelOutUnit.h.

Referenced by MicroGMTCancelOutUnit().

MicroGMTMatchQualLUT l1t::MicroGMTCancelOutUnit::m_foPosMatchQualLUT
private

Definition at line 30 of file MicroGMTCancelOutUnit.h.

Referenced by MicroGMTCancelOutUnit().

MicroGMTMatchQualLUT l1t::MicroGMTCancelOutUnit::m_fwdNegSingleMatchQualLUT
private

Definition at line 36 of file MicroGMTCancelOutUnit.h.

Referenced by MicroGMTCancelOutUnit().

MicroGMTMatchQualLUT l1t::MicroGMTCancelOutUnit::m_fwdPosSingleMatchQualLUT
private

Definition at line 35 of file MicroGMTCancelOutUnit.h.

Referenced by MicroGMTCancelOutUnit().

std::map<int, MicroGMTMatchQualLUT*> l1t::MicroGMTCancelOutUnit::m_lutDict
private

Definition at line 37 of file MicroGMTCancelOutUnit.h.

Referenced by getCoordinateCancelBits(), and MicroGMTCancelOutUnit().

MicroGMTMatchQualLUT l1t::MicroGMTCancelOutUnit::m_ovlNegSingleMatchQualLUT
private

Definition at line 34 of file MicroGMTCancelOutUnit.h.

Referenced by MicroGMTCancelOutUnit().

MicroGMTMatchQualLUT l1t::MicroGMTCancelOutUnit::m_ovlPosSingleMatchQualLUT
private

Definition at line 33 of file MicroGMTCancelOutUnit.h.

Referenced by MicroGMTCancelOutUnit().