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
RPCWheel Class Reference

#include <RPCWheel.h>

Public Member Functions

void createWheelMap ()
 
void emulate ()
 
int getid ()
 
bool initialise ()
 
void print_wheel (const TTUInput &)
 
void printinfo ()
 
bool process (int, const std::map< int, RBCInput * > &)
 
bool process (int, const std::map< int, TTUInput * > &)
 
void retrieveWheelMap (TTUInput &)
 
 RPCWheel ()
 Standard constructor. More...
 
void setProperties (int)
 
void setProperties (int, const char *)
 
void setProperties (int, const char *, const char *)
 
void setSpecifications (const RBCBoardSpecs *)
 
virtual ~RPCWheel ()
 Destructor. More...
 

Public Attributes

std::vector< RBCEmulator * > m_RBCE
 

Private Attributes

bool m_debug
 
int m_id
 
int m_maxlayers
 
int m_maxrbc
 
int m_maxsectors
 
std::bitset< 12 > m_rbcDecision
 
std::vector< int > m_sec1id
 
std::vector< int > m_sec2id
 
std::bitset< 6 > * m_wheelmap
 

Detailed Description

Author
Andres Osorio

email: aosor.nosp@m.io@u.nosp@m.niand.nosp@m.es.e.nosp@m.du.co

Date
2008-10-15

Definition at line 24 of file RPCWheel.h.

Constructor & Destructor Documentation

RPCWheel::RPCWheel ( )

Standard constructor.

Definition at line 18 of file RPCWheel.cc.

References m_debug, m_id, m_maxlayers, m_maxrbc, m_maxsectors, m_sec1id, m_sec2id, and m_wheelmap.

18  {
19 
20  m_id = 0;
21 
22  m_maxrbc = 6;
23  m_maxlayers = 6;
24  m_maxsectors = 12;
25 
26  m_debug = false;
27 
28  m_sec1id.push_back(12);
29  m_sec2id.push_back(1);
30  m_sec1id.push_back(2);
31  m_sec2id.push_back(3);
32  m_sec1id.push_back(4);
33  m_sec2id.push_back(5);
34  m_sec1id.push_back(6);
35  m_sec2id.push_back(7);
36  m_sec1id.push_back(8);
37  m_sec2id.push_back(9);
38  m_sec1id.push_back(10);
39  m_sec2id.push_back(11);
40 
41  m_wheelmap = new std::bitset<6>[12];
42 
43 }
std::bitset< 6 > * m_wheelmap
Definition: RPCWheel.h:74
std::vector< int > m_sec2id
Definition: RPCWheel.h:69
int m_id
Definition: RPCWheel.h:63
bool m_debug
Definition: RPCWheel.h:76
std::vector< int > m_sec1id
Definition: RPCWheel.h:68
int m_maxsectors
Definition: RPCWheel.h:66
int m_maxlayers
Definition: RPCWheel.h:65
int m_maxrbc
Definition: RPCWheel.h:64
RPCWheel::~RPCWheel ( )
virtual

Destructor.

Definition at line 106 of file RPCWheel.cc.

References m_RBCE, m_sec1id, m_sec2id, and m_wheelmap.

106  {
107 
108  //destroy all rbc objects associated
109  std::vector<RBCEmulator*>::iterator itr;
110  for( itr = m_RBCE.begin(); itr != m_RBCE.end(); ++itr)
111  if ( (*itr) ) delete (*itr);
112 
113  m_RBCE.clear();
114  m_sec1id.clear();
115  m_sec2id.clear();
116 
117  if ( m_wheelmap ) delete[] m_wheelmap;
118 
119 }
std::bitset< 6 > * m_wheelmap
Definition: RPCWheel.h:74
std::vector< int > m_sec2id
Definition: RPCWheel.h:69
std::vector< int > m_sec1id
Definition: RPCWheel.h:68
std::vector< RBCEmulator * > m_RBCE
Definition: RPCWheel.h:57

Member Function Documentation

void RPCWheel::createWheelMap ( )

Definition at line 234 of file RPCWheel.cc.

References gather_cfg::cout, gen::k, m_debug, m_maxrbc, m_rbcDecision, m_RBCE, and m_wheelmap.

Referenced by TTUEmulator::processTtu().

235 {
236 
237  m_rbcDecision.reset();
238 
239  std::bitset<6> layersignal;
240 
241  layersignal = * m_RBCE[0]->getlayersignal( 0 );
242  m_wheelmap[11] = layersignal;
243 
244  m_rbcDecision.set( 11 , m_RBCE[0]->getdecision( 0 ) );
245 
246  for( int k=0; k < (m_maxrbc-1); ++k )
247  {
248  layersignal = * m_RBCE[k+1]->getlayersignal( 0 );
249  m_wheelmap[(k*2)+1] = layersignal;
250  layersignal = * m_RBCE[k+1]->getlayersignal( 1 );
251  m_wheelmap[(k*2)+2] = layersignal;
252 
253  m_rbcDecision.set( (k*2)+1 , m_RBCE[k+1]->getdecision( 0 ) );
254  m_rbcDecision.set( (k*2)+2 , m_RBCE[k+1]->getdecision( 1 ) );
255 
256  }
257 
258  layersignal = * m_RBCE[0]->getlayersignal( 1 );
259  m_wheelmap[0] = layersignal;
260 
261  m_rbcDecision.set( 0 , m_RBCE[0]->getdecision( 1 ) );
262 
263  if( m_debug ) std::cout << "RPCWheel::createWheelMap done" << std::endl;
264 
265 }
std::bitset< 6 > * m_wheelmap
Definition: RPCWheel.h:74
bool m_debug
Definition: RPCWheel.h:76
std::bitset< 12 > m_rbcDecision
Definition: RPCWheel.h:73
int m_maxrbc
Definition: RPCWheel.h:64
int k[5][pyjets_maxn]
std::vector< RBCEmulator * > m_RBCE
Definition: RPCWheel.h:57
tuple cout
Definition: gather_cfg.py:121
void RPCWheel::emulate ( )

Definition at line 140 of file RPCWheel.cc.

References gen::k, m_maxrbc, and m_RBCE.

141 {
142  //This is a test emulation
143  for( int k=0; k < m_maxrbc; ++k )
144  {
145  m_RBCE[k]->emulate();
146  }
147 
148 }
int m_maxrbc
Definition: RPCWheel.h:64
int k[5][pyjets_maxn]
std::vector< RBCEmulator * > m_RBCE
Definition: RPCWheel.h:57
int RPCWheel::getid ( )
inline

Definition at line 51 of file RPCWheel.h.

References m_id.

Referenced by TTUEmulator::processTtu().

51 { return m_id; };
int m_id
Definition: RPCWheel.h:63
bool RPCWheel::initialise ( )

Definition at line 130 of file RPCWheel.cc.

References gen::k, m_maxrbc, m_RBCE, and ntuplemaker::status.

131 {
132 
133  bool status(false);
134  for( int k=0; k < m_maxrbc; ++k )
135  status = m_RBCE[k]->initialise();
136  return status;
137 
138 }
bool initialise()
Definition: RPCWheel.cc:130
int m_maxrbc
Definition: RPCWheel.h:64
int k[5][pyjets_maxn]
std::vector< RBCEmulator * > m_RBCE
Definition: RPCWheel.h:57
tuple status
Definition: ntuplemaker.py:245
void RPCWheel::print_wheel ( const TTUInput wmap)

Definition at line 301 of file RPCWheel.cc.

References gather_cfg::cout, i, TTUInput::input_sec, j, gen::k, TTUInput::m_bx, m_maxlayers, m_maxsectors, and TTUInput::m_wheelId.

Referenced by retrieveWheelMap().

302 {
303 
304  std::cout << "RPCWheel::print_wheel> " << wmap.m_wheelId << '\t' << wmap.m_bx << std::endl;
305 
306  for( int i=0; i < m_maxsectors; ++i) std::cout << '\t' << (i+1);
307  std::cout << std::endl;
308 
309  for( int k=0; k < m_maxlayers; ++k )
310  {
311  std::cout << (k+1) << '\t';
312  for( int j=0; j < m_maxsectors; ++j)
313  std::cout << wmap.input_sec[j][k] << '\t';
314  std::cout << std::endl;
315  }
316 
317 }
int i
Definition: DBlmapReader.cc:9
int m_bx
Definition: TTUInput.h:53
int m_wheelId
Definition: TTUInput.h:55
int m_maxsectors
Definition: RPCWheel.h:66
int m_maxlayers
Definition: RPCWheel.h:65
int j
Definition: DBlmapReader.cc:9
int k[5][pyjets_maxn]
tuple cout
Definition: gather_cfg.py:121
std::bitset< 6 > * input_sec
Definition: TTUInput.h:59
void RPCWheel::printinfo ( )

Definition at line 292 of file RPCWheel.cc.

References gather_cfg::cout, gen::k, m_id, m_maxrbc, and m_RBCE.

293 {
294 
295  std::cout << "Wheel -> " << m_id << '\n';
296  for( int k=0; k < m_maxrbc; ++k )
297  m_RBCE[k]->printinfo();
298 
299 }
void printinfo()
Definition: RPCWheel.cc:292
int m_id
Definition: RPCWheel.h:63
int m_maxrbc
Definition: RPCWheel.h:64
int k[5][pyjets_maxn]
std::vector< RBCEmulator * > m_RBCE
Definition: RPCWheel.h:57
tuple cout
Definition: gather_cfg.py:121
bool RPCWheel::process ( int  bx,
const std::map< int, RBCInput * > &  data 
)

Definition at line 150 of file RPCWheel.cc.

References abs, gather_cfg::cout, gen::k, combine::key, m_debug, m_maxrbc, m_RBCE, and ntuplemaker::status.

Referenced by ConfigBuilder.ConfigBuilder.PrintAllModules::leave().

151 {
152 
153  int bxsign(1);
154  bool status(false);
155 
156  std::map<int,RBCInput*>::const_iterator itr;
157 
158  if ( bx != 0 ) bxsign = ( bx / abs(bx) );
159  else bxsign = 1;
160 
161  for(int k=0; k < m_maxrbc; ++k) {
162 
163  m_RBCE[k]->reset();
164 
165  int key = bxsign*( 1000000 * abs(bx)
166  + m_RBCE[k]->m_rbcinfo->wheelIdx()*10000
167  + m_RBCE[k]->m_rbcinfo->sector(0)*100
168  + m_RBCE[k]->m_rbcinfo->sector(1) );
169 
170  itr = data.find( key );
171 
172  if ( itr != data.end() ) {
173 
174  if ( ! (*itr).second->hasData ) {
175  status |= false;
176  continue;
177  } else {
178  if( m_debug ) std::cout << "RPCWheel::process> found data at: "
179  << key << '\t'
180  << ( itr->second ) << std::endl;
181  m_RBCE[k]->emulate( ( itr->second ) );
182  status |= true;
183  }
184 
185  } else {
186  //if( m_debug ) std::cout << "RPCWheel::process> position not found: " << key << std::endl;
187  status |= false;
188  }
189 
190  }
191 
192  return status;
193 
194 }
#define abs(x)
Definition: mlp_lapack.h:159
bool m_debug
Definition: RPCWheel.h:76
int m_maxrbc
Definition: RPCWheel.h:64
int k[5][pyjets_maxn]
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
list key
Definition: combine.py:13
std::vector< RBCEmulator * > m_RBCE
Definition: RPCWheel.h:57
tuple cout
Definition: gather_cfg.py:121
tuple status
Definition: ntuplemaker.py:245
bool RPCWheel::process ( int  bx,
const std::map< int, TTUInput * > &  data 
)

Definition at line 196 of file RPCWheel.cc.

References abs, gather_cfg::cout, gen::k, combine::key, m_debug, m_id, m_maxsectors, m_wheelmap, and ntuplemaker::status.

Referenced by ConfigBuilder.ConfigBuilder.PrintAllModules::leave().

197 {
198 
199  int bxsign(1);
200  bool status(false);
201 
202  std::map<int,TTUInput*>::const_iterator itr;
203 
204  if ( bx != 0 ) bxsign = ( bx / abs(bx) );
205  else bxsign = 1;
206 
207  int key = bxsign*( 1000000 * abs(bx) + (m_id+2)*10000 );
208 
209  itr = data.find( key );
210 
211  if ( itr != data.end() ) {
212  if( m_debug ) std::cout << "RPCWheel::process> found data at: " << key << '\t'
213  << ( itr->second ) << std::endl;
214 
215  if ( ! (*itr).second->m_hasHits ) return false;
216 
217  for( int k=0; k < m_maxsectors; ++k ) {
218  m_wheelmap[k] = (*itr).second->input_sec[k];
219  status = true;
220  }
221 
222  } else {
223  //if( m_debug ) std::cout << "RPCWheel::process> position not found: " << key << std::endl;
224  status = false;
225  }
226 
227  return status;
228 
229 }
std::bitset< 6 > * m_wheelmap
Definition: RPCWheel.h:74
#define abs(x)
Definition: mlp_lapack.h:159
int m_id
Definition: RPCWheel.h:63
bool m_debug
Definition: RPCWheel.h:76
int m_maxsectors
Definition: RPCWheel.h:66
int k[5][pyjets_maxn]
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
list key
Definition: combine.py:13
tuple cout
Definition: gather_cfg.py:121
tuple status
Definition: ntuplemaker.py:245
void RPCWheel::retrieveWheelMap ( TTUInput output)

Definition at line 267 of file RPCWheel.cc.

References gather_cfg::cout, i, TTUInput::input_sec, j, m_debug, m_id, m_maxlayers, m_maxsectors, TTUInput::m_rbcDecision, m_rbcDecision, TTUInput::m_wheelId, m_wheelmap, print_wheel(), and TTUInput::reset().

Referenced by TTUEmulator::processTtu().

268 {
269 
270  if( m_debug ) std::cout << "RPCWheel::retrieveWheelMap starts" << std::endl;
271  output.reset();
272 
273  for(int i=0; i < m_maxsectors; ++i ) {
274  for( int j=0; j < m_maxlayers; ++j )
275  {
276  output.input_sec[i].set(j, m_wheelmap[i][j]);
277  }
278  }
279 
280  output.m_wheelId = m_id;
281 
282  output.m_rbcDecision = m_rbcDecision;
283 
284  if( m_debug ) print_wheel( output );
285  if( m_debug ) std::cout << "RPCWheel::retrieveWheelMap done" << std::endl;
286 
287 }
int i
Definition: DBlmapReader.cc:9
void print_wheel(const TTUInput &)
Definition: RPCWheel.cc:301
std::bitset< 6 > * m_wheelmap
Definition: RPCWheel.h:74
int m_wheelId
Definition: TTUInput.h:55
int m_id
Definition: RPCWheel.h:63
void reset()
Definition: TTUInput.cc:44
bool m_debug
Definition: RPCWheel.h:76
std::bitset< 12 > m_rbcDecision
Definition: RPCWheel.h:73
int m_maxsectors
Definition: RPCWheel.h:66
std::bitset< 12 > m_rbcDecision
Definition: TTUInput.h:60
int m_maxlayers
Definition: RPCWheel.h:65
int j
Definition: DBlmapReader.cc:9
tuple cout
Definition: gather_cfg.py:121
std::bitset< 6 > * input_sec
Definition: TTUInput.h:59
void RPCWheel::setProperties ( int  wid)

Definition at line 45 of file RPCWheel.cc.

References gen::k, m_id, m_maxrbc, m_maxsectors, m_RBCE, m_sec1id, m_sec2id, m_wheelmap, and reset().

45  {
46 
47  m_id = wid;
48 
49  int bisector[2];
50 
51  for( int k=0; k < m_maxrbc; ++k )
52  {
53  bisector[0]= m_sec1id[k];
54  bisector[1]= m_sec2id[k];
55  m_RBCE.push_back( new RBCEmulator( ) );
56  m_RBCE[k]->setid( wid, bisector );
57  }
58 
59  for( int k=0; k < m_maxsectors; ++k)
60  m_wheelmap[k].reset();
61 
62 }
std::bitset< 6 > * m_wheelmap
Definition: RPCWheel.h:74
std::vector< int > m_sec2id
Definition: RPCWheel.h:69
int m_id
Definition: RPCWheel.h:63
std::vector< int > m_sec1id
Definition: RPCWheel.h:68
int m_maxsectors
Definition: RPCWheel.h:66
int m_maxrbc
Definition: RPCWheel.h:64
int k[5][pyjets_maxn]
std::vector< RBCEmulator * > m_RBCE
Definition: RPCWheel.h:57
void reset(double vett[256])
Definition: TPedValues.cc:11
void RPCWheel::setProperties ( int  wid,
const char *  logic_type 
)

Definition at line 65 of file RPCWheel.cc.

References gen::k, m_id, m_maxrbc, m_maxsectors, m_RBCE, m_sec1id, m_sec2id, m_wheelmap, and reset().

65  {
66 
67  m_id = wid;
68 
69  int bisector[2];
70 
71  for( int k=0; k < m_maxrbc; ++k )
72  {
73  bisector[0]= m_sec1id[k];
74  bisector[1]= m_sec2id[k];
75  m_RBCE.push_back( new RBCEmulator( logic_type ) );
76  m_RBCE[k]->setid( wid, bisector );
77  }
78 
79  for( int k=0; k < m_maxsectors; ++k)
80  m_wheelmap[k].reset();
81 
82 }
std::bitset< 6 > * m_wheelmap
Definition: RPCWheel.h:74
std::vector< int > m_sec2id
Definition: RPCWheel.h:69
int m_id
Definition: RPCWheel.h:63
std::vector< int > m_sec1id
Definition: RPCWheel.h:68
int m_maxsectors
Definition: RPCWheel.h:66
int m_maxrbc
Definition: RPCWheel.h:64
int k[5][pyjets_maxn]
std::vector< RBCEmulator * > m_RBCE
Definition: RPCWheel.h:57
void reset(double vett[256])
Definition: TPedValues.cc:11
void RPCWheel::setProperties ( int  wid,
const char *  f_name,
const char *  logic_type 
)

Definition at line 84 of file RPCWheel.cc.

References gen::k, m_id, m_maxrbc, m_maxsectors, m_RBCE, m_wheelmap, and reset().

84  {
85 
86  m_id = wid;
87 
88  int bisector[2];
89 
90  for( int k=0; k < m_maxrbc; ++k )
91  {
92  bisector[0]= (k*2)+1;
93  bisector[1]= (k*2)+2;
94  m_RBCE.push_back( new RBCEmulator( f_name, logic_type ) );
95  m_RBCE[k]->setid( wid, bisector );
96  }
97 
98  for( int k=0; k < m_maxsectors; ++k)
99  m_wheelmap[k].reset();
100 
101 }
std::bitset< 6 > * m_wheelmap
Definition: RPCWheel.h:74
int m_id
Definition: RPCWheel.h:63
int m_maxsectors
Definition: RPCWheel.h:66
int m_maxrbc
Definition: RPCWheel.h:64
int k[5][pyjets_maxn]
std::vector< RBCEmulator * > m_RBCE
Definition: RPCWheel.h:57
void reset(double vett[256])
Definition: TPedValues.cc:11
void RPCWheel::setSpecifications ( const RBCBoardSpecs rbcspecs)

Definition at line 122 of file RPCWheel.cc.

References gen::k, m_maxrbc, and m_RBCE.

123 {
124 
125  for( int k=0; k < m_maxrbc; ++k )
126  m_RBCE[k]->setSpecifications( rbcspecs );
127 
128 }
int m_maxrbc
Definition: RPCWheel.h:64
int k[5][pyjets_maxn]
std::vector< RBCEmulator * > m_RBCE
Definition: RPCWheel.h:57
void setSpecifications(const RBCBoardSpecs *)
Definition: RPCWheel.cc:122

Member Data Documentation

bool RPCWheel::m_debug
private

Definition at line 76 of file RPCWheel.h.

Referenced by createWheelMap(), process(), retrieveWheelMap(), and RPCWheel().

int RPCWheel::m_id
private

Definition at line 63 of file RPCWheel.h.

Referenced by getid(), printinfo(), process(), retrieveWheelMap(), RPCWheel(), and setProperties().

int RPCWheel::m_maxlayers
private

Definition at line 65 of file RPCWheel.h.

Referenced by print_wheel(), retrieveWheelMap(), and RPCWheel().

int RPCWheel::m_maxrbc
private
int RPCWheel::m_maxsectors
private

Definition at line 66 of file RPCWheel.h.

Referenced by print_wheel(), process(), retrieveWheelMap(), RPCWheel(), and setProperties().

std::bitset<12> RPCWheel::m_rbcDecision
private

Definition at line 73 of file RPCWheel.h.

Referenced by createWheelMap(), and retrieveWheelMap().

std::vector<RBCEmulator*> RPCWheel::m_RBCE
std::vector<int> RPCWheel::m_sec1id
private

Definition at line 68 of file RPCWheel.h.

Referenced by RPCWheel(), setProperties(), and ~RPCWheel().

std::vector<int> RPCWheel::m_sec2id
private

Definition at line 69 of file RPCWheel.h.

Referenced by RPCWheel(), setProperties(), and ~RPCWheel().

std::bitset<6>* RPCWheel::m_wheelmap
private

Definition at line 74 of file RPCWheel.h.

Referenced by createWheelMap(), process(), retrieveWheelMap(), RPCWheel(), setProperties(), and ~RPCWheel().