CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
20  m_maxBx = 7;
21  m_maxBxWindow = 3; //... considering that we have a bxing in the range [-3,+3]
22  m_maxSectors = 12;
23 
24  int maxMaps = m_maxBx * m_maxSectors;
25 
27  m_wheelMap = new std::bitset<6>[m_maxSectors];
28  m_wheelMapBx = new std::bitset<6>[m_maxSectors * m_maxBx];
30 
31  for(int i=0; i < m_maxSectors; ++i)
32  m_wheelMap[i].reset();
33 
34  for(int i=0; i < maxMaps; ++i)
35  m_wheelMapBx[i].reset();
36 
37  m_debug = false;
38 
39 }
40 //=============================================================================
41 // Destructor
42 //=============================================================================
44 
45  if ( m_wheelMap ) delete[] m_wheelMap;
46  if ( m_wheelMapBx ) delete[] m_wheelMapBx;
47  if ( m_ttuinVec ) delete[] m_ttuinVec;
48 
49 }
50 
51 //=============================================================================
52 void RPCWheelMap::addHit( int bx, int sec, int layer)
53 {
54 
55  // |--12--|--12--|--12--|--12--|--12--|--12--|--12--| (12 sectors x 6 layers x 7 bx)
56  // 0.....11
57  int indx1 = bx + m_maxBxWindow;
58  int indx2 = sec + indx1*m_maxSectors;
59  m_wheelMapBx[ indx2 ].set( layer-1, 1);
60 
61 }
62 
64 {
65 
66  bool anyHits(false);
67 
68  for(int bx=0; bx < m_maxBx; ++bx) {
69 
70  anyHits = false;
71 
72  for(int i=0; i < m_maxSectors; ++i) {
73 
74  int indx = i + bx*m_maxSectors;
75 
76  m_ttuinVec[bx].m_bx = ( bx - m_maxBxWindow );
77  m_wheelMap[i] = m_wheelMapBx[ indx ];
79 
80  anyHits |= m_wheelMap[i].any();
81 
82  if( m_debug ) {
84  test = m_wheelMap[i].to_string<char,std::char_traits<char>,std::allocator<char> >();
85  std::cout << "prepareData> sec: " << i << " " << test << " anyHits " << anyHits << std::endl;
86  }
87 
88  }
89 
90  m_ttuinVec[bx].m_hasHits = anyHits;
91 
92  }
93 
94  if( m_debug ) std::cout << "prepareData> done." << '\n';
95 
96 }
97 
98 
int i
Definition: DBlmapReader.cc:9
int m_bx
Definition: TTUInput.h:52
bool m_debug
Definition: RPCWheelMap.h:46
virtual ~RPCWheelMap()
Destructor.
Definition: RPCWheelMap.cc:43
RPCWheelMap()
Standard constructor.
Definition: RPCWheelMap.h:17
void prepareData()
Definition: RPCWheelMap.cc:63
int wheelid()
Definition: RPCWheelMap.h:27
std::bitset< 6 > * m_wheelMap
Definition: RPCWheelMap.h:43
TTUInput * m_ttuinVec
Definition: RPCWheelMap.h:29
int m_maxSectors
Definition: RPCWheelMap.h:40
int m_maxBxWindow
Definition: RPCWheelMap.h:41
bool m_hasHits
Definition: TTUInput.h:56
std::bitset< 6 > * m_wheelMapBx
Definition: RPCWheelMap.h:44
tuple cout
Definition: gather_cfg.py:145
void reset(double vett[256])
Definition: TPedValues.cc:11
void addHit(int, int, int)
Definition: RPCWheelMap.cc:52
std::bitset< 6 > * input_sec
Definition: TTUInput.h:58