ToolDAQFramework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
nhits.h
Go to the documentation of this file.
1 #ifndef nhits_H
2 #define nhits_H
3 
4 #include <string>
5 #include <iostream>
6 
7 #include "Tool.h"
8 
9 #include "GPUFunctions.h"
10 #include "Stopwatch.h"
11 
12 class NHits: public Tool {
13 
14  public:
15 
16  NHits();
17  bool Initialise(std::string configfile,DataModel &data);
18  bool Execute();
19  bool Finalise();
20 
21  private:
22 
26  unsigned int m_trigger_threshold;
39 
41  void AlgNDigits(const SubSample * samples);
42 
43 #ifdef GPU
44  std::vector<int> m_time_int;
46 #endif
47 
51  std::string m_stopwatch_file;
52 
53  int m_verbose;
54 
55  std::stringstream m_ss;
56 
57  void StreamToLog(int level) {
58  Log(m_ss.str(), level, m_verbose);
59  m_ss.str("");
60  }
61 
62  enum LogLevel {FATAL=-1, ERROR=0, WARN=1, INFO=2, DEBUG1=3, DEBUG2=4, DEBUG3=5};
63 };
64 
65 
66 #endif
void AlgNDigits(const SubSample *samples)
CPU version of the NDigits algorithm.
Definition: nhits.cpp:137
Definition: nhits.h:12
NHits()
Definition: nhits.cpp:3
TimeDelta m_trigger_mask_window_post
Post-trigger time for masking digits from future tools.
Definition: nhits.h:34
bool Finalise()
Definition: nhits.cpp:211
bool Initialise(std::string configfile, DataModel &data)
Definition: nhits.cpp:5
TimeDelta m_trigger_mask_window_pre
Pre-trigger time for masking digits from future tools.
Definition: nhits.h:32
util::Stopwatch * m_stopwatch
The stopwatch, if we&#39;re using one.
Definition: nhits.h:49
TimeDelta m_trigger_search_window
Width of the sliding window.
Definition: nhits.h:24
std::string m_stopwatch_file
Image filename to save the histogram to, if required.
Definition: nhits.h:51
bool m_trigger_OD
Trigger on OD digits, rather than ID digits?
Definition: nhits.h:36
TimeDelta m_trigger_save_window_post
Post-trigger time for saving digits.
Definition: nhits.h:30
void StreamToLog(int level)
Definition: nhits.h:57
unsigned int m_trigger_threshold
Trigger threshold - number of digits must be above this value (equal to does not fire the trigger) ...
Definition: nhits.h:26
void Log(const std::string &message, const int message_level)
Format messages in the same way as for tools.
Definition: Utilities.cpp:276
LogLevel
Definition: nhits.h:62
bool Execute()
Definition: nhits.cpp:85
int m_verbose
Definition: nhits.h:53
TimeDelta m_trigger_save_window_pre
Pre-trigger time for saving digits.
Definition: nhits.h:28
std::stringstream m_ss
Definition: nhits.h:55
bool m_degrade_CPU
degrade data type from float to int
Definition: nhits.h:38