File indexing completed on 2024-04-06 12:21:20
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),
0024 m_phiRPCDigis(inphiRPCDigis){
0025
0026
0027 };
0028
0029 void DTLowQMatching::run(const L1TTwinMuxParams& tmParams) {
0030 m_DphiWindow = tmParams.get_DphiWindowBxShift();
0031
0032 Matching(0);
0033 Matching(1);
0034 }
0035
0036 void DTLowQMatching::Matching(int track_seg) {
0037 L1MuDTChambPhDigi* dtts = nullptr;
0038 L1MuDTChambPhDigi* rpcts1 = nullptr;
0039 L1MuTMChambPhContainer m_phiRPCDigis_tm;
0040 const std::vector<L1MuDTChambPhDigi>* phiChambVector;
0041 phiChambVector = m_phiRPCDigis.getContainer();
0042 m_phiRPCDigis_tm.setContainer(*phiChambVector);
0043
0044 L1MuTMChambPhContainer m_phiDTDigis_tm;
0045 const std::vector<L1MuDTChambPhDigi>* phiChambVectorDT;
0046 phiChambVectorDT = m_phiDTDigis->getContainer();
0047 m_phiDTDigis_tm.setContainer(*phiChambVectorDT);
0048
0049 int bx = 0, wheel = 0, sector = 0, station = 1;
0050
0051 for (wheel = -2; wheel <= 2; wheel++) {
0052 for (sector = 0; sector < 12; sector++) {
0053 for (station = 1; station <= 4; station++) {
0054 for (bx = -3; bx <= 3; bx++) {
0055 int matched = 0;
0056 for (int rpcbx = bx - 1; rpcbx <= bx + 1; rpcbx++) {
0057 dtts = nullptr;
0058 rpcts1 = nullptr;
0059 dtts = m_phiDTDigis_tm.chPhiSegm(wheel, station, sector, bx, track_seg);
0060 if (!dtts || dtts->code() >= 2)
0061 continue;
0062 int nhits = 0;
0063 nhits = DTRPCBxCorrection::nRPCHits(m_phiRPCDigis, rpcbx, wheel, sector, station);
0064 for (int hit = 0; hit < nhits; hit++) {
0065 rpcts1 = m_phiRPCDigis_tm.chPhiSegm(wheel, station, sector, rpcbx, hit);
0066
0067
0068 if (rpcts1 && DTRPCBxCorrection::deltaPhi(dtts->phi(), rpcts1->phi()) < m_DphiWindow) {
0069 matched++;
0070 continue;
0071 }
0072 }
0073 }
0074 if (matched == 0 && dtts && dtts->code() < 2) {
0075
0076 L1MuDTChambPhDigi dtts2(dtts->bxNum(),
0077 dtts->whNum(),
0078 dtts->scNum(),
0079 dtts->stNum(),
0080 dtts->phi(),
0081 dtts->phiB(),
0082 7,
0083 dtts->Ts2Tag(),
0084 dtts->BxCnt(),
0085 dtts->RpcBit());
0086 *dtts = dtts2;
0087 }
0088 }
0089 }
0090 }
0091 }
0092 }