3 #include <Event/oEvent.h>
4 #include <Event/A_Event.h>
5 #include <Event/Event.h>
6 #include <Event/packet.h>
55 std::queue<int> savepacket;
56 unsigned int size = 0;
72 std::map<int, boost::numeric::interval<int> >::const_iterator dropiter;
76 int packetid =
plist[i]->getIdentifier();
82 if (packetid < dropiter->first)
87 if (boost::numeric::in(packetid, dropiter->second))
100 if (packetid < dropiter->first)
105 if (boost::numeric::in(packetid, dropiter->second))
114 size +=
plist[i]->getLength() + 4;
120 cout <<
"Fun4AllEventOutStream: dropping packet " << i
121 <<
" in list with id " <<
plist[i]->getIdentifier() << endl;
132 oEvent new_event(
evtbuf, size, evt->getRunNumber(), evt->getEvtType(), evt->getEvtSequence());
133 while (!savepacket.empty())
135 int index = savepacket.front();
136 new_event.addPacket(
plist[index]);
168 boost::numeric::interval<int> newinterval;
171 newinterval.assign(minpacket, maxpacket);
175 cout <<
"Exception thrown: " << e.what() << endl;
176 cout <<
"for interval[" << minpacket <<
"," << maxpacket <<
"]" << endl;
177 cout <<
"exiting" << endl;
181 if (! boost::numeric::in(minpacket, newinterval))
183 cout <<
PHWHERE <<
" boost interval does not cover minpacket " << minpacket << endl;
184 cout <<
"that is seriously wrong, exiting" << endl;
187 if (! boost::numeric::in(maxpacket, newinterval))
189 cout <<
PHWHERE <<
" boost interval does not cover maxpacket " << maxpacket << endl;
190 cout <<
"that is seriously wrong, exiting" << endl;
201 boost::numeric::interval<int> newinterval;
204 newinterval.assign(minpacket, maxpacket);
208 cout <<
"Exception thrown: " << e.what() << endl;
209 cout <<
"for interval[" << minpacket <<
"," << maxpacket <<
"]" << endl;
210 cout <<
"exiting" << endl;
214 if (! boost::numeric::in(minpacket, newinterval))
216 cout <<
PHWHERE <<
" boost interval does not cover minpacket " << minpacket << endl;
217 cout <<
"that is seriously wrong, exiting" << endl;
220 if (! boost::numeric::in(maxpacket, newinterval))
222 cout <<
PHWHERE <<
" boost interval does not cover maxpacket " << maxpacket << endl;
223 cout <<
"that is seriously wrong, exiting" << endl;
int verbosity
The verbosity level. 0 means not verbose at all.
std::map< int, boost::numeric::interval< int > > droppktrange
int AddPacketRange(const int minpacket, const int maxpacket)
virtual ~Fun4AllEventOutStream()
Fun4AllEventOutStream(const std::string &name="OUTSTREAM")
int resize_evtbuf(const unsigned int newsize)
int AddPacket(const int ipkt)
int DropPacket(const int ipkt)
int DropPacketRange(const int minpacket, const int maxpacket)
virtual int WriteEventOut(Event *)
std::map< int, boost::numeric::interval< int > > addpktrange
virtual int WriteEvent(Event *evt)