ToolDAQFramework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
ReconInfo.h
Go to the documentation of this file.
1 #ifndef RECONINFO_H
2 #define RECONINFO_H
3 
4 #include <iostream>
5 #include <vector>
6 #include <cmath>
7 
8 #include "TimeDelta.h"
9 
10 typedef enum EReconstructers {
16  kReconRandom //ensure this stays at the end, for looping purposes
18 
19 typedef enum NClustersWarnings {
24  kNClustersGolden //ensure this stays at the end, for looping purposes
26 
27 typedef enum SNWarnings {
32  kSNWarningGolden //ensure this stays at the end, for looping purposes
33 } SNWarning_t;
34 
35 struct Pos3D
36 {
37  double x, y, z;
38  double R() { return sqrt(x*x + y*y + z*z); }
39 };
40 
42 {
43  double theta, phi, alpha;
44 };
45 
47 {
49 };
50 
52 {
55  SNWarningParams(int nclusters,int dim, NClustersWarning_t nclusters_warning){m_nclusters = nclusters; m_dim = dim; m_nclusters_warning = nclusters_warning;};
56 };
57 
58 class ReconInfo
59 {
60  public:
61  ReconInfo();
62 
63  void AddRecon(Reconstructer_t reconstructer, int trigger_num, int nhits, TimeDelta time, double * vertex, double goodness_of_fit, double goodness_of_time_fit, bool fill_has_direction = true, double energy = -1.);
64 
65  void AddRecon(Reconstructer_t reconstructer, int trigger_num, int nhits, TimeDelta time, double * vertex, double goodness_of_fit, double goodness_of_time_fit,
66  double * direction_euler, double * cherenkov_cone, double direction_likelihood, double energy = -1.);
67 
68  void AddReconFrom(ReconInfo * in, const int irecon);
69 
70  static std::string EnumAsString(Reconstructer_t r);
71 
72  static Reconstructer_t ReconstructerFromString(std::string s);
73 
74  static std::string EnumAsString(NClustersWarning_t w);
75 
76  static NClustersWarning_t NClustersWarningFromString(std::string s);
77 
78  static std::string EnumAsString(SNWarning_t w);
79 
80  static SNWarning_t SNWarningFromString(std::string s);
81 
83 
84  int GetNRecons () { return fNRecons; }
87  Reconstructer_t GetReconstructer (int irecon) { return fReconstructer[irecon]; }
88  int GetTriggerNum (int irecon) { return fTriggerNum[irecon]; }
89  int GetNHits (int irecon) { return fNHits[irecon]; }
90  double GetEnergy (int irecon) { return fEnergy[irecon]; }
91  void SetEnergy (int irecon, double energy) { fEnergy[irecon] = energy; }
92  TimeDelta GetTime (int irecon) { return fTime[irecon]; }
93  Pos3D GetVertex (int irecon) { return fVertex[irecon]; }
94  double GetGoodnessOfFit (int irecon) { return fGoodnessOfFit[irecon]; }
95  double GetGoodnessOfTimeFit(int irecon) { return fGoodnessOfTimeFit[irecon]; }
96  //direction
97  bool GetHasDirection (int irecon) { return fHasDirection[irecon]; }
98  DirectionEuler GetDirectionEuler (int irecon) { return fDirectionEuler[irecon]; }
99  CherenkovCone GetCherenkovCone (int irecon) { return fCherenkovCone[irecon]; }
100  double GetDirectionLikelihood(int irecon) { return fDirectionLikelihood[irecon]; }
101 
102  void Reset();
103 
104  private:
105 
106  //collection
107  int fNRecons;
110 
111  //event
112  std::vector<Reconstructer_t> fReconstructer;
113  std::vector<int> fTriggerNum;
114  std::vector<int> fNHits;
115  std::vector<double> fEnergy;
116 
117  //vertex
118  std::vector<TimeDelta> fTime;
119  std::vector<Pos3D> fVertex;
120  std::vector<double> fGoodnessOfFit;
121  std::vector<double> fGoodnessOfTimeFit;
122 
123  //direction
124  std::vector<bool> fHasDirection;
125  std::vector<DirectionEuler> fDirectionEuler;
126  std::vector<CherenkovCone> fCherenkovCone;
127  std::vector<double> fDirectionLikelihood;
128 
129  void UpdateTimeBoundaries(TimeDelta time);
130 
131 };
132 
133 #endif //RECONINFO_H
enum EReconstructers Reconstructer_t
Pos3D GetVertex(int irecon)
Definition: ReconInfo.h:93
std::vector< Pos3D > fVertex
Definition: ReconInfo.h:119
TimeDelta fLastTime
Definition: ReconInfo.h:109
TimeDelta GetTime(int irecon)
Definition: ReconInfo.h:92
void UpdateTimeBoundaries(TimeDelta time)
Definition: ReconInfo.cpp:213
int fNRecons
Definition: ReconInfo.h:107
static bool ShouldProvideDirection(Reconstructer_t r)
Definition: ReconInfo.cpp:177
double R()
Definition: ReconInfo.h:38
double cos_angle
Definition: ReconInfo.h:48
DirectionEuler GetDirectionEuler(int irecon)
Definition: ReconInfo.h:98
CherenkovCone GetCherenkovCone(int irecon)
Definition: ReconInfo.h:99
NClustersWarning_t m_nclusters_warning
Definition: ReconInfo.h:54
SNWarnings
Definition: ReconInfo.h:27
Reconstructer_t GetReconstructer(int irecon)
Definition: ReconInfo.h:87
double y
Definition: ReconInfo.h:37
std::vector< bool > fHasDirection
Definition: ReconInfo.h:124
enum NClustersWarnings NClustersWarning_t
std::vector< Reconstructer_t > fReconstructer
Definition: ReconInfo.h:112
void AddReconFrom(ReconInfo *in, const int irecon)
Definition: ReconInfo.cpp:58
std::vector< int > fNHits
Definition: ReconInfo.h:114
TimeDelta fFirstTime
Definition: ReconInfo.h:108
static Reconstructer_t ReconstructerFromString(std::string s)
Definition: ReconInfo.cpp:102
double GetGoodnessOfFit(int irecon)
Definition: ReconInfo.h:94
double GetDirectionLikelihood(int irecon)
Definition: ReconInfo.h:100
std::vector< DirectionEuler > fDirectionEuler
Definition: ReconInfo.h:125
TimeDelta GetFirstTime()
Definition: ReconInfo.h:85
TimeDelta GetLastTime()
Definition: ReconInfo.h:86
double phi
Definition: ReconInfo.h:43
int GetTriggerNum(int irecon)
Definition: ReconInfo.h:88
int GetNHits(int irecon)
Definition: ReconInfo.h:89
EReconstructers
Definition: ReconInfo.h:10
std::vector< double > fDirectionLikelihood
Definition: ReconInfo.h:127
static NClustersWarning_t NClustersWarningFromString(std::string s)
Definition: ReconInfo.cpp:134
std::vector< double > fGoodnessOfTimeFit
Definition: ReconInfo.h:121
void SetEnergy(int irecon, double energy)
Definition: ReconInfo.h:91
double x
Definition: ReconInfo.h:37
static SNWarning_t SNWarningFromString(std::string s)
Definition: ReconInfo.cpp:166
void Reset()
Definition: ReconInfo.cpp:191
double z
Definition: ReconInfo.h:37
enum SNWarnings SNWarning_t
double GetGoodnessOfTimeFit(int irecon)
Definition: ReconInfo.h:95
std::vector< double > fEnergy
Definition: ReconInfo.h:115
SNWarningParams(int nclusters, int dim, NClustersWarning_t nclusters_warning)
Definition: ReconInfo.h:55
bool GetHasDirection(int irecon)
Definition: ReconInfo.h:97
std::vector< int > fTriggerNum
Definition: ReconInfo.h:113
static std::string EnumAsString(Reconstructer_t r)
Definition: ReconInfo.cpp:78
std::vector< TimeDelta > fTime
Definition: ReconInfo.h:118
void AddRecon(Reconstructer_t reconstructer, int trigger_num, int nhits, TimeDelta time, double *vertex, double goodness_of_fit, double goodness_of_time_fit, bool fill_has_direction=true, double energy=-1.)
Definition: ReconInfo.cpp:11
NClustersWarnings
Definition: ReconInfo.h:19
std::vector< CherenkovCone > fCherenkovCone
Definition: ReconInfo.h:126
double GetEnergy(int irecon)
Definition: ReconInfo.h:90
double theta
Definition: ReconInfo.h:43
double alpha
Definition: ReconInfo.h:43
int GetNRecons()
Definition: ReconInfo.h:84
std::vector< double > fGoodnessOfFit
Definition: ReconInfo.h:120
double ellipticity
Definition: ReconInfo.h:48