File indexing completed on 2024-04-06 12:21:40
0001
0002 #include "L1Trigger/RPCTrigger/interface/RPCFinalSorter.h"
0003
0004 #include "L1Trigger/RPCTrigger/interface/RPCConst.h"
0005 #include "L1Trigger/RPCTrigger/interface/MuonsGrabber.h"
0006 #include <algorithm>
0007
0008 #include <set>
0009 using namespace std;
0010
0011
0012
0013
0014
0015
0016 RPCFinalSorter::RPCFinalSorter(RPCTriggerConfiguration *triggerConfig) {
0017 m_TrigCnfg = triggerConfig;
0018 m_GBOutputMuons.assign(2, L1RpcTBMuonsVec());
0019 }
0020
0021
0022
0023
0024
0025
0026 L1RpcTBMuonsVec2 RPCFinalSorter::run(L1RpcTBMuonsVec2 &tcsMuonsVec2) {
0027
0028
0029
0030 runFinalSorter(tcsMuonsVec2);
0031
0032 if (m_TrigCnfg->getDebugLevel() != 0) {
0033 for (unsigned int region = 0; region < tcsMuonsVec2.size(); ++region) {
0034 for (unsigned int iTB = 0; iTB < tcsMuonsVec2[region].size(); iTB++) {
0035 #ifndef _STAND_ALONE
0036
0037
0038
0039 MuonsGrabber::Instance().addMuon(tcsMuonsVec2[region][iTB], 4, region, 0, iTB);
0040 #else
0041 std::cout << "GB 4" << region << "0 " << iTB << " "
0042 << tcsMuonsVec2[region][iTB].printDebugInfo(m_TrigCnfg->getDebugLevel()) << std::endl;
0043 #endif
0044 }
0045 }
0046 }
0047
0048 return tcsMuonsVec2;
0049 }
0050
0051
0052
0053
0054
0055 void RPCFinalSorter::runFinalSorter(L1RpcTBMuonsVec2 &finalMuons) {
0056
0057 sort(finalMuons[0].begin(), finalMuons[0].end(), RPCTBMuon::TMuonMore());
0058 sort(finalMuons[1].begin(), finalMuons[1].end(), RPCTBMuon::TMuonMore());
0059
0060
0061 while (finalMuons[0].size() > RPCConst::m_FINAL_OUT_MUONS_CNT) {
0062 finalMuons[0].pop_back();
0063 finalMuons[1].pop_back();
0064 }
0065
0066
0067 for (unsigned int iMu = 0; iMu < finalMuons[0].size(); iMu++) {
0068
0069
0070
0071
0072
0073
0074
0075 }
0076 }