Class Reference for E1039 Core & Analysis Software
Fun4AllRUSOutputManager.h
Go to the documentation of this file.
1 #ifndef _FUN4ALL_UNIVERSAL_OUTPUT_MANAGER__H_
2 #define _FUN4ALL_UNIVERSAL_OUTPUT_MANAGER__H_
4 #include <string>
5 #include <vector>
6 #include <map>
7 #include <TStopwatch.h>
8 
9 class TFile;
10 class TTree;
11 class PHCompositeNode;
12 class SQEvent;
13 class SQSpillMap;
14 class SQHitVector;
15 class SQTrackVector;
16 class SQRun;
17 
19  public:
20  Fun4AllRUSOutputManager(const std::string &myname = "UNIVERSALOUT");
21  virtual ~Fun4AllRUSOutputManager();
22 
23  void SetTreeName(const std::string& name) { m_tree_name = name; }
24  void SetFileName(const std::string& name) { m_file_name = name; }
25  void ResetHitBranches();
27  void SetBasketSize(int size) { m_basket_size = size; }
28  void SetAutoFlush(int flush) { m_auto_flush = flush; }
29  void SetCompressionLevel(int level) { m_compression_level = level; }
30  unsigned int EncodeProcess(int processID, int sourceFlag);
31  void SetProcessId(int proc_id) { process_id = proc_id; }
32  void EnableEventInfo(bool enable) { write_sq_event_info = enable; }
33 
34  virtual int Write(PHCompositeNode* startNode);
35 
36  protected:
37  int OpenFile(PHCompositeNode* startNode);
38  void CloseFile();
39 
40  private:
41  int process_id;
42  int source_flag;
43  bool mc_truth_mode;
44  bool write_sq_event_info;
45  std::string m_tree_name;
46  std::string m_file_name;
47  std::string m_dir_base;
48 
49  TFile* m_file;
50  TTree* m_tree;
51 
52  SQEvent* m_evt;
53  SQSpillMap* m_sp_map;
54  SQHitVector* m_hit_vec;
55  SQTrackVector * m_vec_trk;
56  SQRun* sq_run;
57 
58  int m_basket_size;
59  int m_auto_flush;
60  int m_compression_level;
61 
62  int runID;
63  int spillID;
64  int eventID;
65  int turnID;
66  int rfID;
67  int rfIntensity[33];
68  int fpgaTrigger[5] = {0};
69  int nimTrigger[5] = {0};
70 
71  std::vector<int> hitID;
72  std::vector<int> detectorID;
73  std::vector<int> elementID;
74  std::vector<double> tdcTime;
75  std::vector<double> driftDistance;
76 
77  std::vector<int> hitTrackID, gCharge, gTrackID, gProcessID;
78  std::vector<double> gvx, gvy, gvz, gpx, gpy, gpz;
79  std::vector<double> gx_st1, gy_st1, gz_st1, gpx_st1, gpy_st1, gpz_st1;
80  std::vector<double> gx_st3, gy_st3, gz_st3, gpx_st3, gpy_st3, gpz_st3;
81 
82 };
83 
84 #endif
void SetFileName(const std::string &name)
Fun4AllRUSOutputManager(const std::string &myname="UNIVERSALOUT")
unsigned int EncodeProcess(int processID, int sourceFlag)
int OpenFile(PHCompositeNode *startNode)
void SetTreeName(const std::string &name)
virtual int Write(PHCompositeNode *startNode)
write starting from given node
An SQ interface class to hold one event header.
Definition: SQEvent.h:17
An SQ interface class to hold a list of SQHit objects.
Definition: SQHitVector.h:32
An SQ interface class to hold the run-level info.
Definition: SQRun.h:18
An SQ interface class to hold a list of SQSpill objects.
Definition: SQSpillMap.h:19
An SQ interface class to hold a list of SQTrack objects.
Definition: SQTrackVector.h:19