Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DEventWriterREST.h
Go to the documentation of this file.
1 #ifndef _DEventWriterREST_
2 #define _DEventWriterREST_
3 
4 #include <math.h>
5 #include <vector>
6 #include <string>
7 
8 #include <HDDM/hddm_r.hpp>
9 
10 #include <JANA/JObject.h>
11 #include <JANA/JEventLoop.h>
12 #include <JANA/JApplication.h>
13 
14 #include <DVector3.h>
15 #include <DMatrix.h>
16 
17 #include "PID/DMCReaction.h"
18 #include "PID/DBeamPhoton.h"
19 #include "TRACKING/DMCThrown.h"
20 #include "FCAL/DFCALShower.h"
21 #include "PID/DNeutralShower.h"
22 #include <PID/DDetectorMatches.h>
23 #include "BCAL/DBCALShower.h"
24 #include "TOF/DTOFPoint.h"
25 #include "START_COUNTER/DSCHit.h"
27 #include "TRIGGER/DTrigger.h"
28 #include "DIRC/DDIRCPmtHit.h"
29 #include "RF/DRFTime.h"
30 
31 using namespace std;
32 using namespace jana;
33 
34 class DEventWriterREST : public JObject
35 {
36  public:
37  JOBJECT_PUBLIC(DEventWriterREST);
38 
39  DEventWriterREST(JEventLoop* locEventLoop, string locOutputFileBaseName);
40  ~DEventWriterREST(void);
41 
42  bool Write_RESTEvent(JEventLoop* locEventLoop, string locOutputFileNameSubString) const;
43  string Get_OutputFileName(string locOutputFileNameSubString) const;
44 
45  private:
46  bool Write_RESTEvent(string locOutputFileName, hddm_r::HDDM& locRecord) const;
47 
48  //contains static variables shared amongst threads
49  int& Get_NumEventWriterThreads(void) const; //acquire RESTWriter lock before modifying
50  map<string, pair<ofstream*, hddm_r::ostream*> >& Get_RESTOutputFilePointers(void) const;
51 
52  int32_t Convert_UnsignedIntToSigned(uint32_t locUnsignedInt) const;
53 
58 
59  // metadata to save in the REST file
60  // these should be consistent during program execution
63 };
64 
65 #endif //_DEventWriterREST_
string HDDM_DATA_VERSION_STRING