2#include "Hcal/HcalAlignPolarfires.h"
5HcalAlignPolarfires::PolarfireQueueEntry::PolarfireQueueEntry(
7 const std::string& input_pass, std::pair<int, int>& spill_counter) {
8 int spilln =
event.getObject<
int>(input_name +
"Spill", input_pass);
9 if (spilln != spill_counter.second) {
10 spill_counter.first++;
11 spill_counter.second = spilln;
13 spill = spill_counter.first;
14 ticks =
event.getObject<
int>(input_name +
"Ticks", input_pass);
33 while (pf1_queue.size() > 0 and pf1_queue.front().digis.getNumDigis() == 0)
38 if (
pf0_queue.size() > 0 and pf1_queue.size() > 0) {
40 if (
pf0_queue.front().same_event(pf1_queue.front())) {
44 const auto& unmerged{pf1_queue.front().digis};
45 for (
int i{0}; i < unmerged.getNumDigis(); i++) {
46 auto digi{unmerged.getDigi(i)};
47 std::vector<ldmx::HgcrocDigiCollection::Sample> samples;
48 for (
int j{0}; j < unmerged.getNumSamplesPerDigi(); j++) {
49 samples.push_back(digi.at(i));
51 merged.
addDigi(digi.id(), samples);
57 }
else if (
pf0_queue.front().earlier_event(pf1_queue.front())) {
64 merged = pf1_queue.front().digis;
74 }
else if (pf1_queue.size() > 0) {
77 merged = pf1_queue.front().digis;
#define DECLARE_PRODUCER_NS(NS, CLASS)
Macro which allows the framework to construct a producer given its name during configuration.
void abortEvent()
Abort the event immediately.
void setStorageHint(framework::StorageControl::Hint hint)
Mark the current event as having the given storage control hint from this module.
Implements an event buffer system for storing event data.
Class encapsulating parameters for configuring a processor.
T getParameter(const std::string &name) const
Retrieve the parameter of the given name.
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.
void addDigi(unsigned int id, const std::vector< Sample > &digi)
Add samples to collection.
constexpr StorageControl::Hint hint_shouldKeep
storage control hint alias for backwards compatibility
constexpr StorageControl::Hint hint_shouldDrop
storage control hint alias for backwards compatibility
int ticks
ticks since spill