10 if(configfile!=
"") m_variables.Initialise(configfile);
17 bool use_stopwatch =
false;
18 m_variables.Get(
"use_stopwatch", use_stopwatch);
26 double temp_width, temp_overlap;
27 m_variables.Get(
"sample_width", temp_width);
28 m_variables.Get(
"sample_overlap", temp_overlap);
40 for (std::vector<SubSample>::iterator it = samples.begin(); it != samples.end(); ++it){
41 m_ss <<
"DEBUG: Sorting sample";
48 for (std::vector<SubSample>::const_iterator it = samples.begin(); it != samples.end(); ++it){
57 int N = sample.
m_time.size();
64 std::vector<SubSample> new_samples;
65 for (std::vector<SubSample>::iterator it = samples.begin(); it != samples.end(); ++it){
66 m_ss <<
"DEBUG: Splitting sample";
69 new_samples.insert(new_samples.end(), temp_samples.begin(), temp_samples.end());
70 m_ss <<
"DEBUG: Created " << temp_samples.size() <<
" samples at times (timestamp unit != hit time unit):";
72 for (std::vector<SubSample>::iterator it2 = temp_samples.begin(); it2 != temp_samples.end(); ++it2){
73 m_ss <<
"DEBUG: " << it2->m_timestamp /
TimeDelta::s <<
" First hit: " << (it2->m_time.size()==0 ? -999 : it2->m_time.at(0));
76 m_ss <<
"DEBUG: First unique hit is at " << it2->m_first_unique;
78 for(
size_t ihit = 0; ihit < it2->m_time.size(); ihit++) {
79 m_ss <<
"DEBUG: Hit " << ihit <<
" is at time " << it2->m_time[ihit] <<
" absolute " << it2->AbsoluteDigitTime(ihit);
92 m_ss <<
"DEBUG: Preparing " << m_data->IDSamples.size() <<
" ID samples";
100 m_ss <<
"DEBUG: Preparing " << m_data->ODSamples.size() <<
" OD samples";
std::string Result(std::string method_name, std::string output_file="")
util::Stopwatch * m_stopwatch
The stopwatch, if we're using one.
bool Initialise(std::string configfile, DataModel &data)
void Start()
Start the stopwatch.
std::vector< SubSample > SplitSubSampleVector(std::vector< SubSample > &samples)
Split all SubSamples.
StopwatchTimes Stop()
Stop the stopwatch, returning the CPU time.
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.
static const TimeDelta ns
TimeDelta of 1 ns.
void Log(const std::string &message, const int message_level)
Format messages in the same way as for tools.
std::vector< TimeDelta::short_time_t > m_time
Vector of hit times relative to timestamp for all hits in SubSample. Unit: ns.
bool CheckSubSampleVectorNeedsSplitting(const std::vector< SubSample > &samples)
Check whether any of the SubSamples needs to be split.
static const TimeDelta s
TimeDelta of 1 s.
TimeDelta m_sample_overlap
The desired SubSample overlap time.
void SortSubSampleVector(std::vector< SubSample > &samples)
Sort the digits in all SubSamples by time.