24 #include <arpa/inet.h> 87 std::vector<const raw::RawDigit*> inputDigitsHandle;
88 std::map<unsigned int, const raw::RawDigit*> channelToDigit;
89 e.
getView(
"daq", inputDigitsHandle);
90 for(
size_t c=0;
c<inputDigitsHandle.size(); ++
c){
92 channelToDigit[dig->
Channel()] = dig;
96 const size_t nCrate=1;
98 const size_t nFiber=1;
99 const size_t nFEMBChannel=128;
100 const size_t nTDC=4492;
107 for(
unsigned int slot=0; slot<nSlot; ++slot){
108 for(
unsigned int fiber=0; fiber<nFiber; ++fiber){
109 for(uint32_t tdc=0; tdc<nTDC; ++tdc){
110 uint32_t header=0xdeadbeef;
113 for(
unsigned int fembChannel=0; fembChannel<nFEMBChannel-1; fembChannel+=8){
115 unsigned short samples[8];
116 for(
int i=0; i<8; ++i){
120 samples[i]=channelToDigit[offlineChan]->ADC(tdc);
122 uint32_t word0=samples[0] | (samples[1] << 12) | (samples[2] << 24);
123 uint32_t word1=(samples[2] >> 8) | (samples[3] << 4) | (samples[4] << 16) | (samples[5] << 28);
124 uint32_t word2=(samples[5] >> 4) | (samples[6] << 8) | (samples[7] << 20);
134 uint32_t eof=0xffffffff;
PackedDump & operator=(PackedDump const &)=delete
Collection of charge vs time digitized from a single readout channel.
art::ServiceHandle< dune::PdspChannelMapService > m_channelMap
ChannelID_t Channel() const
DAQ channel this raw data was read from.
void analyze(art::Event const &e) override
EDAnalyzer(fhicl::ParameterSet const &pset)
unsigned int GetOfflineNumberFromDetectorElements(unsigned int crate, unsigned int slot, unsigned int fiber, unsigned int fembchannel, FelixOrRCE frswitch)
#define DEFINE_ART_MODULE(klass)
struct dune::tde::crate crate
std::ofstream m_outputFile
PackedDump(fhicl::ParameterSet const &p)
std::string m_outputFilename
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, std::vector< ELEMENT const * > &result) const
auto const & get(AssnsNode< L, R, D > const &r)