34 uint32_t TEId, REId, TEData, TEOverflow, TETorQ;
36 typedef pair<uint32_t, uint32_t> PairII;
37 vector<uint32_t> vHits;
43 uint32_t nbuf = src.
nBuf();
45 for (uint32_t i = 0; i < nbuf; ++i)
47 uint32_t* buf = src(i);
48 uint32_t* bufend= buf + src.
bufSize(i);
49 for ( ; buf < bufend; ++buf )
52 if (((digi>>18) & 0x3FFF) == 0) {
57 m_builder.
unPack(digi, REId, TEData, TEOverflow, TETorQ);
59 TEId = m_builder.
getTEID( REId );
60 if ( TEId == 0xFFFFFFFF )
continue;
62 curTag = m_mdcTag[REId];
64 if ( curTag[0] == 0 ) {
65 curTag[1] = 0x7FFFFFFF;
66 curTag[2] = 0x7FFFFFFF;
72 if ( m_runId >= m_runFrom && m_runId <= m_runTo ) {
73 if (layer == 20 && wire >= 0 && wire <= 7){
74 TEId = 268456960 + wire;
77 else if (layer == 42 && wire >= 0 && wire <= 7){
78 TEId = 268478464 + wire;
81 else if (layer == 40 && wire >= 200 && wire <= 207){
85 else if (layer == 40 && wire >= 208 && wire <= 215){
91 curTag[0] = (TEId << 2);
93 vHits.push_back( REId );
97 if ( (curTag[0]&1) == 0 ) {
100 curTag[3] |= TEOverflow;
104 if ( TEData >= curTag[1] ) {
105 if ( TEOverflow ) TEData |= (1<<31);
106 vmTDC.push_back( make_pair(REId, TEData) );
109 if ( curTag[3] & 1 ) curTag[1] |= (1<<31);
110 vmTDC.push_back( make_pair(REId, curTag[1]) );
112 curTag[3] &= (0xFFFFFFFF-1);
113 curTag[3] |= TEOverflow;
120 if ( TEOverflow ) curTag[3] |= 2;
126 if ( m_runMode == 1 ) {
127 for ( vector<PairII>::iterator it = vmTDC.begin(); it != vmTDC.end(); ++it ) {
128 curTag = m_mdcTag[it->first];
129 if ( (curTag[0]&3) == 3 ) {
130 uint32_t
data = it->second;
131 if(
data>>31)
continue;
134 des->push_back(mdcDigi);
138 for ( vector<uint32_t>::iterator it = vHits.begin(); it != vHits.end(); ++it) {
139 curTag = m_mdcTag[*it];
140 if ( (curTag[0]&3) == 3 ) {
141 if( ((curTag[3]&3)>0) || (((curTag[3]&12)!=12) && ((curTag[3]&12)!=0)) ) {
147 des->push_back(mdcDigi);
153 for ( vector<PairII>::iterator it = vmTDC.begin(); it != vmTDC.end(); ++it ) {
154 curTag = m_mdcTag[it->first];
155 uint32_t
data = it->second;
158 des->push_back(mdcDigi);
161 for ( vector<uint32_t>::iterator it = vHits.begin(); it != vHits.end(); ++it) {
162 curTag = m_mdcTag[*it];
165 des->push_back(mdcDigi);
171 return StatusCode::SUCCESS;