29 m_lbin =std::make_unique<RBCLinkBoardGLSignal>( &
m_data ) ;
61 auto digiItr = detUnit.second.first;
62 int bx = (*digiItr).bx();
65 if (
m_debug )
std::cout <<
"RBCProcessRPCDigis> found a bx bigger than max allowed: " 71 const RPCRoll * roll =
dynamic_cast<const RPCRoll*
>( (*m_ptr_rpcGeom)->roll(
id));
74 if(
m_debug )
std::cout <<
"RBCProcessRPCDigis: roll is forward" << std::endl;
83 int rollid =
id.roll();
85 int digipos = (station * 100) + (layer * 10) + rollid;
87 if ( (wheel == -1 || wheel == 0 || wheel == 1) && station == 2 && layer == 1 )
88 digipos = 30000 + digipos;
89 if ( (wheel == -2 || wheel == 2) && station == 2 && layer == 2 )
90 digipos = 30000 + digipos;
92 if ( (wheel == -1 || wheel == 0 || wheel == 1) && station == 2 && layer == 2 )
93 digipos = 20000 + digipos;
94 if ( (wheel == -2 || wheel == 2) && station == 2 && layer == 1 )
95 digipos = 20000 + digipos;
98 <<
"Wheel: " << wheel <<
'\t' 99 <<
"Sector: " << sector <<
'\t' 100 <<
"Station: " << station <<
'\t' 101 <<
"Layer: " << layer <<
'\t' 102 <<
"B-Layer: " << blayer <<
'\t' 103 <<
"Roll id: " << rollid <<
'\t' 104 <<
"Digi at: " << digipos <<
'\n';
113 setDigiAt( sector, digipos, wheelData[ (wheel + 2) ] );
116 setDigiAt( sector, digipos, (*itr).second[ (wheel + 2) ] );
122 (*wheelCounter).second.incrementSector( sector );
140 <<
" ndigis " << ndigis << std::endl;
143 wheelCounter.second.evalCounters();
144 if (
m_debug ) wheelCounter.second.printSummary();
147 if (
m_data.empty() )
return 0;
167 dataVec.reserve(maxWheels);
168 for(
int i=0;
i < maxWheels; ++
i) {
169 auto&
block = dataVec.emplace_back();
173 for(
int j=0; j < maxRbcBrds; ++j) {
176 block.m_orsignals[j].input_sec[0].reset();
177 block.m_orsignals[j].input_sec[1].reset();
178 block.m_orsignals[j].needmapping =
false;
179 block.m_orsignals[j].hasData =
false;
193 int bx = vecData.first;
196 if ( bx != 0 ) bxsign = ( bx /
abs(bx) );
199 for(
auto & item : vecData.second) {
201 for(
int k=0;
k < 6; ++
k) {
203 int code = bxsign * ( 1000000*
abs(bx)
204 + 10000*item.wheelIdx()
205 + 100 *item.m_sec1[
k]
206 + 1 *item.m_sec2[
k] );
208 RBCInput * signal = & item.m_orsignals[
k];
211 if ( signal->hasData )
212 m_data.emplace( code , signal );
218 if (
m_debug and not m_vecDataperBx.empty() )
std::cout <<
"builddata: completed. size of data: " <<
m_data.size() << std::endl;
228 if ( _station < 3 ) {
229 blayer = ( (_station-1) * 2 ) + _layer;
232 blayer = _station + 2;
255 for ( pos = 0; pos < 6; ++pos ) {
256 if (block.
m_sec1[pos] == sector || block.
m_sec2[pos] == sector )
277 signals.set( bitpos ,
true );
284 std::cout <<
"RBCProcessRPCDigis> Output starts" << std::endl;
286 for(
auto const& item:
m_data) {
287 std::cout << item.first <<
'\t' << (* item.second ) <<
'\n';
290 std::cout <<
"RBCProcessRPCDigis> Output ends" << std::endl;
void setInputBit(std::bitset< 15 > &, int)
std::array< RBCInput, 6 > m_orsignals
void initialize(std::vector< RPCData > &) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
constexpr std::array< int, 6 > s_sec2id
std::map< int, std::vector< RPCData > > m_vecDataperBx
constexpr std::array< int, 6 > s_sec1id
Abs< T >::type abs(const T &t)
const edm::ESHandle< RPCGeometry > * m_ptr_rpcGeom
const std::map< int, int > s_layermap
constexpr std::array< int, 5 > s_wheelid
const edm::Handle< RPCDigiCollection > * m_ptr_digiColl
RBCProcessRPCDigis(const edm::ESHandle< RPCGeometry > &, const edm::Handle< RPCDigiCollection > &)
Standard constructor.
std::map< int, l1trigger::Counters > m_digiCounters
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
void setDigiAt(int, int, RPCData &)
int getBarrelLayer(const int &, const int &)
std::unique_ptr< RPCInputSignal > m_lbin
std::array< int,6 > m_sec2
~RBCProcessRPCDigis() override
Destructor.
std::map< int, RBCInput * > m_data
std::array< int, 6 > m_sec1