forked from SuperNEMO-DBD/SensitivityModule
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSensitivityModule.h
More file actions
119 lines (104 loc) · 3.83 KB
/
SensitivityModule.h
File metadata and controls
119 lines (104 loc) · 3.83 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
//! \file SensitivityModule.h
//! \brief Example processing module for flreconstruct
//! \details Process a things object
#ifndef TESTMODULE_HH
#define TESTMODULE_HH
// Standard Library
// Third Party
//#include <boost/foreach.hpp>
#include "TFile.h"
#include "TTree.h"
#include "TMath.h"
#include "TF1.h"
#include "TVector3.h"
// - Bayeux
#include "bayeux/dpp/base_module.h"
#include "bayeux/mctools/simulated_data.h"
#include "bayeux/genbb_help/primary_particle.h"
#include "bayeux/genbb_help/primary_event.h"
#include "bayeux/datatools/service_manager.h"
#include "bayeux/geomtools/manager.h"
#include "bayeux/geomtools/geometry_service.h"
#include "bayeux/geomtools/line_3d.h"
#include "bayeux/geomtools/helix_3d.h"
#include "bayeux/geomtools/geomtools.h"
// - Falaise
#include "falaise/snemo/datamodels/calibrated_data.h"
#include "falaise/snemo/datamodels/tracker_clustering_data.h"
#include "falaise/snemo/datamodels/tracker_clustering_solution.h"
#include "falaise/snemo/datamodels/particle_track_data.h"
// From this application
#include "TrackDetails.h"
// math module
#include <cmath>
typedef struct SimDataStorage{
// Truth info - particle energies in MeV and primary vertex position
double higher_energy_;
double lower_energy_;
double total_energy_;
int higher_particle_type_;
int lower_particle_type_;
double og_vertex_x_;
double og_vertex_y_;
double og_vertex_z_;
std::vector<double> og_energy_;
std::vector<double> og_momentum_;
std::vector<double> og_momentum_x_;
std::vector<double> og_momentum_y_;
std::vector<double> og_momentum_z_;
std::vector<double> step_start_vertex_x_;
std::vector<double> step_start_vertex_y_;
std::vector<double> step_start_vertex_z_;
std::vector<double> step_stop_vertex_x_;
std::vector<double> step_stop_vertex_y_;
std::vector<double> step_stop_vertex_z_;
std::vector<double> step_start_momentum_x_;
std::vector<double> step_start_momentum_y_;
std::vector<double> step_start_momentum_z_;
std::vector<double> step_stop_momentum_x_;
std::vector<double> step_stop_momentum_y_;
std::vector<double> step_stop_momentum_z_;
std::vector<double> step_start_time_;
std::vector<double> step_stop_time_;
std::vector<double> step_start_momentum_;
std::vector<double> step_stop_momentum_;
std::vector<bool> step_entering_volume_;
std::vector<bool> step_exiting_volume_;
std::vector<std::string> step_material_;
std::vector<double> step_energy_loss_;
std::vector<int> step_track_id_;
std::vector<double> energy_loss_;
std::vector<double> displacement_;
std::vector<int> track_ids_;
bool escaped_foil_ = true;
}simdatastorage;
// This Project
class SensitivityModule : public dpp::base_module {
static const uint minHitsInCluster=3;
public:
//! Construct module
SensitivityModule();
//! Destructor
virtual ~SensitivityModule();
//! Configure the module
virtual void initialize(const datatools::properties& myConfig,
datatools::service_manager& flServices,
dpp::module_handle_dict_type& moduleDict);
//! Process supplied data record
virtual dpp::base_module::process_status process(datatools::things& workItem);
//! Reset the module
virtual void reset();
private:
TFile* hfile_;
TTree* tree_;
SimDataStorage simdata_;
// configurable data member
std::string filename_output_;
// geometry service
const geomtools::manager* geometry_manager_; //!< The geometry manager
void ResetVars();
// Macro which automatically creates the interface needed
// to enable the module to be loaded at runtime
DPP_MODULE_REGISTRATION_INTERFACE(SensitivityModule);
};
#endif // TESTMODULE_HH