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();
57 if ((
roll->isForward())) {
59 std::cout <<
"RBCProcessRPCSimDigis: roll is forward" << std::endl;
65 int layer =
roll->id().layer();
67 int blayer = getBarrelLayer(layer,
station);
68 int rollid =
id.roll();
70 int digipos = (
station * 100) + (layer * 10) + rollid;
73 digipos = 30000 + digipos;
75 digipos = 30000 + digipos;
78 digipos = 20000 + digipos;
80 digipos = 20000 + digipos;
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];
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;
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;
static AlgebraicMatrix initialize()
constexpr std::array< int, 6 > s_sec2id
constexpr std::array< int, 6 > s_sec1id
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
constexpr std::array< int, 5 > s_wheelid
~RBCProcessRPCSimDigis() override
Destructor.
RBCProcessRPCSimDigis()
Standard constructor.
int getBarrelLayer(const int &, const int &)
void setDigiAt(int, int, RPCData &)
Abs< T >::type abs(const T &t)
void initialize(std::vector< RPCData > &)
const std::map< int, int > s_layermap
void setInputBit(std::bitset< 15 > &, int)
void reset(double vett[256])