#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, PACsVec > | PACsAll |
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 | |
RPCTriggerConfiguration * | m_TriggerConfig |
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).
Definition at line 20 of file RPCTriggerBoard.h.
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.
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.
{ m_TriggerConfig = triggerConfig; m_TBNumber = tbNum; int towerMin=-16; int towerMax=-16; // Calculate tower boundaries for this TB for (int i=0;i <= tbNum; i++){ // Trigger Boards are numbered from 0 to 8 towerMin=towerMax; towerMax+=m_TriggerConfig->getTowsCntOnTB(i); } towerMax--; for (int tower = towerMin; tower <= towerMax; tower++){ for (int logSegment = 0; logSegment < 12; logSegment++){ // One logSegment = one PAC //m_pacs[cone.getTower()][cone.getLogSegment()] RPCConst::l1RpcConeCrdnts coneCrds; coneCrds.m_Tower=tower; coneCrds.m_LogSector=tcNum; coneCrds.m_LogSegment=logSegment; const RPCPacData *pacData = m_TriggerConfig->getPac(coneCrds); // one trigger crate covers one logsector: //RPCPac *pac = new RPCPac(pacData, tower, tcNum, logSegment); boost::shared_ptr< RPCPac > pac (new RPCPac(pacData, tower, tcNum, logSegment) ); m_pacs[tower].push_back(pac); } } }
bool RPCTriggerBoard::runCone | ( | const RPCLogCone & | cone | ) |
Runs RPCPacData::run() for cone. Converts RPCPacMuon to RPCTBMuon and puts it to the m_PacsMuonsVec.
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 asciidump::s.
{ //RPCTBMuon tbMuon(m_TriggerConfig->getPac(cone.getConeCrdnts())->run(cone) ); if(m_pacs.find(cone.getTower())==m_pacs.end()){ std::stringstream s; s << "RPCTriggerBoard::runCone() wrong tower: " << cone.getTower() << " in TB=" << m_TBNumber; throw RPCException(s.str()); } RPCTBMuon tbMuon(m_pacs[cone.getTower()][cone.getLogSegment()]->run(cone)); //Reference: RPCTBMuon(int ptCode, int quality, int sign, int patternNum, unsigned short firedPlanes); //RPCPacMuon pmuon = m_pacs[cone.getTower()][cone.getLogSegment()]->run(cone); //RPCTBMuon tbMuon(pmuon.getPtCode(), pmuon.getQuality(), pmuon.getSign(), pmuon.getPatternNum(), pmuon.getFiredPlanes()); if(tbMuon.getCode() > 0) { m_PacsMuonsVec.push_back(tbMuon); if (m_TriggerConfig->getDebugLevel()!=0){ #ifndef _STAND_ALONE // LogDebug("RPCHwDebug") << "GB 0 -1 " // << tbMuon.printDebugInfo(m_TriggerConfig->getDebugLevel()); MuonsGrabber::Instance().addMuon(tbMuon, 0, -1, -1, -1); #else std::cout << "GB 0 -1 " << tbMuon.printDebugInfo(m_TriggerConfig->getDebugLevel()) << std::endl; #endif //_STAND_ALONE } return true; } else return false; }
L1RpcTBMuonsVec RPCTriggerBoard::runTBGB | ( | ) |
Creates L1RpcTBMuonsVec2 from muons from m_PacsMuonsVec. Then runs RPCTBGhostBuster::run().
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.
{ //4 muons or empty vector if(m_PacsMuonsVec.size() == 0) return L1RpcTBMuonsVec(); L1RpcTBMuonsVec2 gbMuons(RPCConst::m_TOWERS_ON_TB_CNT, L1RpcTBMuonsVec()); for(unsigned int iMu = 0; iMu < m_PacsMuonsVec.size(); iMu++) { int tbTower = m_TriggerConfig->getTowerNumOnTb(m_PacsMuonsVec[iMu].getConeCrdnts()); if(gbMuons[tbTower].size() == 0) gbMuons[tbTower].assign(RPCConst::m_SEGMENTS_IN_SECTOR_CNT, RPCTBMuon()); gbMuons[tbTower][m_PacsMuonsVec[iMu].getLogSegment()] = m_PacsMuonsVec[iMu]; } m_PacsMuonsVec.clear(); return m_TBGhostBuster.run(gbMuons); }
PACsAll RPCTriggerBoard::m_pacs [private] |
Definition at line 50 of file RPCTriggerBoard.h.
Referenced by RPCTriggerBoard(), and runCone().
Definition at line 44 of file RPCTriggerBoard.h.
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().
Definition at line 40 of file RPCTriggerBoard.h.
Referenced by RPCTriggerBoard(), runCone(), and runTBGB().