7#include "TrigScint/Firmware/hitproducer.h"
8#include "TrigScint/Firmware/objdef.h"
19 testCollection_ = ps.
getParameter<std::string>(
"test_collection");
23 ldmx_log(debug) <<
"In TrigScintFirmwareHitProducer: configure done!";
24 ldmx_log(debug) <<
"\nPedestal: " <<
pedestal_ <<
"\nGain: " <<
gain_
28 <<
"\ntest collection: " << testCollection_
29 <<
"\nAre we testing: " << doTest_
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 hitproducer_hw(FIFO, outHit, Peds);
68 std::vector<ldmx::TrigScintHit> trigScintHits;
69 for (
int i = 0; i < NHITS; i++) {
70 if (outHit[i].Amp >= 3) {
71 ldmx_log(debug) <<
"Firmware barID: " << outHit[i].bID
72 <<
", PE Number: " << outHit[i].Amp;
77 hit.
setPE(outHit[i].Amp);
78 trigScintHits.push_back(hit);
#define DECLARE_PRODUCER_NS(NS, 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.
T getParameter(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.
void configure(framework::config::Parameters &ps) override
Callback for the EventProcessor to configure itself from the given set of parameters.
std::string outputCollection_
Name of the output collection that will be used to stored the digitized trigger scintillator hits.
double pePerMip_
Total number of photoelectrons per MIP.
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 inputPassName_
Name of the pass that the input collection is on (empty string means take any pass)
double mevPerMip_
Total MeV per MIP.
std::string inputCollection_
add a hit at index idx to a cluster
class for storing QIE output
Unsigned Arbitrary Precision Type.