23 uint32_t &overFlow, uint32_t &TorQ)
25 REId = (reDigi&m_idMask)>>m_idIndex;
29 TEData = (reDigi&m_dataMask);
30 overFlow = (reDigi&m_overflowMask)>>m_overflowIndex;
31 TorQ = (reDigi&m_TQMask)>>m_TQIndex;
41 cerr <<
"TofBuilder::pack can't get digiCol" << endl;
42 return StatusCode::FAILURE;
46 uint32_t teid = 0, tetdc = 0, teadc = 0, reid = 0, redigi = 0, overflow = 0;
48 TofDigiCol::const_iterator pTofDigi = digiCol->begin();
49 for (pTofDigi; pTofDigi!= digiCol->end(); pTofDigi++) {
50 teid = (*pTofDigi)->getIntId();
51 if ( teid == 0xFFFFFFFF ) {
52 m_buf[size++] = (*pTofDigi)->getOverflow();
56 if ((teid&0x4001) == 1)
continue;
58 tetdc = (*pTofDigi)->getTimeChannel();
59 teadc = (*pTofDigi)->getChargeChannel();
61 uint32_t overflow_tmp = (*pTofDigi)->getOverflow();
63 if(tetdc!=0x7FFFFFFF){
64 overflow = ((tetdc > m_dataMask) ? 1 : 0) | (overflow_tmp&1);
65 redigi = (tetdc&m_dataMask)|
66 ((reid<<m_idIndex)&m_idMask)|
67 ((overflow<<m_overflowIndex)&m_overflowMask)|
68 ((0<<m_TQIndex)&m_TQMask);
69 m_buf[size++] = redigi;
72 if(teadc!=0x7FFFFFFF){
73 overflow = ((teadc > m_dataMask) ? 1 : 0) | ((overflow_tmp>>1)&1);
74 redigi = (teadc&m_dataMask)|
75 ((reid<<m_idIndex)&m_idMask)|
76 ((overflow<<m_overflowIndex)&m_overflowMask)|
77 ((1<<m_TQIndex)&m_TQMask);
78 m_buf[size++] = redigi;
84 return StatusCode::SUCCESS;
93 uint32_t nRELayerPos, nRECellPos, nREEaWePos;
94 uint32_t nRELayerMask, nRECellMask, nREEaWeMask;
98 f.open( initFile.c_str());
101 cerr <<
"Error: could not open file " << initFile << endl;
106 cerr <<
"Error: could not find '##TofDigiConf' in file " << initFile << endl;
107 return StatusCode::FAILURE;
128 uint32_t TELayerMax, TEphiMax, TEBaEaWe;
129 uint32_t eawe = 0, layer = 0, cell = 0;
131 if(barrel_ec_eawe == 1) {
142 for(TEBaEaWe = 0; TEBaEaWe < 2; TEBaEaWe++) {
143 if (barrel_ec_eawe != 1 && TEBaEaWe > 0)
break;
144 eawe = TEBaEaWe + (barrel_ec_eawe/2);
145 for(uint32_t TELayer = 0; TELayer <= TELayerMax; TELayer++) {
146 if (barrel_ec_eawe == 1) {
154 for (uint32_t TEphi = 0; TEphi <= TEphiMax; TEphi++) {
156 uint32_t reid = (((eawe<<nREEaWePos)&nREEaWeMask)|
157 ((layer<<nRELayerPos)&nRELayerMask)|
158 ((cell<<nRECellPos)&nRECellMask));
159 uint32_t teid =
TofID::getIntID(barrel_ec_eawe, TELayer, TEphi, TEBaEaWe);
163 m_re2te[reid] = teid;
164 m_te2reMap.insert(TE2REMAP::value_type(teid, reid)) ;
172 return StatusCode::SUCCESS;