ToolDAQFramework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
TriggerOutput.h
Go to the documentation of this file.
1 #ifndef TRIGGEROUTPUT_H
2 #define TRIGGEROUTPUT_H
3 
4 #include <string>
5 #include <iostream>
6 #include <fstream>
7 
8 #include "Tool.h"
9 
10 #include "TFile.h"
11 #include "TTree.h"
12 
13 #include "Stopwatch.h"
14 
15 class TriggerOutput: public Tool {
16 
17 
18  public:
19 
20  TriggerOutput();
21  bool Initialise(std::string configfile,DataModel &data);
22  bool Execute();
23  bool Finalise();
24 
25 
26  private:
27 
28 
31 
33  std::string m_output_filename;
35  TFile * m_output_file;
37  TTree * m_header_tree;
39  TTree * m_triggers_tree;
40 
42 
44  TriggerType_t the_type;
56  std::vector<float> the_trigger_info;
57 
61  std::string m_stopwatch_file;
62 
63  int m_verbose;
64 
65  std::stringstream m_ss;
66 
67  void StreamToLog(int level) {
68  Log(m_ss.str(), level, m_verbose);
69  m_ss.str("");
70  }
71 
72  enum LogLevel {FATAL=-1, ERROR=0, WARN=1, INFO=2, DEBUG1=3, DEBUG2=4, DEBUG3=5};
73 
74  double absolute_time(TimeDelta d);
75 
76 };
77 
78 
79 #endif
TriggerType_t the_type
The type of Trigger.
Definition: TriggerOutput.h:44
std::string m_output_filename
Output ROOT filename that this tool RECREATE&#39;s.
Definition: TriggerOutput.h:33
double the_trigger_time
The actual time of the trigger.
Definition: TriggerOutput.h:54
double the_mask_end_time
The ending time of the hit mask.
Definition: TriggerOutput.h:52
double the_mask_start_time
The starting time of the hit mask.
Definition: TriggerOutput.h:50
bool Initialise(std::string configfile, DataModel &data)
std::vector< float > the_trigger_info
extra info from the trigger
Definition: TriggerOutput.h:56
double absolute_time(TimeDelta d)
TTree * m_triggers_tree
Tree containing triggers.
Definition: TriggerOutput.h:39
void StreamToLog(int level)
Definition: TriggerOutput.h:67
float m_interpose_interval
Definition: TriggerOutput.h:41
TTree * m_header_tree
header
Definition: TriggerOutput.h:37
TFile * m_output_file
Output ROOT file.
Definition: TriggerOutput.h:35
std::string m_stopwatch_file
Image filename to save the histogram to, if required.
Definition: TriggerOutput.h:61
double the_readout_end_time
The ending time of the trigger window.
Definition: TriggerOutput.h:48
void Log(const std::string &message, const int message_level)
Format messages in the same way as for tools.
Definition: Utilities.cpp:276
bool m_trigger_OD
Trigger on OD digits, rather than ID digits?
Definition: TriggerOutput.h:30
double the_readout_start_time
The starting time of the trigger window.
Definition: TriggerOutput.h:46
util::Stopwatch * m_stopwatch
The stopwatch, if we&#39;re using one.
Definition: TriggerOutput.h:59
std::stringstream m_ss
Definition: TriggerOutput.h:65