9 #include "art/Framework/Core/EDProducer.h"
10 #include "art/Framework/Principal/Event.h"
11 #include "art/Framework/Principal/Handle.h"
12 #include "art/Framework/Services/Registry/ServiceHandle.h"
13 #include "art/Persistency/Common/PtrMaker.h"
14 #include "art/Utilities/ToolMacros.h"
15 #include "cetlib/cpu_timer.h"
16 #include "fhiclcpp/ParameterSet.h"
17 #include "messagefacility/MessageLogger/MessageLogger.h"
23 #include "sbndaq-artdaq-core/Overlays/ICARUS/PhysCrateFragment.hh"
47 explicit TPCDecoder(fhicl::ParameterSet
const &pset);
58 virtual void produces(art::ProducesCollector&)
override;
65 virtual void configure(
const fhicl::ParameterSet&)
override;
112 collector.produces< std::vector<raw::RawDigit>>();
120 fGeometry = art::ServiceHandle<geo::Geometry const>{}.get();
137 icarus::PhysCrateFragment physCrateFragment(fragment);
139 size_t nBoardsPerFragment = physCrateFragment.nBoards();
140 size_t nChannelsPerBoard = physCrateFragment.nChannelsPerBoard();
143 for(
size_t board = 0; board < physCrateFragment.nBoards(); board++)
148 size_t boardId = nChannelsPerBoard * (nBoardsPerFragment * fragment_id + board);
151 const icarus::A2795DataBlock::data_t* dataBlock = physCrateFragment.BoardData(board);
154 for(
size_t channel = 0; channel < physCrateFragment.nChannelsPerBoard(); channel++)
162 for(
size_t tick = 0;
tick < physCrateFragment.nSamplesPerChannel();
tick++)
163 wvfm[
tick] = dataBlock[channel +
tick * physCrateFragment.nChannelsPerBoard()];
165 fRawDigitCollection->emplace_back(channel_num,physCrateFragment.nSamplesPerChannel(),wvfm);
IDecoder interface class definiton.
virtual void outputDataProducts(art::Event &event) override
Output the data products to the event store.
This provides an art tool interface definition for tools which "decode" artdaq fragments into LArSoft...
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
uint32_t fFragment_id_offset
Definition of basic raw digits.
RawDigitCollectionPtr fRawDigitCollection
const geo::Geometry * fGeometry
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
virtual void initializeDataProducts() override
Initialize any data products the tool will output.
virtual void produces(art::ProducesCollector &) override
Each algorithm may have different objects it wants "produced" so use this to let the top level produc...
The geometry of one entire detector, as served by art.
virtual void process_fragment(const artdaq::Fragment &fragment) override
Given a set of recob hits, run DBscan to form 3D clusters.
TPCDecoder class definiton.
virtual void configure(const fhicl::ParameterSet &) override
Interface for configuring the particular algorithm tool.
std::unique_ptr< std::vector< raw::RawDigit >> RawDigitCollectionPtr
TPCDecoder(fhicl::ParameterSet const &pset)
Constructor.
unsigned int ChannelID_t
Type representing the ID of a readout channel.
art framework interface to geometry description