|
14 | 14 |
|
15 | 15 | // Output: sbnd::trigger::pmtSoftwareTrigger data product |
16 | 16 |
|
17 | | -// More information can be found at: |
18 | | -// https://sbnsoftware.github.io/sbndcode_wiki/SBND_Trigger |
| 17 | +// ! NOTE! this needs to be kept up to date with the latest |
| 18 | +// ! version of this module that is running in the DAQ! |
| 19 | +// ! sbndaq-artdaq/ArtModules/SBND/SoftwareTrigger/PMTMetricProducer_module.cc |
19 | 20 | //////////////////////////////////////////////////////////////////////// |
20 | 21 |
|
21 | 22 | #include "art/Framework/Core/EDProducer.h" |
@@ -350,13 +351,13 @@ void sbnd::trigger::pmtSoftwareTriggerProducer::produce(art::Event& e) |
350 | 351 | // # of containers = # of boards |
351 | 352 | // # of entries inside the container = # of triggers |
352 | 353 | if (fragmentHandle->front().type() == artdaq::Fragment::ContainerFragmentType) { |
353 | | - foundfragments = true; |
354 | 354 | for (auto cont : *fragmentHandle) { |
355 | 355 | artdaq::ContainerFragment contf(cont); |
356 | 356 | if (contf.fragment_type()==sbndaq::detail::FragmentType::CAENV1730) { |
| 357 | + if (contf.block_count()==0) continue; |
357 | 358 | if (std::find(fFragIDs.begin(), fFragIDs.end(), contf[0].get()->fragmentID()) == fFragIDs.end()) continue; |
358 | 359 | if (fVerbose>=3) TLOG(TLVL_INFO) << "Found " << contf.block_count() << " CAEN1730 fragments in container with fragID " << contf[0].get()->fragmentID(); |
359 | | - // std::cout << "Found " << contf.block_count() << " CAEN1730 fragments in container with fragID " << contf[0].get()->fragmentID() << std::endl; |
| 360 | + foundfragments = true; |
360 | 361 |
|
361 | 362 | if (etrig_frag_dt==1e9){ |
362 | 363 | for (size_t ii = 0; ii < contf.block_count(); ++ii){ |
@@ -612,10 +613,11 @@ int8_t sbnd::trigger::pmtSoftwareTriggerProducer::getClosestFTrig(double refTime |
612 | 613 | std::vector<uint32_t> sbnd::trigger::pmtSoftwareTriggerProducer::sumWvfms(const std::vector<uint32_t>& v1, const std::vector<uint16_t>& v2) |
613 | 614 | { |
614 | 615 | size_t result_len = (v1.size() > v2.size()) ? v1.size() : v2.size(); |
615 | | - std::vector<uint32_t> result(result_len,0); |
| 616 | + std::vector<uint32_t> result(result_len, 0); |
616 | 617 | for (size_t i = 0; i < result_len; i++){ |
617 | | - auto value1 = (i < v1.size()) ? v1[i] : 0; |
618 | | - auto value2 = (i < v2.size()) ? v2[i] : 0; |
| 618 | + // padding with 2e4 (for baseline ~14e3, 2e4 is safe value) |
| 619 | + auto value1 = (i < v1.size()) ? v1[i] : 2e4; |
| 620 | + auto value2 = (i < v2.size()) ? v2[i] : 2e4; |
619 | 621 | result.at(i) = value1 + value2; |
620 | 622 | } |
621 | 623 | return result; |
|
0 commit comments