CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Attributes
RPCWheelMap Class Reference

#include <RPCWheelMap.h>

Public Member Functions

void addHit (int, int, int)
 
void prepareData ()
 
 RPCWheelMap ()
 Standard constructor. More...
 
 RPCWheelMap (int)
 
int wheelid ()
 
int wheelIdx ()
 
virtual ~RPCWheelMap ()
 Destructor. More...
 

Public Attributes

TTUInputm_ttuinVec
 

Private Attributes

int m_bx
 
bool m_debug
 
int m_maxBx
 
int m_maxBxWindow
 
int m_maxSectors
 
int m_wheelid
 
std::bitset< 6 > * m_wheelMap
 
std::bitset< 6 > * m_wheelMapBx
 

Detailed Description

Author
Andres Felipe Osorio Oliveros
Date
2008-11-24

Definition at line 15 of file RPCWheelMap.h.

Constructor & Destructor Documentation

RPCWheelMap::RPCWheelMap ( )
inline

Standard constructor.

Definition at line 18 of file RPCWheelMap.h.

18 {};
RPCWheelMap::RPCWheelMap ( int  wheelid)

Definition at line 19 of file RPCWheelMap.cc.

References i, m_debug, m_maxBx, m_maxBxWindow, m_maxSectors, m_ttuinVec, m_wheelid, m_wheelMap, m_wheelMapBx, reset(), and wheelid().

19  {
20 
21  m_maxBx = 7;
22  m_maxBxWindow = 3; //... considering that we have a bxing in the range [-3,+3]
23  m_maxSectors = 12;
24 
25  int maxMaps = m_maxBx * m_maxSectors;
26 
28  m_wheelMap = new std::bitset<6>[m_maxSectors];
29  m_wheelMapBx = new std::bitset<6>[m_maxSectors * m_maxBx];
31 
32  for(int i=0; i < m_maxSectors; ++i)
33  m_wheelMap[i].reset();
34 
35  for(int i=0; i < maxMaps; ++i)
36  m_wheelMapBx[i].reset();
37 
38  m_debug = false;
39 
40 }
int i
Definition: DBlmapReader.cc:9
bool m_debug
Definition: RPCWheelMap.h:47
int wheelid()
Definition: RPCWheelMap.h:28
std::bitset< 6 > * m_wheelMap
Definition: RPCWheelMap.h:44
TTUInput * m_ttuinVec
Definition: RPCWheelMap.h:30
int m_maxSectors
Definition: RPCWheelMap.h:41
int m_maxBxWindow
Definition: RPCWheelMap.h:42
std::bitset< 6 > * m_wheelMapBx
Definition: RPCWheelMap.h:45
void reset(double vett[256])
Definition: TPedValues.cc:11
RPCWheelMap::~RPCWheelMap ( )
virtual

Destructor.

Definition at line 44 of file RPCWheelMap.cc.

References m_ttuinVec, m_wheelMap, and m_wheelMapBx.

44  {
45 
46  if ( m_wheelMap ) delete[] m_wheelMap;
47  if ( m_wheelMapBx ) delete[] m_wheelMapBx;
48  if ( m_ttuinVec ) delete[] m_ttuinVec;
49 
50 }
std::bitset< 6 > * m_wheelMap
Definition: RPCWheelMap.h:44
TTUInput * m_ttuinVec
Definition: RPCWheelMap.h:30
std::bitset< 6 > * m_wheelMapBx
Definition: RPCWheelMap.h:45

Member Function Documentation

void RPCWheelMap::addHit ( int  bx,
int  sec,
int  layer 
)

Definition at line 53 of file RPCWheelMap.cc.

References m_maxBxWindow, m_maxSectors, and m_wheelMapBx.

54 {
55 
56  // |--12--|--12--|--12--|--12--|--12--|--12--|--12--| (12 sectors x 6 layers x 7 bx)
57  // 0.....11
58  int indx1 = bx + m_maxBxWindow;
59  int indx2 = sec + indx1*m_maxSectors;
60  m_wheelMapBx[ indx2 ].set( layer-1, 1);
61 
62 }
int m_maxSectors
Definition: RPCWheelMap.h:41
int m_maxBxWindow
Definition: RPCWheelMap.h:42
std::bitset< 6 > * m_wheelMapBx
Definition: RPCWheelMap.h:45
void RPCWheelMap::prepareData ( )

Definition at line 64 of file RPCWheelMap.cc.

References gather_cfg::cout, i, TTUInput::input_sec, TTUInput::m_bx, m_debug, TTUInput::m_hasHits, m_maxBx, m_maxBxWindow, m_maxSectors, m_ttuinVec, m_wheelMap, m_wheelMapBx, and run_regression::test.

65 {
66 
67  bool anyHits(false);
68 
69  for(int bx=0; bx < m_maxBx; ++bx) {
70 
71  anyHits = false;
72 
73  for(int i=0; i < m_maxSectors; ++i) {
74 
75  int indx = i + bx*m_maxSectors;
76 
77  m_ttuinVec[bx].m_bx = ( bx - m_maxBxWindow );
78  m_wheelMap[i] = m_wheelMapBx[ indx ];
80 
81  anyHits |= m_wheelMap[i].any();
82 
83  if( m_debug ) {
84  std::string test;
85  test = m_wheelMap[i].to_string<char,std::char_traits<char>,std::allocator<char> >();
86  std::cout << "prepareData> sec: " << i << " " << test << " anyHits " << anyHits << std::endl;
87  }
88 
89  }
90 
91  m_ttuinVec[bx].m_hasHits = anyHits;
92 
93  }
94 
95  if( m_debug ) std::cout << "prepareData> done." << '\n';
96 
97 }
int i
Definition: DBlmapReader.cc:9
int m_bx
Definition: TTUInput.h:53
bool m_debug
Definition: RPCWheelMap.h:47
std::bitset< 6 > * m_wheelMap
Definition: RPCWheelMap.h:44
TTUInput * m_ttuinVec
Definition: RPCWheelMap.h:30
int m_maxSectors
Definition: RPCWheelMap.h:41
int m_maxBxWindow
Definition: RPCWheelMap.h:42
bool m_hasHits
Definition: TTUInput.h:57
std::bitset< 6 > * m_wheelMapBx
Definition: RPCWheelMap.h:45
tuple cout
Definition: gather_cfg.py:121
std::bitset< 6 > * input_sec
Definition: TTUInput.h:59
int RPCWheelMap::wheelid ( )
inline

Definition at line 28 of file RPCWheelMap.h.

References m_wheelid.

Referenced by RPCWheelMap().

28 { return m_wheelid; };
int RPCWheelMap::wheelIdx ( )
inline

Definition at line 30 of file RPCWheelMap.h.

References m_wheelid.

30 { return (m_wheelid+2); };

Member Data Documentation

int RPCWheelMap::m_bx
private

Definition at line 38 of file RPCWheelMap.h.

bool RPCWheelMap::m_debug
private

Definition at line 47 of file RPCWheelMap.h.

Referenced by prepareData(), and RPCWheelMap().

int RPCWheelMap::m_maxBx
private

Definition at line 40 of file RPCWheelMap.h.

Referenced by prepareData(), and RPCWheelMap().

int RPCWheelMap::m_maxBxWindow
private

Definition at line 42 of file RPCWheelMap.h.

Referenced by addHit(), prepareData(), and RPCWheelMap().

int RPCWheelMap::m_maxSectors
private

Definition at line 41 of file RPCWheelMap.h.

Referenced by addHit(), prepareData(), and RPCWheelMap().

TTUInput* RPCWheelMap::m_ttuinVec

Definition at line 30 of file RPCWheelMap.h.

Referenced by prepareData(), RPCWheelMap(), and ~RPCWheelMap().

int RPCWheelMap::m_wheelid
private

Definition at line 39 of file RPCWheelMap.h.

Referenced by RPCWheelMap(), wheelid(), and wheelIdx().

std::bitset<6>* RPCWheelMap::m_wheelMap
private

Definition at line 44 of file RPCWheelMap.h.

Referenced by prepareData(), RPCWheelMap(), and ~RPCWheelMap().

std::bitset<6>* RPCWheelMap::m_wheelMapBx
private

Definition at line 45 of file RPCWheelMap.h.

Referenced by addHit(), prepareData(), RPCWheelMap(), and ~RPCWheelMap().