PDDPRawInputDriver_service.cc
Go to the documentation of this file.
1 /*
2  Input source driver for ProtoDUNE-DP raw data
3 
4 
5  */
6 
16 
17 // DUNE includes
19 
20 #include "PDDPRawInputDriver.h"
21 
22 #include "PDDPChannelMap.h"
23 
24 #include <exception>
25 #include <thread>
26 #include <mutex>
27 #include <regex>
28 #include <sstream>
29 #include <iterator>
30 #include <algorithm>
31 
32 
33 #define CHECKBYTEBIT(var, pos) ( (var) & (1<<pos) )
34 #define DCBITFLAG 0x0 // 0x0 LSB -> 0x7 MSB
35 #define GETDCFLAG(info) (CHECKBYTEBIT(info, DCBITFLAG)>0)
36 
37 //
38 // event data quality flag
39 // number of non instrumented cards for L1 builders
40 #define EVCARD0 0x19
41 #define EVDQFLAG(info) ( (info & 0x3F ) == EVCARD0 )
42 
43 
44 using UIntVec = std::vector<unsigned>;
45 
46 //
47 //
48 //
49 namespace
50 {
51  void unpackCroData( const char *buf, size_t nb, bool cflag,
52  unsigned nsa, adcbuf_t &data )
53  {
54  //data.clear();
55  if( !cflag ) // unpack the uncompressed data into RawDigit
56  {
57  data.push_back( raw::RawDigit::ADCvector_t(nsa) );
58  size_t sz = 0;
59  const BYTE* start = buf;
60  const BYTE* stop = start + nb;
61  while(start!=stop)
62  {
63  BYTE v1 = *start++;
64  BYTE v2 = *start++;
65  BYTE v3 = *start++;
66 
67  uint16_t tmp1 = ((v1 << 4) + ((v2 >> 4) & 0xf)) & 0xfff;
68  uint16_t tmp2 = (((v2 & 0xf) << 8 ) + (v3 & 0xff)) & 0xfff;
69 
70  // if( offset > 0 ) // invert baseline: tmp fix for the signal inversion
71  // {
72  // float ftmp1 = offset - tmp1;
73  // if( ftmp1 < 0 ) ftmp1 = 0;
74  // tmp1 = (uint16_t)(ftmp1);
75 
76  // float ftmp2 = offset - tmp2;
77  // if( ftmp2 < 0 ) ftmp2 = 0;
78  // tmp2 = (uint16_t)(ftmp2);
79  // }
80 
81  if( sz == nsa ){ data.push_back(raw::RawDigit::ADCvector_t(nsa)); sz = 0; }
82  data.back()[sz++] = (short)tmp1;
83 
84  if( sz == nsa ){ data.push_back(raw::RawDigit::ADCvector_t(nsa)); sz = 0; }
85  data.back()[sz++] = (short)tmp2;
86  }
87  }
88  else
89  //TODO finalize the format of compressed data
90  // the data for each channel should be preceeded by size in words
91  {
92  // should not happen ...
93  mf::LogError(__FUNCTION__)<<"The format for the compressed data is to be defined";
94  }
95  }
96 
97  // get byte content for a given data type
98  // NOTE: cast assumes host byte order
99  template<typename T> T ConvertToValue(const void *in)
100  {
101  const T *ptr = static_cast<const T*>(in);
102  return *ptr;
103  }
104 
105 
106  // binary file format exception
107  class formatexception : public std::exception
108  {
109  virtual const char* what() const throw()
110  {
111  return "Bad file format";
112  }
113  };
114  static formatexception fex;
115 }
116 
117 
118 
119 //
120 namespace lris
121 {
122 
123  // ctor
124  PDDPRawInputDriver::PDDPRawInputDriver( fhicl::ParameterSet const &pset,
126  art::SourceHelper const &pm ) :
127  __sourceHelper( pm ),
128  __currentSubRunID(),
129  __eventCtr( 0 ),
130  __eventNum( 0 )
131  {
132  const std::string myname = "PDDPRawInputDriver::ctor: ";
133 
134  __logLevel = pset.get<int>("LogLevel", 0);
135  __outlbl_digits = pset.get<std::string>("OutputLabelRawDigits", "daq");
136  __outlbl_rdtime = pset.get<std::string>("OutputLabelRDTime", "daq");
137  __outlbl_status = pset.get<std::string>("OutputLabelRDStatus", "daq");
138  auto vecped_crps = pset.get<std::vector<UIntVec>>("InvertBaseline", std::vector<UIntVec>());
139  auto select_crps = pset.get<std::vector<unsigned>>("SelectCRPs", std::vector<unsigned>());
140 
141  std::map<unsigned, unsigned> invped_crps;
142  if( !vecped_crps.empty() ){
143  for( auto &v : vecped_crps ){
144  if( v.size() != 2 ){
145  if( __logLevel >= 1 )
146  std::cerr<<myname<<"Bad vector size for pedestal inversion parameters"<<std::endl;
147  continue;
148  }
149  // CRP ID = Pedestal inversion
150  invped_crps[ v[0] ] = v[1];
151  }
152  }
153 
154  if( __logLevel >= 1 )
155  {
156  std::cout << myname << " Configuration : " << std::endl;
157  std::cout << myname << " LogLevel : " << __logLevel << std::endl;
158  std::cout << myname << " OutputLabelRawDigits : " << __outlbl_digits << std::endl;
159  std::cout << myname << " OutputLabelRDStatus : " << __outlbl_status << std::endl;
160  std::cout << myname << " OutputLabelRDtime : " << __outlbl_rdtime << std::endl;
161  std::cout << myname << " SelectCRPs : ";
162  if( select_crps.empty() ) std::cout<<"all"<<std::endl;
163  else
164  {
165  std::ostringstream vstr;
166  std::copy(select_crps.begin(), select_crps.end()-1,
167  std::ostream_iterator<unsigned>(vstr, ", "));
168  vstr << select_crps.back();
169  std::cout << vstr.str() << std::endl;
170  }
171  std::cout << myname << " InvertBaseline : ";
172  if( invped_crps.empty() ) std::cout<<"None"<<std::endl;
173  else {
174  for( auto const &m : invped_crps )
175  std::cout<< "[ "<<m.first<<", "<<m.second<<" ] ";
176  std::cout<<std::endl;
177  }
178  }
179 
180  __prodlbl_digits = __getProducerLabel( __outlbl_digits );
181  __prodlbl_rdtime = __getProducerLabel( __outlbl_rdtime );
182  __prodlbl_status = __getProducerLabel( __outlbl_status );
183 
184 
185 
186  //
187  helper.reconstitutes<std::vector<raw::RawDigit>, art::InEvent>(__outlbl_digits,
189  helper.reconstitutes<std::vector<raw::RDStatus>, art::InEvent>(__outlbl_status,
191  helper.reconstitutes<std::vector<raw::RDTimeStamp>, art::InEvent>(__outlbl_rdtime,
193 
194 
195  // number of uncompressed ADC samples per channel in PDDP CRO data (fixed parameter)
196  __nsacro = 10000;
197 
198  // could also use pset if more parametres are needed (e.g., for LRO data)
199 
200  //
201  // channel map order by CRP View
203 
204  auto crpidx = cmap->get_crpidx();
205  for( auto c: crpidx )
206  {
207  std::vector<dune::DPChannelId> chidx = cmap->find_by_crp( c, true );
208 
209  // check if we want to keep only specific CRPs
210  bool keep = true;
211  if( !select_crps.empty() )
212  {
213  if( std::find( select_crps.begin(), select_crps.end(), c ) == select_crps.end() )
214  {
215  keep = false;
216  }
217  }
218  if( __logLevel >= 2 )
219  std::cout<<myname<<" CRP "<<c<<" selected "<<keep<<std::endl;
220 
221  // check if we need to invert baseline for the group of CRP channels
222  unsigned invped = 0;
223  if( !invped_crps.empty() ){
224  auto it = invped_crps.find( c );
225  if( it != invped_crps.end() ){
226  invped = it->second;
227  }
228  }
229  if( __logLevel >= 2 )
230  std::cout<<myname<<" CRP "<<c<<" baseline "<<invped<<std::endl;
231 
232 
233  //std::cout<<chidx.size()<<std::endl;
234  for( auto id: chidx )
235  {
236  __daqch.push_back( id.seqn() );
237  __keepch.push_back( keep );
238  __invped.push_back( invped );
239  }
240  }
241 
242  if( __logLevel >= 1 )
243  {
244  std::cout << myname << " Readout info : " << std::endl;
245  std::cout<<myname << " Number of CRPs from chmap : " << cmap->ncrps() << std::endl;
246  std::cout<<myname << " Total channels expected : " << __daqch.size() << std::endl;
247  }
248 
249  }
250 
251  //
253  {
254  __close();
255  }
256 
257  //
259  art::FileBlock* &fb )
260  {
261  __close();
262 
263  __eventCtr = 0;
264  __eventNum = 0;
265 
266  fb = new art::FileBlock(art::FileFormatVersion(1, "DPPD RawInput 2019"), name);
267 
268  //
269  __file.open( name.c_str(), std::ios::in | std::ios::binary | std::ios::ate);
270 
271  if( !__file.is_open() )
272  {
274  << "Error opening binary file " << name << std::endl;
275  }
276 
277  // get file size
278  __filesz = __file.tellg();
279 
280  // move to beginning
281  __file.seekg(0, std::ios::beg);
282 
283  // unpack event table
284  if( __unpack_evtable() == 0 )
285  {
286  __close();
288  << "File " << name << " does not have any events"<< std::endl;
289  }
290 
292  __file_seqno = __get_file_seqno( name );
293  }
294 
295 
296  //
298  art::SubRunPrincipal* const &inSR,
299  art::RunPrincipal* &outR,
300  art::SubRunPrincipal* &outSR,
301  art::EventPrincipal* &outE )
302  {
303  mf::LogInfo(__FUNCTION__)<<"Processing "<<__eventCtr<<" event record";
304  if( __eventCtr == __eventNum )
305  {
306  //ok we finished
307  mf::LogDebug(__FUNCTION__)<<"Finished reading "<<__eventNum<<" events";
308  return false;
309  }
310 
311  // move to the next file position
312  if( __events[ __eventCtr ] != __file.tellg() )
313  __file.seekg( __events[ __eventCtr ], std::ios::beg );
314  size_t bsz = __evsz[ __eventCtr ];
315 
316  std::vector<BYTE> buf;
317  __readChunk( buf, bsz );
318 
319  // increment our event counter
320  __eventCtr++;
321 
322  DaqEvent event;
323  //bool ok =
324  __unpackEvent( buf, event );
325  // not sure what art wants me to do here if this was not ok ???
326 
327  art::RunNumber_t rn = event.runnum;
328  art::SubRunNumber_t srn = __file_seqno; // seq no from file name
329 
330  uint64_t sec = event.trigstamp.tv_sec;
331  uint64_t nsec = event.trigstamp.tv_nsec;
332 
333  // first 4 bytes are seconds and last four bytes are nsec
334  uint64_t tval = (sec << 32) + nsec;
335 
336  // here we are using event timestamp
337  // what happens if events in the future in same sub-run
338  // (different L2 builder) event have a lower timestamp
339  art::Timestamp tstamp( tval );
340 
341  bool doupdate;
342  if( (doupdate = (rn != __currentSubRunID.run())) )
343  {
344  outR = __sourceHelper.makeRunPrincipal(rn, tstamp);
345  doupdate = true;
346  }
347  if( (doupdate = (srn != __currentSubRunID.subRun())) )
348  {
349  outSR = __sourceHelper.makeSubRunPrincipal(rn, srn, tstamp);
350  }
351 
352  if( doupdate )
353  __currentSubRunID = art::SubRunID( rn, srn );
354 
355 
358  event.evnum, tstamp );
359 
360 
361  std::unique_ptr< std::vector<raw::RawDigit> > cro_data ( new std::vector<raw::RawDigit> );
362  std::unique_ptr< std::vector<raw::RDTimeStamp> > cro_rdtm ( new std::vector<raw::RDTimeStamp> );
363  std::unique_ptr< std::vector<raw::RDStatus> > cro_stat ( new std::vector<raw::RDStatus> );
364 
365  // move data
366  cro_data->reserve( event.crodata.size() );
367 
368  //
370 
371  for( size_t i=0;i<event.crodata.size();i++ )
372  {
373  if( i >= __daqch.size() )
374  {
375  mf::LogError(__FUNCTION__)<<"The channel map appears to be wrong";
376  break;
377  }
378  unsigned daqch = __daqch[i];
379  raw::ChannelID_t ch = i; //daqch;
380  // raw digit
381  if( __keepch[i] ){
382  unsigned invped = __invped[i];
383  if( invped > 0 ){
384  for( auto &e : event.crodata[daqch] ){
385  float v = (float)invped - e;
386  e = (short)(v);
387  }
388  }
389  cro_data->push_back( raw::RawDigit(ch, __nsacro,
390  std::move( event.crodata[daqch] ),
391  event.compression) );
392  }
393  else
394  cro_data->push_back( raw::RawDigit(ch, 0, dummy, event.compression) );
395 
396  // RDTimeStamp
397  //cro_rdtm->push_back( raw::RDTimeStamp( tval, ch ) );
398 
399  // Assns how to make ?
400  //auto const rwdigiptr = art::PtrMaker<raw::RawDigit>;
401  //auto const rdtimeptr = art::PtrMaker<raw::RDTimeStamp>;
402  //cro_asso->addSingle( rwdigiptr, rdtimeptr );
403  }
404  unsigned int statword = 0;
405  bool discarded = false;
406  bool kept = false;
407  if( !event.good ) // data missing from some units
408  {
409  discarded = false;
410  kept = true;
411  }
412  if( discarded ) statword |= 1;
413  if( kept ) statword |= 2;
414  cro_stat->emplace_back( discarded, kept, statword );
415 
416  // assign some trigger flag ... see DataPrepModule
417  uint16_t rdtsflags = 0xd; // CRT for now
418  cro_rdtm->emplace_back( raw::RDTimeStamp( tval, rdtsflags ) );
419 
423 
424  return true;
425  }
426 
427  //
428  // split output container name configuration into label and instance
430  {
431  std::string res = "";
432  size_t ipos = lbl.find(":");
433  if ( ipos != std::string::npos ) {
434  res = lbl.substr(ipos + 1);
435  lbl = lbl.substr(0, ipos);
436  }
437 
438  return res;
439  }
440 
441 
442 
443  //
444  ///
446  {
447  if(__file.is_open())
448  __file.close();
449 
450  __filesz = 0;
451  }
452 
453  //
454  // read a chunk of bytes from file
455  void PDDPRawInputDriver::__readChunk( std::vector<BYTE> &bytes, size_t sz )
456  {
457  bytes.resize( sz );
458  __file.read( &bytes[0], sz );
459  if( !__file )
460  {
461  ssize_t nb = __file.gcount();
462  //mf::LogWarning(__FUNCTION__)
463  //<<"Could not read "<<sz<" bytes "<<" only "<<nb<<" were available"<<endl;
464  bytes.resize( nb );
465  // reset stream state from errors
466  __file.clear();
467  }
468  }
469 
470  //
471  // unpack the header with event table
473  {
474  unsigned rval = 0;
475  //__eventNum = 0;
476 
477  std::vector<BYTE> buf;
478  size_t msz = 2*sizeof(uint32_t);
479  __readChunk( buf, msz);
480  if( buf.size() != msz )
481  {
482  mf::LogError(__FUNCTION__)<<"Could not read number of events";
483  return 0;
484  }
485 
486 
487  // number of events in the file
488  __eventNum = ConvertToValue<uint32_t>(&buf[4]);
489  rval += buf.size();
490 
491  // file
492  if( __eventNum == 0 )
493  {
494  mf::LogError(__FUNCTION__)<<"File does not contain any events";
495  return 0;
496  }
497 
498  mf::LogInfo(__FUNCTION__)<<"Number of events in this file "<<__eventNum;
499 
500  size_t evtsz = __eventNum * 4 * sizeof(uint32_t);
501  if( evtsz + rval >= __filesz )
502  {
503  mf::LogError(__FUNCTION__)<<"Cannot find event table";
504  return 0;
505  }
506 
507  // read next chunk with event table info
508  __readChunk( buf, evtsz );
509  rval += buf.size();
510 
511  // unpack sizes of events in sequence
512  // we are only interested in the size here
513  __evsz.clear();
514  for( unsigned i=0;i<buf.size();i+=16 )
515  {
516  unsigned o = 0;
517  //uint32_t sn = ConvertToValue<uint32_t>(&buf[i+o]);
518 
519  o = 4;
520  uint32_t sz = ConvertToValue<uint32_t>(&buf[i+o]);
521  __evsz.push_back( sz );
522  }
523 
524  // generate table of positions of events in a file
525  __events.clear();
526 
527  // first event is at the current position
528  __events.push_back( __file.tellg() );
529  for(size_t i=0; i < __evsz.size()-1; i++)
530  {
531  __file.seekg( __evsz[i], std::ios::cur );
532  if( !__file )
533  {
534  mf::LogError(__FUNCTION__)<<"Event table does not match file size";
535  __file.clear();
536  __evsz.resize( __events.size() );
537  __eventNum = __events.size();
538  break;
539  }
540  __events.push_back( __file.tellg() );
541  }
542 
543  //for( auto e : __events ) std::cout<<e<<"\n";
544  //for( auto e : __evsz ) std::cout<<e<<"\n";
545 
546  // return the number of bytes unpacked
547  return rval;
548  }
549 
550  //
551  // unpack event info from each l1evb fragment
552  unsigned PDDPRawInputDriver::__unpack_eve_info( const char *buf, eveinfo_t &ei )
553  {
554  //
555  unsigned rval = 0;
556 
557  //
558  //memset(&ei, 0, sizeof(ei));
559  try
560  {
561  // check for delimiting words
562  BYTE k0 = buf[0];
563  BYTE k1 = buf[1];
564  static const unsigned evskey = 0xFF;
565  if( !( ((k0 & 0xFF) == evskey) && ((k1 & 0xFF) == evskey) ) )
566  {
567  mf::LogError(__FUNCTION__)<<"Event delimiting word could not be detected";
568  throw fex;
569  }
570  rval += 2;
571 
572  // decode run number
573  ei.runnum = ConvertToValue<uint32_t>( buf+rval );
574  rval += sizeof( ei.runnum );
575 
576  // run flags
577  ei.runflags = (uint8_t)buf[rval++];
578 
579  // this is actually written in host byte order
580  ei.ti = ConvertToValue<triginfo_t>( buf+rval );
581  rval += sizeof(ei.ti);
582 
583  // data quality flags
584  ei.evflag = (uint8_t)buf[rval++];
585 
586  // event number 4 bytes
587  ei.evnum = ConvertToValue<uint32_t>( buf+rval );
588  rval += sizeof( ei.evnum );
589 
590  // size of the lro data segment
591  ei.evszlro = ConvertToValue<uint32_t>( buf+rval );
592  rval += sizeof( ei.evszlro );
593 
594  // size of the cro data segment
595  ei.evszcro = ConvertToValue<uint32_t>( buf+rval );
596  rval += sizeof( ei.evszcro );
597  }
598  catch(std::exception &e)
599  {
600  rval = 0;
601  }
602 
603  return rval;
604  }
605 
606  //
607  //
608  bool PDDPRawInputDriver::__unpackEvent( std::vector<BYTE> &buf, DaqEvent &event )
609  {
610  // fragments from each L1 builder
611  std::vector<fragment_t> frags;
612 
613  unsigned idx = 0;
614  for(;;)
615  {
616  fragment_t afrag;
617  if( idx >= buf.size() ) break;
618  unsigned rval = __unpack_eve_info( &buf[idx], afrag.ei );
619  if( rval == 0 ) return false;
620  idx += rval;
621  // set point to the binary data
622  afrag.bytes = &buf[idx];
623  size_t dsz = afrag.ei.evszcro + afrag.ei.evszlro;
624  idx += dsz;
625  idx += 1; // "Bruno byte"
626 
627  // some basic checks
628  if( frags.size() >= 1 )
629  {
630  if( frags[0].ei.runnum != afrag.ei.runnum )
631  {
632  mf::LogError(__FUNCTION__)<<"run numbers do not match among event fragments";
633  continue;
634  }
635  if( frags[0].ei.evnum != afrag.ei.evnum )
636  {
637  mf::LogError(__FUNCTION__)<<"event numbers do not match among event fragments";
638  mf::LogDebug(__FUNCTION__)<<"event number "<< frags[0].ei.evnum;
639  mf::LogDebug(__FUNCTION__)<<"event number "<< afrag.ei.evnum;
640  continue;
641  }
642  // check also timestamps???
643  }
644 
645  frags.push_back( afrag );
646  }
647 
648  //mf::LogDebug(__FUNCTION__)<<"number of fragments "<<frags.size()<<"\n";
649  //
650  std::mutex iomutex;
651  std::vector<std::thread> threads(frags.size() - 1);
652  unsigned nsa = __nsacro;
653  //unsigned invped = __invped;
654  for (unsigned i = 1; i<frags.size(); ++i)
655  {
656  auto afrag = frags.begin() + i;
657  threads[i-1] = std::thread([&iomutex, i, nsa, afrag] {
658  {
659  std::lock_guard<std::mutex> iolock(iomutex);
660  // make it look like we're using i so clang doesn't complain. This had been commented out
661  //msg_info << "Unpack thread #" << i << " is running\n";
662  if (i==100000) std::cout << "Unpack thread #" << i << " is running\n";
663  }
664  //unpackLROData( f0->bytes, f0->ei.evszlro, ... );
665  unpackCroData( afrag->bytes + afrag->ei.evszlro, afrag->ei.evszcro,
666  GETDCFLAG(afrag->ei.runflags), nsa, afrag->crodata);
667  });
668  }
669 
670  // unpack first fragment in the main thread
671  auto f0 = frags.begin();
672  event.good = EVDQFLAG( f0->ei.evflag );
673  event.runnum = f0->ei.runnum;
674  event.runflags = f0->ei.runflags;
675  //
676  event.evnum = f0->ei.evnum;
677  event.evflags.push_back( f0->ei.evflag );
678  //
679  event.trigtype = f0->ei.ti.type;
680  event.trignum = f0->ei.ti.num;
681  event.trigstamp = f0->ei.ti.ts;
682 
683  //unpackLROData( f0->bytes, f0->ei.evszlro, ... );
684  unpackCroData( f0->bytes + f0->ei.evszlro, f0->ei.evszcro, GETDCFLAG(f0->ei.runflags),
685  nsa, event.crodata );
686 
687  event.compression = raw::kNone;
688  // the compression should be set for all L1 event builders,
689  // since this depends on loaded AMC firmware
690  if( GETDCFLAG(f0->ei.runflags) )
691  event.compression = raw::kHuffman;
692 
693  // wait for other threads to complete
694  for (auto& t : threads) t.join();
695 
696  // merge with other fragments
697  for (auto it = frags.begin() + 1; it != frags.end(); ++it )
698  {
699  event.good = ( event.good && EVDQFLAG( it->ei.evflag ) );
700  event.evflags.push_back( it->ei.evflag );
701 
702  //
703  event.crodata.reserve(event.crodata.size() + it->crodata.size() );
704  std::move( std::begin( it->crodata ), std::end( it->crodata ),
705  std::back_inserter( event.crodata ));
706  it->crodata.clear();
707  }
708 
709  return true;
710  }
711 
712 
713  // assumed file name form <runno>_<seqno>_<L2evbID>.<extension>
714  // e.g., 198_129_b.test
716  {
717  unsigned rval = 0;
718 
719  //std::cout << "input " << s << std::endl;
720  std::regex r("[[:digit:]]+_([[:digit:]]+)_[[:alnum:]]\\.[[:alnum:]]+");
721  std::smatch m;
722 
723  if( !regex_search( s, m, r ) )
724  {
725  mf::LogWarning(__FUNCTION__) << "Unable to extract seqno from file name "<< s;
726  return rval;
727  }
728 
729  //
730  try
731  {
732  // str() is the entire match
733  rval = std::stoi( m.str(1) );
734  }
735  catch (const std::invalid_argument& ia)
736  {
737  rval = 0;
738  mf::LogWarning(__FUNCTION__) << "This should never happen";
739  }
740 
741  return rval;
742  }
743 
744 
745 } //namespace lris
static QCString name
Definition: declinfo.cpp:673
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
Huffman Encoding.
Definition: RawTypes.h:10
static constexpr double nb
Definition: Units.h:81
Collection of charge vs time digitized from a single readout channel.
Definition: RawDigit.h:69
std::string string
Definition: nybbler.cc:12
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
bool readNext(art::RunPrincipal *const &inR, art::SubRunPrincipal *const &inSR, art::RunPrincipal *&outR, art::SubRunPrincipal *&outSR, art::EventPrincipal *&outE)
std::vector< unsigned > __invped
bool __unpackEvent(std::vector< BYTE > &buf, DaqEvent &event)
SubRunPrincipal * makeSubRunPrincipal(SubRunAuxiliary const &subRunAux) const
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
Definition: RawDigit.h:73
std::vector< unsigned > UIntVec
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
no compression
Definition: RawTypes.h:9
RunPrincipal * makeRunPrincipal(RunAuxiliary const &runAux) const
Definition: SourceHelper.cc:92
std::vector< std::streampos > __events
std::vector< bool > __keepch
TypeLabel const & reconstitutes(std::string const &modLabel, std::string const &instanceName={})
const double e
std::vector< unsigned > __daqch
def move(depos, offset)
Definition: depos.py:107
RunNumber_t run() const
Definition: SubRunID.h:85
T get(std::string const &key) const
Definition: ParameterSet.h:271
char BYTE
Definition: dlardaq.h:39
IDNumber_t< Level::SubRun > SubRunNumber_t
Definition: IDNumber.h:119
std::vector< uint32_t > __evsz
#define GETDCFLAG(info)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
#define EVDQFLAG(info)
T ConvertToValue(const void *in)
Definition: dlardaq.h:110
unsigned __get_file_seqno(std::string s)
std::enable_if_t<!detail::range_sets_supported(P::branch_type)> put_product_in_principal(std::unique_ptr< T > &&product, P &principal, std::string const &module_label, std::string const &instance_name={})
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
Conversion of binary data to root files.
unsigned __unpack_eve_info(const char *buf, eveinfo_t &ei)
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void readFile(std::string const &name, art::FileBlock *&fb)
T copy(T const &v)
cet::LibraryManager dummy("noplugin")
EventPrincipal * makeEventPrincipal(EventAuxiliary const &eventAux, std::unique_ptr< History > &&history) const
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:72
SubRunNumber_t subRun() const
Definition: SubRunID.h:91
std::string __getProducerLabel(std::string &lbl)
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
byte bytes
Alias for common language habits.
Definition: datasize.h:101
void __readChunk(std::vector< BYTE > &bytes, size_t sz)
static formatexception fex
Definition: dlardaq.h:52
static QCString * s
Definition: config.cpp:1042
art::SourceHelper const & __sourceHelper
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
QTextStream & endl(QTextStream &s)
Event finding and building.
IDNumber_t< Level::Run > RunNumber_t
Definition: IDNumber.h:120