19 m_TrigCnfg = triggerConfig;
32 for(
unsigned int iTC = 0; iTC < tcsMuonsVec2.size()-1; iTC++) {
33 for(
unsigned int iMu = 0; iMu < tcsMuonsVec2[iTC].size(); iMu++) {
34 if(tcsMuonsVec2[iTC][iMu].getCode() == 0)
36 if(tcsMuonsVec2[iTC][iMu].gBDataKilledLast()) {
37 for(
unsigned int iMuN = 0; iMuN < tcsMuonsVec2[iTC+1].size(); iMuN++) {
38 if(tcsMuonsVec2[iTC+1][iMuN].getCode() == 0)
40 if(tcsMuonsVec2[iTC+1][iMuN].gBDataKilledFirst())
42 int eta1 = tcsMuonsVec2[iTC][iMu].getEtaAddr();
43 int eta2 = tcsMuonsVec2[iTC+1][iMuN].getEtaAddr();
44 if ( eta1 > 16 ) eta1 = - ( (~eta1 & 63) + 1);
45 if ( eta2 > 16 ) eta2 = - ( (~eta2 & 63) + 1);
46 if(
abs(eta1 - eta2) <= 1)
48 if(tcsMuonsVec2[iTC][iMu].getCode() <= tcsMuonsVec2[iTC+1][iMuN].getCode())
51 tcsMuonsVec2[iTC][iMu].kill();
56 tcsMuonsVec2[iTC+1][iMuN].kill();
68 for(
unsigned int iTC = 1; iTC < tcsMuonsVec2.size()-1; iTC++)
69 for(
unsigned int iMu = 0; iMu < tcsMuonsVec2[iTC].size(); iMu++)
70 if(tcsMuonsVec2[iTC][iMu].isLive()){
73 if( tcsMuonsVec2[iTC][iMu].getEtaAddr() >= 57 ||
74 tcsMuonsVec2[iTC][iMu].getEtaAddr() <= 7 )
76 outputBarrelMuons.push_back(tcsMuonsVec2[iTC][iMu]);
79 outputEndcapMuons.push_back(tcsMuonsVec2[iTC][iMu]);
89 outputBarrelMuons.pop_back();
94 outputEndcapMuons.pop_back();
96 m_GBOutputMuons[0].insert(m_GBOutputMuons[0].
end(),
97 outputBarrelMuons.begin(),
98 outputBarrelMuons.end());
99 m_GBOutputMuons[1].insert(m_GBOutputMuons[1].
end(),
100 outputEndcapMuons.begin(),
101 outputEndcapMuons.end());
102 return m_GBOutputMuons;
106 if ( mask < 0 || mask > 3) {
107 throw cms::Exception(
"RPCHalfSorter::maskHSBInput") <<
" hsbMask has wrong value - " << mask <<
" \n";
113 }
else if (mask == 2){
136 m_GBOutputMuons[0].clear();
137 m_GBOutputMuons[1].clear();
141 if ( tcsMuonsVec2[m_TrigCnfg->getTCsCnt()-1].size()==0 || hsbConf->getHsbMask(0,0) == 3 ) {
142 firstHalfTcsMuonsVec2.push_back(tcsMuonsVec2[m_TrigCnfg->getTCsCnt()-1]);
145 maskHSBInput(newVec, hsbConf->getHsbMask(0,0));
146 firstHalfTcsMuonsVec2.push_back(newVec);
152 for(
int iTC = 0; iTC < m_TrigCnfg->getTCsCnt()/2 +1; iTC++) {
153 for(
unsigned int iMu = 0; iMu < tcsMuonsVec2[iTC].size(); iMu++){
154 if ( secAddr != 0 && secAddr != 7 ){
155 tcsMuonsVec2[iTC][iMu].setSectorAddr(secAddr);
164 if ( tcsMuonsVec2[iTC].
size()==0 || hsbConf->getHsbMask(0, iTC+1) == 3 ) {
165 firstHalfTcsMuonsVec2.push_back(tcsMuonsVec2[iTC]);
168 maskHSBInput(newVec, hsbConf->getHsbMask(0, iTC+1));
169 firstHalfTcsMuonsVec2.push_back(newVec);
174 runHalf(firstHalfTcsMuonsVec2);
176 unsigned int fhBMuons = m_GBOutputMuons[0].size();
177 unsigned int fhEMuons = m_GBOutputMuons[1].size();
182 for(
int iTC = m_TrigCnfg->getTCsCnt()/2-1; iTC < m_TrigCnfg->getTCsCnt(); iTC++) {
183 for(
unsigned int iMu = 0; iMu < tcsMuonsVec2[iTC].size(); iMu++){
184 if ( secAddr != 0 && secAddr != 7 ){
185 tcsMuonsVec2[iTC][iMu].setSectorAddr(secAddr);
191 if ( tcsMuonsVec2[iTC].
size()==0 || hsbConf->getHsbMask(1, iTC-5) == 3 ) {
192 secondHalfTcsMuonsVec2.push_back(tcsMuonsVec2[iTC]);
195 maskHSBInput(newVec, hsbConf->getHsbMask(1, iTC-5));
196 secondHalfTcsMuonsVec2.push_back(newVec);
201 if ( tcsMuonsVec2[0].
size()==0 || hsbConf->getHsbMask(1 , 7) == 3 ) {
202 secondHalfTcsMuonsVec2.push_back(tcsMuonsVec2[0]);
205 maskHSBInput(newVec, hsbConf->getHsbMask(1, 7));
206 secondHalfTcsMuonsVec2.push_back(newVec);
209 runHalf(secondHalfTcsMuonsVec2);
211 for (
unsigned int region = 0; region < m_GBOutputMuons.size(); ++region){
212 for (
unsigned int i = 0;
i < m_GBOutputMuons[region].size(); ++
i)
215 unsigned int halfNum = 0;
220 if ( (region == 0 &&
i >= fhBMuons ) ||
221 (region == 1 &&
i >= fhEMuons ) )
227 if (m_TrigCnfg->getDebugLevel()==1){
237 <<
" " << i - iMod <<
" "
238 << m_GBOutputMuons[region][
i].printDebugInfo(m_TrigCnfg->getDebugLevel())
243 int segment = m_GBOutputMuons[region][
i].getSegmentAddr();
244 int sector = m_GBOutputMuons[region][
i].getSectorAddr()-1+6*halfNum;
245 int pt = m_GBOutputMuons[region][
i].getPtCode();
247 m_GBOutputMuons[region][
i].setPhiAddr( (sector*12 + segment + 2)%144 );
252 return m_GBOutputMuons;
static const unsigned int m_FINAL_OUT_MUONS_CNT
m_Number of muon candidates return by Final GhostBuster&Sorter
L1RpcTBMuonsVec2 runHalf(L1RpcTBMuonsVec2 &tcsMuonsVec2)
static MuonsGrabber & Instance()
void maskHSBInput(L1RpcTBMuonsVec &newVec, int mask)
static const unsigned int m_SEGMENTS_IN_SECTOR_CNT
m_Number of Logic Segments in one Logic Sector, defines also the number of Logic Cones for one Logic ...
L1RpcTBMuonsVec2 run(L1RpcTBMuonsVec2 &tcsMuonsVec2, edm::ESHandle< L1RPCHsbConfig > hsbConf)
std::vector< RPCTBMuon > L1RpcTBMuonsVec
std::vector< L1RpcTBMuonsVec > L1RpcTBMuonsVec2
void addMuon(RPCTBMuon &mu, int lvl, int region, int hs, int index)
RPCHalfSorter(RPCTriggerConfiguration *triggerConfig)
tuple size
Write out results.