LDMX Software
HcalAlignPolarfires.h
1#ifndef HCALALIGNPOLARFIRES_H
2#define HCALALIGNPOLARFIRES_H
3#include <queue>
4
7
8namespace hcal {
18 std::vector<std::string> input_names_;
20 std::string input_pass_;
22 std::string output_name_;
24 static int max_tick_diff_;
25
26 public:
29 int spill;
31 int ticks;
34 const std::string& input_name,
35 const std::string& input_pass,
36 std::pair<int, int>& spill_counter);
37 bool same_event(const PolarfireQueueEntry& rhs) {
38 return (spill == rhs.spill and abs(ticks - rhs.ticks) < max_tick_diff_);
39 }
40 bool earlier_event(const PolarfireQueueEntry& rhs) {
41 if (spill == rhs.spill) return ticks < rhs.ticks;
42 return spill < rhs.spill;
43 }
44 };
46 std::queue<PolarfireQueueEntry> pf0_queue, pf1_queue;
48 std::pair<int, int> pf0_spill_counter{0, -1}, pf1_spill_counter{0, -1};
49
50 public:
51 HcalAlignPolarfires(const std::string& n, framework::Process& p)
52 : framework::Producer(n, p) {}
53 virtual ~HcalAlignPolarfires() = default;
55 void produce(framework::Event& event) override;
56};
57
58} // namespace hcal
59#endif /* HCALALIGNPOLARFIRES_H */
Base classes for all user event processing components to extend.
Class that represents a digitized hit in a calorimeter cell readout by an HGCROC.
Implements an event buffer system for storing event data.
Definition Event.h:41
Class which represents the process under execution.
Definition Process.h:36
Base class for a module which produces a data product.
Producer(const std::string &name, Process &process)
Class constructor.
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:27
Align the two polarfires with drop/keep hints signalling successful merge.
void configure(framework::config::Parameters &ps) override
Callback for the EventProcessor to configure itself from the given set of parameters.
std::vector< std::string > input_names_
input decoded objects (vector index == polarfire index)
static int max_tick_diff_
number of 5MHz ticks difference to consider polarfires aligned
void produce(framework::Event &event) override
Process the event and put new data products into it.
std::pair< int, int > pf0_spill_counter
spill counter
std::queue< PolarfireQueueEntry > pf0_queue
queue of unmatched digis
std::string input_pass_
pass name for decoded objects
std::string output_name_
output object name
Represents a collection of the digi hits readout by an HGCROC.
All classes in the ldmx-sw project use this namespace.
Definition PerfDict.cxx:45