Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:21:41

0001 //---------------------------------------------------------------------------
0002 #include "L1Trigger/RPCTrigger/interface/RPCTriggerCrate.h"
0003 #include "L1Trigger/RPCTrigger/interface/MuonsGrabber.h"
0004 
0005 //---------------------------------------------------------------------------
0006 RPCTriggerCrate::RPCTriggerCrate(RPCTriggerConfiguration* triggerConfig, int tcNum)
0007     : m_TCGhostBusterSorter(triggerConfig) {
0008   //m_TCGhostBusterSorter = tcGhostBusterSorter;
0009   m_TriggerConfig = triggerConfig;
0010   m_WasMuon = false;
0011 
0012   m_TCNumber = tcNum;
0013 
0014   for (int iTB = 0; iTB < triggerConfig->getTBsInTC(); iTB++)
0015     m_TBsVec.push_back(RPCTriggerBoard(triggerConfig, iTB, tcNum));
0016 }
0017 //----------------------------------------
0018 L1RpcTBMuonsVec RPCTriggerCrate::runTCGBSorter() {
0019   if (!m_WasMuon)
0020     return L1RpcTBMuonsVec();
0021 
0022   L1RpcTBMuonsVec2 tbMuonsVec2;
0023   for (unsigned int iTB = 0; iTB < m_TBsVec.size(); iTB++) {
0024     tbMuonsVec2.push_back(m_TBsVec[iTB].runTBGB());
0025   }
0026 
0027   m_WasMuon = false;
0028 
0029   if (m_TriggerConfig->getDebugLevel() != 0) {
0030     for (unsigned int iTC = 0; iTC < tbMuonsVec2.size(); iTC++) {
0031       for (unsigned int iTB = 0; iTB < tbMuonsVec2[iTC].size(); iTB++) {
0032 #ifndef _STAND_ALONE
0033         //           LogDebug("RPCHwDebug") << "GB 1 " << iTB << " "
0034         //             <<tbMuonsVec2[iTC][iTB].printDebugInfo(m_TriggerConfig->getDebugLevel());
0035         MuonsGrabber::Instance().addMuon(tbMuonsVec2[iTC][iTB], 1, -1, -1, iTB);
0036 #else
0037         std::cout << "GB 1 "
0038                   << "GB 1 " << iTB << " " << tbMuonsVec2[iTC][iTB].printDebugInfo(m_TriggerConfig->getDebugLevel())
0039                   << std::endl;
0040 #endif  //_STAND_ALONE
0041       }
0042     }
0043   }
0044 
0045   return m_TCGhostBusterSorter.run(tbMuonsVec2);
0046 }
0047 
0048 /** Runs RPCTriggerBoard::runCone() for every TB. Cheks, if any non empty muons were found*/
0049 void RPCTriggerCrate::runCone(const RPCLogCone& cone) {
0050   if (m_TBsVec[m_TriggerConfig->getTBNum(cone.getConeCrdnts())].runCone(cone))
0051     m_WasMuon = true;
0052 }