23 uint32_t &overFlow, uint32_t &TorQ)
25 REId = (reDigi&m_idMask)>>m_idIndex;
27 TEData = reDigi&m_dataMask;
28 overFlow = (reDigi&m_overflowMask)>>m_overflowIndex;
29 TorQ = (reDigi&m_TQMask)>>m_TQIndex;
38 cerr <<
"MdcBuilder::pack can't get digiCol" << endl;
39 return StatusCode::FAILURE;
43 uint32_t teid = 0, tetdc = 0, teadc = 0, reid = 0, redigi = 0, overflow = 0;
45 MdcDigiCol::const_iterator pMdcDigi = digiCol->begin();
46 for (pMdcDigi; pMdcDigi!= digiCol->end(); pMdcDigi++) {
50 if ( layer == 20 && wire < 8 ) {
53 else if ( layer == 42 && wire < 8 ) {
56 else if ( layer == 40 ) {
57 if ( wire >= 200 && wire < 208 ) {
60 else if ( wire >= 208 && wire < 216 ) {
68 tetdc = (*pMdcDigi)->getTimeChannel();
69 teadc = (*pMdcDigi)->getChargeChannel();
71 uint32_t overflow_tmp = (*pMdcDigi)->getOverflow();
73 if(tetdc!=0x7FFFFFFF){
74 overflow = ((tetdc > m_dataMask) ? 1 : 0) | (overflow_tmp&1);
75 redigi = (tetdc&m_dataMask)|
76 ((reid<<m_idIndex)&m_idMask)|
77 ((overflow<<m_overflowIndex)&m_overflowMask)|
78 ((0<<m_TQIndex)&m_TQMask);
79 m_buf[size++] = redigi;
82 if(teadc!=0x7FFFFFFF){
83 overflow = ((teadc > m_dataMask) ? 1 : 0) | ((overflow_tmp>>1)&1);
84 redigi = (teadc&m_dataMask)|
85 ((reid<<m_idIndex)&m_idMask)|
86 ((overflow<<m_overflowIndex)&m_overflowMask)|
87 ((1<<m_TQIndex)&m_TQMask);
88 m_buf[size++] = redigi;
94 return StatusCode::SUCCESS;
103 uint32_t NRELAYERPOS, NREWIREPOS, NREEAWEPOS;
104 uint32_t NRELAYERMASK, NREWIREMASK, NREEAWEMASK;
109 f.open( initFile.c_str());
112 cerr <<
"Error: could not open file " << initFile << endl;
117 cerr <<
"Error: could not find '##MdcDigiConf' in file " << initFile << endl;
118 return StatusCode::FAILURE;
133 uint32_t nRELayerPos, nREWirePos, nREEaWePos;
134 uint32_t nRELayerMask, nREWireMask, nREEaWeMask;
142 uint32_t layer, wire;
144 nRELayerPos = NRELAYERPOS;
145 nREWirePos = NREWIREPOS;
146 nRELayerMask = NRELAYERMASK;
147 nREWireMask = NREWIREMASK;
149 for(uint32_t TELayer = 0; TELayer <= TELayerMax; TELayer++ )
156 nRELayerMask = nRELayerMask&0xFFFFFBFF;
157 nREWireMask = nREWireMask|0x00000400;
165 for(uint32_t TEWire = 0; TEWire <= TEWireMax; TEWire++ )
168 uint32_t reid = (((layer<<nRELayerPos)&nRELayerMask)|
169 ((wire<<nREWirePos)&nREWireMask))>>2;
179 cerr <<
"Error: REID overflow !" << reid << endl;
184 m_re2te[reid] = teid;
185 m_te2reMap.insert(TE2REMAP::value_type(teid, reid)) ;
190 return StatusCode::SUCCESS;