Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:30:34

0001 // Include files
0002 
0003 // local
0004 #include "L1Trigger/RPCTechnicalTrigger/interface/RPCWheelMap.h"
0005 #include <string>
0006 #include <iostream>
0007 //-----------------------------------------------------------------------------
0008 // Implementation file for class : RPCWheelMap
0009 //
0010 // 2008-11-24 : Andres Felipe Osorio Oliveros
0011 //-----------------------------------------------------------------------------
0012 
0013 //=============================================================================
0014 // Standard constructor, initializes variables
0015 //=============================================================================
0016 RPCWheelMap::RPCWheelMap(int wheelid) {
0017   m_wheelid = wheelid;
0018   m_debug = false;
0019 }
0020 
0021 //=============================================================================
0022 void RPCWheelMap::addHit(int bx, int sec, int layer) {
0023   // |--12--|--12--|--12--|--12--|--12--|--12--|--12--| (12 sectors x 6 layers x  7 bx)
0024   // 0.....11
0025   int indx1 = bx + m_maxBxWindow;
0026   int indx2 = sec + indx1 * m_maxSectors;
0027   m_wheelMapBx[indx2].set(layer - 1, true);
0028 }
0029 
0030 void RPCWheelMap::prepareData() {
0031   bool anyHits(false);
0032 
0033   for (int bx = 0; bx < m_maxBx; ++bx) {
0034     anyHits = false;
0035 
0036     for (int i = 0; i < m_maxSectors; ++i) {
0037       int indx = i + bx * m_maxSectors;
0038 
0039       m_ttuinVec[bx].m_bx = (bx - m_maxBxWindow);
0040       m_wheelMap[i] = m_wheelMapBx[indx];
0041       m_ttuinVec[bx].input_sec[i] = m_wheelMap[i];
0042 
0043       anyHits |= m_wheelMap[i].any();
0044 
0045       if (m_debug) {
0046         std::string test;
0047         test = m_wheelMap[i].to_string<char, std::char_traits<char>, std::allocator<char> >();
0048         std::cout << "prepareData> sec: " << i << " " << test << " anyHits " << anyHits << std::endl;
0049       }
0050     }
0051 
0052     m_ttuinVec[bx].m_hasHits = anyHits;
0053   }
0054 
0055   if (m_debug)
0056     std::cout << "prepareData> done." << '\n';
0057 }