ToolDAQFramework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
SupernovaDirectionCalculator.h
Go to the documentation of this file.
1 #ifndef SupernovaDirectionCalculator_H
2 #define SupernovaDirectionCalculator_H
3 
4 #include <string>
5 #include <iostream>
6 
7 #include "Tool.h"
8 #include "Stopwatch.h"
9 
10 class SupernovaDirectionCalculator: public Tool {
11 
12 
13  public:
14 
16  bool Initialise(std::string configfile,DataModel &data);
17  bool Execute();
18  bool Finalise();
19 
21  double GetEventWeight(double log10_energy);
22 
26  void CalculateDirection(float direction[3], float costheta_cut);
27 
28  private:
29 
31  std::string m_input_filter_name;
32 
35 
37  std::vector<double> m_log10_energy;
39  std::vector<double> m_weight;
40 
44  std::string m_stopwatch_file;
45 
47  int m_verbose;
48 
50  std::stringstream m_ss;
51 
54  void StreamToLog(int level) {
55  Log(m_ss.str(), level, m_verbose);
56  m_ss.str("");
57  }
58 
60  enum LogLevel {FATAL=-1, ERROR=0, WARN=1, INFO=2, DEBUG1=3, DEBUG2=4, DEBUG3=5};
61 
62 
63 };
64 
65 
66 #endif
std::vector< double > m_log10_energy
Vector of log10(energy) for weight interpolation.
double GetEventWeight(double log10_energy)
Return the weight for the event.
std::stringstream m_ss
For easy formatting of Log messages.
std::vector< double > m_weight
Vector of weights for interpolation.
util::Stopwatch * m_stopwatch
The stopwatch, if we&#39;re using one.
int m_verbose
Verbosity level, as defined in tool parameter file.
void CalculateDirection(float direction[3], float costheta_cut)
void Log(const std::string &message, const int message_level)
Format messages in the same way as for tools.
Definition: Utilities.cpp:276
std::string m_stopwatch_file
Image filename to save the histogram to, if required.
bool m_weight_events
Enable weighting of events.
bool Initialise(std::string configfile, DataModel &data)