|
117 | 117 | #include "sbnobj/Common/POTAccounting/BNBSpillInfo.h" |
118 | 118 | #include "sbnobj/Common/POTAccounting/EXTCountInfo.h" |
119 | 119 | #include "sbnobj/Common/POTAccounting/NuMISpillInfo.h" |
| 120 | +#include "sbncode/BeamSpillInfoRetriever/POTTools.h" |
| 121 | +#include "artdaq-core/Data/ContainerFragment.hh" |
120 | 122 | #include "sbnobj/Common/Trigger/ExtraTriggerInfo.h" |
121 | 123 | #include "sbnobj/Common/Reco/CRUMBSResult.h" |
122 | 124 | #include "sbnobj/Common/Reco/OpT0FinderResult.h" |
@@ -1393,6 +1395,7 @@ bool CAFMaker::GetPsetParameter(const fhicl::ParameterSet& pset, |
1393 | 1395 |
|
1394 | 1396 | //...................................................................... |
1395 | 1397 | void CAFMaker::produce(art::Event& evt) noexcept { |
| 1398 | + mf::LogInfo("CAFMaker") << "CAFMaker::produce called for event: " << evt.id(); |
1396 | 1399 |
|
1397 | 1400 | bool const firstInFile = (fIndexInFile++ == 0); |
1398 | 1401 |
|
@@ -1756,6 +1759,24 @@ void CAFMaker::produce(art::Event& evt) noexcept { |
1756 | 1759 | FillTriggerEmulation(monpulses_handle, monpulse_sizes_handle, pairs_handle, trigemu_handle, srtrigger); |
1757 | 1760 | } |
1758 | 1761 |
|
| 1762 | + |
| 1763 | + // Fill PTB (Penn Trigger Board) information for SBND real data |
| 1764 | + if (isRealData && fDet == kSBND) { |
| 1765 | + art::InputTag PTB_itag("daq", "ContainerPTB"); |
| 1766 | + art::Handle<artdaq::Fragments> ptb_frags_handle; |
| 1767 | + evt.getByLabel(PTB_itag, ptb_frags_handle); |
| 1768 | + if (ptb_frags_handle.isValid()) { |
| 1769 | + mf::LogDebug("CAFMaker") << "Found ContainerPTB, extracting PTB triggers..."; |
| 1770 | + std::vector<sbn::pot::PTBInfo_t> ptb_triggers = sbn::pot::extractAllPTBInfo(*ptb_frags_handle); |
| 1771 | + mf::LogDebug("CAFMaker") << "Extracted " << ptb_triggers.size() << " PTB triggers"; |
| 1772 | + FillPTBTriggersSBND(ptb_triggers, srtrigger); |
| 1773 | + mf::LogDebug("CAFMaker") << "PTB HLT triggers: " << srtrigger.ptb_hlt_timestamp.size() |
| 1774 | + << ", LLT triggers: " << srtrigger.ptb_llt_timestamp.size(); |
| 1775 | + } else { |
| 1776 | + mf::LogDebug("CAFMaker") << "ContainerPTB not found for event " << evt.id(); |
| 1777 | + } |
| 1778 | + } |
| 1779 | + |
1759 | 1780 | // If not real data, fill in enough of the SRTrigger to make (e.g.) the CRT |
1760 | 1781 | // time referencing work. TODO: add more stuff to a "MC"-Trigger? |
1761 | 1782 | // No longer needed with incorporation of trigger emulation in the MC. |
|
0 commit comments