#include <L1Trigger/RPCTrigger/interface/RPCPacManager.h>
Public Member Functions | |
TPacType * | getPac (const RPCConst::l1RpcConeCrdnts &coneCrdnts) const |
TPacType * | getPac (int m_tower, int logSector, int logSegment) const |
Returns the pointer to m_PAC for given LogCone defined by m_tower, logSector, logSegment. | |
void | init (const L1RPCConfig *rpcconf) |
void | init (std::string patFilesDirectory, L1RpcPACsCntEnum _PACsCnt) |
Gets data for PACs. | |
~RPCPacManager () | |
Private Attributes | |
L1RpcPACsCntEnum | m_PACsCnt |
std::vector< std::vector < std::vector< TPacType * > > > | m_PacTab |
m_PacTab[m_tower][logSector][m_LogSegment] | |
int | m_SectorsCnt |
Count of used differnt sectors. | |
int | m_SegmentCnt |
Count of used differnt segments. |
The tempalte type TPacTypeshould be derived from RPCPacBase, and containe the constructor: RPCPacData(std::string patFilesDir, int m_tower, int logSector, int logSegment). 3 configuration are suported: ONE_PAC_PER_TOWER - the same m_PAC (set of patterns etc.) for every LogCone in a m_tower _12_PACS_PER_TOWER - the same m_PAC in the same segment in every sector, (i.e. 12 PACs in sector (one for LogicCone (segment)), all sectors are treat as one) _144_PACS_PER_TOWER - one m_PAC for every LogicCone of given m_tower
Definition at line 42 of file RPCPacManager.h.
RPCPacManager< TPacType >::~RPCPacManager | ( | ) | [inline] |
Definition at line 44 of file RPCPacManager.h.
00044 { 00045 for (unsigned int m_tower = 0; m_tower < m_PacTab.size(); m_tower++) 00046 for (unsigned int logSector = 0; logSector < m_PacTab[m_tower].size(); logSector++) { 00047 for (unsigned int logSegment = 0; logSegment < m_PacTab[m_tower][logSector].size(); logSegment++) { 00048 TPacType* pac = m_PacTab[m_tower][logSector][logSegment]; 00049 delete pac; 00050 } 00051 } 00052 }
TPacType* RPCPacManager< TPacType >::getPac | ( | const RPCConst::l1RpcConeCrdnts & | coneCrdnts | ) | const [inline] |
Definition at line 193 of file RPCPacManager.h.
00193 { 00194 return getPac(coneCrdnts.m_Tower, coneCrdnts.m_LogSector, coneCrdnts.m_LogSegment); 00195 }
TPacType* RPCPacManager< TPacType >::getPac | ( | int | m_tower, | |
int | logSector, | |||
int | logSegment | |||
) | const [inline] |
Returns the pointer to m_PAC for given LogCone defined by m_tower, logSector, logSegment.
Here you do not have to care, what configuration is curent used.
m_tower | -16 : 16, | |
logSector | 0 : 11, | |
logSegment | 0 : 11. |
Definition at line 172 of file RPCPacManager.h.
Referenced by RPCPacManager< RPCPacData >::getPac(), and RPCBasicTrigConfig::getPac().
00172 { 00173 if (m_PacTab.size() <= (unsigned int) abs(m_tower)) 00174 throw RPCException("RPCPacManager::getPac: given towerNum to big"); 00175 // edm::LogError("RPCTrigger") << "RPCPacManager::getPac: given towerNum to big" << std::endl; 00176 00177 //int curLogSector = logSector; 00178 //int curlogSegment = logSegment; 00179 00180 if(m_PACsCnt == ONE_PAC_PER_TOWER) { 00181 logSector = 0; 00182 logSegment = 0; 00183 } 00184 else if(m_PACsCnt == _12_PACS_PER_TOWER) { 00185 logSector = 0; 00186 } 00187 00188 //XXXX//m_PacTab[abs(m_tower)][logSector][logSegment]->setCurrentPosition(m_tower, curLogSector, curlogSegment); 00189 return m_PacTab[std::abs(m_tower)][logSector][logSegment]; 00190 };
void RPCPacManager< TPacType >::init | ( | const L1RPCConfig * | rpcconf | ) | [inline] |
Definition at line 92 of file RPCPacManager.h.
00092 { 00093 00094 switch (rpcconf->getPPT()){ 00095 case 1: 00096 m_PACsCnt = ONE_PAC_PER_TOWER; 00097 break; 00098 case 12: 00099 m_PACsCnt = _12_PACS_PER_TOWER; 00100 break; 00101 case 144: 00102 m_PACsCnt = _144_PACS_PER_TOWER; 00103 break; 00104 00105 } 00106 00107 if(m_PACsCnt == ONE_PAC_PER_TOWER) { 00108 m_SectorsCnt = 1; 00109 m_SegmentCnt = 1; 00110 } 00111 else if(m_PACsCnt == _12_PACS_PER_TOWER) { 00112 m_SectorsCnt = 1; 00113 m_SegmentCnt = 12; 00114 } 00115 else if(m_PACsCnt == _144_PACS_PER_TOWER) { 00116 m_SectorsCnt = 12; 00117 m_SegmentCnt = 12; 00118 } 00119 else if(m_PACsCnt == TB_TESTS) { 00120 m_SectorsCnt = 1; 00121 m_SegmentCnt = 4; 00122 } 00123 00124 /* 00125 std::vector<std::vector<std::vector<RPCPattern::RPCPatVec> > > patvec; 00126 std::vector<std::vector<std::vector<RPCPattern::TQualityVec> > > qualvec; 00127 for (int tower = 0; tower < RPCConst::m_TOWER_COUNT; ++tower) { 00128 patvec.push_back(std::vector< std::vector< RPCPattern::RPCPatVec > >()); 00129 qualvec.push_back(std::vector< std::vector< RPCPattern::TQualityVec > >()); 00130 for (int logSector = 0; logSector < m_SectorsCnt; ++logSector) { 00131 patvec[tower].push_back(std::vector< RPCPattern::RPCPatVec >()); 00132 qualvec[tower].push_back(std::vector< RPCPattern::TQualityVec >()); 00133 for (int logSegment = 0; logSegment < m_SegmentCnt; ++logSegment) { 00134 patvec[tower][logSector].push_back(RPCPattern::RPCPatVec()); 00135 qualvec[tower][logSector].push_back(RPCPattern::TQualityVec()); 00136 } 00137 } 00138 } 00139 00140 for (unsigned int ipat=0; ipat<rpcconf->m_pats.size(); ipat++) 00141 patvec[rpcconf->m_pats[ipat].getTower()][rpcconf->m_pats[ipat].getLogSector()][rpcconf->m_pats[ipat].getLogSegment()].push_back(rpcconf->m_pats[ipat]); 00142 for (unsigned int iqual=0; iqual<rpcconf->m_quals.size(); iqual++) 00143 qualvec[rpcconf->m_quals[iqual].m_tower][rpcconf->m_quals[iqual].m_logsector][rpcconf->m_quals[iqual].m_logsegment].push_back(rpcconf->m_quals[iqual]); 00144 */ 00145 00146 00147 for (int tower = 0; tower < RPCConst::m_TOWER_COUNT; tower++) { 00148 m_PacTab.push_back(std::vector<std::vector<TPacType*> >()); 00149 for (int logSector = 0; logSector < m_SectorsCnt; logSector++) { 00150 m_PacTab[tower].push_back(std::vector<TPacType*>()); 00151 for (int logSegment = 0; logSegment < m_SegmentCnt; logSegment++) { 00152 /*L1RPCConfig* rpcconf1=new L1RPCConfig(); 00153 rpcconf1->setPPT(rpcconf->getPPT()); 00154 for (unsigned int ipat=0; ipat<patvec[tower][logSector][logSegment].size(); ipat++) 00155 rpcconf1->m_pats.push_back(patvec[tower][logSector][logSegment][ipat]); 00156 for (unsigned int iqual=0; iqual<qualvec[tower][logSector][logSegment].size(); iqual++) 00157 rpcconf1->m_quals.push_back(qualvec[tower][logSector][logSegment][iqual]); 00158 //TPacType* pac = new TPacType(rpcconf1->m_pats,rpcconf1->m_quals);*/ 00159 TPacType* pac = new TPacType(rpcconf, tower, logSector, logSegment); 00160 m_PacTab[tower][logSector].push_back(pac); 00161 } 00162 } 00163 } 00164 xercesc::XMLPlatformUtils::Terminate(); 00165 };
void RPCPacManager< TPacType >::init | ( | std::string | patFilesDirectory, | |
L1RpcPACsCntEnum | _PACsCnt | |||
) | [inline] |
Gets data for PACs.
patFilesDirectory | The directory where files defining PACs are stored. The files should be named acording to special convencion. | |
_PACsCnt | The configuration version. Should be caled once, before using PACs |
Definition at line 59 of file RPCPacManager.h.
Referenced by RPCTrigger::produce().
00059 { 00060 m_PACsCnt = _PACsCnt; 00061 if(m_PACsCnt == ONE_PAC_PER_TOWER) { 00062 m_SectorsCnt = 1; 00063 m_SegmentCnt = 1; 00064 } 00065 else if(m_PACsCnt == _12_PACS_PER_TOWER) { 00066 m_SectorsCnt = 1; 00067 m_SegmentCnt = 12; 00068 } 00069 else if(m_PACsCnt == _144_PACS_PER_TOWER) { 00070 m_SectorsCnt = 12; 00071 m_SegmentCnt = 12; 00072 } 00073 else if(m_PACsCnt == TB_TESTS) { 00074 m_SectorsCnt = 1; 00075 m_SegmentCnt = 4; 00076 } 00077 00078 for (int m_tower = 0; m_tower < RPCConst::m_TOWER_COUNT; m_tower++) { 00079 m_PacTab.push_back(std::vector<std::vector<TPacType*> >()); 00080 for (int logSector = 0; logSector < m_SectorsCnt; logSector++) { 00081 m_PacTab[m_tower].push_back(std::vector<TPacType*>()); 00082 for (int logSegment = 0; logSegment < m_SegmentCnt; logSegment++) { 00083 TPacType* pac = new TPacType(patFilesDirectory, m_tower, logSector, logSegment); 00084 m_PacTab[m_tower][logSector].push_back(pac); 00085 } 00086 } 00087 } 00088 xercesc::XMLPlatformUtils::Terminate(); 00089 };
L1RpcPACsCntEnum RPCPacManager< TPacType >::m_PACsCnt [private] |
Definition at line 204 of file RPCPacManager.h.
Referenced by RPCPacManager< RPCPacData >::getPac(), and RPCPacManager< RPCPacData >::init().
std::vector<std::vector<std::vector<TPacType*> > > RPCPacManager< TPacType >::m_PacTab [private] |
m_PacTab[m_tower][logSector][m_LogSegment]
Definition at line 198 of file RPCPacManager.h.
Referenced by RPCPacManager< RPCPacData >::getPac(), RPCPacManager< RPCPacData >::init(), and RPCPacManager< RPCPacData >::~RPCPacManager().
int RPCPacManager< TPacType >::m_SectorsCnt [private] |
Count of used differnt sectors.
Definition at line 200 of file RPCPacManager.h.
Referenced by RPCPacManager< RPCPacData >::init().
int RPCPacManager< TPacType >::m_SegmentCnt [private] |
Count of used differnt segments.
Definition at line 202 of file RPCPacManager.h.
Referenced by RPCPacManager< RPCPacData >::init().