Skip to content

Commit

Permalink
Incorporating Tom's Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rodwyer100 committed Sep 26, 2024
1 parent 52967ef commit 7a92f72
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 21 deletions.
2 changes: 2 additions & 0 deletions TrigScint/include/TrigScint/Firmware/hitproducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@

#include "objdef.h"

#ifdef TS_NOT_EMULATION
void copyHit1(Hit One, Hit Two);
void copyHit2(Hit One, Hit Two);
void hitproducer_ref(ap_uint<14> FIFO[NHITS][5], Hit outHit[NHITS],
ap_uint<8> Peds[NHITS]);
#endif
void hitproducer_hw(ap_uint<14> FIFO[NHITS][5], Hit outHit[NHITS],
ap_uint<8> Peds[NHITS]);

Expand Down
3 changes: 0 additions & 3 deletions TrigScint/include/TrigScint/TrigScintFirmwareHitProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ class TrigScintFirmwareHitProducer : public framework::Producer {
*/

private:
/// Class to set the verbosity level.
// TODO: Make use of the global verbose parameter.
bool verbose_{false};

/// Name of the input collection containing the sim hits
std::string inputCollection_;
Expand Down
2 changes: 2 additions & 0 deletions TrigScint/src/TrigScint/Firmware/hitproducer_hw.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

void hitproducer_hw(ap_uint<14> FIFO[NHITS][5], Hit outHit[NHITS],
ap_uint<8> Peds[NHITS]) {
#ifdef TS_NOT_EMULATION
#pragma HLS ARRAY_PARTITION variable = FIFO complete
#pragma HLS ARRAY_PARTITION variable = amplitude complete
#pragma HLS ARRAY_PARTITION variable = Peds complete
Expand Down Expand Up @@ -66,6 +67,7 @@ void hitproducer_hw(ap_uint<14> FIFO[NHITS][5], Hit outHit[NHITS],
#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[49]

#pragma HLS PIPELINE
#endif

// The QIE11 card takes an analogue SiPM PE count
// and converts electron counts from it via a piecewise
Expand Down
27 changes: 9 additions & 18 deletions TrigScint/src/TrigScint/TrigScintFirmwareHitProducer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,16 @@ void TrigScintFirmwareHitProducer::configure(
testCollection_ = ps.getParameter<std::string>("test_collection");
inputPassName_ = ps.getParameter<std::string>("input_pass_name");
outputCollection_ = ps.getParameter<std::string>("output_collection");
verbose_ = ps.getParameter<bool>("verbose");
sample_of_interest_ = ps.getParameter<int>("sample_of_interest");
if (verbose_) {
ldmx_log(info) << "In TrigScintFirmwareHitProducer: configure done!";
ldmx_log(info) << "\nPedestal: " << pedestal_ << "\nGain: " << gain_
ldmx_log(debug) << "In TrigScintFirmwareHitProducer: configure done!";
ldmx_log(debug) << "\nPedestal: " << pedestal_ << "\nGain: " << gain_
<< "\nMEV per MIP: " << mevPerMip_
<< "\nPE per MIP: " << pePerMip_
<< "\ninput collection: " << inputCollection_
<< "\ntest collection: " << testCollection_
<< "\nAre we testing: " << doTest_
<< "\nInput pass name: " << inputPassName_
<< "\nOutput collection: " << outputCollection_
<< "\nVerbosity: " << verbose_;
}

<< "\nOutput collection: " << outputCollection_;
return;
}

Expand All @@ -43,13 +38,11 @@ void TrigScintFirmwareHitProducer::produce(framework::Event &event) {
// purpose is to emulate existing reconstruction software in firmware for
// triggering. I will more fully explain the operation and choices made in
// hitproducer_hw in hitproducer_hw
if (verbose_) {
const auto rechits{event.getCollection<ldmx::TrigScintHit>(testCollection_,
const auto rechits{event.getCollection<ldmx::TrigScintHit>(testCollection_,
inputPassName_)};
for (const auto &hit : rechits) {
ldmx_log(debug) << "Analysis barID: " << hit.getBarID()
<< ", PE Number: " << hit.getPE();
}
for (const auto &hit : rechits) {
ldmx_log(debug) << "Analysis barID: " << hit.getBarID()
<< ", PE Number: " << hit.getPE();
}
const auto digis{event.getCollection<trigscint::TrigScintQIEDigis>(
inputCollection_, inputPassName_)};
Expand All @@ -75,10 +68,8 @@ void TrigScintFirmwareHitProducer::produce(framework::Event &event) {
std::vector<ldmx::TrigScintHit> trigScintHits;
for (int i = 0; i < NHITS; i++) {
if (outHit[i].Amp >= 3) {
if (verbose_) {
ldmx_log(debug) << "Firmware barID: " << outHit[i].bID
<< ", PE Number: " << outHit[i].Amp;
}
ldmx_log(debug) << "Firmware barID: " << outHit[i].bID
<< ", PE Number: " << outHit[i].Amp;
ldmx::TrigScintHit hit;
hit.setModuleID(outHit[i].mID);
hit.setBarID(outHit[i].bID);
Expand Down

0 comments on commit 7a92f72

Please sign in to comment.