CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RPCFinalSorter.cc
Go to the documentation of this file.
1 //---------------------------------------------------------------------------
3 
6 #include <algorithm>
7 //---------------------------------------------------------------------------
8 #include <set>
9 using namespace std;
10 
17 
18  m_TrigCnfg = triggerConfig;
19  m_GBOutputMuons.assign(2, L1RpcTBMuonsVec());
20 
21 }
29 
30  //m_GBOutputMuons[0].clear();
31  //m_GBOutputMuons[1].clear();
32 
33  runFinalSorter(tcsMuonsVec2); // modyfies tcsMuonsVec2
34 
35 
36  if (m_TrigCnfg->getDebugLevel()!=0){
37  for (unsigned int region = 0; region < tcsMuonsVec2.size(); ++region){
38  for (unsigned int iTB = 0; iTB < tcsMuonsVec2[region].size(); iTB++){
39 #ifndef _STAND_ALONE
40  // LogDebug("RPCHwDebug")<<"GB 4" << region
41  // << "0 " << iTB << " "
42  // << tcsMuonsVec2[region][iTB].printDebugInfo(m_TrigCnfg->getDebugLevel());
43  MuonsGrabber::Instance().addMuon(tcsMuonsVec2[region][iTB], 4, region, 0, iTB);
44 #else
45  std::cout<<"GB 4" << region
46  << "0 " << iTB << " "
47  << tcsMuonsVec2[region][iTB].printDebugInfo(m_TrigCnfg->getDebugLevel())
48  << std::endl;
49 #endif
50  }
51  }
52  }
53 
54  return tcsMuonsVec2;
55 }
56 /*
57  *
58  *
59  *
60 */
62 //---------sorting-----------------------------------------
63  sort(finalMuons[0].begin(), finalMuons[0].end(), RPCTBMuon::TMuonMore()) ;
64  sort(finalMuons[1].begin(), finalMuons[1].end(), RPCTBMuon::TMuonMore()) ;
65 
66 //-------setting size to m_GBETA_OUT_MUONS_CNT----------------
67  while(finalMuons[0].size() > RPCConst::m_FINAL_OUT_MUONS_CNT) {
68  finalMuons[0].pop_back();
69  finalMuons[1].pop_back();
70  }
71 
72 //-----setting 2'complement EtaAddr
73  for(unsigned int iMu = 0; iMu < finalMuons[0].size(); iMu++) {
74  // 10 oct 2006 - moved to RPCTCGhostBusterSorter::run
75  //finalMuons[0][iMu].setEtaAddr(m_TrigCnfg->towNum2TowNum2Comp(finalMuons[0][iMu].getEtaAddr()));
76  //finalMuons[1][iMu].setEtaAddr(m_TrigCnfg->towNum2TowNum2Comp(finalMuons[1][iMu].getEtaAddr()));
77 
78  // 9 July 2007 - temporarly moved to HS
79  //finalMuons[0][iMu].setPhiAddr(finalMuons[0][iMu].getContinSegmAddr());
80  //finalMuons[1][iMu].setPhiAddr(finalMuons[1][iMu].getContinSegmAddr());
81  }
82 }
void runFinalSorter(L1RpcTBMuonsVec2 &finalMuons)
static const unsigned int m_FINAL_OUT_MUONS_CNT
m_Number of muon candidates return by Final GhostBuster&amp;Sorter
Definition: RPCConst.h:163
static MuonsGrabber & Instance()
Definition: MuonsGrabber.cc:59
std::vector< RPCTBMuon > L1RpcTBMuonsVec
Definition: RPCTBMuon.h:206
std::vector< L1RpcTBMuonsVec > L1RpcTBMuonsVec2
Definition: RPCTBMuon.h:207
L1RpcTBMuonsVec2 run(L1RpcTBMuonsVec2 &tcsMuonsVec2)
#define end
Definition: vmac.h:38
RPCFinalSorter(RPCTriggerConfiguration *triggerConfig)
void addMuon(RPCTBMuon &mu, int lvl, int region, int hs, int index)
#define begin
Definition: vmac.h:31
tuple cout
Definition: gather_cfg.py:121
Used in sorting.
Definition: RPCTBMuon.h:97
tuple size
Write out results.