1 #include "../interface/MicroGMTCancelOutUnit.h"
35 std::vector<std::shared_ptr<GMTInternalMuon>> coll1;
37 std::vector<std::shared_ptr<GMTInternalMuon>> coll2;
40 if (trackFinder ==
bmtf) {
43 for (
int currentWedge = 0; currentWedge < maxWedges; ++currentWedge) {
44 for (
auto mu : wedges.at(currentWedge)) {
48 int neighbourWedge = (currentWedge + 1) % maxWedges;
49 for (
auto mu : wedges.at(neighbourWedge)) {
67 std::vector<std::shared_ptr<GMTInternalMuon>> coll1;
70 std::vector<std::shared_ptr<GMTInternalMuon>> coll2;
73 for (
int currentSector = 0; currentSector < 6; ++currentSector) {
74 for (
auto omtfMuon : omtfSectors.at(currentSector)) {
75 coll1.push_back(omtfMuon);
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);
101 std::vector<std::shared_ptr<GMTInternalMuon>> coll1;
104 std::vector<std::shared_ptr<GMTInternalMuon>> coll2;
107 for (
int curOmtfSector = 0; curOmtfSector < 6; ++curOmtfSector) {
108 for (
auto omtfMuon : omtfSectors.at(curOmtfSector)) {
109 coll1.push_back(omtfMuon);
115 for (
int i = 0;
i < 3; ++
i) {
117 int curEmtfSector = ((curOmtfSector + 5) +
i) % 6;
118 for (
auto emtfMuon : emtfSectors.at(curEmtfSector)) {
119 coll2.push_back(emtfMuon);
135 if (coll1.size() == 0 || coll2.size() == 0) {
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) {
147 int dPhi = (*mu_w1)->hwGlobalPhi() - (*mu_w2)->hwGlobalPhi();
148 if (dPhi > 338) dPhi -= 576;
150 int dEta =
std::abs((*mu_w1)->hwEta() - (*mu_w2)->hwEta());
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);
void setCancelOutBitsOverlapEndcap(GMTInternalWedges &, GMTInternalWedges &, cancelmode)
Cancel-out between overlap and endcap track finders.
void setCancelOutBitsOverlapBarrel(GMTInternalWedges &, GMTInternalWedges &, cancelmode)
Cancel-out between overlap and barrel track finders.
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...
MicroGMTCancelOutUnit(const edm::ParameterSet &)
MicroGMTMatchQualLUT m_brlSingleMatchQualLUT
int getDeltaPhiWidth() const
MicroGMTMatchQualLUT m_boPosMatchQualLUT
MicroGMTMatchQualLUT m_foNegMatchQualLUT
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...
MicroGMTMatchQualLUT m_fwdPosSingleMatchQualLUT
double dPhi(double phi1, double phi2)
MicroGMTMatchQualLUT m_ovlPosSingleMatchQualLUT
Abs< T >::type abs(const T &t)
std::map< int, MicroGMTMatchQualLUT * > m_lutDict
MicroGMTMatchQualLUT m_boNegMatchQualLUT
int lookup(int dEta, int dPhi) const
void setCancelOutBits(GMTInternalWedges &, tftype, cancelmode)
Cancel out between sectors/wedges in one track finder.
int getDeltaEtaWidth() const
MicroGMTMatchQualLUT m_fwdNegSingleMatchQualLUT
MicroGMTMatchQualLUT m_ovlNegSingleMatchQualLUT
MicroGMTMatchQualLUT m_foPosMatchQualLUT
std::map< int, std::vector< std::shared_ptr< GMTInternalMuon > > > GMTInternalWedges
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
virtual ~MicroGMTCancelOutUnit()