CMS 3D CMS Logo

RPCWheelMap.cc
Go to the documentation of this file.
1 // Include files
2 
3 // local
5 #include <string>
6 #include <iostream>
7 //-----------------------------------------------------------------------------
8 // Implementation file for class : RPCWheelMap
9 //
10 // 2008-11-24 : Andres Felipe Osorio Oliveros
11 //-----------------------------------------------------------------------------
12 
13 //=============================================================================
14 // Standard constructor, initializes variables
15 //=============================================================================
18  m_debug = false;
19 }
20 
21 //=============================================================================
22 void RPCWheelMap::addHit(int bx, int sec, int layer) {
23  // |--12--|--12--|--12--|--12--|--12--|--12--|--12--| (12 sectors x 6 layers x 7 bx)
24  // 0.....11
25  int indx1 = bx + m_maxBxWindow;
26  int indx2 = sec + indx1 * m_maxSectors;
27  m_wheelMapBx[indx2].set(layer - 1, true);
28 }
29 
31  bool anyHits(false);
32 
33  for (int bx = 0; bx < m_maxBx; ++bx) {
34  anyHits = false;
35 
36  for (int i = 0; i < m_maxSectors; ++i) {
37  int indx = i + bx * m_maxSectors;
38 
39  m_ttuinVec[bx].m_bx = (bx - m_maxBxWindow);
40  m_wheelMap[i] = m_wheelMapBx[indx];
41  m_ttuinVec[bx].input_sec[i] = m_wheelMap[i];
42 
43  anyHits |= m_wheelMap[i].any();
44 
45  if (m_debug) {
47  test = m_wheelMap[i].to_string<char, std::char_traits<char>, std::allocator<char> >();
48  std::cout << "prepareData> sec: " << i << " " << test << " anyHits " << anyHits << std::endl;
49  }
50  }
51 
52  m_ttuinVec[bx].m_hasHits = anyHits;
53  }
54 
55  if (m_debug)
56  std::cout << "prepareData> done." << '\n';
57 }
std::array< TTUInput, m_maxBx > m_ttuinVec
Definition: RPCWheelMap.h:29
bool m_debug
Definition: RPCWheelMap.h:41
void prepareData()
Definition: RPCWheelMap.cc:30
static constexpr int m_maxBx
Definition: RPCWheelMap.h:16
int wheelid() const
Definition: RPCWheelMap.h:27
RPCWheelMap(int)
Definition: RPCWheelMap.cc:16
std::array< std::bitset< 6 >, m_maxSectors > m_wheelMap
Definition: RPCWheelMap.h:38
std::array< std::bitset< 6 >, m_maxSectors *m_maxBx > m_wheelMapBx
Definition: RPCWheelMap.h:39
static constexpr int m_maxBxWindow
Definition: RPCWheelMap.h:18
static constexpr int m_maxSectors
Definition: RPCWheelMap.h:17
void addHit(int, int, int)
Definition: RPCWheelMap.cc:22