EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4AllEventOutStream.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4AllEventOutStream.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef FUN4ALLRAW_FUN4ALLEVENTOUTSTREAM_H
4 #define FUN4ALLRAW_FUN4ALLEVENTOUTSTREAM_H
5 
6 // base class for output streams writing Events in
7 // one or the other form
8 
9 #include <fun4all/Fun4AllBase.h>
10 
11 #include <Event/phenixTypes.h>
12 
13 #include <boost/numeric/interval.hpp>
14 
15 #include <map>
16 #include <string>
17 
18 class Event;
19 class Packet;
21 
23 {
24  public:
25  virtual ~Fun4AllEventOutStream();
26  virtual int StreamStatus() { return 0; }
27  virtual int WriteEvent(Event *evt);
28  virtual int WriteEventOut(Event * /*evt*/) { return 0; }
29  virtual int CloseOutStream() { return 0; }
30 
31  int AddPacket(const int ipkt);
32  int DropPacket(const int ipkt);
33  int AddPacketRange(const int minpacket, const int maxpacket);
34  int DropPacketRange(const int minpacket, const int maxpacket);
36 
37  protected:
38  Fun4AllEventOutStream(const std::string &name = "OUTSTREAM");
39  int resize_evtbuf(const unsigned int newsize);
41 
42  private:
44  Fun4AllEventOutputManager *m_MyManager; // pointer to my master
45  unsigned int evtbuf_size;
46  // flag to stear behavior, if 1 only add packets (drop all others), if 0 no filtering,
47  // if -1 accept all, drop selected and afterwards add back selected ones
51  int npackets;
53  std::map<int, boost::numeric::interval<int> > addpktrange;
54  std::map<int, boost::numeric::interval<int> > droppktrange;
55 };
56 
57 #endif