9PatternLUTMaker::PatternLUTMaker(
const std::string& name,
11 : Analyzer(name, process) {}
14 input_file_ = ps.
get<std::string>(
"input_file");
15 output_file_ = ps.
get<std::string>(
"output_file");
16 lut_threshold_ = ps.
get<
double>(
"lut_threshold");
17 verbose_ = ps.
get<
int>(
"verbosity");
30 ldmx_log(info) <<
"In PatternLUTMaker: configure done!" << std::endl;
31 ldmx_log(info) <<
"Got parameters: \nInput file: " << input_file_
32 <<
"\nOutput file: " << output_file_
33 <<
"\nLUT threshold: " << lut_threshold_
34 <<
"\nVerbosity: " << verbose_;
39void PatternLUTMaker::onProcessStart() {
40 infile_.open(input_file_);
41 outfile_.open(output_file_);
43 if (total_lines_ > 0)
return;
46 while (infile_ >> ev >> p1 >> p2 >> p3) {
52 groups_[{p12, p23}].push_back(
61void PatternLUTMaker::onProcessEnd() {
62 ldmx_log(info) <<
"total_lines = " << total_lines_;
63 ldmx_log(info) <<
"groups = " << groups_.size();
70 ldmx_log(info) <<
"Total number of cluster combinations: " << total_lines_
72 <<
"Number of different propagation patterns: "
73 << groups_.size() <<
"\n"
74 <<
"LUT Threshold: " << lut_threshold_ * 100 <<
"%\n";
77 for (
auto& g : groups_) {
78 int count = g.second.size();
79 double frac =
static_cast<double>(count) / total_lines_;
82 ldmx_log(debug) <<
"(" << g.first.first <<
"," << g.first.second
83 <<
") appears " << count <<
" times, (" << frac * 100
90 for (
auto& line : g.second) {
92 outfile_ << line.p1_ <<
" " << line.p2_ <<
" " << line.p3_ <<
"\n";
98 ldmx_log(info) <<
"\nLUT textfile written." <<
"\n"
99 << combs <<
" combinations (" << tracks
100 <<
" tracks) written to LUT.\n";
#define DECLARE_ANALYZER(CLASS)
Macro which allows the framework to construct an analyzer given its name during configuration.
Writes LUT based on frequency of track propagation patterns for LUT-based TS tracking.
Implements an event buffer system for storing event data.
Class which represents the process under execution.
Class encapsulating parameters for configuring a processor.
const T & get(const std::string &name) const
Retrieve the parameter of the given name.