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

#include <LArRawInputDriverShortBo.h>

Public Member Functions

 LArRawInputDriverShortBo (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 LArRawInputDriverShortBo.h.

Member Typedef Documentation

Definition at line 49 of file LArRawInputDriverShortBo.h.

Constructor & Destructor Documentation

lris::LArRawInputDriverShortBo::LArRawInputDriverShortBo ( 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 231 of file LArRawInputDriverShortBo.cxx.

234  :
236  , currentDir_ ()
237  , inputfiles_ ( )
238  , nextfile_ ( inputfiles_.begin() )
239  , filesdone_ ( inputfiles_.end() )
240  , currentSubRunID_ ( )
241  {
242  helper.reconstitutes<raw::DAQHeader, art::InEvent>("daq");
243  helper.reconstitutes<std::vector<raw::RawDigit>, art::InEvent>("daq");
244  helper.reconstitutes<sumdata::RunData, art::InRun> ("daq");
245  }
stringvec_t::const_iterator filesdone_
art::SourceHelper const & principalMaker_
TypeLabel const & reconstitutes(std::string const &modLabel, std::string const &instanceName={})
stringvec_t::const_iterator nextfile_

Member Function Documentation

void lris::LArRawInputDriverShortBo::closeCurrentFile ( )

Definition at line 247 of file LArRawInputDriverShortBo.cxx.

248  {
249  // Nothing to do (See EventFileSentry).
250  }
void lris::LArRawInputDriverShortBo::readFile ( std::string const &  name,
art::FileBlock *&  fb 
)

Definition at line 252 of file LArRawInputDriverShortBo.cxx.

254  {
255  // Get the list of event files for this directory.
256  currentDir_ = name;
257  inputfiles_ = getsortedfiles(currentDir_);
258  nextfile_ = inputfiles_.begin();
259  filesdone_ = inputfiles_.end();
261 
262  // Fill and return a new Fileblock.
263  fb = new art::FileBlock(art::FileFormatVersion(1, "LArRawInput 2011a"),
264  currentDir_);
265  }
static QCString name
Definition: declinfo.cpp:673
stringvec_t::const_iterator filesdone_
stringvec_t::const_iterator nextfile_
bool lris::LArRawInputDriverShortBo::readNext ( art::RunPrincipal *const &  inR,
art::SubRunPrincipal *const &  inSR,
art::RunPrincipal *&  outR,
art::SubRunPrincipal *&  outSR,
art::EventPrincipal *&  outE 
)

Definition at line 267 of file LArRawInputDriverShortBo.cxx.

272  {
273  if (inputfiles_.empty() || nextfile_ == filesdone_ ) return false;
274 
275  // Create empty result, then fill it from current filename:
276  std::unique_ptr<std::vector<raw::RawDigit> > rdcolsb ( new std::vector<raw::RawDigit> );
277 
278  raw::DAQHeader daqHeader;
279  bool firstEventInRun = (nextfile_ == inputfiles_.begin());
280 
281  process_LAr_file( currentDir_, *nextfile_++, *rdcolsb, daqHeader );
282  std::unique_ptr<raw::DAQHeader> daqcolsb( new raw::DAQHeader(daqHeader) );
283 
284  art::RunNumber_t rn = daqHeader.GetRun();
285  art::Timestamp tstamp = daqHeader.GetTimeStamp();
286 
287  if (firstEventInRun)
288  {
289  std::unique_ptr<sumdata::RunData> rundatasb(new sumdata::RunData("bo") );
291  outR = principalMaker_.makeRunPrincipal(rn, tstamp);
294  tstamp);
295  art::put_product_in_principal(std::move(rundatasb), *outR, "daq");
296  } else if (rn != currentSubRunID_.run())
297  {
298  throw cet::exception("InconsistentEventStream")
299  << "Encountered run #" << rn
300  << " while processing events from run #" << currentSubRunID_.run()
301  << "\n";
302  }
303 
306  daqHeader.GetEvent(),
307  tstamp);
308 
309  // Put products in the event.
311  *outE,
312  "daq"); // Module label
314  *outE,
315  "daq"); // Module label
316 
317  return true;
318  }
stringvec_t::const_iterator filesdone_
SubRunPrincipal * makeSubRunPrincipal(SubRunAuxiliary const &subRunAux) const
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={})
stringvec_t::const_iterator nextfile_
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
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::LArRawInputDriverShortBo::currentDir_
private

Definition at line 52 of file LArRawInputDriverShortBo.h.

art::SubRunID lris::LArRawInputDriverShortBo::currentSubRunID_
private

Definition at line 56 of file LArRawInputDriverShortBo.h.

stringvec_t::const_iterator lris::LArRawInputDriverShortBo::filesdone_
private

Definition at line 55 of file LArRawInputDriverShortBo.h.

stringvec_t lris::LArRawInputDriverShortBo::inputfiles_
private

Definition at line 53 of file LArRawInputDriverShortBo.h.

stringvec_t::const_iterator lris::LArRawInputDriverShortBo::nextfile_
private

Definition at line 54 of file LArRawInputDriverShortBo.h.

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

Definition at line 51 of file LArRawInputDriverShortBo.h.


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