10 #include "art/Framework/Core/EDProducer.h"
11 #include "art/Framework/Core/ModuleMacros.h"
12 #include "art/Framework/Principal/Event.h"
13 #include "art/Framework/Principal/Handle.h"
14 #include "art/Framework/Principal/Run.h"
15 #include "art/Framework/Principal/SubRun.h"
16 #include "canvas/Utilities/InputTag.h"
17 #include "fhiclcpp/types/Atom.h"
18 #include "messagefacility/MessageLogger/MessageLogger.h"
24 #include "artdaq-core/Data/Fragment.hh"
25 #include "sbndaq-artdaq-core/Overlays/ICARUS/ICARUSTriggerUDPFragment.hh"
51 Name{
"raw_data_label" },
52 Comment{
"art data product instance name for trigger information (product label is 'daq')" }
71 void produce(art::Event&
e)
override;
87 raw_data_label_(params().RawDataLabel())
90 produces< std::vector< sbn::EXTCountInfo >, art::InSubRun >();
103 auto const & raw_data = e.getProduct< std::vector<artdaq::Fragment> >({ raw_data_label_,
"ICARUSTriggerUDP" });
105 unsigned int number_of_gates_since_previous_event = 0;
107 for(
auto raw_datum : raw_data){
109 icarus::ICARUSTriggerUDPFragment frag(raw_datum);
110 std::string data = frag.GetDataString();
111 char *buffer =
const_cast<char*
>(data.c_str());
112 icarus::ICARUSTriggerInfo datastream_info = icarus::parse_ICARUSTriggerString(buffer);
113 gate_type = datastream_info.gate_type;
114 number_of_gates_since_previous_event = frag.getDeltaGatesBNB();
123 TotalEXTCounts += number_of_gates_since_previous_event;
129 fOutExtInfos.push_back(extInfo);
148 auto p = std::make_unique< std::vector< sbn::EXTCountInfo > >(fOutExtInfos);
150 sr.put(std::move(
p));
fhicl::Atom< std::string > RawDataLabel
void beginSubRun(art::SubRun &sr) override
void endSubRun(art::SubRun &sr) override
EXTRetriever & operator=(EXTRetriever const &)=delete
art::EDProducer::Table< Config > Parameters
Collection of exceptions for Geometry system.
void produce(art::Event &e) override
BEGIN_PROLOG vertical distance to the surface Name
std::string raw_data_label_
EXTRetriever(Parameters const ¶ms)
std::vector< sbn::EXTCountInfo > fOutExtInfos
int gates_since_last_trigger
Class defining a sparse vector (holes are zeroes)