File indexing completed on 2024-09-07 04:37:03
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include <iostream>
0013 #include <iomanip>
0014 #include <iterator>
0015
0016 #include "L1Trigger/L1TTwinMux/interface/DTLowQMatching.h"
0017 #include "L1Trigger/L1TTwinMux/interface/DTRPCBxCorrection.h"
0018 #include "L1Trigger/L1TTwinMux/interface/L1MuTMChambPhContainer.h"
0019
0020 using namespace std;
0021
0022 DTLowQMatching::DTLowQMatching(L1MuDTChambPhContainer const* inphiDTDigis, L1MuDTChambPhContainer const& inphiRPCDigis)
0023 : m_phiDTDigis(inphiDTDigis), m_phiRPCDigis(inphiRPCDigis) {}
0024
0025 void DTLowQMatching::run(const L1TTwinMuxParams& tmParams) {
0026 m_DphiWindow = tmParams.get_DphiWindowBxShift();
0027
0028 Matching(0);
0029 Matching(1);
0030 }
0031
0032 void DTLowQMatching::Matching(int track_seg) {
0033 L1MuDTChambPhDigi* dtts = nullptr;
0034 L1MuDTChambPhDigi* rpcts1 = nullptr;
0035 L1MuTMChambPhContainer m_phiRPCDigis_tm;
0036 const std::vector<L1MuDTChambPhDigi>* phiChambVector;
0037 phiChambVector = m_phiRPCDigis.getContainer();
0038 m_phiRPCDigis_tm.setContainer(*phiChambVector);
0039
0040 L1MuTMChambPhContainer m_phiDTDigis_tm;
0041 const std::vector<L1MuDTChambPhDigi>* phiChambVectorDT;
0042 phiChambVectorDT = m_phiDTDigis->getContainer();
0043 m_phiDTDigis_tm.setContainer(*phiChambVectorDT);
0044
0045 int bx = 0, wheel = 0, sector = 0, station = 1;
0046
0047 for (wheel = -2; wheel <= 2; wheel++) {
0048 for (sector = 0; sector < 12; sector++) {
0049 for (station = 1; station <= 4; station++) {
0050 for (bx = -3; bx <= 3; bx++) {
0051 int matched = 0;
0052 for (int rpcbx = bx - 1; rpcbx <= bx + 1; rpcbx++) {
0053 dtts = nullptr;
0054 rpcts1 = nullptr;
0055 dtts = m_phiDTDigis_tm.chPhiSegm(wheel, station, sector, bx, track_seg);
0056 if (!dtts || dtts->code() >= 2)
0057 continue;
0058 int nhits = 0;
0059 nhits = DTRPCBxCorrection::nRPCHits(m_phiRPCDigis, rpcbx, wheel, sector, station);
0060 for (int hit = 0; hit < nhits; hit++) {
0061 rpcts1 = m_phiRPCDigis_tm.chPhiSegm(wheel, station, sector, rpcbx, hit);
0062
0063
0064 if (rpcts1 && DTRPCBxCorrection::deltaPhi(dtts->phi(), rpcts1->phi()) < m_DphiWindow) {
0065 matched++;
0066 continue;
0067 }
0068 }
0069 }
0070 if (matched == 0 && dtts && dtts->code() < 2) {
0071
0072 L1MuDTChambPhDigi dtts2(dtts->bxNum(),
0073 dtts->whNum(),
0074 dtts->scNum(),
0075 dtts->stNum(),
0076 dtts->phi(),
0077 dtts->phiB(),
0078 7,
0079 dtts->Ts2Tag(),
0080 dtts->BxCnt(),
0081 dtts->RpcBit());
0082 *dtts = dtts2;
0083 }
0084 }
0085 }
0086 }
0087 }
0088 }