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 ( 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.

10  :
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 }
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
RPCFinalSorter m_FinalSorter
Definition: RPCPacTrigger.h:44
RPCTriggerConfiguration * m_TrigCnfg
Definition: RPCPacTrigger.h:42

Member Function Documentation

L1RpcTBMuonsVec RPCPacTrigger::getNotEmptyMuons ( )

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

Definition at line 107 of file RPCPacTrigger.cc.

References m_GBFinalMuons.

107  {
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 }
L1RpcTBMuonsVec2 m_GBFinalMuons
Definition: RPCPacTrigger.h:51
std::vector< RPCTBMuon > L1RpcTBMuonsVec
Definition: RPCTBMuon.h:206
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 22 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().

22  {
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 }
RPCHalfSorter m_HalfSorters
Definition: RPCPacTrigger.h:45
std::vector< RPCTriggerCrate > m_TriggerCratesVec
Definition: RPCPacTrigger.h:40
L1RpcTBMuonsVec2 m_GBFinalMuons
Definition: RPCPacTrigger.h:51
static MuonsGrabber & Instance()
Definition: MuonsGrabber.cc:58
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)
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:42

Member Data Documentation

RPCFinalSorter RPCPacTrigger::m_FinalSorter
private

Definition at line 44 of file RPCPacTrigger.h.

Referenced by runEvent().

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 51 of file RPCPacTrigger.h.

Referenced by getNotEmptyMuons(), and runEvent().

RPCHalfSorter RPCPacTrigger::m_HalfSorters
private

Definition at line 45 of file RPCPacTrigger.h.

Referenced by runEvent().

RPCTriggerConfiguration* RPCPacTrigger::m_TrigCnfg
private

Definition at line 42 of file RPCPacTrigger.h.

Referenced by RPCPacTrigger(), and runEvent().

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

Definition at line 40 of file RPCPacTrigger.h.

Referenced by RPCPacTrigger(), and runEvent().