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

#include <LArRawInputDriverLongBo.h>

Public Member Functions

 LArRawInputDriverLongBo (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

typedef std::vector< std::stringstringvec_t
 

Private Attributes

art::SourceHelper const & principalMaker_
 
std::string currentDir_
 
stringvec_t inputfiles_
 
stringvec_t::const_iterator nextfile_
 
stringvec_t::const_iterator filesdone_
 
art::SubRunID currentSubRunID_
 

Detailed Description

Definition at line 28 of file LArRawInputDriverLongBo.h.

Member Typedef Documentation

Definition at line 49 of file LArRawInputDriverLongBo.h.

Constructor & Destructor Documentation

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

Class to fill the constraints on a template argument to the class, FileReaderSource

Definition at line 279 of file LArRawInputDriverLongBo.cxx.

282  :
284  , currentDir_ ()
285  , inputfiles_ ( )
286  , nextfile_ ( inputfiles_.begin() )
287  , filesdone_ ( inputfiles_.end() )
288  , currentSubRunID_ ( )
289  {
290  helper.reconstitutes<raw::DAQHeader, art::InEvent>("daq");
291  helper.reconstitutes<std::vector<raw::RawDigit>, art::InEvent>("daq");
292  helper.reconstitutes<std::vector<raw::ExternalTrigger>,art::InEvent>("daq");
293  helper.reconstitutes<sumdata::RunData, art::InRun> ("daq");
294  }
stringvec_t::const_iterator nextfile_
art::SourceHelper const & principalMaker_
TypeLabel const & reconstitutes(std::string const &modLabel, std::string const &instanceName={})
stringvec_t::const_iterator filesdone_

Member Function Documentation

void lris::LArRawInputDriverLongBo::closeCurrentFile ( )

Definition at line 296 of file LArRawInputDriverLongBo.cxx.

297  {
298  // Nothing to do (See EventFileSentry).
299  }
void lris::LArRawInputDriverLongBo::readFile ( std::string const &  name,
art::FileBlock *&  fb 
)

Definition at line 301 of file LArRawInputDriverLongBo.cxx.

303  {
304  // Get the list of event files for this directory.
305  currentDir_ = name;
306  inputfiles_ = getsortedfiles(currentDir_);
307  nextfile_ = inputfiles_.begin();
308  filesdone_ = inputfiles_.end();
310 
311  // Fill and return a new Fileblock.
312  fb = new art::FileBlock(art::FileFormatVersion(1, "LArRawInput 2011a"),
313  currentDir_);
314  }
static QCString name
Definition: declinfo.cpp:673
stringvec_t::const_iterator nextfile_
stringvec_t::const_iterator filesdone_
bool lris::LArRawInputDriverLongBo::readNext ( art::RunPrincipal *const &  inR,
art::SubRunPrincipal *const &  inSR,
art::RunPrincipal *&  outR,
art::SubRunPrincipal *&  outSR,
art::EventPrincipal *&  outE 
)

Definition at line 316 of file LArRawInputDriverLongBo.cxx.

321  {
322  if (inputfiles_.empty() || nextfile_ == filesdone_ ) return false;
323 
324  // Create empty result, then fill it from current filename:
325  std::unique_ptr<std::vector<raw::RawDigit> > rdcollb ( new std::vector<raw::RawDigit> );
326  std::unique_ptr<std::vector<raw::ExternalTrigger> > etcollb ( new std::vector<raw::ExternalTrigger> );
327 
328  raw::DAQHeader daqHeader;
329  bool firstEventInRun = (nextfile_ == inputfiles_.begin());
330 
331  process_LAr_file( currentDir_, *nextfile_++, *rdcollb, daqHeader, *etcollb);
332  std::unique_ptr<raw::DAQHeader> daqcollb( new raw::DAQHeader(daqHeader) );
333 
334  art::RunNumber_t rn = daqHeader.GetRun();
335  art::Timestamp tstamp = daqHeader.GetTimeStamp();
336 
337  if (firstEventInRun)
338  {
339  std::unique_ptr<sumdata::RunData> rundata(new sumdata::RunData("bo") );
341  outR = principalMaker_.makeRunPrincipal(rn, tstamp);
344  tstamp);
345  art::put_product_in_principal(std::move(rundata), *outR, "daq");
346  } else if (rn != currentSubRunID_.run())
347  {
348  throw cet::exception("InconsistentEventStream")
349  << "Encountered run #" << rn
350  << " while processing events from run #" << currentSubRunID_.run()
351  << "\n";
352  }
353 
356  daqHeader.GetEvent(),
357  tstamp);
358 
359  // Put products in the event.
361  *outE,
362  "daq"); // Module label
364  *outE,
365  "daq"); // Module label
367  *outE,
368  "daq"); // Module label
369 
370  return true;
371  }
SubRunPrincipal * makeSubRunPrincipal(SubRunAuxiliary const &subRunAux) const
stringvec_t::const_iterator nextfile_
RunPrincipal * makeRunPrincipal(RunAuxiliary const &runAux) const
Definition: SourceHelper.cc:92
art::SourceHelper const & principalMaker_
def move(depos, offset)
Definition: depos.py:107
RunNumber_t run() const
Definition: SubRunID.h:85
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={})
unsigned short GetRun() const
Definition: DAQHeader.h:103
unsigned short GetEvent() const
Definition: DAQHeader.h:105
EventPrincipal * makeEventPrincipal(EventAuxiliary const &eventAux, std::unique_ptr< History > &&history) const
SubRunNumber_t subRun() const
Definition: SubRunID.h:91
stringvec_t::const_iterator filesdone_
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
time_t GetTimeStamp() const
Definition: DAQHeader.h:106
IDNumber_t< Level::Run > RunNumber_t
Definition: IDNumber.h:120

Member Data Documentation

std::string lris::LArRawInputDriverLongBo::currentDir_
private

Definition at line 52 of file LArRawInputDriverLongBo.h.

art::SubRunID lris::LArRawInputDriverLongBo::currentSubRunID_
private

Definition at line 56 of file LArRawInputDriverLongBo.h.

stringvec_t::const_iterator lris::LArRawInputDriverLongBo::filesdone_
private

Definition at line 55 of file LArRawInputDriverLongBo.h.

stringvec_t lris::LArRawInputDriverLongBo::inputfiles_
private

Definition at line 53 of file LArRawInputDriverLongBo.h.

stringvec_t::const_iterator lris::LArRawInputDriverLongBo::nextfile_
private

Definition at line 54 of file LArRawInputDriverLongBo.h.

art::SourceHelper const& lris::LArRawInputDriverLongBo::principalMaker_
private

Definition at line 51 of file LArRawInputDriverLongBo.h.


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