LDMX Software
PatternLUTMaker.h
Go to the documentation of this file.
1
8#ifndef TOOLS_PATTERNLUTMAKER_H
9#define TOOLS_PATTERNLUTMAKER_H
10#include <fstream>
11#include <map>
12#include <string>
13#include <utility>
14#include <vector>
15
16#include "Framework/Configure/Parameters.h"
18
19namespace tools {
20
22 public:
23 struct Line {
24 int event_;
25 float p1_, p2_, p3_;
26 };
27
28 PatternLUTMaker(const std::string& name, framework::Process& process);
29
30 virtual ~PatternLUTMaker() = default;
31
32 void configure(framework::config::Parameters& parameters) override;
33
34 void analyze(const framework::Event& event) override;
35
36 void onProcessStart() override;
37
38 void onProcessEnd() override;
39
40 private:
41 // verbosity
42 int verbose_{0};
43
44 // input text file of clusters
45 std::string input_file_;
46
47 // output LUT file name
48 std::string output_file_;
49
50 // minimum frequency of a specific pattern to be written to the LUT
51 double lut_threshold_{0.0008};
52
53 std::ifstream infile_;
54 std::ofstream outfile_;
55
56 // to group cluster combinations by track pattern
57 std::map<std::pair<float, float>, std::vector<Line>> groups_;
58
59 //total number of lines in input file
60 int total_lines_{0};
61};
62
63} // namespace tools
64
65#endif /* TOOLS_PATTERNLUTMAKER_H */
Base classes for all user event processing components to extend.
Base class for a module which does not produce a data product.
virtual void process(Event &event) final
Processing an event for an Analyzer is calling analyze.
Implements an event buffer system for storing event data.
Definition Event.h:42
Class which represents the process under execution.
Definition Process.h:37
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:29
void onProcessStart() override
Callback for the EventProcessor to take any necessary action when the processing of events starts,...
void onProcessEnd() override
Callback for the EventProcessor to take any necessary action when the processing of events finishes,...
void analyze(const framework::Event &event) override
Process the event and make histograms or summaries.
void configure(framework::config::Parameters &parameters) override
Callback for the EventProcessor to configure itself from the given set of parameters.