5 #include <onlmon/OnlMonServer.h>
7 #include <Event/Event.h>
8 #include <Event/EventTypes.h>
9 #include <Event/msg_profile.h>
63 TH1 *newhist =
new TH1F(
"pktsize_tmp",
"packet size storage facility", 1, 0, 1);
80 std::ostringstream errmsg;
81 errmsg <<
"Packet array too small, need at least " << nw <<
" entries";
88 std::map<unsigned int, unsigned int>::iterator mapiter;
89 for (
int i = 0;
i < nw;
i++)
105 std::cout <<
"Packet " << packetid <<
" size: " << size <<
" sum size: "
114 std::cout <<
"putting map into histos" << std::endl;
133 TH1 *newhist =
new TH1F(
"pktsize_tmp",
"packet size storage facility",
packetsize.size(), 0,
packetsize.size());
138 std::map<unsigned int, unsigned int>::const_iterator mapiter;
145 sizehist->SetBinContent(nbin, aversize);
146 sizehist->SetBinError(nbin, mapiter->first);
156 std::map<unsigned int, unsigned int>::const_iterator mapiter;
159 std::cout <<
"Packet " << mapiter->first
160 <<
", SumBytes " << mapiter->second
161 <<
", Average " << (float) (mapiter->second) / (float) (
nevnts)
165 std::cout <<
"could not find dcm group for packet " << mapiter->first << std::endl;
176 std::map<std::string, unsigned int>::const_iterator iter;
179 std::cout <<
"DCM group " << iter->first
180 <<
", SumBytes " << iter->second
181 <<
", Average " << (float) (iter->second) / (float) (
nevnts)
187 std::cout <<
"Fiber group " << iter->first
188 <<
", SumBytes " << iter->second
189 <<
", Average " << (float) (iter->second) / (float) (
nevnts)
193 if (what ==
"GRANULES")
195 std::map<std::string, std::pair<unsigned int, unsigned int> >::const_iterator mapiter;
198 std::cout <<
"Granule " << mapiter->first
199 <<
", Min Packet " << mapiter->second.first
200 <<
", Max Packet " << mapiter->second.second
206 std::multimap<double, int> sortlist;
207 std::map<unsigned int, unsigned int>::const_iterator mapiter;
211 sortlist.insert(std::pair<double, int>(aversize, mapiter->first));
213 std::multimap<double, int>::const_iterator mmapiter;
214 for (mmapiter = sortlist.begin(); mmapiter != sortlist.end(); ++mmapiter)
216 std::cout <<
"Packet " << mmapiter->second
217 <<
" Size: " << mmapiter->first
222 if (what ==
"DCMGROUP")
224 std::map<std::string, std::set<unsigned int> > dcms;
225 std::map<unsigned int, std::string>::const_iterator iter;
228 std::map<std::string, std::set<unsigned int> >::iterator iter2 = dcms.find(iter->second);
229 if (iter2 == dcms.end())
231 std::set<unsigned int> newset;
232 newset.insert(iter->first);
233 dcms[iter->second] = newset;
237 (iter2->second).insert(iter->first);
240 std::map<std::string, std::set<unsigned int> >::const_iterator iter3;
241 std::set<unsigned int>::const_iterator iter4;
242 for (iter3 = dcms.begin(); iter3 != dcms.end(); ++iter3)
244 std::cout <<
"dcm group " << iter3->first <<
" packets: " << std::endl;
245 for (iter4 = (iter3->second).begin(); iter4 != (iter3->second).
end(); ++iter4)
247 std::cout << *iter4 <<
" ";
249 std::cout << std::endl;
257 std::map<std::string, std::pair<unsigned int, unsigned int> >::const_iterator graniter;
259 unsigned int lolim, hilim;
260 std::map<unsigned int, unsigned int> granpackets;
261 std::map<unsigned int, unsigned int>::iterator piter0, piter1, piter2;
264 name = graniter->first;
265 lolim = graniter->second.first;
266 hilim = graniter->second.second;
268 if (piter1->first < hilim)
274 std::cout <<
"Name: " << name <<
" first packet: " << piter1->first
275 <<
" last packet: " << piter2->first << std::endl;
282 std::cout <<
"Name: " << name <<
" No packet found" << std::endl;
286 for (piter0 = piter1; piter0 !=
packetsize.upper_bound(hilim); ++piter0)
288 granpackets[piter0->first] = piter0->second;
296 std::cout <<
"Non assigned packets found" << std::endl;
299 std::cout <<
"Packet ID: " << piter0->first << std::endl;
301 std::ostringstream errmsg;
302 errmsg <<
"PktSizeMon::UpdateDB() unassigned packets found:";
305 errmsg <<
" " << piter0->first;