18 m_ptr_rpcGeom = &rpcGeom;
19 m_ptr_digiSimLink = &digiSimLink;
21 m_lbin = std::make_unique<RBCLinkBoardGLSignal>(&m_data);
40 for (m_linkItr = (*m_ptr_digiSimLink)->begin(); m_linkItr != (*m_ptr_digiSimLink)->end(); ++m_linkItr) {
41 for (m_digiItr = m_linkItr->data.begin(); m_digiItr != m_linkItr->data.end(); ++m_digiItr) {
43 std::cout <<
"looping over digis 1 ..." << std::endl;
45 int bx = (*m_digiItr).getBx();
47 if (
abs(
bx) >= m_maxBxWindow) {
49 std::cout <<
"RBCProcessRPCSimDigis> found a bx bigger than max allowed: " <<
bx << std::endl;
53 uint32_t detid = m_digiItr->getDetUnitId();
55 const RPCRoll* roll = dynamic_cast<const RPCRoll*>((*m_ptr_rpcGeom)->roll(
id));
59 std::cout <<
"RBCProcessRPCSimDigis: roll is forward" << std::endl;
68 int rollid =
id.roll();
73 digipos = 30000 + digipos;
75 digipos = 30000 + digipos;
78 digipos = 20000 + digipos;
80 digipos = 20000 + digipos;
83 std::cout <<
"Bx: " <<
bx <<
'\t' <<
"Wheel: " <<
wheel <<
'\t' <<
"Sector: " << sector <<
'\t'
84 <<
"Station: " <<
station <<
'\t' <<
"Layer: " <<
layer <<
'\t' <<
"B-Layer: " << blayer <<
'\t'
85 <<
"Roll id: " << rollid <<
'\t' <<
"Digi at: " << digipos <<
'\n';
88 auto itr = m_vecDataperBx.find(
bx);
90 if (itr == m_vecDataperBx.end()) {
93 auto& wheelData = m_vecDataperBx[
bx];
96 setDigiAt(sector, digipos,
block);
99 setDigiAt(sector, digipos,
block);
103 std::cout <<
"looping over digis 2 ..." << std::endl;
110 std::cout <<
"size of data vectors: " << m_vecDataperBx.size() << std::endl;
120 std::cout <<
"RBCProcessRPCSimDigis: DataSize: " << m_data.size() <<
" ndigis " << ndigis << std::endl;
134 constexpr
int maxWheels = 5;
135 constexpr
int maxRbcBrds = 6;
137 dataVec.reserve(maxWheels);
138 for (
int i = 0;
i < maxWheels; ++
i) {
139 auto&
block = dataVec.emplace_back();
143 for (
int j = 0;
j < maxRbcBrds; ++
j) {
146 block.m_orsignals[
j].input_sec[0].reset();
147 block.m_orsignals[
j].input_sec[1].reset();
148 block.m_orsignals[
j].needmapping =
false;
149 block.m_orsignals[
j].hasData =
false;
154 std::cout <<
"initialize: completed" << std::endl;
160 for (
auto& dataPerBx : m_vecDataperBx) {
161 int bx = dataPerBx.first;
169 for (
auto&
item : dataPerBx.second) {
170 for (
int k = 0;
k < 6; ++
k) {
171 code = bxsign * (1000000 *
abs(
bx) + 10000 *
item.wheelIdx() + 100 *
item.m_sec1[
k] + 1 *
item.m_sec2[
k]);
174 signal->needmapping =
false;
177 m_data.insert(std::make_pair(code, signal));
182 if (m_debug and not m_vecDataperBx.empty())
183 std::cout <<
"builddata: completed. size of data: " << m_data.size() << std::endl;
191 blayer = ((_station - 1) * 2) + _layer;
193 blayer = _station + 2;
221 setInputBit(
block.m_orsignals[
pos].input_sec[isAoB], digipos);
223 block.m_orsignals[
pos].hasData =
true;
229 std::cout <<
"setDigiAt completed" << std::endl;
235 std::cout <<
"Bitpos: " << bitpos << std::endl;
236 signals.set(bitpos,
true);
240 std::cout <<
"RBCProcessRPCSimDigis> Output starts" << std::endl;
242 std::map<int, RBCInput*>::const_iterator itr;
243 for (itr = m_data.begin(); itr != m_data.end(); ++itr) {
244 std::cout << (*itr).first <<
'\t' << (*(*itr).second) <<
'\n';
247 std::cout <<
"RBCProcessRPCSimDigis> Output ends" << std::endl;