Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
lris::PDDPRawInputDriver Class Reference

#include <PDDPRawInputDriver.h>

Classes

struct  eveinfo_t
 
struct  fragment_t
 
struct  triginfo_t
 

Public Member Functions

 PDDPRawInputDriver (fhicl::ParameterSet const &pset, art::ProductRegistryHelper &helper, art::SourceHelper const &pm)
 
void closeCurrentFile ()
 
void readFile (std::string const &name, art::FileBlock *&fb)
 
bool readNext (art::RunPrincipal *const &inR, art::SubRunPrincipal *const &inSR, art::RunPrincipal *&outR, art::SubRunPrincipal *&outSR, art::EventPrincipal *&outE)
 

Private Types

enum  { evinfoSz = 44 }
 
typedef struct lris::PDDPRawInputDriver::triginfo_t triginfo_t
 
typedef struct lris::PDDPRawInputDriver::eveinfo_t eveinfo_t
 
typedef struct lris::PDDPRawInputDriver::fragment_t fragment_t
 

Private Member Functions

void __close ()
 
void __readChunk (std::vector< BYTE > &bytes, size_t sz)
 
bool __unpackEvent (std::vector< BYTE > &buf, DaqEvent &event)
 
std::string __getProducerLabel (std::string &lbl)
 
unsigned __unpack_evtable ()
 
unsigned __unpack_eve_info (const char *buf, eveinfo_t &ei)
 
unsigned __get_file_seqno (std::string s)
 

Private Attributes

art::SourceHelper const & __sourceHelper
 
art::SubRunID __currentSubRunID
 
int __logLevel
 
std::string __outlbl_digits
 
std::string __outlbl_status
 
std::string __outlbl_rdtime
 
std::string __prodlbl_digits
 
std::string __prodlbl_status
 
std::string __prodlbl_rdtime
 
uint32_t __eventCtr
 
uint32_t __eventNum
 
size_t __nsacro
 
std::vector< unsigned > __daqch
 
std::vector< bool__keepch
 
std::vector< unsigned > __invped
 
std::vector< std::streampos > __events
 
std::vector< uint32_t > __evsz
 
size_t __filesz
 
std::ifstream __file
 
unsigned __file_seqno
 

Detailed Description

Definition at line 71 of file PDDPRawInputDriver.h.

Member Typedef Documentation

Member Enumeration Documentation

anonymous enum
private
Enumerator
evinfoSz 

Definition at line 136 of file PDDPRawInputDriver.h.

Constructor & Destructor Documentation

lris::PDDPRawInputDriver::PDDPRawInputDriver ( fhicl::ParameterSet const &  pset,
art::ProductRegistryHelper helper,
art::SourceHelper const &  pm 
)

Definition at line 124 of file PDDPRawInputDriver_service.cc.

126  :
127  __sourceHelper( pm ),
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 
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  }
std::string string
Definition: nybbler.cc:12
std::vector< unsigned > __invped
std::vector< bool > __keepch
TypeLabel const & reconstitutes(std::string const &modLabel, std::string const &instanceName={})
std::vector< unsigned > __daqch
T copy(T const &v)
std::string __getProducerLabel(std::string &lbl)
art::SourceHelper const & __sourceHelper
QTextStream & endl(QTextStream &s)

Member Function Documentation

void lris::PDDPRawInputDriver::__close ( )
private

Definition at line 445 of file PDDPRawInputDriver_service.cc.

446  {
447  if(__file.is_open())
448  __file.close();
449 
450  __filesz = 0;
451  }
unsigned lris::PDDPRawInputDriver::__get_file_seqno ( std::string  s)
private

Definition at line 715 of file PDDPRawInputDriver_service.cc.

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  }
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
static QCString * s
Definition: config.cpp:1042
std::string lris::PDDPRawInputDriver::__getProducerLabel ( std::string lbl)
private

Definition at line 429 of file PDDPRawInputDriver_service.cc.

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  }
std::string string
Definition: nybbler.cc:12
void lris::PDDPRawInputDriver::__readChunk ( std::vector< BYTE > &  bytes,
size_t  sz 
)
private

Definition at line 455 of file PDDPRawInputDriver_service.cc.

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  }
static constexpr double nb
Definition: Units.h:81
unsigned lris::PDDPRawInputDriver::__unpack_eve_info ( const char *  buf,
eveinfo_t ei 
)
private

Definition at line 552 of file PDDPRawInputDriver_service.cc.

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  }
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
const double e
char BYTE
Definition: dlardaq.h:39
static formatexception fex
Definition: dlardaq.h:52
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
unsigned lris::PDDPRawInputDriver::__unpack_evtable ( )
private

Definition at line 472 of file PDDPRawInputDriver_service.cc.

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  }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
std::vector< std::streampos > __events
std::vector< uint32_t > __evsz
void __readChunk(std::vector< BYTE > &bytes, size_t sz)
bool lris::PDDPRawInputDriver::__unpackEvent ( std::vector< BYTE > &  buf,
DaqEvent &  event 
)
private

Definition at line 608 of file PDDPRawInputDriver_service.cc.

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  }
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
struct lris::PDDPRawInputDriver::fragment_t fragment_t
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
no compression
Definition: RawTypes.h:9
def move(depos, offset)
Definition: depos.py:107
#define GETDCFLAG(info)
#define EVDQFLAG(info)
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
unsigned __unpack_eve_info(const char *buf, eveinfo_t &ei)
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:72
Event finding and building.
void lris::PDDPRawInputDriver::closeCurrentFile ( )

Definition at line 252 of file PDDPRawInputDriver_service.cc.

253  {
254  __close();
255  }
void lris::PDDPRawInputDriver::readFile ( std::string const &  name,
art::FileBlock *&  fb 
)

Definition at line 258 of file PDDPRawInputDriver_service.cc.

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 
293  }
static QCString name
Definition: declinfo.cpp:673
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
unsigned __get_file_seqno(std::string s)
QTextStream & endl(QTextStream &s)
bool lris::PDDPRawInputDriver::readNext ( art::RunPrincipal *const &  inR,
art::SubRunPrincipal *const &  inSR,
art::RunPrincipal *&  outR,
art::SubRunPrincipal *&  outSR,
art::EventPrincipal *&  outE 
)

Definition at line 297 of file PDDPRawInputDriver_service.cc.

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  }
Collection of charge vs time digitized from a single readout channel.
Definition: RawDigit.h:69
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
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
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
RunPrincipal * makeRunPrincipal(RunAuxiliary const &runAux) const
Definition: SourceHelper.cc:92
std::vector< std::streampos > __events
std::vector< bool > __keepch
const double e
std::vector< unsigned > __daqch
def move(depos, offset)
Definition: depos.py:107
RunNumber_t run() const
Definition: SubRunID.h:85
IDNumber_t< Level::SubRun > SubRunNumber_t
Definition: IDNumber.h:119
std::vector< uint32_t > __evsz
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
cet::LibraryManager dummy("noplugin")
EventPrincipal * makeEventPrincipal(EventAuxiliary const &eventAux, std::unique_ptr< History > &&history) const
SubRunNumber_t subRun() const
Definition: SubRunID.h:91
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
void __readChunk(std::vector< BYTE > &bytes, size_t sz)
art::SourceHelper const & __sourceHelper
IDNumber_t< Level::Run > RunNumber_t
Definition: IDNumber.h:120

Member Data Documentation

art::SubRunID lris::PDDPRawInputDriver::__currentSubRunID
private

Definition at line 91 of file PDDPRawInputDriver.h.

std::vector<unsigned> lris::PDDPRawInputDriver::__daqch
private

Definition at line 121 of file PDDPRawInputDriver.h.

uint32_t lris::PDDPRawInputDriver::__eventCtr
private

Definition at line 102 of file PDDPRawInputDriver.h.

uint32_t lris::PDDPRawInputDriver::__eventNum
private

Definition at line 103 of file PDDPRawInputDriver.h.

std::vector<std::streampos> lris::PDDPRawInputDriver::__events
private

Definition at line 127 of file PDDPRawInputDriver.h.

std::vector<uint32_t> lris::PDDPRawInputDriver::__evsz
private

Definition at line 128 of file PDDPRawInputDriver.h.

std::ifstream lris::PDDPRawInputDriver::__file
private

Definition at line 132 of file PDDPRawInputDriver.h.

unsigned lris::PDDPRawInputDriver::__file_seqno
private

Definition at line 133 of file PDDPRawInputDriver.h.

size_t lris::PDDPRawInputDriver::__filesz
private

Definition at line 131 of file PDDPRawInputDriver.h.

std::vector<unsigned> lris::PDDPRawInputDriver::__invped
private

Definition at line 124 of file PDDPRawInputDriver.h.

std::vector<bool> lris::PDDPRawInputDriver::__keepch
private

Definition at line 122 of file PDDPRawInputDriver.h.

int lris::PDDPRawInputDriver::__logLevel
private

Definition at line 93 of file PDDPRawInputDriver.h.

size_t lris::PDDPRawInputDriver::__nsacro
private

Definition at line 106 of file PDDPRawInputDriver.h.

std::string lris::PDDPRawInputDriver::__outlbl_digits
private

Definition at line 95 of file PDDPRawInputDriver.h.

std::string lris::PDDPRawInputDriver::__outlbl_rdtime
private

Definition at line 97 of file PDDPRawInputDriver.h.

std::string lris::PDDPRawInputDriver::__outlbl_status
private

Definition at line 96 of file PDDPRawInputDriver.h.

std::string lris::PDDPRawInputDriver::__prodlbl_digits
private

Definition at line 98 of file PDDPRawInputDriver.h.

std::string lris::PDDPRawInputDriver::__prodlbl_rdtime
private

Definition at line 100 of file PDDPRawInputDriver.h.

std::string lris::PDDPRawInputDriver::__prodlbl_status
private

Definition at line 99 of file PDDPRawInputDriver.h.

art::SourceHelper const& lris::PDDPRawInputDriver::__sourceHelper
private

Definition at line 90 of file PDDPRawInputDriver.h.


The documentation for this class was generated from the following files: