4#include "TrigScint/Event/TrigScintHit.h"
5#include "TrigScint/Event/TrigScintQIEDigis.h"
6#include "TrigScint/Firmware/hitproducer.h"
7#include "TrigScint/Firmware/objdef.h"
18 test_collection_ = ps.
get<std::string>(
"test_collection");
22 ldmx_log(debug) <<
"In TrigScintFirmwareHitProducer: configure done!";
23 ldmx_log(debug) <<
"\nPedestal: " <<
pedestal_ <<
"\nGain: " <<
gain_
27 <<
"\ntest collection: " << test_collection_
28 <<
"\nAre we testing: " << do_test_
42 for (
const auto& hit : rechits) {
43 ldmx_log(debug) <<
"Analysis barID: " << hit.getBarID()
44 <<
", PE Number: " << hit.getPE();
51 for (
int i = 0; i < NCHAN; i++) {
53 fifo[i][0] = (peds[i] << 6) + 63;
54 fifo[i][1] = (peds[i] << 6) + 63;
55 fifo[i][2] = (peds[i] << 6) + 63;
56 fifo[i][3] = (peds[i] << 6) + 63;
57 fifo[i][4] = (peds[i] << 6) + 63;
59 for (
const auto& digi : digis) {
60 std::vector<int> adcs = digi.getADC();
61 std::vector<int> tdcs = digi.getTDC();
62 for (
int i = 0; i < NTIMES; i++) {
63 fifo[digi.getChanID()][i] =
64 static_cast<ap_uint<14>>((adcs.at(i) << 6) + (tdcs.at(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.