7#include "TrigScint/Firmware/hitproducer.h"
8#include "TrigScint/Firmware/objdef.h"
19 test_collection_ = ps.
get<std::string>(
"test_collection");
23 ldmx_log(debug) <<
"In TrigScintFirmwareHitProducer: configure done!";
24 ldmx_log(debug) <<
"\nPedestal: " <<
pedestal_ <<
"\nGain: " <<
gain_
28 <<
"\ntest collection: " << test_collection_
29 <<
"\nAre we testing: " << do_test_
43 for (
const auto &hit : rechits) {
44 ldmx_log(debug) <<
"Analysis barID: " << hit.getBarID()
45 <<
", PE Number: " << hit.getPE();
52 for (
int i = 0; i < NCHAN; i++) {
54 fifo[i][0] = (peds[i] << 6) + 63;
55 fifo[i][1] = (peds[i] << 6) + 63;
56 fifo[i][2] = (peds[i] << 6) + 63;
57 fifo[i][3] = (peds[i] << 6) + 63;
58 fifo[i][4] = (peds[i] << 6) + 63;
60 for (
const auto &digi : digis) {
61 std::vector<int> adcs = digi.getADC();
62 std::vector<int> tdcs = digi.getTDC();
63 for (
int i = 0; i < NTIMES; i++) {
64 fifo[digi.getChanID()][i] = (
ap_uint<14>)((adcs[i] << 6) + (tdcs[i]));
67 hitproducerHw(fifo, out_hit, peds);
68 std::vector<ldmx::TrigScintHit> trig_scint_hits;
69 for (
int i = 0; i < NHITS; i++) {
70 if (out_hit[i].amp_ >= 3) {
71 ldmx_log(debug) <<
"Firmware barID: " << out_hit[i].b_id_
72 <<
", PE Number: " << out_hit[i].amp_;
77 hit.
setPE(out_hit[i].amp_);
78 trig_scint_hits.push_back(hit);
#define DECLARE_PRODUCER(CLASS)
Macro which allows the framework to construct a producer given its name during configuration.
Implements an event buffer system for storing event data.
Class encapsulating parameters for configuring a processor.
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
void setTime(float time)
Set the time of the hit [ns].
void setPE(const float PE)
Set hit pe.
void setBarID(const int barID)
Set hit bar ID.
void setModuleID(const int moduleID)
Set hit module ID.
std::string output_collection_
Name of the output collection that will be used to stored the digitized trigger scintillator hits.
void configure(framework::config::Parameters &ps) override
Callback for the EventProcessor to configure itself from the given set of parameters.
int sample_of_interest_
Total number of photoelectrons per MIP.
void produce(framework::Event &event) override
Process the event and put new data products into it.
double pedestal_
QIE pedestal.
std::string input_collection_
add a hit at index idx to a cluster
std::string input_pass_name_
Name of the pass that the input collection is on (empty string means take any pass)
double mev_per_mip_
Total MeV per MIP.
double pe_per_mip_
Total number of photoelectrons per MIP.
class for storing QIE output
Unsigned Arbitrary Precision Type.