CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
< boost::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

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

Definition at line 48 of file RPCTriggerBoard.h.

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

Definition at line 47 of file RPCTriggerBoard.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file RPCTriggerBoard.cc.

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

15 {
16 
17  m_TriggerConfig = triggerConfig;
18  m_TBNumber = tbNum;
19 
20  int towerMin=-16;
21  int towerMax=-16;
22 
23  // Calculate tower boundaries for this TB
24  for (int i=0;i <= tbNum; i++){ // Trigger Boards are numbered from 0 to 8
25  towerMin=towerMax;
26  towerMax+=m_TriggerConfig->getTowsCntOnTB(i);
27  }
28  towerMax--;
29 
30  for (int tower = towerMin; tower <= towerMax; tower++){
31  for (int logSegment = 0; logSegment < 12; logSegment++){ // One logSegment = one PAC
32  //m_pacs[cone.getTower()][cone.getLogSegment()]
34  coneCrds.m_Tower=tower;
35  coneCrds.m_LogSector=tcNum;
36  coneCrds.m_LogSegment=logSegment;
37 
38  const RPCPacData *pacData = m_TriggerConfig->getPac(coneCrds);
39 
40  // one trigger crate covers one logsector:
41  //RPCPac *pac = new RPCPac(pacData, tower, tcNum, logSegment);
42  boost::shared_ptr< RPCPac > pac (new RPCPac(pacData, tower, tcNum, logSegment) );
43 
44  m_pacs[tower].push_back(pac);
45 
46  }
47  }
48 
49 
50 }
int i
Definition: DBlmapReader.cc:9
The coordinates of Logic Cone: m_Tower, m_LogSector, m_LogSegment.
Definition: RPCConst.h:119
virtual const RPCPacData * getPac(const RPCConst::l1RpcConeCrdnts &coneCrdnts) const =0
Returns pointer to m_PAC that should run given LogCone.
Definition: RPCPac.h:14
int m_TBNumber
0...8 , 0 = tbn4, m_tower -16..-13, 4 = tb0
RPCTriggerConfiguration * m_TriggerConfig
virtual int getTowsCntOnTB(int tbNum)=0
Returns the count of Towers, that are covered by given TB .

Member Function Documentation

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 52 of file RPCTriggerBoard.cc.

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.

52  {
53 
54  //RPCTBMuon tbMuon(m_TriggerConfig->getPac(cone.getConeCrdnts())->run(cone) );
55  if(m_pacs.find(cone.getTower())==m_pacs.end()){
56  std::stringstream s;
57  s << "RPCTriggerBoard::runCone() wrong tower: " << cone.getTower() << " in TB=" << m_TBNumber;
58  throw RPCException(s.str());
59  }
60 
61  RPCTBMuon tbMuon(m_pacs[cone.getTower()][cone.getLogSegment()]->run(cone));
62  //Reference: RPCTBMuon(int ptCode, int quality, int sign, int patternNum, unsigned short firedPlanes);
63 
64  //RPCPacMuon pmuon = m_pacs[cone.getTower()][cone.getLogSegment()]->run(cone);
65  //RPCTBMuon tbMuon(pmuon.getPtCode(), pmuon.getQuality(), pmuon.getSign(), pmuon.getPatternNum(), pmuon.getFiredPlanes());
66 
67 
68  if(tbMuon.getCode() > 0) {
69  m_PacsMuonsVec.push_back(tbMuon);
70  if (m_TriggerConfig->getDebugLevel()!=0){
71 #ifndef _STAND_ALONE
72  // LogDebug("RPCHwDebug") << "GB 0 -1 "
73  // << tbMuon.printDebugInfo(m_TriggerConfig->getDebugLevel());
74  MuonsGrabber::Instance().addMuon(tbMuon, 0, -1, -1, -1);
75 #else
76  std::cout << "GB 0 -1 "
77  << tbMuon.printDebugInfo(m_TriggerConfig->getDebugLevel())
78  << std::endl;
79 #endif //_STAND_ALONE
80  }
81  return true;
82  }
83  else
84  return false;
85 
86 }
int getLogSegment() const
Definition: RPCLogCone.cc:192
static MuonsGrabber & Instance()
Definition: MuonsGrabber.cc:58
int getTower() const
Definition: RPCLogCone.cc:188
int m_TBNumber
0...8 , 0 = tbn4, m_tower -16..-13, 4 = tb0
RPCTriggerConfiguration * m_TriggerConfig
void addMuon(RPCTBMuon &mu, int lvl, int region, int hs, int index)
tuple cout
Definition: gather_cfg.py:145
L1RpcTBMuonsVec m_PacsMuonsVec
L1RpcTBMuonsVec RPCTriggerBoard::runTBGB ( )

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

Returns
4 muons or empty vector.

Definition at line 88 of file RPCTriggerBoard.cc.

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

88  { //4 muons or empty vector
89  if(m_PacsMuonsVec.size() == 0)
90  return L1RpcTBMuonsVec();
91 
93  for(unsigned int iMu = 0; iMu < m_PacsMuonsVec.size(); iMu++) {
94  int tbTower = m_TriggerConfig->getTowerNumOnTb(m_PacsMuonsVec[iMu].getConeCrdnts());
95 
96  if(gbMuons[tbTower].size() == 0)
97  gbMuons[tbTower].assign(RPCConst::m_SEGMENTS_IN_SECTOR_CNT, RPCTBMuon());
98 
99  gbMuons[tbTower][m_PacsMuonsVec[iMu].getLogSegment()] = m_PacsMuonsVec[iMu];
100  }
101 
102  m_PacsMuonsVec.clear();
103  return m_TBGhostBuster.run(gbMuons);
104 }
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:159
std::vector< RPCTBMuon > L1RpcTBMuonsVec
Definition: RPCTBMuon.h:206
RPCTBGhostBuster m_TBGhostBuster
std::vector< L1RpcTBMuonsVec > L1RpcTBMuonsVec2
Definition: RPCTBMuon.h:207
L1RpcTBMuonsVec run(L1RpcTBMuonsVec2 &pacMuonsVec2) const
static const unsigned int m_TOWERS_ON_TB_CNT
Max number of towers covered by one Trugger Board.
Definition: RPCConst.h:158
RPCTriggerConfiguration * m_TriggerConfig
virtual int getTowerNumOnTb(const RPCConst::l1RpcConeCrdnts &coneCrdnts)=0
tuple size
Write out results.
L1RpcTBMuonsVec m_PacsMuonsVec

Member Data Documentation

PACsAll RPCTriggerBoard::m_pacs
private

Definition at line 50 of file RPCTriggerBoard.h.

Referenced by RPCTriggerBoard(), and runCone().

L1RpcTBMuonsVec RPCTriggerBoard::m_PacsMuonsVec
private

Definition at line 44 of file RPCTriggerBoard.h.

Referenced by runCone(), and runTBGB().

RPCTBGhostBuster RPCTriggerBoard::m_TBGhostBuster
private

Definition at line 42 of file RPCTriggerBoard.h.

Referenced by runTBGB().

int RPCTriggerBoard::m_TBNumber
private

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

Definition at line 38 of file RPCTriggerBoard.h.

Referenced by RPCTriggerBoard(), and runCone().

RPCTriggerConfiguration* RPCTriggerBoard::m_TriggerConfig
private

Definition at line 40 of file RPCTriggerBoard.h.

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