CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RPCPacTrigger.cc
Go to the documentation of this file.
1 /*******************************************************************************
2 * *
3 * Karol Bunkowski *
4 * Warsaw University 2004 *
5 * *
6 *******************************************************************************/
9 
11  m_FinalSorter(triggerConfig),
12  m_HalfSorters(triggerConfig)
13 {
14  m_TrigCnfg = triggerConfig;
15  for(int iTC = 0; iTC < m_TrigCnfg->getTCsCnt(); iTC++) {
17  }
18 }
19 
21 
23  m_GBFinalMuons.clear();
24 
25  if (m_TrigCnfg->getDebugLevel()!=0){
26 #ifdef _STAND_ALONE
27  std::cout << "---TBMuons in new event" << std::endl;
28 #endif // _STAND_ALONE
29  }
30  for(unsigned int iLC = 0; iLC < logConesVec.size(); iLC++) {
31  if(logConesVec[iLC].getFiredPlanesCnt() >= 3) {
32  m_TriggerCratesVec[m_TrigCnfg->getTCNum(logConesVec[iLC].getConeCrdnts())]
33  .runCone(logConesVec[iLC]);
34  }
35  }
36 
37  L1RpcTBMuonsVec2 tcsMuonsVec2;
38  for(unsigned int iTC = 0; iTC < m_TriggerCratesVec.size(); iTC++) {
39  tcsMuonsVec2.push_back(m_TriggerCratesVec[iTC].runTCGBSorter());
40  }
41 
42  if (m_TrigCnfg->getDebugLevel()!=0){
43  for (unsigned int iTC = 0; iTC < tcsMuonsVec2.size(); iTC++){
44  for (unsigned int iTB = 0; iTB < tcsMuonsVec2[iTC].size(); iTB++){
45 #ifdef _STAND_ALONE
46  std::cout << "GB 2 " << iTB << " "
47  <<tcsMuonsVec2[iTC][iTB].printDebugInfo(m_TrigCnfg->getDebugLevel())
48  << std::endl;
49 #else
50  // LogDebug("RPCHwDebug") << "GB 2 " << iTB << " "
51  // <<tcsMuonsVec2[iTC][iTB].printDebugInfo(m_TrigCnfg->getDebugLevel());
52  MuonsGrabber::Instance().addMuon(tcsMuonsVec2[iTC][iTB], 2, -1, -1, iTB);
53 
54 
55 #endif // _STAND_ALONE
56  }
57  }
58  }
59 
60  // It would be fine, if half sorters would just modify tcsMuonsVec2
61  L1RpcTBMuonsVec2 halfMuons = m_HalfSorters.run(tcsMuonsVec2, hsbConf);
62  m_GBFinalMuons = m_FinalSorter.run(halfMuons);
63 
64 #ifdef GETCONES
65  bool foundMuons = false;
66  L1RpcTBMuonsVec bMuons = m_GBFinalMuons[0];
67  L1RpcTBMuonsVec fMuons = m_GBFinalMuons[1];
68 
69  std::cout<< "------------" << std::endl;
70  for (unsigned int i = 0; i < bMuons.size(); i++){
71  if (bMuons[i].getPtCode()!=0){
72  /*
73  std::cout<< "ptcode " << bMuons[i].getPtCode()
74  << " t " << bMuons[i].getTower()
75  << " sec " << bMuons[i].getLogSector()
76  << " seg " << bMuons[i].getLogSegment()
77  << std::endl;*/
78  foundMuons = true;
79  }
80  }
81  for (unsigned int i = 0; i < fMuons.size(); i++){
82  if (fMuons[i].getPtCode()!=0){
83  /*std::cout<< "ptcode " << fMuons[i].getPtCode()
84  << " t " << fMuons[i].getTower()
85  << " sec " << fMuons[i].getLogSector()
86  << " seg " << fMuons[i].getLogSegment()
87  << std::endl;*/
88  foundMuons = true;
89  }
90  }
91  if (!foundMuons){
92  for(unsigned int iLC = 0; iLC < logConesVec.size(); iLC++) {
93  if(logConesVec[iLC].getFiredPlanesCnt() >= 3) {
94  std::cout<< logConesVec[iLC].toString();
95  }
96  }
97  }
98 #endif
99 
100 
101 
102  return m_GBFinalMuons;
103 }
104 
106 
108  L1RpcTBMuonsVec notEmptyMuonsVec;
109  for(unsigned int iMu = 0; iMu < m_GBFinalMuons[0].size(); iMu++)
110  if(m_GBFinalMuons[0][iMu].getCode() != 0)
111  notEmptyMuonsVec.push_back(m_GBFinalMuons[0][iMu]);
112 
113  for(unsigned int iMu = 0; iMu < m_GBFinalMuons[1].size(); iMu++)
114  if(m_GBFinalMuons[1][iMu].getCode() != 0)
115  notEmptyMuonsVec.push_back(m_GBFinalMuons[1][iMu]);
116 
117  return notEmptyMuonsVec;
118 }
int i
Definition: DBlmapReader.cc:9
RPCHalfSorter m_HalfSorters
Definition: RPCPacTrigger.h:45
virtual int getTCsCnt()=0
returns count of Trigger Crates in system.
std::vector< RPCTriggerCrate > m_TriggerCratesVec
Definition: RPCPacTrigger.h:40
L1RpcTBMuonsVec2 m_GBFinalMuons
Definition: RPCPacTrigger.h:51
static MuonsGrabber & Instance()
Definition: MuonsGrabber.cc:59
L1RpcTBMuonsVec2 run(L1RpcTBMuonsVec2 &tcsMuonsVec2, edm::ESHandle< L1RPCHsbConfig > hsbConf)
std::vector< RPCTBMuon > L1RpcTBMuonsVec
Definition: RPCTBMuon.h:206
std::vector< L1RpcTBMuonsVec > L1RpcTBMuonsVec2
Definition: RPCTBMuon.h:207
RPCFinalSorter m_FinalSorter
Definition: RPCPacTrigger.h:44
L1RpcTBMuonsVec2 run(L1RpcTBMuonsVec2 &tcsMuonsVec2)
RPCPacTrigger(RPCTriggerConfiguration *triggerConfig)
void addMuon(RPCTBMuon &mu, int lvl, int region, int hs, int index)
virtual int getTCNum(const RPCConst::l1RpcConeCrdnts &coneCrdnts)=0
Returns the index of TC that should run given LogCone.
tuple cout
Definition: gather_cfg.py:121
L1RpcTBMuonsVec2 runEvent(const L1RpcLogConesVec &logConesVec, edm::ESHandle< L1RPCHsbConfig > hsbConf)
RPCTriggerConfiguration * m_TrigCnfg
Definition: RPCPacTrigger.h:42
L1RpcTBMuonsVec getNotEmptyMuons()
std::vector< RPCLogCone > L1RpcLogConesVec
Definition: RPCLogCone.h:126