CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
RPCPacTrigger Class Reference

#include <RPCPacTrigger.h>

Public Member Functions

L1RpcTBMuonsVec getNotEmptyMuons ()
 
 RPCPacTrigger (RPCTriggerConfiguration *triggerConfig)
 
L1RpcTBMuonsVec2 runEvent (const L1RpcLogConesVec &logConesVec, edm::ESHandle< L1RPCHsbConfig > hsbConf)
 

Private Attributes

RPCFinalSorter m_FinalSorter
 
L1RpcTBMuonsVec2 m_GBFinalMuons
 
RPCHalfSorter m_HalfSorters
 
RPCTriggerConfigurationm_TrigCnfg
 
std::vector< RPCTriggerCratem_TriggerCratesVec
 

Detailed Description

Simulations of Pattern Comparator trigger. For every event runs PACs, ghost-busters and sorters. Contains the structure of hardware: Trigger Crates, Final Sorters, etc.

Author
Karol Bunkowski (Warsaw)

Definition at line 18 of file RPCPacTrigger.h.

Constructor & Destructor Documentation

◆ RPCPacTrigger()

RPCPacTrigger::RPCPacTrigger ( RPCTriggerConfiguration triggerConfig)

Construct the structure of Trigger Crates, m_TBGhostBuster, m_TCGhostBusterSorter and m_FinalSorter are also created. Since these object do not holds any data, on instance is enough for whole system. Found muons are stored in TB and TC.

Definition at line 10 of file RPCPacTrigger.cc.

References RPCTriggerConfiguration::getTCsCnt(), m_TrigCnfg, and m_TriggerCratesVec.

11  : m_FinalSorter(triggerConfig), m_HalfSorters(triggerConfig) {
12  m_TrigCnfg = triggerConfig;
13  for (int iTC = 0; iTC < m_TrigCnfg->getTCsCnt(); iTC++) {
15  }
16 }
RPCHalfSorter m_HalfSorters
Definition: RPCPacTrigger.h:44
virtual int getTCsCnt()=0
returns count of Trigger Crates in system.
std::vector< RPCTriggerCrate > m_TriggerCratesVec
Definition: RPCPacTrigger.h:39
RPCFinalSorter m_FinalSorter
Definition: RPCPacTrigger.h:43
RPCTriggerConfiguration * m_TrigCnfg
Definition: RPCPacTrigger.h:41

Member Function Documentation

◆ getNotEmptyMuons()

L1RpcTBMuonsVec RPCPacTrigger::getNotEmptyMuons ( )

Returns vector of not empty muons. Can be called only after runEvent()

Definition at line 100 of file RPCPacTrigger.cc.

References m_GBFinalMuons.

100  {
101  L1RpcTBMuonsVec notEmptyMuonsVec;
102  for (unsigned int iMu = 0; iMu < m_GBFinalMuons[0].size(); iMu++)
103  if (m_GBFinalMuons[0][iMu].getCode() != 0)
104  notEmptyMuonsVec.push_back(m_GBFinalMuons[0][iMu]);
105 
106  for (unsigned int iMu = 0; iMu < m_GBFinalMuons[1].size(); iMu++)
107  if (m_GBFinalMuons[1][iMu].getCode() != 0)
108  notEmptyMuonsVec.push_back(m_GBFinalMuons[1][iMu]);
109 
110  return notEmptyMuonsVec;
111 }
L1RpcTBMuonsVec2 m_GBFinalMuons
Definition: RPCPacTrigger.h:50
std::vector< RPCTBMuon > L1RpcTBMuonsVec
Definition: RPCTBMuon.h:218

◆ runEvent()

L1RpcTBMuonsVec2 RPCPacTrigger::runEvent ( const L1RpcLogConesVec logConesVec,
edm::ESHandle< L1RPCHsbConfig hsbConf 
)

For every logCone from logConesVec runs RPCTriggerCrate::runCone(). Then for every TC runs RPCTriggerCrate::runTCGBSorter(). Then runs and RPCFinalSorter::run().

Returns
m_GBFinalMuons[be][iMU] be = 0 = barrel; be = 1 = endcaps, 4 muons from barrel and 4 muons from endcaps, (some can be empty)

Definition at line 20 of file RPCPacTrigger.cc.

References MuonsGrabber::addMuon(), gather_cfg::cout, RPCTriggerConfiguration::getDebugLevel(), RPCTriggerConfiguration::getTCNum(), mps_fire::i, MuonsGrabber::Instance(), m_FinalSorter, m_GBFinalMuons, m_HalfSorters, m_TrigCnfg, m_TriggerCratesVec, RPCHalfSorter::run(), and RPCFinalSorter::run().

20  {
21  m_GBFinalMuons.clear();
22 
23  if (m_TrigCnfg->getDebugLevel() != 0) {
24 #ifdef _STAND_ALONE
25  std::cout << "---TBMuons in new event" << std::endl;
26 #endif // _STAND_ALONE
27  }
28  for (unsigned int iLC = 0; iLC < logConesVec.size(); iLC++) {
29  if (logConesVec[iLC].getFiredPlanesCnt() >= 3) {
30  m_TriggerCratesVec[m_TrigCnfg->getTCNum(logConesVec[iLC].getConeCrdnts())].runCone(logConesVec[iLC]);
31  }
32  }
33 
34  L1RpcTBMuonsVec2 tcsMuonsVec2;
35  for (unsigned int iTC = 0; iTC < m_TriggerCratesVec.size(); iTC++) {
36  tcsMuonsVec2.push_back(m_TriggerCratesVec[iTC].runTCGBSorter());
37  }
38 
39  if (m_TrigCnfg->getDebugLevel() != 0) {
40  for (unsigned int iTC = 0; iTC < tcsMuonsVec2.size(); iTC++) {
41  for (unsigned int iTB = 0; iTB < tcsMuonsVec2[iTC].size(); iTB++) {
42 #ifdef _STAND_ALONE
43  std::cout << "GB 2 " << iTB << " " << tcsMuonsVec2[iTC][iTB].printDebugInfo(m_TrigCnfg->getDebugLevel())
44  << std::endl;
45 #else
46  // LogDebug("RPCHwDebug") << "GB 2 " << iTB << " "
47  // <<tcsMuonsVec2[iTC][iTB].printDebugInfo(m_TrigCnfg->getDebugLevel());
48  MuonsGrabber::Instance().addMuon(tcsMuonsVec2[iTC][iTB], 2, -1, -1, iTB);
49 
50 #endif // _STAND_ALONE
51  }
52  }
53  }
54 
55  // It would be fine, if half sorters would just modify tcsMuonsVec2
56  L1RpcTBMuonsVec2 halfMuons = m_HalfSorters.run(tcsMuonsVec2, hsbConf);
57  m_GBFinalMuons = m_FinalSorter.run(halfMuons);
58 
59 #ifdef GETCONES
60  bool foundMuons = false;
61  L1RpcTBMuonsVec bMuons = m_GBFinalMuons[0];
62  L1RpcTBMuonsVec fMuons = m_GBFinalMuons[1];
63 
64  std::cout << "------------" << std::endl;
65  for (unsigned int i = 0; i < bMuons.size(); i++) {
66  if (bMuons[i].getPtCode() != 0) {
67  /*
68  std::cout<< "ptcode " << bMuons[i].getPtCode()
69  << " t " << bMuons[i].getTower()
70  << " sec " << bMuons[i].getLogSector()
71  << " seg " << bMuons[i].getLogSegment()
72  << std::endl;*/
73  foundMuons = true;
74  }
75  }
76  for (unsigned int i = 0; i < fMuons.size(); i++) {
77  if (fMuons[i].getPtCode() != 0) {
78  /*std::cout<< "ptcode " << fMuons[i].getPtCode()
79  << " t " << fMuons[i].getTower()
80  << " sec " << fMuons[i].getLogSector()
81  << " seg " << fMuons[i].getLogSegment()
82  << std::endl;*/
83  foundMuons = true;
84  }
85  }
86  if (!foundMuons) {
87  for (unsigned int iLC = 0; iLC < logConesVec.size(); iLC++) {
88  if (logConesVec[iLC].getFiredPlanesCnt() >= 3) {
89  std::cout << logConesVec[iLC].toString();
90  }
91  }
92  }
93 #endif
94 
95  return m_GBFinalMuons;
96 }
RPCHalfSorter m_HalfSorters
Definition: RPCPacTrigger.h:44
std::vector< RPCTriggerCrate > m_TriggerCratesVec
Definition: RPCPacTrigger.h:39
L1RpcTBMuonsVec2 m_GBFinalMuons
Definition: RPCPacTrigger.h:50
static MuonsGrabber & Instance()
Definition: MuonsGrabber.cc:48
L1RpcTBMuonsVec2 run(L1RpcTBMuonsVec2 &tcsMuonsVec2, edm::ESHandle< L1RPCHsbConfig > hsbConf)
std::vector< RPCTBMuon > L1RpcTBMuonsVec
Definition: RPCTBMuon.h:218
std::vector< L1RpcTBMuonsVec > L1RpcTBMuonsVec2
Definition: RPCTBMuon.h:219
RPCFinalSorter m_FinalSorter
Definition: RPCPacTrigger.h:43
L1RpcTBMuonsVec2 run(L1RpcTBMuonsVec2 &tcsMuonsVec2)
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.
RPCTriggerConfiguration * m_TrigCnfg
Definition: RPCPacTrigger.h:41

Member Data Documentation

◆ m_FinalSorter

RPCFinalSorter RPCPacTrigger::m_FinalSorter
private

Definition at line 43 of file RPCPacTrigger.h.

Referenced by runEvent().

◆ m_GBFinalMuons

L1RpcTBMuonsVec2 RPCPacTrigger::m_GBFinalMuons
private

Muons found in each event. m_GBFinalMuons[be][iMU] be = 0 = barrel; be = 1 = endcaps, 4 muons from barrel and 4 muons from endcaps, (some can be empty)

Definition at line 50 of file RPCPacTrigger.h.

Referenced by getNotEmptyMuons(), and runEvent().

◆ m_HalfSorters

RPCHalfSorter RPCPacTrigger::m_HalfSorters
private

Definition at line 44 of file RPCPacTrigger.h.

Referenced by runEvent().

◆ m_TrigCnfg

RPCTriggerConfiguration* RPCPacTrigger::m_TrigCnfg
private

Definition at line 41 of file RPCPacTrigger.h.

Referenced by RPCPacTrigger(), and runEvent().

◆ m_TriggerCratesVec

std::vector<RPCTriggerCrate> RPCPacTrigger::m_TriggerCratesVec
private

Definition at line 39 of file RPCPacTrigger.h.

Referenced by RPCPacTrigger(), and runEvent().