ThinSliceEvent.h
Go to the documentation of this file.
1 #ifndef THINSLICEEVENT_hh
2 #define THINSLICEEVENT_hh
3 #include "TSpline.h"
4 namespace protoana {
6  public:
7  ThinSliceEvent(int event, int subrun, int run)
8  : event_ID(event), subrun_ID(subrun), run_ID(run) {
9  sample_ID = -999;
10  selection_ID = -999;
13  true_beam_endP = -999;
14  true_beam_startP = -999;
15  true_beam_endZ = -999.;
16  true_beam_mass = -999;
17  reco_beam_endZ = -999;
18  beam_inst_P = -999;
19  pdg = -999;
20  reco_beam_incidentEnergies = std::vector<double>();
21  true_beam_incidentEnergies = std::vector<double>();
22  true_beam_traj_Z = std::vector<double>();
23  true_beam_traj_KE = std::vector<double>();
24  true_beam_slices = std::vector<int>();
25  calibrated_dQdX = std::vector<double>();
26  beam_EField = std::vector<double>();
27  track_pitch = std::vector<double>();
28  g4rw_weights = std::map<std::string, std::vector<double>>();
29  g4rw_splines = std::map<std::string, TSpline3*>();
30  reco_daughter_track_thetas = std::vector<double>();
31  reco_daughter_track_scores = std::vector<double>();
32  reco_daughter_track_dQdX = std::vector<std::vector<double>>();
33  reco_daughter_track_res_range = std::vector<std::vector<double>>();
34  reco_daughter_efield = std::vector<std::vector<double>>();
35  has_pi0_shower = false;
36  };
37  /*
38  ~ThinSliceEvent() {
39  for (auto s : g4rw_splines) {
40  delete s.second;
41  }
42  };*/
43 
44  /*
45  int GetEventID() const {
46  return event_ID;
47  };
48 
49  int GetSubrunID() const {
50  return subrun_ID;
51  };
52 
53  int GetRunID() const {
54  return run_ID;
55  };*/
56 
57  int GetSampleID() const {
58  return sample_ID;
59  };
60  void SetSampleID(int s) {
61  sample_ID = s;
62  };
63 
64  int GetSelectionID() const {
65  return selection_ID;
66  };
67  void SetSelectionID(int s) {
68  selection_ID = s;
69  };
70 
71  bool GetHasPi0Shower() const {
72  return has_pi0_shower;
73  };
74  void SetHasPi0Shower(bool s) {
75  has_pi0_shower = s;
76  };
77 
78  double GetTrueInteractingEnergy() const {
80  };
81  void SetTrueInteractingEnergy(double e) {
83  };
84 
85  double GetRecoInteractingEnergy() const {
87  };
88  void SetRecoInteractingEnergy(double e) {
90  };
91 
92  double GetTrueEndP() const {
93  return true_beam_endP;
94  };
95  void SetTrueEndP(double p) {
96  true_beam_endP = p;
97  };
98 
99  double GetTrueEndZ() const {
100  return true_beam_endZ;
101  };
102  void SetTrueEndZ(double z) {
103  true_beam_endZ = z;
104  };
105 
106  double GetRecoEndZ() const {
107  return reco_beam_endZ;
108  };
109  void SetRecoEndZ(double p) {
110  reco_beam_endZ = p;
111  };
112 
113  double GetTrueStartP() const {
114  return true_beam_startP;
115  };
116  void SetTrueStartP(double p) {
118  };
119 
120  double GetTrueMass() const {
121  return true_beam_mass;
122  };
123  void SetTrueMass(double m) {
124  true_beam_mass = m;
125  };
126 
127  const std::vector<double> & GetRecoIncidentEnergies() const {
129  };
130  void SetRecoIncidentEnergies(std::vector<double> v) {
132  };
133 
134  const std::vector<double> & GetTrueIncidentEnergies() const {
136  };
137  void SetTrueIncidentEnergies(std::vector<double> v) {
139  };
140 
141  const std::vector<double> & GetTrueTrajZ() const {
142  return true_beam_traj_Z;
143  };
144  void SetTrueTrajZ(std::vector<double> v) {
145  true_beam_traj_Z = v;
146  };
147 
148  const std::vector<double> & GetTrueTrajKE() const {
149  return true_beam_traj_KE;
150  };
151  void SetTrueTrajKE(std::vector<double> v) {
152  true_beam_traj_KE = v;
153  };
154 
155  const std::vector<double> & GetRecoDaughterTrackThetas() const {
157  };
158  void SetRecoDaughterTrackThetas(std::vector<double> v) {
160  };
161 
162  const std::vector<double> & GetRecoDaughterTrackScores() const {
164  };
165  void SetRecoDaughterTrackScores(std::vector<double> v) {
167  };
168 
169  const std::vector<std::vector<double>>
172  };
173  void AddRecoDaughterTrackResRange(std::vector<double> v) {
174  reco_daughter_track_res_range.push_back(v);
175  };
176 
177  const std::vector<std::vector<double>>
180  };
181  void AddRecoDaughterTrackdQdX(std::vector<double> v) {
182  reco_daughter_track_dQdX.push_back(v);
183  };
184 
185  const std::vector<std::vector<double>>
187  return reco_daughter_efield;
188  };
189  void AddRecoDaughterEField(std::vector<double> v) {
190  reco_daughter_efield.push_back(v);
191  };
192 
193  const std::vector<int> & GetTrueSlices() const {
194  return true_beam_slices;
195  };
196  void SetTrueSlices(std::vector<int> v) {
197  true_beam_slices = v;
198  };
199 
200  const std::vector<double> & GetdQdXCalibrated() const {
201  return calibrated_dQdX;
202  };
203  void SetdQdXCalibrated(std::vector<double> v) {
204  calibrated_dQdX = v;
205  };
206 
207  const std::vector<double> & GetEField() const {
208  return beam_EField;
209  };
210  void SetEField(std::vector<double> v) {
211  beam_EField = v;
212  };
213 
214  const std::vector<double> & GetTrackPitch() const {
215  return track_pitch;
216  };
217  void SetTrackPitch(std::vector<double> v) {
218  track_pitch = v;
219  };
220 
221  void SetBeamInstP(double p) {
222  beam_inst_P = p;
223  };
224  double GetBeamInstP() const {
225  return beam_inst_P;
226  };
227 
228  void SetPDG(int p) {
229  pdg = p;
230  };
231  int GetPDG() const {
232  return pdg;
233  };
234 
235  void MakeG4RWBranch(const std::string & br, const std::vector<double> & ws) {
236  g4rw_weights[br] = ws;
237  };
238  double GetG4RWWeight(const std::string & br, size_t i) const {
239  if (g4rw_weights.at(br).size() == 0) return 1.;
240  return g4rw_weights.at(br).at(i);
241  };
242  const std::map<std::string, std::vector<double>> & GetG4RWWeightMap() const {
243  return g4rw_weights;
244  };
245  const std::vector<double> & GetG4RWBranch(const std::string & br) const {
246  return g4rw_weights.at(br);
247  };
248  bool HasG4RWBranch(const std::string & br) const {
249  return (g4rw_weights.find(br) != g4rw_weights.end());
250  };
251 
252  void MakeG4RWSpline(const std::string & br) {
253  std::vector<double> vars;
254  if (!g4rw_weights[br].size()) return;
255  for (size_t i = 0; i < g4rw_weights[br].size(); ++i) {
256  vars.push_back(.1*(1+i));
257  }
258  std::string name = "g4rw_spline_event_" + std::to_string(event_ID) + "_" +
260  g4rw_splines[br] = new TSpline3(name.c_str(), &vars[0],
261  &g4rw_weights[br][0], vars.size());
262  };
263 
264  int GetEventID() const {return event_ID;};
265  int GetSubrunID() const {return subrun_ID;};
266  int GetRunID() const {return run_ID;};
267 
268  private:
269  int event_ID, subrun_ID, run_ID;
272  int pdg;
276  double beam_inst_P;
278  std::vector<double> reco_beam_incidentEnergies,
284  std::vector<std::vector<double>> reco_daughter_track_dQdX,
287 
288  std::vector<int> true_beam_slices;
289  std::vector<double> calibrated_dQdX, beam_EField,
290  track_pitch;
291  std::map<std::string, std::vector<double>> g4rw_weights;
292  std::map<std::string, TSpline3*> g4rw_splines;
293 };
294 }
295 #endif
static QCString name
Definition: declinfo.cpp:673
std::vector< int > true_beam_slices
ThinSliceEvent(int event, int subrun, int run)
Definition: ThinSliceEvent.h:7
double GetG4RWWeight(const std::string &br, size_t i) const
const std::vector< int > & GetTrueSlices() const
const std::vector< double > & GetG4RWBranch(const std::string &br) const
const std::vector< double > & GetdQdXCalibrated() const
const std::vector< double > & GetRecoDaughterTrackThetas() const
double GetTrueEndZ() const
std::string string
Definition: nybbler.cc:12
bool GetHasPi0Shower() const
const std::vector< double > & GetTrueTrajZ() const
void SetTrueTrajKE(std::vector< double > v)
void SetTrueMass(double m)
void AddRecoDaughterEField(std::vector< double > v)
std::map< std::string, std::vector< double > > g4rw_weights
std::vector< double > reco_daughter_track_thetas
const std::vector< double > & GetTrueTrajKE() const
void SetTrueInteractingEnergy(double e)
std::vector< std::vector< double > > reco_daughter_track_res_range
void SetRecoDaughterTrackThetas(std::vector< double > v)
const std::vector< double > & GetTrackPitch() const
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
std::vector< double > true_beam_incidentEnergies
void SetRecoIncidentEnergies(std::vector< double > v)
double GetBeamInstP() const
const double e
double GetTrueStartP() const
void SetTrueEndZ(double z)
double GetTrueInteractingEnergy() const
double GetRecoInteractingEnergy() const
double GetTrueEndP() const
std::vector< double > calibrated_dQdX
void SetTrueSlices(std::vector< int > v)
p
Definition: test.py:223
std::vector< double > true_beam_traj_Z
void SetTrueTrajZ(std::vector< double > v)
double GetRecoEndZ() const
void SetRecoInteractingEnergy(double e)
const std::vector< double > & GetRecoIncidentEnergies() const
void SetRecoEndZ(double p)
const std::vector< double > & GetRecoDaughterTrackScores() const
void SetTrackPitch(std::vector< double > v)
const std::vector< std::vector< double > > & GetRecoDaughterTrackdQdXs() const
std::vector< std::vector< double > > reco_daughter_track_dQdX
void SetRecoDaughterTrackScores(std::vector< double > v)
const std::vector< double > & GetTrueIncidentEnergies() const
void AddRecoDaughterTrackResRange(std::vector< double > v)
const std::vector< std::vector< double > > & GetRecoDaughterTrackResRanges() const
const std::vector< double > & GetEField() const
void SetTrueStartP(double p)
void SetHasPi0Shower(bool s)
bool HasG4RWBranch(const std::string &br) const
std::vector< double > true_beam_traj_KE
std::vector< double > reco_beam_incidentEnergies
void SetTrueEndP(double p)
std::vector< std::vector< double > > reco_daughter_efield
const std::map< std::string, std::vector< double > > & GetG4RWWeightMap() const
std::map< std::string, TSpline3 * > g4rw_splines
double GetTrueMass() const
std::vector< double > beam_EField
const std::vector< std::vector< double > > & GetRecoDaughterEFields() const
std::vector< double > reco_daughter_track_scores
void SetBeamInstP(double p)
void SetEField(std::vector< double > v)
std::string to_string(ModuleType const mt)
Definition: ModuleType.h:34
static QCString * s
Definition: config.cpp:1042
void SetTrueIncidentEnergies(std::vector< double > v)
void MakeG4RWSpline(const std::string &br)
void SetdQdXCalibrated(std::vector< double > v)
std::vector< double > track_pitch
Event finding and building.
void MakeG4RWBranch(const std::string &br, const std::vector< double > &ws)
void AddRecoDaughterTrackdQdX(std::vector< double > v)