CMS 3D CMS Logo

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

#include <RPCTriggerBoard.h>

Public Member Functions

 RPCTriggerBoard (RPCTriggerConfiguration *triggerConfig, int tbNum, int tcNum)
 
bool runCone (const RPCLogCone &cone)
 
L1RpcTBMuonsVec runTBGB ()
 

Private Types

typedef std::map< int, PACsVecPACsAll
 
typedef std::vector< std::shared_ptr< RPCPac > > PACsVec
 

Private Attributes

PACsAll m_pacs
 
L1RpcTBMuonsVec m_PacsMuonsVec
 
RPCTBGhostBuster m_TBGhostBuster
 
int m_TBNumber
 0...8 , 0 = tbn4, m_tower -16..-13, 4 = tb0 More...
 
RPCTriggerConfigurationm_TriggerConfig
 

Detailed Description

Class describing the Trigger Board. In hardware on one TB thera are m_PAC procesors for 3 or 4 towers of one sector. In this implementation the RPCTriggerBoard does not holds the m_PAC, but acces them through RPCTriggerConfiguration, beacouse deifferent configuration are possible (for example the same m_PAC for every Log Segment of given m_tower).

Author
Karol Bunkowski (Warsaw)

Definition at line 20 of file RPCTriggerBoard.h.

Member Typedef Documentation

◆ PACsAll

typedef std::map<int, PACsVec> RPCTriggerBoard::PACsAll
private

Definition at line 45 of file RPCTriggerBoard.h.

◆ PACsVec

typedef std::vector<std::shared_ptr<RPCPac> > RPCTriggerBoard::PACsVec
private

Definition at line 44 of file RPCTriggerBoard.h.

Constructor & Destructor Documentation

◆ RPCTriggerBoard()

RPCTriggerBoard::RPCTriggerBoard ( RPCTriggerConfiguration triggerConfig,
int  tbNum,
int  tcNum 
)

Definition at line 12 of file RPCTriggerBoard.cc.

13  {
14  m_TriggerConfig = triggerConfig;
15  m_TBNumber = tbNum;
16 
17  int towerMin = -16;
18  int towerMax = -16;
19 
20  // Calculate tower boundaries for this TB
21  for (int i = 0; i <= tbNum; i++) { // Trigger Boards are numbered from 0 to 8
22  towerMin = towerMax;
23  towerMax += m_TriggerConfig->getTowsCntOnTB(i);
24  }
25  towerMax--;
26 
27  for (int tower = towerMin; tower <= towerMax; tower++) {
28  for (int logSegment = 0; logSegment < 12; logSegment++) { // One logSegment = one PAC
29  //m_pacs[cone.getTower()][cone.getLogSegment()]
31  coneCrds.m_Tower = tower;
32  coneCrds.m_LogSector = tcNum;
33  coneCrds.m_LogSegment = logSegment;
34 
35  const RPCPacData* pacData = m_TriggerConfig->getPac(coneCrds);
36 
37  // one trigger crate covers one logsector:
38  //RPCPac *pac = new RPCPac(pacData, tower, tcNum, logSegment);
39  std::shared_ptr<RPCPac> pac(new RPCPac(pacData, tower, tcNum, logSegment));
40 
41  m_pacs[tower].push_back(pac);
42  }
43  }

References RPCTriggerConfiguration::getPac(), RPCTriggerConfiguration::getTowsCntOnTB(), mps_fire::i, RPCConst::l1RpcConeCrdnts::m_LogSector, RPCConst::l1RpcConeCrdnts::m_LogSegment, m_pacs, m_TBNumber, RPCConst::l1RpcConeCrdnts::m_Tower, m_TriggerConfig, and hgcalTowerProducer_cfi::tower.

Member Function Documentation

◆ runCone()

bool RPCTriggerBoard::runCone ( const RPCLogCone cone)

Runs RPCPacData::run() for cone. Converts RPCPacMuon to RPCTBMuon and puts it to the m_PacsMuonsVec.

Returns
true if non-empty muon was return by m_PAC

Definition at line 45 of file RPCTriggerBoard.cc.

46  {
47  //RPCTBMuon tbMuon(m_TriggerConfig->getPac(cone.getConeCrdnts())->run(cone) );
48  if (m_pacs.find(cone.getTower()) == m_pacs.end()) {
49  std::stringstream s;
50  s << "RPCTriggerBoard::runCone() wrong tower: " << cone.getTower() << " in TB=" << m_TBNumber;
51  throw RPCException(s.str());
52  }
53 
54  RPCTBMuon tbMuon(m_pacs[cone.getTower()][cone.getLogSegment()]->run(cone));
55  //Reference: RPCTBMuon(int ptCode, int quality, int sign, int patternNum, unsigned short firedPlanes);
56 
57  //RPCPacMuon pmuon = m_pacs[cone.getTower()][cone.getLogSegment()]->run(cone);
58  //RPCTBMuon tbMuon(pmuon.getPtCode(), pmuon.getQuality(), pmuon.getSign(), pmuon.getPatternNum(), pmuon.getFiredPlanes());
59 
60  if (tbMuon.getCode() > 0) {
61  m_PacsMuonsVec.push_back(tbMuon);
62  if (m_TriggerConfig->getDebugLevel() != 0) {
63 #ifndef _STAND_ALONE
64  // LogDebug("RPCHwDebug") << "GB 0 -1 "
65  // << tbMuon.printDebugInfo(m_TriggerConfig->getDebugLevel());
66  MuonsGrabber::Instance().addMuon(tbMuon, 0, -1, -1, -1);
67 #else
68  std::cout << "GB 0 -1 " << tbMuon.printDebugInfo(m_TriggerConfig->getDebugLevel()) << std::endl;
69 #endif //_STAND_ALONE
70  }
71  return true;
72  } else
73  return false;

References MuonsGrabber::addMuon(), gather_cfg::cout, RPCTriggerConfiguration::getDebugLevel(), RPCLogCone::getLogSegment(), RPCLogCone::getTower(), MuonsGrabber::Instance(), m_pacs, m_PacsMuonsVec, m_TBNumber, m_TriggerConfig, and alignCSCRings::s.

◆ runTBGB()

L1RpcTBMuonsVec RPCTriggerBoard::runTBGB ( )

Creates L1RpcTBMuonsVec2 from muons from m_PacsMuonsVec. Then runs RPCTBGhostBuster::run().

Returns
4 muons or empty vector.

Definition at line 75 of file RPCTriggerBoard.cc.

76  { //4 muons or empty vector
77  if (m_PacsMuonsVec.empty())
78  return L1RpcTBMuonsVec();
79 
81  for (unsigned int iMu = 0; iMu < m_PacsMuonsVec.size(); iMu++) {
82  int tbTower = m_TriggerConfig->getTowerNumOnTb(m_PacsMuonsVec[iMu].getConeCrdnts());
83 
84  if (gbMuons[tbTower].empty())
85  gbMuons[tbTower].assign(RPCConst::m_SEGMENTS_IN_SECTOR_CNT, RPCTBMuon());
86 
87  gbMuons[tbTower][m_PacsMuonsVec[iMu].getLogSegment()] = m_PacsMuonsVec[iMu];
88  }
89 
90  m_PacsMuonsVec.clear();
91  return m_TBGhostBuster.run(gbMuons);

References relativeConstraints::empty, RPCTriggerConfiguration::getTowerNumOnTb(), m_PacsMuonsVec, RPCConst::m_SEGMENTS_IN_SECTOR_CNT, m_TBGhostBuster, RPCConst::m_TOWERS_ON_TB_CNT, m_TriggerConfig, and RPCTBGhostBuster::run().

Member Data Documentation

◆ m_pacs

PACsAll RPCTriggerBoard::m_pacs
private

Definition at line 47 of file RPCTriggerBoard.h.

Referenced by RPCTriggerBoard(), and runCone().

◆ m_PacsMuonsVec

L1RpcTBMuonsVec RPCTriggerBoard::m_PacsMuonsVec
private

Definition at line 41 of file RPCTriggerBoard.h.

Referenced by runCone(), and runTBGB().

◆ m_TBGhostBuster

RPCTBGhostBuster RPCTriggerBoard::m_TBGhostBuster
private

Definition at line 39 of file RPCTriggerBoard.h.

Referenced by runTBGB().

◆ m_TBNumber

int RPCTriggerBoard::m_TBNumber
private

0...8 , 0 = tbn4, m_tower -16..-13, 4 = tb0

Definition at line 35 of file RPCTriggerBoard.h.

Referenced by RPCTriggerBoard(), and runCone().

◆ m_TriggerConfig

RPCTriggerConfiguration* RPCTriggerBoard::m_TriggerConfig
private

Definition at line 37 of file RPCTriggerBoard.h.

Referenced by RPCTriggerBoard(), runCone(), and runTBGB().

RPCTBGhostBuster::run
L1RpcTBMuonsVec run(L1RpcTBMuonsVec2 &pacMuonsVec2) const
Definition: RPCTBGhostBuster.cc:14
RPCTBMuon
Definition: RPCTBMuon.h:17
mps_fire.i
i
Definition: mps_fire.py:428
RPCTriggerConfiguration::getDebugLevel
int getDebugLevel() const
Definition: RPCTriggerConfiguration.h:41
RPCConst::l1RpcConeCrdnts::m_Tower
int m_Tower
Definition: RPCConst.h:119
RPCLogCone::getTower
int getTower() const
Definition: RPCLogCone.cc:161
gather_cfg.cout
cout
Definition: gather_cfg.py:144
hgcalTowerProducer_cfi.tower
tower
Definition: hgcalTowerProducer_cfi.py:4
MuonsGrabber::Instance
static MuonsGrabber & Instance()
Definition: MuonsGrabber.cc:48
L1RpcTBMuonsVec
std::vector< RPCTBMuon > L1RpcTBMuonsVec
Definition: RPCTBMuon.h:218
alignCSCRings.s
s
Definition: alignCSCRings.py:92
RPCConst::l1RpcConeCrdnts
The coordinates of Logic Cone: m_Tower, m_LogSector, m_LogSegment.
Definition: RPCConst.h:118
RPCConst::m_SEGMENTS_IN_SECTOR_CNT
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 ...
Definition: RPCConst.h:154
RPCTriggerBoard::m_TriggerConfig
RPCTriggerConfiguration * m_TriggerConfig
Definition: RPCTriggerBoard.h:37
RPCTriggerBoard::m_pacs
PACsAll m_pacs
Definition: RPCTriggerBoard.h:47
RPCLogCone::getLogSegment
int getLogSegment() const
Definition: RPCLogCone.cc:165
RPCTriggerBoard::m_PacsMuonsVec
L1RpcTBMuonsVec m_PacsMuonsVec
Definition: RPCTriggerBoard.h:41
RPCConst::m_TOWERS_ON_TB_CNT
static const unsigned int m_TOWERS_ON_TB_CNT
Max number of towers covered by one Trugger Board.
Definition: RPCConst.h:153
RPCTriggerBoard::m_TBNumber
int m_TBNumber
0...8 , 0 = tbn4, m_tower -16..-13, 4 = tb0
Definition: RPCTriggerBoard.h:35
RPCConst::l1RpcConeCrdnts::m_LogSegment
int m_LogSegment
Definition: RPCConst.h:121
RPCTriggerConfiguration::getPac
virtual const RPCPacData * getPac(const RPCConst::l1RpcConeCrdnts &coneCrdnts) const =0
Returns pointer to m_PAC that should run given LogCone.
RPCTriggerBoard::m_TBGhostBuster
RPCTBGhostBuster m_TBGhostBuster
Definition: RPCTriggerBoard.h:39
RPCException
Definition: RPCException.h:21
L1RpcTBMuonsVec2
std::vector< L1RpcTBMuonsVec > L1RpcTBMuonsVec2
Definition: RPCTBMuon.h:219
RPCTriggerConfiguration::getTowerNumOnTb
virtual int getTowerNumOnTb(const RPCConst::l1RpcConeCrdnts &coneCrdnts)=0
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
RPCPac
Definition: RPCPac.h:13
RPCTriggerConfiguration::getTowsCntOnTB
virtual int getTowsCntOnTB(int tbNum)=0
Returns the count of Towers, that are covered by given TB .
MuonsGrabber::addMuon
void addMuon(RPCTBMuon &mu, int lvl, int region, int hs, int index)
Definition: MuonsGrabber.cc:118
RPCConst::l1RpcConeCrdnts::m_LogSector
int m_LogSector
Definition: RPCConst.h:120
RPCPacData
Definition: RPCPacData.h:33