-
Notifications
You must be signed in to change notification settings - Fork 1
/
data_output.h
76 lines (45 loc) · 1.6 KB
/
data_output.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef DATA_OUTPUT_H
#define DATA_OUTPUT_H
// class handling writing of event information and detected photon information to output root file
#include <vector>
#include "TFile.h"
#include "TTree.h"
#include "TVector3.h"
class data_output {
private:
// output file
TFile *output_file;
// branches:
TTree *event_tree;
TTree *data_tree;
TTree *data_tree_vuv;
TTree *data_tree_vis;
// tree entries:
// event
int event_no;
double event_E;
double event_x_pos, event_y_pos, event_z_pos;
// data
int data_pmt, data_pmt_vuv, data_pmt_vis;
int data_event, data_event_vuv, data_event_vis;
double data_time, data_time_vuv, data_time_vis;
double data_x_pos, data_x_pos_vuv, data_x_pos_vis;
double data_y_pos, data_y_pos_vuv, data_y_pos_vis;
double data_z_pos, data_z_pos_vuv, data_z_pos_vis;
const bool include_reflected;
public:
// constructor
data_output(const char* output_file_name, const bool include_timings, const bool include_reflected);
// destructor
~data_output();
// add event tree entry
void add_event(const int &event_number, const double &event_energy, const std::vector<double> &event_position);
// add data tree entry
// without times
void add_data(const int &event_number, const int &optical_channel, const int &num_VUV, const int &num_VIS, const TVector3 &ScintPoint);
// with times
void add_data(const int &event_number, const int &optical_channel, const int &num_VUV, const int &num_VIS, const TVector3 &ScintPoint, const std::vector<double> ×_vuv, const std::vector<double> ×_vis);
// write file
void write_output_file() { output_file->Write(); }
};
#endif