ToolDAQFramework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
PrepareSubSamples.h
Go to the documentation of this file.
1 #ifndef PrepareSubSamples_H
2 #define PrepareSubSamples_H
3 
4 #include <string>
5 #include <iostream>
6 
7 #include "Tool.h"
8 #include "TimeDelta.h"
9 #include "Stopwatch.h"
10 
11 class PrepareSubSamples: public Tool {
12 
13 
14  public:
15 
17  bool Initialise(std::string configfile,DataModel &data);
18  bool Execute();
19  bool Finalise();
20 
21 
22  private:
23 
28 
32  std::string m_stopwatch_file;
33 
34  int m_verbose;
35 
36  std::stringstream m_ss;
37 
38  void StreamToLog(int level) {
39  Log(m_ss.str(), level, m_verbose);
40  m_ss.str("");
41  }
42 
43  enum LogLevel {FATAL=-1, ERROR=0, WARN=1, INFO=2, DEBUG1=3, DEBUG2=4, DEBUG3=5};
44 
46  void SortSubSampleVector(std::vector<SubSample> &samples);
48  bool CheckSubSampleVectorNeedsSplitting(const std::vector<SubSample> &samples);
50  bool CheckSubSampleNeedsSplitting(const SubSample &sample);
52  std::vector<SubSample> SplitSubSampleVector(std::vector<SubSample> &samples);
53 
54 };
55 
56 
57 #endif
util::Stopwatch * m_stopwatch
The stopwatch, if we&#39;re using one.
bool Initialise(std::string configfile, DataModel &data)
std::vector< SubSample > SplitSubSampleVector(std::vector< SubSample > &samples)
Split all SubSamples.
std::stringstream m_ss
void StreamToLog(int level)
std::string m_stopwatch_file
Image filename to save the histogram to, if required.
TimeDelta m_sample_width
The desired maximum SubSample length.
bool CheckSubSampleNeedsSplitting(const SubSample &sample)
Check whether the SubSample needs to be split.
void Log(const std::string &message, const int message_level)
Format messages in the same way as for tools.
Definition: Utilities.cpp:276
bool CheckSubSampleVectorNeedsSplitting(const std::vector< SubSample > &samples)
Check whether any of the SubSamples needs to be split.
TimeDelta m_sample_overlap
The desired SubSample overlap time.
void SortSubSampleVector(std::vector< SubSample > &samples)
Sort the digits in all SubSamples by time.