CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
RPCWheel Class Reference

#include <RPCWheel.h>

Public Member Functions

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

Private Attributes

bool m_debug
 
int m_id
 
std::bitset< 12 > m_rbcDecision
 
std::vector< std::unique_ptr< RBCEmulator > > m_RBCE
 
std::array< std::bitset< 6 >, 12 > m_wheelmap
 

Static Private Attributes

static constexpr int m_maxlayers = 6
 
static constexpr int m_maxrbc = 6
 
static constexpr int m_maxsectors = 12
 

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 19 of file RPCWheel.cc.

References m_debug.

19  :
20  m_id{0},
21  m_debug{false}
22 {
23 }
int m_id
Definition: RPCWheel.h:62
bool m_debug
Definition: RPCWheel.h:72
RPCWheel::RPCWheel ( RPCWheel &&  )
default

Member Function Documentation

void RPCWheel::createWheelMap ( )

Definition at line 199 of file RPCWheel.cc.

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

200 {
201 
202  m_rbcDecision.reset();
203 
204  std::bitset<6> layersignal;
205 
206  layersignal = * m_RBCE[0]->getlayersignal( 0 );
207  m_wheelmap[11] = layersignal;
208 
209  m_rbcDecision.set( 11 , m_RBCE[0]->getdecision( 0 ) );
210 
211  for( int k=0; k < (m_maxrbc-1); ++k )
212  {
213  layersignal = * m_RBCE[k+1]->getlayersignal( 0 );
214  m_wheelmap[(k*2)+1] = layersignal;
215  layersignal = * m_RBCE[k+1]->getlayersignal( 1 );
216  m_wheelmap[(k*2)+2] = layersignal;
217 
218  m_rbcDecision.set( (k*2)+1 , m_RBCE[k+1]->getdecision( 0 ) );
219  m_rbcDecision.set( (k*2)+2 , m_RBCE[k+1]->getdecision( 1 ) );
220 
221  }
222 
223  layersignal = * m_RBCE[0]->getlayersignal( 1 );
224  m_wheelmap[0] = layersignal;
225 
226  m_rbcDecision.set( 0 , m_RBCE[0]->getdecision( 1 ) );
227 
228  if( m_debug ) std::cout << "RPCWheel::createWheelMap done" << std::endl;
229 
230 }
std::array< std::bitset< 6 >, 12 > m_wheelmap
Definition: RPCWheel.h:70
bool m_debug
Definition: RPCWheel.h:72
std::bitset< 12 > m_rbcDecision
Definition: RPCWheel.h:69
int k[5][pyjets_maxn]
std::vector< std::unique_ptr< RBCEmulator > > m_RBCE
Definition: RPCWheel.h:60
static constexpr int m_maxrbc
Definition: RPCWheel.h:63
void RPCWheel::emulate ( )

Definition at line 105 of file RPCWheel.cc.

References gen::k, m_maxrbc, and m_RBCE.

106 {
107  //This is a test emulation
108  for( int k=0; k < m_maxrbc; ++k )
109  {
110  m_RBCE[k]->emulate();
111  }
112 
113 }
int k[5][pyjets_maxn]
std::vector< std::unique_ptr< RBCEmulator > > m_RBCE
Definition: RPCWheel.h:60
static constexpr int m_maxrbc
Definition: RPCWheel.h:63
int RPCWheel::getid ( ) const
inline

Definition at line 50 of file RPCWheel.h.

References m_id, print_wheel(), and printinfo().

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

Definition at line 95 of file RPCWheel.cc.

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

96 {
97 
98  bool status(false);
99  for( int k=0; k < m_maxrbc; ++k )
100  status = m_RBCE[k]->initialise();
101  return status;
102 
103 }
bool initialise()
Definition: RPCWheel.cc:95
int k[5][pyjets_maxn]
std::vector< std::unique_ptr< RBCEmulator > > m_RBCE
Definition: RPCWheel.h:60
static constexpr int m_maxrbc
Definition: RPCWheel.h:63
RPCWheel& RPCWheel::operator= ( RPCWheel &&  )
default
void RPCWheel::print_wheel ( const TTUInput wmap) const

Definition at line 266 of file RPCWheel.cc.

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

Referenced by getid(), and retrieveWheelMap().

267 {
268 
269  std::cout << "RPCWheel::print_wheel> " << wmap.m_wheelId << '\t' << wmap.m_bx << std::endl;
270 
271  for( int i=0; i < m_maxsectors; ++i) std::cout << '\t' << (i+1);
272  std::cout << std::endl;
273 
274  for( int k=0; k < m_maxlayers; ++k )
275  {
276  std::cout << (k+1) << '\t';
277  for( int j=0; j < m_maxsectors; ++j)
278  std::cout << wmap.input_sec[j][k] << '\t';
279  std::cout << std::endl;
280  }
281 
282 }
int m_bx
Definition: TTUInput.h:31
static constexpr int m_maxlayers
Definition: RPCWheel.h:64
int m_wheelId
Definition: TTUInput.h:33
static constexpr int m_maxsectors
Definition: RPCWheel.h:65
std::array< std::bitset< 6 >, 12 > input_sec
Definition: TTUInput.h:37
int k[5][pyjets_maxn]
void RPCWheel::printinfo ( ) const

Definition at line 257 of file RPCWheel.cc.

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

Referenced by getid().

258 {
259 
260  std::cout << "Wheel -> " << m_id << '\n';
261  for( int k=0; k < m_maxrbc; ++k )
262  m_RBCE[k]->printinfo();
263 
264 }
int m_id
Definition: RPCWheel.h:62
int k[5][pyjets_maxn]
std::vector< std::unique_ptr< RBCEmulator > > m_RBCE
Definition: RPCWheel.h:60
static constexpr int m_maxrbc
Definition: RPCWheel.h:63
void printinfo() const
Definition: RPCWheel.cc:257
bool RPCWheel::process ( int  bx,
const std::map< int, RBCInput * > &  data 
)

Definition at line 115 of file RPCWheel.cc.

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

116 {
117 
118  int bxsign(1);
119  bool status(false);
120 
121  std::map<int,RBCInput*>::const_iterator itr;
122 
123  if ( bx != 0 ) bxsign = ( bx / abs(bx) );
124  else bxsign = 1;
125 
126  for(int k=0; k < m_maxrbc; ++k) {
127 
128  m_RBCE[k]->reset();
129 
130  int key = bxsign*( 1000000 * abs(bx)
131  + m_RBCE[k]->rbcinfo().wheelIdx()*10000
132  + m_RBCE[k]->rbcinfo().sector(0)*100
133  + m_RBCE[k]->rbcinfo().sector(1) );
134 
135  itr = data.find( key );
136 
137  if ( itr != data.end() ) {
138 
139  if ( ! (*itr).second->hasData ) {
140  status |= false;
141  continue;
142  } else {
143  if( m_debug ) std::cout << "RPCWheel::process> found data at: "
144  << key << '\t'
145  << ( itr->second ) << std::endl;
146  m_RBCE[k]->emulate( ( itr->second ) );
147  status |= true;
148  }
149 
150  } else {
151  //if( m_debug ) std::cout << "RPCWheel::process> position not found: " << key << std::endl;
152  status |= false;
153  }
154 
155  }
156 
157  return status;
158 
159 }
bool m_debug
Definition: RPCWheel.h:72
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
std::vector< std::unique_ptr< RBCEmulator > > m_RBCE
Definition: RPCWheel.h:60
static constexpr int m_maxrbc
Definition: RPCWheel.h:63
bool RPCWheel::process ( int  bx,
const std::map< int, TTUInput * > &  data 
)

Definition at line 161 of file RPCWheel.cc.

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

162 {
163 
164  int bxsign(1);
165  bool status(false);
166 
167  std::map<int,TTUInput*>::const_iterator itr;
168 
169  if ( bx != 0 ) bxsign = ( bx / abs(bx) );
170  else bxsign = 1;
171 
172  int key = bxsign*( 1000000 * abs(bx) + (m_id+2)*10000 );
173 
174  itr = data.find( key );
175 
176  if ( itr != data.end() ) {
177  if( m_debug ) std::cout << "RPCWheel::process> found data at: " << key << '\t'
178  << ( itr->second ) << std::endl;
179 
180  if ( ! (*itr).second->m_hasHits ) return false;
181 
182  for( int k=0; k < m_maxsectors; ++k ) {
183  m_wheelmap[k] = (*itr).second->input_sec[k];
184  status = true;
185  }
186 
187  } else {
188  //if( m_debug ) std::cout << "RPCWheel::process> position not found: " << key << std::endl;
189  status = false;
190  }
191 
192  return status;
193 
194 }
std::array< std::bitset< 6 >, 12 > m_wheelmap
Definition: RPCWheel.h:70
int m_id
Definition: RPCWheel.h:62
bool m_debug
Definition: RPCWheel.h:72
static constexpr 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
void RPCWheel::retrieveWheelMap ( TTUInput output)

Definition at line 232 of file RPCWheel.cc.

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

233 {
234 
235  if( m_debug ) std::cout << "RPCWheel::retrieveWheelMap starts" << std::endl;
236  output.reset();
237 
238  for(int i=0; i < m_maxsectors; ++i ) {
239  for( int j=0; j < m_maxlayers; ++j )
240  {
241  output.input_sec[i].set(j, m_wheelmap[i][j]);
242  }
243  }
244 
245  output.m_wheelId = m_id;
246 
247  output.m_rbcDecision = m_rbcDecision;
248 
249  if( m_debug ) print_wheel( output );
250  if( m_debug ) std::cout << "RPCWheel::retrieveWheelMap done" << std::endl;
251 
252 }
std::array< std::bitset< 6 >, 12 > m_wheelmap
Definition: RPCWheel.h:70
static constexpr int m_maxlayers
Definition: RPCWheel.h:64
int m_wheelId
Definition: TTUInput.h:33
int m_id
Definition: RPCWheel.h:62
void reset()
Definition: TTUInput.cc:30
bool m_debug
Definition: RPCWheel.h:72
std::bitset< 12 > m_rbcDecision
Definition: RPCWheel.h:69
static constexpr int m_maxsectors
Definition: RPCWheel.h:65
std::bitset< 12 > m_rbcDecision
Definition: TTUInput.h:38
std::array< std::bitset< 6 >, 12 > input_sec
Definition: TTUInput.h:37
void print_wheel(const TTUInput &) const
Definition: RPCWheel.cc:266
void RPCWheel::setProperties ( int  wid)

Definition at line 25 of file RPCWheel.cc.

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

25  {
26 
27  m_id = wid;
28 
29  int bisector[2];
30 
31  m_RBCE.reserve(m_maxrbc);
32  for( int k=0; k < m_maxrbc; ++k )
33  {
34  bisector[0]= s_sec1id[k];
35  bisector[1]= s_sec2id[k];
36  m_RBCE.emplace_back(std::make_unique<RBCEmulator>());
37  m_RBCE[k]->setid( wid, bisector );
38  }
39 
40  for( int k=0; k < m_maxsectors; ++k)
41  m_wheelmap[k].reset();
42 
43 }
std::array< std::bitset< 6 >, 12 > m_wheelmap
Definition: RPCWheel.h:70
int m_id
Definition: RPCWheel.h:62
constexpr std::array< int, 6 > s_sec2id
static constexpr int m_maxsectors
Definition: RPCWheel.h:65
constexpr std::array< int, 6 > s_sec1id
int k[5][pyjets_maxn]
std::vector< std::unique_ptr< RBCEmulator > > m_RBCE
Definition: RPCWheel.h:60
static constexpr int m_maxrbc
Definition: RPCWheel.h:63
void reset(double vett[256])
Definition: TPedValues.cc:11
void RPCWheel::setProperties ( int  wid,
const char *  logic_type 
)

Definition at line 46 of file RPCWheel.cc.

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

46  {
47 
48  m_id = wid;
49 
50  int bisector[2];
51  m_RBCE.reserve(m_maxrbc);
52  for( int k=0; k < m_maxrbc; ++k )
53  {
54  bisector[0]= s_sec1id[k];
55  bisector[1]= s_sec2id[k];
56  m_RBCE.push_back( std::make_unique<RBCEmulator>( logic_type ) );
57  m_RBCE[k]->setid( wid, bisector );
58  }
59 
60  for( int k=0; k < m_maxsectors; ++k)
61  m_wheelmap[k].reset();
62 
63 }
std::array< std::bitset< 6 >, 12 > m_wheelmap
Definition: RPCWheel.h:70
int m_id
Definition: RPCWheel.h:62
constexpr std::array< int, 6 > s_sec2id
static constexpr int m_maxsectors
Definition: RPCWheel.h:65
constexpr std::array< int, 6 > s_sec1id
int k[5][pyjets_maxn]
std::vector< std::unique_ptr< RBCEmulator > > m_RBCE
Definition: RPCWheel.h:60
static constexpr int m_maxrbc
Definition: RPCWheel.h:63
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 65 of file RPCWheel.cc.

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

65  {
66 
67  m_id = wid;
68 
69  int bisector[2];
70 
71  m_RBCE.reserve(m_maxrbc);
72  for( int k=0; k < m_maxrbc; ++k )
73  {
74  bisector[0]= (k*2)+1;
75  bisector[1]= (k*2)+2;
76  m_RBCE.push_back(std::make_unique<RBCEmulator>( f_name, logic_type ) );
77  m_RBCE[k]->setid( wid, bisector );
78  }
79 
80  for( int k=0; k < m_maxsectors; ++k)
81  m_wheelmap[k].reset();
82 
83 }
std::array< std::bitset< 6 >, 12 > m_wheelmap
Definition: RPCWheel.h:70
int m_id
Definition: RPCWheel.h:62
static constexpr int m_maxsectors
Definition: RPCWheel.h:65
int k[5][pyjets_maxn]
std::vector< std::unique_ptr< RBCEmulator > > m_RBCE
Definition: RPCWheel.h:60
static constexpr int m_maxrbc
Definition: RPCWheel.h:63
void reset(double vett[256])
Definition: TPedValues.cc:11
void RPCWheel::setSpecifications ( const RBCBoardSpecs rbcspecs)

Definition at line 87 of file RPCWheel.cc.

References gen::k, m_maxrbc, and m_RBCE.

88 {
89 
90  for( int k=0; k < m_maxrbc; ++k )
91  m_RBCE[k]->setSpecifications( rbcspecs );
92 
93 }
int k[5][pyjets_maxn]
std::vector< std::unique_ptr< RBCEmulator > > m_RBCE
Definition: RPCWheel.h:60
static constexpr int m_maxrbc
Definition: RPCWheel.h:63
void setSpecifications(const RBCBoardSpecs *)
Definition: RPCWheel.cc:87

Member Data Documentation

bool RPCWheel::m_debug
private

Definition at line 72 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(), and setProperties().

constexpr int RPCWheel::m_maxlayers = 6
staticprivate

Definition at line 64 of file RPCWheel.h.

Referenced by print_wheel(), and retrieveWheelMap().

constexpr int RPCWheel::m_maxrbc = 6
staticprivate
constexpr int RPCWheel::m_maxsectors = 12
staticprivate

Definition at line 65 of file RPCWheel.h.

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

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

Definition at line 69 of file RPCWheel.h.

Referenced by createWheelMap(), and retrieveWheelMap().

std::vector<std::unique_ptr<RBCEmulator> > RPCWheel::m_RBCE
private
std::array<std::bitset<6>,12> RPCWheel::m_wheelmap
private

Definition at line 70 of file RPCWheel.h.

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