19 REId = ( reDigi & m_idMask ) >> m_idIndex;
20 TETDC = ( reDigi & m_tdcMask ) >> m_tdcIndex;
21 TEADC = ( reDigi & m_adcMask ) >> m_adcIndex;
22 measure = ( reDigi & m_measureMask ) >> m_measureIndex;
30 cerr <<
"EmcBuilder::pack can't get digiCol" << endl;
31 return StatusCode::FAILURE;
35 uint32_t teid = 0, tetdc = 0, teadc = 0, reid = 0, redigi = 0, measure = 0;
37 EmcDigiCol::const_iterator pEmcDigi = digiCol->begin();
38 for ( pEmcDigi; pEmcDigi != digiCol->end(); pEmcDigi++ )
40 teid = ( *pEmcDigi )->getIntId();
42 tetdc = ( *pEmcDigi )->getTimeChannel();
43 teadc = ( *pEmcDigi )->getChargeChannel();
44 measure = ( *pEmcDigi )->getMeasure();
47 if ( teadc & 0x80000000 )
continue;
49 redigi = ( ( reid << m_idIndex ) & m_idMask ) | ( ( tetdc << m_tdcIndex ) & m_tdcMask ) |
50 ( ( teadc << m_adcIndex ) & m_adcMask ) |
51 ( ( measure << m_measureIndex ) & m_measureMask );
52 m_buf[size++] = redigi;
57 return StatusCode::SUCCESS;
65 uint32_t nREThetaPos, nREPhiPos, nREEaWePos;
66 uint32_t nREThetaMask, nREPhiMask, nREEaWeMask;
70 f.open( initFile.c_str() );
74 cerr <<
"Error: could not open file " << initFile << endl;
75 return StatusCode::FAILURE;
80 cerr <<
"Error: could not find '##EmcDigiConf' in file " << initFile << endl;
81 return StatusCode::FAILURE;
92 return StatusCode::FAILURE;
101 uint32_t TEthetaMax, TEphiMax;
102 uint32_t TEthetaMin, TEphiMin;
103 uint32_t eawe = 0, theta = 0, phi = 0;
118 for ( uint32_t TEtheta = TEthetaMin; TEtheta <= TEthetaMax; TEtheta++ )
144 for ( uint32_t TEphi = TEphiMin; TEphi <= TEphiMax; TEphi++ )
149 uint32_t reid = ( ( eawe << nREEaWePos ) & nREEaWeMask ) |
150 ( ( theta << nREThetaPos ) & nREThetaMask ) |
151 ( ( phi << nREPhiPos ) & nREPhiMask );
159 cerr <<
"Error: REID overflow !" << reid << endl;
164 m_re2te[reid] = teid;
165 m_te2reMap.insert( TE2REMAP::value_type( teid, reid ) );
170 return StatusCode::SUCCESS;