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 sameEvent(const PolarfireQueueEntry& rhs) {
38 return (spill_ == rhs.spill_ and
39 abs(ticks_ - rhs.ticks_) < max_tick_diff);
40 }
41 bool earlierEvent(const PolarfireQueueEntry& rhs) {
42 if (spill_ == rhs.spill_) return ticks_ < rhs.ticks_;
43 return spill_ < rhs.spill_;
44 }
45 };
47 std::queue<PolarfireQueueEntry> pf0_queue_, pf1_queue_;
49 std::pair<int, int> pf0_spill_counter_{0, -1}, pf1_spill_counter_{0, -1};
50
51 public:
52 HcalAlignPolarfires(const std::string& n, framework::Process& p)
53 : framework::Producer(n, p) {}
54 virtual ~HcalAlignPolarfires() = default;
56 void produce(framework::Event& event) override;
57};
58
59} // namespace hcal
60#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:42
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:29
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.
static int max_tick_diff
number of 5MHz ticks difference to consider polarfires aligned
std::vector< std::string > input_names_
input decoded objects (vector index == polarfire index_)
std::queue< PolarfireQueueEntry > pf0_queue_
queue of unmatched digis
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::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.