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() [1/2]

RPCWheel::RPCWheel ( )

Standard constructor.

Definition at line 17 of file RPCWheel.cc.

17 : m_id{0}, m_debug{false} {}
int m_id
Definition: RPCWheel.h:60
bool m_debug
Definition: RPCWheel.h:70

◆ RPCWheel() [2/2]

RPCWheel::RPCWheel ( RPCWheel &&  )
default

Member Function Documentation

◆ createWheelMap()

void RPCWheel::createWheelMap ( )

Definition at line 165 of file RPCWheel.cc.

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

165  {
166  m_rbcDecision.reset();
167 
168  std::bitset<6> layersignal;
169 
170  layersignal = *m_RBCE[0]->getlayersignal(0);
171  m_wheelmap[11] = layersignal;
172 
173  m_rbcDecision.set(11, m_RBCE[0]->getdecision(0));
174 
175  for (int k = 0; k < (m_maxrbc - 1); ++k) {
176  layersignal = *m_RBCE[k + 1]->getlayersignal(0);
177  m_wheelmap[(k * 2) + 1] = layersignal;
178  layersignal = *m_RBCE[k + 1]->getlayersignal(1);
179  m_wheelmap[(k * 2) + 2] = layersignal;
180 
181  m_rbcDecision.set((k * 2) + 1, m_RBCE[k + 1]->getdecision(0));
182  m_rbcDecision.set((k * 2) + 2, m_RBCE[k + 1]->getdecision(1));
183  }
184 
185  layersignal = *m_RBCE[0]->getlayersignal(1);
186  m_wheelmap[0] = layersignal;
187 
188  m_rbcDecision.set(0, m_RBCE[0]->getdecision(1));
189 
190  if (m_debug)
191  std::cout << "RPCWheel::createWheelMap done" << std::endl;
192 }
bool m_debug
Definition: RPCWheel.h:70
std::array< std::bitset< 6 >, 12 > m_wheelmap
Definition: RPCWheel.h:68
std::bitset< 12 > m_rbcDecision
Definition: RPCWheel.h:67
std::vector< std::unique_ptr< RBCEmulator > > m_RBCE
Definition: RPCWheel.h:58
static constexpr int m_maxrbc
Definition: RPCWheel.h:61

◆ emulate()

void RPCWheel::emulate ( )

Definition at line 82 of file RPCWheel.cc.

References dqmdumpme::k, m_maxrbc, and m_RBCE.

82  {
83  //This is a test emulation
84  for (int k = 0; k < m_maxrbc; ++k) {
85  m_RBCE[k]->emulate();
86  }
87 }
std::vector< std::unique_ptr< RBCEmulator > > m_RBCE
Definition: RPCWheel.h:58
static constexpr int m_maxrbc
Definition: RPCWheel.h:61

◆ getid()

int RPCWheel::getid ( ) const
inline

Definition at line 50 of file RPCWheel.h.

References m_id.

50 { return m_id; };
int m_id
Definition: RPCWheel.h:60

◆ initialise()

bool RPCWheel::initialise ( )

Definition at line 75 of file RPCWheel.cc.

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

75  {
76  bool status(false);
77  for (int k = 0; k < m_maxrbc; ++k)
78  status = m_RBCE[k]->initialise();
79  return status;
80 }
bool initialise()
Definition: RPCWheel.cc:75
std::vector< std::unique_ptr< RBCEmulator > > m_RBCE
Definition: RPCWheel.h:58
static constexpr int m_maxrbc
Definition: RPCWheel.h:61

◆ operator=()

RPCWheel& RPCWheel::operator= ( RPCWheel &&  )
default

◆ print_wheel()

void RPCWheel::print_wheel ( const TTUInput wmap) const

Definition at line 223 of file RPCWheel.cc.

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

Referenced by retrieveWheelMap().

223  {
224  std::cout << "RPCWheel::print_wheel> " << wmap.m_wheelId << '\t' << wmap.m_bx << std::endl;
225 
226  for (int i = 0; i < m_maxsectors; ++i)
227  std::cout << '\t' << (i + 1);
228  std::cout << std::endl;
229 
230  for (int k = 0; k < m_maxlayers; ++k) {
231  std::cout << (k + 1) << '\t';
232  for (int j = 0; j < m_maxsectors; ++j)
233  std::cout << wmap.input_sec[j][k] << '\t';
234  std::cout << std::endl;
235  }
236 }
int m_bx
Definition: TTUInput.h:30
static constexpr int m_maxlayers
Definition: RPCWheel.h:62
int m_wheelId
Definition: TTUInput.h:32
static constexpr int m_maxsectors
Definition: RPCWheel.h:63
std::array< std::bitset< 6 >, 12 > input_sec
Definition: TTUInput.h:36

◆ printinfo()

void RPCWheel::printinfo ( ) const

Definition at line 217 of file RPCWheel.cc.

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

217  {
218  std::cout << "Wheel -> " << m_id << '\n';
219  for (int k = 0; k < m_maxrbc; ++k)
220  m_RBCE[k]->printinfo();
221 }
int m_id
Definition: RPCWheel.h:60
void printinfo() const
Definition: RPCWheel.cc:217
std::vector< std::unique_ptr< RBCEmulator > > m_RBCE
Definition: RPCWheel.h:58
static constexpr int m_maxrbc
Definition: RPCWheel.h:61

◆ process() [1/2]

bool RPCWheel::process ( int  bx,
const std::map< int, RBCInput *> &  data 
)

Definition at line 89 of file RPCWheel.cc.

References funct::abs(), simKBmtfDigis_cfi::bx, gather_cfg::cout, data, dqmdumpme::k, crabWrapper::key, m_debug, m_maxrbc, m_RBCE, and mps_update::status.

89  {
90  int bxsign(1);
91  bool status(false);
92 
93  std::map<int, RBCInput*>::const_iterator itr;
94 
95  if (bx != 0)
96  bxsign = (bx / abs(bx));
97  else
98  bxsign = 1;
99 
100  for (int k = 0; k < m_maxrbc; ++k) {
101  m_RBCE[k]->reset();
102 
103  int key = bxsign * (1000000 * abs(bx) + m_RBCE[k]->rbcinfo().wheelIdx() * 10000 +
104  m_RBCE[k]->rbcinfo().sector(0) * 100 + m_RBCE[k]->rbcinfo().sector(1));
105 
106  itr = data.find(key);
107 
108  if (itr != data.end()) {
109  if (!(*itr).second->hasData) {
110  status |= false;
111  continue;
112  } else {
113  if (m_debug)
114  std::cout << "RPCWheel::process> found data at: " << key << '\t' << (itr->second) << std::endl;
115  m_RBCE[k]->emulate((itr->second));
116  status |= true;
117  }
118 
119  } else {
120  //if( m_debug ) std::cout << "RPCWheel::process> position not found: " << key << std::endl;
121  status |= false;
122  }
123  }
124 
125  return status;
126 }
bool m_debug
Definition: RPCWheel.h:70
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
std::vector< std::unique_ptr< RBCEmulator > > m_RBCE
Definition: RPCWheel.h:58
static constexpr int m_maxrbc
Definition: RPCWheel.h:61

◆ process() [2/2]

bool RPCWheel::process ( int  bx,
const std::map< int, TTUInput *> &  data 
)

Definition at line 128 of file RPCWheel.cc.

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

128  {
129  int bxsign(1);
130  bool status(false);
131 
132  std::map<int, TTUInput*>::const_iterator itr;
133 
134  if (bx != 0)
135  bxsign = (bx / abs(bx));
136  else
137  bxsign = 1;
138 
139  int key = bxsign * (1000000 * abs(bx) + (m_id + 2) * 10000);
140 
141  itr = data.find(key);
142 
143  if (itr != data.end()) {
144  if (m_debug)
145  std::cout << "RPCWheel::process> found data at: " << key << '\t' << (itr->second) << std::endl;
146 
147  if (!(*itr).second->m_hasHits)
148  return false;
149 
150  for (int k = 0; k < m_maxsectors; ++k) {
151  m_wheelmap[k] = (*itr).second->input_sec[k];
152  status = true;
153  }
154 
155  } else {
156  //if( m_debug ) std::cout << "RPCWheel::process> position not found: " << key << std::endl;
157  status = false;
158  }
159 
160  return status;
161 }
int m_id
Definition: RPCWheel.h:60
bool m_debug
Definition: RPCWheel.h:70
std::array< std::bitset< 6 >, 12 > m_wheelmap
Definition: RPCWheel.h:68
static constexpr int m_maxsectors
Definition: RPCWheel.h:63
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79

◆ retrieveWheelMap()

void RPCWheel::retrieveWheelMap ( TTUInput output)

Definition at line 194 of file RPCWheel.cc.

References gather_cfg::cout, mps_fire::i, dqmiolumiharvest::j, m_debug, m_id, m_maxlayers, m_maxsectors, m_rbcDecision, m_wheelmap, and print_wheel().

194  {
195  if (m_debug)
196  std::cout << "RPCWheel::retrieveWheelMap starts" << std::endl;
197  output.reset();
198 
199  for (int i = 0; i < m_maxsectors; ++i) {
200  for (int j = 0; j < m_maxlayers; ++j) {
201  output.input_sec[i].set(j, m_wheelmap[i][j]);
202  }
203  }
204 
205  output.m_wheelId = m_id;
206 
207  output.m_rbcDecision = m_rbcDecision;
208 
209  if (m_debug)
211  if (m_debug)
212  std::cout << "RPCWheel::retrieveWheelMap done" << std::endl;
213 }
static constexpr int m_maxlayers
Definition: RPCWheel.h:62
int m_id
Definition: RPCWheel.h:60
void print_wheel(const TTUInput &) const
Definition: RPCWheel.cc:223
bool m_debug
Definition: RPCWheel.h:70
std::array< std::bitset< 6 >, 12 > m_wheelmap
Definition: RPCWheel.h:68
std::bitset< 12 > m_rbcDecision
Definition: RPCWheel.h:67
static constexpr int m_maxsectors
Definition: RPCWheel.h:63
Definition: output.py:1

◆ setProperties() [1/3]

void RPCWheel::setProperties ( int  wid)

Definition at line 19 of file RPCWheel.cc.

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

19  {
20  m_id = wid;
21 
22  int bisector[2];
23 
24  m_RBCE.reserve(m_maxrbc);
25  for (int k = 0; k < m_maxrbc; ++k) {
26  bisector[0] = s_sec1id[k];
27  bisector[1] = s_sec2id[k];
28  m_RBCE.emplace_back(std::make_unique<RBCEmulator>());
29  m_RBCE[k]->setid(wid, bisector);
30  }
31 
32  for (int k = 0; k < m_maxsectors; ++k)
33  m_wheelmap[k].reset();
34 }
constexpr std::array< int, 6 > s_sec2id
constexpr std::array< int, 6 > s_sec1id
int m_id
Definition: RPCWheel.h:60
std::array< std::bitset< 6 >, 12 > m_wheelmap
Definition: RPCWheel.h:68
static constexpr int m_maxsectors
Definition: RPCWheel.h:63
std::vector< std::unique_ptr< RBCEmulator > > m_RBCE
Definition: RPCWheel.h:58
static constexpr int m_maxrbc
Definition: RPCWheel.h:61
void reset(double vett[256])
Definition: TPedValues.cc:11

◆ setProperties() [2/3]

void RPCWheel::setProperties ( int  wid,
const char *  logic_type 
)

Definition at line 36 of file RPCWheel.cc.

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

36  {
37  m_id = wid;
38 
39  int bisector[2];
40  m_RBCE.reserve(m_maxrbc);
41  for (int k = 0; k < m_maxrbc; ++k) {
42  bisector[0] = s_sec1id[k];
43  bisector[1] = s_sec2id[k];
44  m_RBCE.push_back(std::make_unique<RBCEmulator>(logic_type));
45  m_RBCE[k]->setid(wid, bisector);
46  }
47 
48  for (int k = 0; k < m_maxsectors; ++k)
49  m_wheelmap[k].reset();
50 }
constexpr std::array< int, 6 > s_sec2id
constexpr std::array< int, 6 > s_sec1id
int m_id
Definition: RPCWheel.h:60
std::array< std::bitset< 6 >, 12 > m_wheelmap
Definition: RPCWheel.h:68
static constexpr int m_maxsectors
Definition: RPCWheel.h:63
std::vector< std::unique_ptr< RBCEmulator > > m_RBCE
Definition: RPCWheel.h:58
static constexpr int m_maxrbc
Definition: RPCWheel.h:61
void reset(double vett[256])
Definition: TPedValues.cc:11

◆ setProperties() [3/3]

void RPCWheel::setProperties ( int  wid,
const char *  f_name,
const char *  logic_type 
)

Definition at line 52 of file RPCWheel.cc.

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

52  {
53  m_id = wid;
54 
55  int bisector[2];
56 
57  m_RBCE.reserve(m_maxrbc);
58  for (int k = 0; k < m_maxrbc; ++k) {
59  bisector[0] = (k * 2) + 1;
60  bisector[1] = (k * 2) + 2;
61  m_RBCE.push_back(std::make_unique<RBCEmulator>(f_name, logic_type));
62  m_RBCE[k]->setid(wid, bisector);
63  }
64 
65  for (int k = 0; k < m_maxsectors; ++k)
66  m_wheelmap[k].reset();
67 }
int m_id
Definition: RPCWheel.h:60
std::array< std::bitset< 6 >, 12 > m_wheelmap
Definition: RPCWheel.h:68
static constexpr int m_maxsectors
Definition: RPCWheel.h:63
std::vector< std::unique_ptr< RBCEmulator > > m_RBCE
Definition: RPCWheel.h:58
static constexpr int m_maxrbc
Definition: RPCWheel.h:61
void reset(double vett[256])
Definition: TPedValues.cc:11

◆ setSpecifications()

void RPCWheel::setSpecifications ( const RBCBoardSpecs rbcspecs)

Definition at line 70 of file RPCWheel.cc.

References dqmdumpme::k, m_maxrbc, and m_RBCE.

70  {
71  for (int k = 0; k < m_maxrbc; ++k)
72  m_RBCE[k]->setSpecifications(rbcspecs);
73 }
std::vector< std::unique_ptr< RBCEmulator > > m_RBCE
Definition: RPCWheel.h:58
static constexpr int m_maxrbc
Definition: RPCWheel.h:61
void setSpecifications(const RBCBoardSpecs *)
Definition: RPCWheel.cc:70

Member Data Documentation

◆ m_debug

bool RPCWheel::m_debug
private

Definition at line 70 of file RPCWheel.h.

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

◆ m_id

int RPCWheel::m_id
private

Definition at line 60 of file RPCWheel.h.

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

◆ m_maxlayers

constexpr int RPCWheel::m_maxlayers = 6
staticprivate

Definition at line 62 of file RPCWheel.h.

Referenced by print_wheel(), and retrieveWheelMap().

◆ m_maxrbc

constexpr int RPCWheel::m_maxrbc = 6
staticprivate

◆ m_maxsectors

constexpr int RPCWheel::m_maxsectors = 12
staticprivate

Definition at line 63 of file RPCWheel.h.

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

◆ m_rbcDecision

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

Definition at line 67 of file RPCWheel.h.

Referenced by createWheelMap(), and retrieveWheelMap().

◆ m_RBCE

std::vector<std::unique_ptr<RBCEmulator> > RPCWheel::m_RBCE
private

◆ m_wheelmap

std::array<std::bitset<6>, 12> RPCWheel::m_wheelmap
private

Definition at line 68 of file RPCWheel.h.

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