![]() |
![]() |
#include <L1Trigger/RPCTrigger/interface/RPCTCGhostBusterSorter.h>
Public Member Functions | |
RPCTCGhostBusterSorter (RPCTriggerConfiguration *triggerConfig) | |
L1RpcTBMuonsVec | run (L1RpcTBMuonsVec2 &tbMuonsVec) |
Peformes the Trigger Crate Ghost Buster and sorter algorithm - in eta between TB of one TC. | |
Private Attributes | |
RPCTriggerConfiguration * | m_TriggerConfig |
Because the class does not keep any data and GB is the same for every TC, there might be one and the same object of this class for all TCs.
Definition at line 14 of file RPCTCGhostBusterSorter.h.
RPCTCGhostBusterSorter::RPCTCGhostBusterSorter | ( | RPCTriggerConfiguration * | triggerConfig | ) |
Definition at line 9 of file RPCTCGhostBusterSorter.cc.
References m_TriggerConfig.
00009 { 00010 m_TriggerConfig = triggerConfig; 00011 }
L1RpcTBMuonsVec RPCTCGhostBusterSorter::run | ( | L1RpcTBMuonsVec2 & | tbMuonsVec | ) |
Peformes the Trigger Crate Ghost Buster and sorter algorithm - in eta between TB of one TC.
Coverts muons etaAddr from 2bit tow num on TB (0-2 or 0-3) to continous m_tower number (etaAddr) (0 - 32, tower0 = 16)
Definition at line 13 of file RPCTCGhostBusterSorter.cc.
References funct::abs(), RPCTriggerConfiguration::getTowsCntOnTB(), RPCConst::m_TCGB_OUT_MUONS_CNT, m_TriggerConfig, python::multivaluedict::sort(), RPCTriggerConfiguration::towAddr2TowNum(), and RPCTriggerConfiguration::towNum2TowNum2Comp().
Referenced by RPCTriggerCrate::runTCGBSorter().
00013 { 00014 for (unsigned int iTB = 0; iTB < tbMuonsVec2.size()-1; iTB++) { 00015 for(unsigned int iMu = 0; iMu < tbMuonsVec2[iTB].size(); iMu++) { 00016 if(tbMuonsVec2[iTB][iMu].getPtCode() == 0) 00017 break; //becouse muons are sorted 00018 00019 //muon from this TB is on positive edge of TB (last m_tower of this tb): 00020 if(tbMuonsVec2[iTB][iMu].getEtaAddr() == (m_TriggerConfig->getTowsCntOnTB(iTB)-1)) { 00021 for(unsigned int iMuN = 0; iMuN < tbMuonsVec2[iTB + 1].size(); iMuN++) { 00022 if(tbMuonsVec2[iTB + 1][iMuN].getPtCode() == 0) 00023 break; //becouse muons are sorted 00024 00025 //muon from next TB is on negative edge (first m_tower of this TB): 00026 if(tbMuonsVec2[iTB+1][iMuN].getEtaAddr() == 0) { 00027 if( abs(tbMuonsVec2[iTB][iMu].getPhiAddr() - tbMuonsVec2[iTB+1][iMuN].getPhiAddr()) <= 1) 00028 if(tbMuonsVec2[iTB][iMu].getCode() < tbMuonsVec2[iTB+1][iMuN].getCode()) 00029 tbMuonsVec2[iTB][iMu].kill(); 00030 else 00031 tbMuonsVec2[iTB+1][iMuN].kill(); 00032 } 00033 } 00034 } 00035 } 00036 } 00037 00038 //---------sorting----------------------------------------- 00039 /* multiset<RPCTBMuon, RPCTBMuon::TMuonMore> liveMuonsSet; 00040 for(unsigned int iTB = 0; iTB < tbMuonsVec2.size(); iTB++) 00041 for(unsigned int iMu = 0; iMu < tbMuonsVec2[iTB].size(); iMu++) 00042 if(tbMuonsVec2[iTB][iMu].isLive()) { 00043 00044 int etaAddr = tbMuonsVec2[iTB][iMu].getEtaAddr() | (iTB<<2); //m_tower number natural 00045 etaAddr = m_TriggerConfig->towAddr2TowNum(etaAddr); //m_tower number: -16 : 16 00046 etaAddr = etaAddr + 16; // m_tower number continous 0 : 32 00047 tbMuonsVec2[iTB][iMu].setEtaAddr(etaAddr); 00048 00049 liveMuonsSet.insert(tbMuonsVec2[iTB][iMu]); 00050 } 00051 L1RpcTBMuonsVec outputMuons(liveMuonsSet.begin(), liveMuonsSet.end()); */ 00052 00053 L1RpcTBMuonsVec outputMuons; 00054 for(unsigned int iTB = 0; iTB < tbMuonsVec2.size(); iTB++) 00055 for(unsigned int iMu = 0; iMu < tbMuonsVec2[iTB].size(); iMu++) 00056 if(tbMuonsVec2[iTB][iMu].isLive()) { 00057 int etaAddr = tbMuonsVec2[iTB][iMu].getEtaAddr() | (iTB<<2); //m_tower number natural <0...35> 00058 etaAddr = m_TriggerConfig->towAddr2TowNum(etaAddr); //m_tower number: -16 : 16 00059 //etaAddr = etaAddr + 16; // m_tower number continous 0 : 32 00060 etaAddr = m_TriggerConfig->towNum2TowNum2Comp(etaAddr); // 10 oct 2006 - moved from FS 00061 tbMuonsVec2[iTB][iMu].setEtaAddr(etaAddr); 00062 00063 outputMuons.push_back(tbMuonsVec2[iTB][iMu]); 00064 } 00065 00066 sort(outputMuons.begin(), outputMuons.end(), RPCTBMuon::TMuonMore()); 00067 00068 //-------setting size to m_GBETA_OUT_MUONS_CNT---------------- 00069 while(outputMuons.size() < RPCConst::m_TCGB_OUT_MUONS_CNT) 00070 outputMuons.push_back(RPCTBMuon()); 00071 while(outputMuons.size() > RPCConst::m_TCGB_OUT_MUONS_CNT) 00072 outputMuons.pop_back(); 00073 00074 return outputMuons; 00075 }
Definition at line 26 of file RPCTCGhostBusterSorter.h.
Referenced by RPCTCGhostBusterSorter(), and run().