ToolDAQFramework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
BONSAI.h
Go to the documentation of this file.
1 #ifndef BONSAI_H
2 #define BONSAI_H
3 
4 #include <string>
5 #include <iostream>
6 #include <vector>
7 
8 #include "Tool.h"
9 #include "Stopwatch.h"
10 
11 #include "WCSimRootEvent.hh"
12 #include "WCSimBonsai.hh"
13 
14 class BONSAI: public Tool {
15 
16  public:
17 
18  BONSAI();
19  bool Initialise(std::string configfile,DataModel &data);
20  bool Execute();
21  bool Finalise();
22 
23 
24  private:
25 
27  WCSimBonsai * m_bonsai;
31  std::vector<int> * m_in_PMTIDs;
33  std::vector<float> * m_in_Ts;
35  std::vector<float> * m_in_Qs;
36 
38  unsigned int m_nhits_min;
40  unsigned int m_nhits_max;
41 
45  std::string m_stopwatch_file;
46 
48  int m_verbose;
49 
51  std::stringstream m_ss;
52 
55  void StreamToLog(int level) {
56  Log(m_ss.str(), level, m_verbose);
57  m_ss.str("");
58  }
59 
61  enum LogLevel {FATAL=-1, ERROR=0, WARN=1, INFO=2, DEBUG1=3, DEBUG2=4, DEBUG3=5};
62 
63 };
64 
65 
66 #endif
WCSimBonsai * m_bonsai
This is the class that runs the BONSAI low-energy reconstruction algorithm.
Definition: BONSAI.h:27
int m_verbose
Verbosity level, as defined in tool parameter file.
Definition: BONSAI.h:48
util::Stopwatch * m_stopwatch
The stopwatch, if we&#39;re using one.
Definition: BONSAI.h:43
std::vector< float > * m_in_Ts
Times of hits in a trigger.
Definition: BONSAI.h:33
void StreamToLog(int level)
Definition: BONSAI.h:55
int m_in_nhits
Number of hits in a trigger.
Definition: BONSAI.h:29
std::vector< int > * m_in_PMTIDs
PMT IDs of hits in a trigger.
Definition: BONSAI.h:31
unsigned int m_nhits_min
Below this number of hits in a trigger, don&#39;t run BONSAI. Equality is run. Set in config file...
Definition: BONSAI.h:38
bool Execute()
Definition: BONSAI.cpp:52
std::stringstream m_ss
For easy formatting of Log messages.
Definition: BONSAI.h:51
std::vector< float > * m_in_Qs
Charges of hits in a trigger.
Definition: BONSAI.h:35
LogLevel
Log level enumerations.
Definition: BONSAI.h:61
BONSAI()
Definition: BONSAI.cpp:3
Definition: BONSAI.h:14
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.
Definition: BONSAI.h:45
bool Finalise()
Definition: BONSAI.cpp:166
unsigned int m_nhits_max
Above this number of hits in a trigger, don&#39;t run BONSAI. Equality is run. Set in config file...
Definition: BONSAI.h:40
bool Initialise(std::string configfile, DataModel &data)
Definition: BONSAI.cpp:5