Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
hd_eventfilter/MyProcessor.h
Go to the documentation of this file.
1 // Author: David Lawrence June 25, 2004
2 //
3 //
4 // MyProcessor.h
5 //
6 /// Example program for a Hall-D analyzer which uses DANA
7 ///
8 
9 #include <string>
10 
11 #include <JANA/JEventProcessor.h>
12 #include <JANA/JEventLoop.h>
13 using namespace jana;
14 
15 #include <HDDM/hddm_s.hpp>
16 #include <fstream>
17 
18 
19 class MyProcessor:public JEventProcessor
20 {
21  public:
22  jerror_t init(void); ///< Called once at program start.
23  jerror_t brun(JEventLoop *loop, int32_t runnumber) { ///< Called everytime a new run number is detected.
24  return NOERROR;
25  }
26  jerror_t evnt(JEventLoop *loop, uint64_t eventnumber); ///< Called every event.
27  jerror_t erun(void) { ///< Called everytime run number changes, provided brun has been called.
28  return NOERROR;
29  }
30  jerror_t fini(void); ///< Called after last event of last event source has been processed.
31 
33  std::ofstream *ofs;
34  hddm_s::ostream *fout;
35  unsigned long Nevents_written;
36 
37  private:
40 };
char string[256]
jerror_t brun(JEventLoop *loop, int32_t runnumber)
hddm_s::ostream * fout
unsigned long Nevents_written