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 23 of file RPCWheel.h.

Constructor & Destructor Documentation

RPCWheel::RPCWheel ( )

Standard constructor.

Definition at line 17 of file RPCWheel.cc.

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

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

Destructor.

Definition at line 105 of file RPCWheel.cc.

References m_RBCE, m_sec1id, m_sec2id, and m_wheelmap.

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

Member Function Documentation

void RPCWheel::createWheelMap ( )

Definition at line 233 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().

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

Definition at line 139 of file RPCWheel.cc.

References gen::k, m_maxrbc, and m_RBCE.

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

Definition at line 50 of file RPCWheel.h.

References m_id.

Referenced by TTUEmulator::processTtu().

50 { return m_id; };
int m_id
Definition: RPCWheel.h:62
bool RPCWheel::initialise ( )

Definition at line 129 of file RPCWheel.cc.

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

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

Definition at line 300 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().

301 {
302 
303  std::cout << "RPCWheel::print_wheel> " << wmap.m_wheelId << '\t' << wmap.m_bx << std::endl;
304 
305  for( int i=0; i < m_maxsectors; ++i) std::cout << '\t' << (i+1);
306  std::cout << std::endl;
307 
308  for( int k=0; k < m_maxlayers; ++k )
309  {
310  std::cout << (k+1) << '\t';
311  for( int j=0; j < m_maxsectors; ++j)
312  std::cout << wmap.input_sec[j][k] << '\t';
313  std::cout << std::endl;
314  }
315 
316 }
int i
Definition: DBlmapReader.cc:9
int m_bx
Definition: TTUInput.h:52
int m_wheelId
Definition: TTUInput.h:54
int m_maxsectors
Definition: RPCWheel.h:65
int m_maxlayers
Definition: RPCWheel.h:64
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:58
void RPCWheel::printinfo ( )

Definition at line 291 of file RPCWheel.cc.

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

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

Definition at line 149 of file RPCWheel.cc.

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

Referenced by ConfigBuilder.ConfigBuilder::addExtraStream(), ConfigBuilder.ConfigBuilder::completeInputCommand(), ConfigBuilder.ConfigBuilder::doNotInlineEventContent(), ConfigBuilder.ConfigBuilder.PrintAllModules::leave(), ConfigBuilder.ConfigBuilder::prepare_FASTSIM(), ConfigBuilder.ConfigBuilder::prepare_HLT(), ConfigBuilder.ConfigBuilder::prepare_LHE(), ConfigBuilder.ConfigBuilder::prepare_VALIDATION(), ConfigBuilder.ConfigBuilder::renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder::renameInputTagsInSequence(), and ConfigBuilder.ConfigBuilder::scheduleSequence().

150 {
151 
152  int bxsign(1);
153  bool status(false);
154 
155  std::map<int,RBCInput*>::const_iterator itr;
156 
157  if ( bx != 0 ) bxsign = ( bx / abs(bx) );
158  else bxsign = 1;
159 
160  for(int k=0; k < m_maxrbc; ++k) {
161 
162  m_RBCE[k]->reset();
163 
164  int key = bxsign*( 1000000 * abs(bx)
165  + m_RBCE[k]->m_rbcinfo->wheelIdx()*10000
166  + m_RBCE[k]->m_rbcinfo->sector(0)*100
167  + m_RBCE[k]->m_rbcinfo->sector(1) );
168 
169  itr = data.find( key );
170 
171  if ( itr != data.end() ) {
172 
173  if ( ! (*itr).second->hasData ) {
174  status |= false;
175  continue;
176  } else {
177  if( m_debug ) std::cout << "RPCWheel::process> found data at: "
178  << key << '\t'
179  << ( itr->second ) << std::endl;
180  m_RBCE[k]->emulate( ( itr->second ) );
181  status |= true;
182  }
183 
184  } else {
185  //if( m_debug ) std::cout << "RPCWheel::process> position not found: " << key << std::endl;
186  status |= false;
187  }
188 
189  }
190 
191  return status;
192 
193 }
bool m_debug
Definition: RPCWheel.h:75
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int m_maxrbc
Definition: RPCWheel.h:63
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:56
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 195 of file RPCWheel.cc.

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

Referenced by ConfigBuilder.ConfigBuilder::addExtraStream(), ConfigBuilder.ConfigBuilder::completeInputCommand(), ConfigBuilder.ConfigBuilder::doNotInlineEventContent(), ConfigBuilder.ConfigBuilder.PrintAllModules::leave(), ConfigBuilder.ConfigBuilder::prepare_FASTSIM(), ConfigBuilder.ConfigBuilder::prepare_HLT(), ConfigBuilder.ConfigBuilder::prepare_LHE(), ConfigBuilder.ConfigBuilder::prepare_VALIDATION(), ConfigBuilder.ConfigBuilder::renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder::renameInputTagsInSequence(), and ConfigBuilder.ConfigBuilder::scheduleSequence().

196 {
197 
198  int bxsign(1);
199  bool status(false);
200 
201  std::map<int,TTUInput*>::const_iterator itr;
202 
203  if ( bx != 0 ) bxsign = ( bx / abs(bx) );
204  else bxsign = 1;
205 
206  int key = bxsign*( 1000000 * abs(bx) + (m_id+2)*10000 );
207 
208  itr = data.find( key );
209 
210  if ( itr != data.end() ) {
211  if( m_debug ) std::cout << "RPCWheel::process> found data at: " << key << '\t'
212  << ( itr->second ) << std::endl;
213 
214  if ( ! (*itr).second->m_hasHits ) return false;
215 
216  for( int k=0; k < m_maxsectors; ++k ) {
217  m_wheelmap[k] = (*itr).second->input_sec[k];
218  status = true;
219  }
220 
221  } else {
222  //if( m_debug ) std::cout << "RPCWheel::process> position not found: " << key << std::endl;
223  status = false;
224  }
225 
226  return status;
227 
228 }
std::bitset< 6 > * m_wheelmap
Definition: RPCWheel.h:73
int m_id
Definition: RPCWheel.h:62
bool m_debug
Definition: RPCWheel.h:75
int m_maxsectors
Definition: RPCWheel.h:65
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
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 266 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().

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

Definition at line 44 of file RPCWheel.cc.

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

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

Definition at line 64 of file RPCWheel.cc.

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

64  {
65 
66  m_id = wid;
67 
68  int bisector[2];
69 
70  for( int k=0; k < m_maxrbc; ++k )
71  {
72  bisector[0]= m_sec1id[k];
73  bisector[1]= m_sec2id[k];
74  m_RBCE.push_back( new RBCEmulator( logic_type ) );
75  m_RBCE[k]->setid( wid, bisector );
76  }
77 
78  for( int k=0; k < m_maxsectors; ++k)
79  m_wheelmap[k].reset();
80 
81 }
std::bitset< 6 > * m_wheelmap
Definition: RPCWheel.h:73
std::vector< int > m_sec2id
Definition: RPCWheel.h:68
int m_id
Definition: RPCWheel.h:62
std::vector< int > m_sec1id
Definition: RPCWheel.h:67
int m_maxsectors
Definition: RPCWheel.h:65
int m_maxrbc
Definition: RPCWheel.h:63
int k[5][pyjets_maxn]
std::vector< RBCEmulator * > m_RBCE
Definition: RPCWheel.h:56
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 83 of file RPCWheel.cc.

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

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

Definition at line 121 of file RPCWheel.cc.

References gen::k, m_maxrbc, and m_RBCE.

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

Member Data Documentation

bool RPCWheel::m_debug
private

Definition at line 75 of file RPCWheel.h.

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

int RPCWheel::m_id
private

Definition at line 62 of file RPCWheel.h.

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

int RPCWheel::m_maxlayers
private

Definition at line 64 of file RPCWheel.h.

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

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

Definition at line 65 of file RPCWheel.h.

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

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

Definition at line 72 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 67 of file RPCWheel.h.

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

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

Definition at line 68 of file RPCWheel.h.

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

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

Definition at line 73 of file RPCWheel.h.

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