ToolDAQFramework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
ReconReset.cpp
Go to the documentation of this file.
1 #include "ReconReset.h"
2 
4 
5 
6 bool ReconReset::Initialise(std::string configfile, DataModel &data){
7 
8  if(configfile!="") m_variables.Initialise(configfile);
9  //m_variables.Print();
10 
11  m_verbose = 0;
12  m_variables.Get("verbose", m_verbose);
13 
14  //Setup and start the stopwatch
15  bool use_stopwatch = false;
16  m_variables.Get("use_stopwatch", use_stopwatch);
17  m_stopwatch = use_stopwatch ? new util::Stopwatch("ReconReset") : 0;
18 
19  m_stopwatch_file = "";
20  m_variables.Get("stopwatch_file", m_stopwatch_file);
21 
23 
24  m_data= &data;
25 
26  if(m_stopwatch) Log(m_stopwatch->Result("Initialise"), INFO, m_verbose);
27 
28  return true;
29 }
30 
31 
34 
35  //reset the main holder of reconstructed information
36  m_data->RecoInfo.Reset();
37 
38  //and all the filtered versions
39  for (std::map<std::string, ReconInfo *>::iterator it=m_data->RecoInfoMap.begin();
40  it!=m_data->RecoInfoMap.end();
41  ++it) {
42  ss << "DEBUG: Resetting RecoInfoMap name " << it->first;
44  it->second->Reset();
45  }
46 
48 
49  return true;
50 }
51 
52 
54  if(m_stopwatch) {
56  m_stopwatch->Start();
57  }
58 
59  if(m_stopwatch) {
60  Log(m_stopwatch->Result("Finalise"), INFO, m_verbose);
61  delete m_stopwatch;
62  }
63 
64  return true;
65 }
std::string Result(std::string method_name, std::string output_file="")
Definition: Stopwatch.cpp:38
void Start()
Start the stopwatch.
Definition: Stopwatch.cpp:18
util::Stopwatch * m_stopwatch
The stopwatch, if we&#39;re using one.
Definition: ReconReset.h:25
StopwatchTimes Stop()
Stop the stopwatch, returning the CPU time.
Definition: Stopwatch.cpp:24
bool Execute()
Definition: ReconReset.cpp:32
std::stringstream ss
Definition: ReconReset.h:31
bool Initialise(std::string configfile, DataModel &data)
Definition: ReconReset.cpp:6
int m_verbose
Definition: ReconReset.h:29
void StreamToLog(int level)
Definition: ReconReset.h:33
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: ReconReset.h:27
bool Finalise()
Definition: ReconReset.cpp:53