00001 //--------------------------------------------------------------------------- 00002 #include "L1Trigger/RPCTrigger/interface/RPCTriggerCrate.h" 00003 #include "L1Trigger/RPCTrigger/interface/MuonsGrabber.h" 00004 00005 //--------------------------------------------------------------------------- 00006 RPCTriggerCrate::RPCTriggerCrate(RPCTriggerConfiguration* triggerConfig, int tcNum): 00007 m_TCGhostBusterSorter(triggerConfig) 00008 { 00009 //m_TCGhostBusterSorter = tcGhostBusterSorter; 00010 m_TriggerConfig = triggerConfig; 00011 m_WasMuon = false; 00012 00013 m_TCNumber = tcNum; 00014 00015 for(int iTB = 0; iTB < triggerConfig->getTBsInTC(); iTB++) 00016 m_TBsVec.push_back(RPCTriggerBoard(triggerConfig, iTB, tcNum)); 00017 } 00018 //---------------------------------------- 00019 L1RpcTBMuonsVec RPCTriggerCrate::runTCGBSorter() { 00020 if(!m_WasMuon) 00021 return L1RpcTBMuonsVec(); 00022 00023 L1RpcTBMuonsVec2 tbMuonsVec2; 00024 for(unsigned int iTB = 0; iTB < m_TBsVec.size(); iTB++) { 00025 tbMuonsVec2.push_back(m_TBsVec[iTB].runTBGB()); 00026 } 00027 00028 m_WasMuon = false; 00029 00030 if ( m_TriggerConfig->getDebugLevel()!=0){ 00031 00032 for (unsigned int iTC = 0; iTC < tbMuonsVec2.size(); iTC++){ 00033 for (unsigned int iTB = 0; iTB < tbMuonsVec2[iTC].size(); iTB++){ 00034 #ifndef _STAND_ALONE 00035 // LogDebug("RPCHwDebug") << "GB 1 " << iTB << " " 00036 // <<tbMuonsVec2[iTC][iTB].printDebugInfo(m_TriggerConfig->getDebugLevel()); 00037 MuonsGrabber::Instance().addMuon(tbMuonsVec2[iTC][iTB], 1, -1, -1, iTB); 00038 #else 00039 std::cout << "GB 1 " << "GB 1 " << iTB << " " 00040 <<tbMuonsVec2[iTC][iTB].printDebugInfo(m_TriggerConfig->getDebugLevel()) 00041 << std::endl; 00042 #endif //_STAND_ALONE 00043 } 00044 } 00045 00046 } 00047 00048 return m_TCGhostBusterSorter.run(tbMuonsVec2); 00049 } 00050 00051 00053 void RPCTriggerCrate::runCone(const RPCLogCone& cone) { 00054 if(m_TBsVec[m_TriggerConfig->getTBNum(cone.getConeCrdnts())].runCone(cone)) 00055 m_WasMuon = true; 00056 }