CMS 3D CMS Logo

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