23{
24 uint32_t REId, TEId, TEData, TEOverflow, TETorQ;
25 uint32_t nbuf = src.
nBuf();
26
28 typedef std::multimap<uint32_t, TofDigi*>::iterator my_iter;
29 std::multimap<uint32_t, TofDigi*> mapIdData;
30 my_iter it;
31
32 for (uint32_t i = 0; i < nbuf; ++i) {
33 uint32_t* buf = src(i);
34 uint32_t bufSize = src.
bufSize(i);
35 for (uint32_t j = 0; j < bufSize; ++j) {
36 m_builder.
unPack(buf[j], REId, TEData, TEOverflow, TETorQ);
37 TEId = m_builder.
getTEID( REId);
38 if ( TEId == 0xFFFFFFFF ) {
39 uint32_t data_unit = buf[j];
40 if ( (data_unit >> 25) == 0x7F ) {
43 des->push_back(tofDigi);
44 }
45 continue;
46 }
47
48 uint32_t
count = mapIdData.count(TEId);
49
50 if (count == 0) {
51 if (TETorQ) {
54 }
55 else {
58 }
59 mapIdData.insert(make_pair(TEId, tofDigi));
60 }
61 else {
62 pair<my_iter, my_iter> range = mapIdData.equal_range(TEId);
63 it = range.first;
64 tofDigi = it->second;
65 if (TETorQ) {
69 while ((++it) != range.second) {
70 tofDigi = it->second;
72 }
73 }
74 else {
75 uint32_t flag = (tofDigi->
getOverflow() & 0x3C) | 8;
76 while (it != range.second) {
77 tofDigi = (it++)->second;
79 }
82 mapIdData.insert(make_pair(TEId, tofDigi));
83 }
84 }
85 else {
89 while ((++it) != range.second) {
90 tofDigi = it->second;
92 }
93 }
94 else {
95 uint32_t flag = (tofDigi->
getOverflow() & 0x3C) | 4;
96 while (it != range.second) {
97 tofDigi = (it++)->second;
99 }
102 mapIdData.insert(make_pair(TEId, tofDigi));
103 }
104 }
105 }
106 }
107 }
108
109 my_iter end = mapIdData.end();
110 for (it = mapIdData.begin(); it != end; ++it) {
111 TEId = it->first;
112 tofDigi = it->second;
113 if ( (TEId&0xFFFF7FFF) != 0x20000060 ) {
114 des->push_back(tofDigi);
115 }
116
117 else {
118 if (des2 != 0) {
119 des2->push_back(
new LumiDigi(tofDigi));
120 }
121 delete tofDigi;
122 }
123 }
124
125 return StatusCode::SUCCESS;
126}
uint32_t bufSize(int i) const
void setChargeChannel(const unsigned int chargeChannel)
unsigned int getChargeChannel() const
void setTimeChannel(const unsigned int timeChannel)
unsigned int getTimeChannel() const
virtual uint32_t getTEID(uint32_t reid)
virtual void unPack(uint32_t reDigi, uint32_t &REId, uint32_t &TEData, uint32_t &overFlow, uint32_t &TorQ)
unsigned int getOverflow()
void setOverflow(const unsigned int overflow)