#include <L1Trigger/RPCTrigger/interface/RPCTBGhostBuster.h>
Public Member Functions | ||||
L1RpcTBMuonsVec | gBEta (L1RpcTBMuonsVec2 &gbPhiMuonsVec2) const | |||
| ||||
L1RpcTBMuonsVec | gBPhi (L1RpcTBMuonsVec &pacMuonsVec) const | |||
| ||||
L1RpcTBMuonsVec | run (L1RpcTBMuonsVec2 &pacMuonsVec2) const | |||
Calls gBPhi and gBEta. |
Because the class does not keep any data and GB is the same for every TB, there might be one and the same object of this class for all TBs.
Definition at line 13 of file RPCTBGhostBuster.h.
L1RpcTBMuonsVec RPCTBGhostBuster::gBEta | ( | L1RpcTBMuonsVec2 & | gbPhiMuonsVec2 | ) | const |
gbPhiMuonsVec2 | size() should be equal to 4 (max number of m_tower in TB). |
Performs the Eta Goustbuster - between muons from diferent towers. Calls RPCTBMuon::setPhiAddr() for each alive muon.
Definition at line 126 of file RPCTBGhostBuster.cc.
References funct::abs(), RPCConst::m_GBETA_OUT_MUONS_CNT, and python::multivaluedict::sort().
Referenced by run().
00126 { 00127 //----- killing ghosts --------------------------------------- 00128 for(unsigned int iMuVec = 0; iMuVec < gbPhiMuonsVec2.size() -1; iMuVec++) { 00129 for(unsigned int iMu = 0; iMu < gbPhiMuonsVec2[iMuVec].size(); iMu++) { 00130 if(gbPhiMuonsVec2[iMuVec][iMu].getCode() == 0) 00131 break; //because muons are sorted 00132 00133 for(unsigned int iMuNext = 0; iMuNext < gbPhiMuonsVec2[iMuVec+1].size(); iMuNext++) 00134 if(abs(gbPhiMuonsVec2[iMuVec][iMu].getPhiAddr()-gbPhiMuonsVec2[iMuVec+1][iMuNext].getPhiAddr())<=1) 00135 00136 //comparing with next: 00137 if(gbPhiMuonsVec2[iMuVec][iMu].getCode() < gbPhiMuonsVec2[iMuVec+1][iMuNext].getCode()) 00138 gbPhiMuonsVec2[iMuVec][iMu].kill(); 00139 else 00140 gbPhiMuonsVec2[iMuVec+1][iMuNext].kill(); 00141 } 00142 } 00143 00144 //---------sorting----------------------------------------- 00145 /* multiset<RPCTBMuon, RPCTBMuon::TMuonMore> liveMuonsSet; 00146 for(unsigned int iMuVec = 0; iMuVec < gbPhiMuonsVec2.size(); iMuVec++) 00147 for(unsigned int iMu = 0; iMu < gbPhiMuonsVec2[iMuVec].size(); iMu++) 00148 if(gbPhiMuonsVec2[iMuVec][iMu].isLive()) { 00149 gbPhiMuonsVec2[iMuVec][iMu].setEtaAddr(iMuVec); 00150 liveMuonsSet.insert(gbPhiMuonsVec2[iMuVec][iMu]); 00151 } 00152 L1RpcTBMuonsVec outputMuons(liveMuonsSet.begin(), liveMuonsSet.end()); */ 00153 00154 L1RpcTBMuonsVec outputMuons; 00155 for(unsigned int iMuVec = 0; iMuVec < gbPhiMuonsVec2.size(); iMuVec++) 00156 for(unsigned int iMu = 0; iMu < gbPhiMuonsVec2[iMuVec].size(); iMu++) 00157 if(gbPhiMuonsVec2[iMuVec][iMu].isLive()) { 00158 gbPhiMuonsVec2[iMuVec][iMu].setEtaAddr(iMuVec); 00159 outputMuons.push_back(gbPhiMuonsVec2[iMuVec][iMu]); 00160 } 00161 sort(outputMuons.begin(), outputMuons.end(), RPCTBMuon::TMuonMore()); 00162 00163 //-------setting size to m_GBETA_OUT_MUONS_CNT---------------- 00164 while(outputMuons.size() < RPCConst::m_GBETA_OUT_MUONS_CNT) 00165 outputMuons.push_back(RPCTBMuon()); 00166 while(outputMuons.size() > RPCConst::m_GBETA_OUT_MUONS_CNT) 00167 outputMuons.pop_back(); 00168 00169 return outputMuons; 00170 }
L1RpcTBMuonsVec RPCTBGhostBuster::gBPhi | ( | L1RpcTBMuonsVec & | pacMuonsVec | ) | const |
pacMuonsVec | pacMuonsVec.size() should be equal to 12 (Segment in given TB count) or 0, Performs Phi Goustbuster - between muons in one sector of the same m_tower. |
Definition at line 52 of file RPCTBGhostBuster.cc.
References RPCConst::m_GBPHI_OUT_MUONS_CNT, RPCConst::m_SEGMENTS_IN_SECTOR_CNT, and python::multivaluedict::sort().
Referenced by run().
00052 { 00053 if(pacMuonsVec.size() == 0) 00054 return L1RpcTBMuonsVec(); //empty vector; 00055 //--------- killing ghosts --------------------------------------- 00056 pacMuonsVec.push_back(RPCTBMuon()); //adding empty muon to the end, 00057 00058 for(unsigned int iMu = 0; iMu < RPCConst::m_SEGMENTS_IN_SECTOR_CNT; iMu++) { 00059 if(pacMuonsVec[iMu].getCode() == 0) 00060 ; 00061 else if(pacMuonsVec[iMu].getCode() < pacMuonsVec[iMu + 1].getCode()) 00062 pacMuonsVec[iMu].kill(); 00063 else if(pacMuonsVec[iMu].getCode() == pacMuonsVec[iMu + 1].getCode()) { 00064 if(pacMuonsVec[iMu].wasKilled()) 00065 pacMuonsVec[iMu+1].kill(); 00066 else 00067 pacMuonsVec[iMu].kill(); 00068 } 00069 else //> 00070 pacMuonsVec[iMu+1].kill(); 00071 } 00072 00073 pacMuonsVec.pop_back(); //removing empty muon from the end, 00074 00075 //-------setting the m_GBData ---------------------------------- 00076 if(pacMuonsVec[0].isLive()) 00077 pacMuonsVec[0].setGBDataKilledFirst(); 00078 else if(pacMuonsVec[0].wasKilled()) 00079 for(unsigned int iMu = 0; iMu < RPCConst::m_SEGMENTS_IN_SECTOR_CNT; iMu++) { 00080 if(pacMuonsVec[iMu].isLive()) { 00081 pacMuonsVec[iMu].setGBDataKilledFirst(); 00082 break; 00083 } 00084 } 00085 00086 if(pacMuonsVec[RPCConst::m_SEGMENTS_IN_SECTOR_CNT-1].isLive()) 00087 pacMuonsVec[RPCConst::m_SEGMENTS_IN_SECTOR_CNT-1].setGBDataKilledLast(); 00088 else if(pacMuonsVec[RPCConst::m_SEGMENTS_IN_SECTOR_CNT-1].wasKilled()) 00089 for(int iMu = RPCConst::m_SEGMENTS_IN_SECTOR_CNT -1; iMu >= 0 ; iMu--) { 00090 if(pacMuonsVec[iMu].isLive()) { 00091 pacMuonsVec[iMu].setGBDataKilledLast(); 00092 break; 00093 } 00094 } 00095 //-------------sorting ------------------------------------------ 00096 /* 00097 multiset<RPCTBMuon, RPCTBMuon::TMuonMore> liveMuonsSet; 00098 for(int iMu = 0; iMu < m_SEGMENTS_IN_SECTOR_CNT; iMu++) { 00099 if(pacMuonsVec[iMu].isLive()) { 00100 pacMuonsVec[iMu].setPhiAddr(iMu); 00101 liveMuonsSet.insert(pacMuonsVec[iMu]); 00102 } 00103 } 00104 L1RpcTBMuonsVec outputMuons(liveMuonsSet.begin(), liveMuonsSet.end());*/ 00105 00106 L1RpcTBMuonsVec outputMuons; 00107 for(unsigned int iMu = 0; iMu < RPCConst::m_SEGMENTS_IN_SECTOR_CNT; iMu++) { 00108 if(pacMuonsVec[iMu].isLive()) { 00109 pacMuonsVec[iMu].setPhiAddr(iMu); 00110 outputMuons.push_back(pacMuonsVec[iMu]); 00111 } 00112 } 00113 sort(outputMuons.begin(), outputMuons.end(), RPCTBMuon::TMuonMore()); 00114 00115 //-------setting size to m_GBPHI_OUT_MUONS_CNT---------------- 00116 while (outputMuons.size() < RPCConst::m_GBPHI_OUT_MUONS_CNT) 00117 outputMuons.push_back(RPCTBMuon()); 00118 while(outputMuons.size() > RPCConst::m_GBPHI_OUT_MUONS_CNT) 00119 outputMuons.pop_back(); 00120 00121 return outputMuons; 00122 }
L1RpcTBMuonsVec RPCTBGhostBuster::run | ( | L1RpcTBMuonsVec2 & | pacMuonsVec2 | ) | const |
Calls gBPhi and gBEta.
pacMuonsVec2 | pacMuonsVec2[0..3][0..11] (4 Towers x 12 Segments (PACs) ), if pacMuonsVec2[i].size() == 0, means no nonempty muon. |
Definition at line 15 of file RPCTBGhostBuster.cc.
References gBEta(), and gBPhi().
Referenced by RPCTriggerBoard::runTBGB().
00015 { 00016 L1RpcTBMuonsVec2 gbPhiMuonsVec2; 00017 for(unsigned int iTow = 0; iTow < pacMuonsVec2.size(); iTow++) { 00018 gbPhiMuonsVec2.push_back(gBPhi(pacMuonsVec2[iTow])); 00019 } 00020 00021 return gBEta(gbPhiMuonsVec2); 00022 }