#include <RawInputSource.h>
Public Member Functions | |
RawInputSource (ParameterSet const &pset, InputSourceDescription const &desc) | |
virtual | ~RawInputSource () |
Protected Member Functions | |
std::auto_ptr< Event > | makeEvent (RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, Timestamp const &tstamp) |
virtual std::auto_ptr< Event > | readOneEvent ()=0 |
Private Member Functions | |
virtual ItemType | getNextItemType () |
virtual EventPrincipal * | readEvent_ () |
virtual EventPrincipal * | readIt (EventID const &eventID) |
virtual boost::shared_ptr < LuminosityBlockAuxiliary > | readLuminosityBlockAuxiliary_ () |
virtual boost::shared_ptr < RunAuxiliary > | readRunAuxiliary_ () |
virtual void | skip (int offset) |
Private Attributes | |
bool | eventCached_ |
LuminosityBlockNumber_t | luminosityBlockNumber_ |
bool | newLumi_ |
bool | newRun_ |
RunNumber_t | runNumber_ |
Definition at line 18 of file RawInputSource.h.
edm::RawInputSource::RawInputSource | ( | ParameterSet const & | pset, |
InputSourceDescription const & | desc | ||
) | [explicit] |
Definition at line 14 of file RawInputSource.cc.
References edm::Timestamp::beginOfTime(), and edm::InputSource::setTimestamp().
: InputSource(pset, desc), runNumber_(RunNumber_t()), luminosityBlockNumber_(), newRun_(false), newLumi_(false), eventCached_(false) { setTimestamp(Timestamp::beginOfTime()); }
edm::RawInputSource::~RawInputSource | ( | ) | [virtual] |
Definition at line 24 of file RawInputSource.cc.
{ }
InputSource::ItemType edm::RawInputSource::getNextItemType | ( | ) | [private, virtual] |
Implements edm::InputSource.
Definition at line 67 of file RawInputSource.cc.
References alignCSCRings::e, eventCached_, edm::InputSource::IsEvent, edm::InputSource::IsFile, edm::InputSource::IsInvalid, edm::InputSource::IsLumi, edm::InputSource::IsRun, edm::InputSource::IsStop, luminosityBlockNumber_, newLumi_, newRun_, readOneEvent(), runNumber_, and edm::InputSource::state().
{ if(state() == IsInvalid) { return IsFile; } if(newRun_) { return IsRun; } if(newLumi_) { return IsLumi; } if(eventCached_) { return IsEvent; } std::auto_ptr<Event> e(readOneEvent()); if(e.get() == 0) { return IsStop; } else { e->commit_(); } if(e->run() != runNumber_) { newRun_ = newLumi_ = true; runNumber_ = e->run(); luminosityBlockNumber_ = e->luminosityBlock(); return IsRun; } else if(e->luminosityBlock() != luminosityBlockNumber_) { luminosityBlockNumber_ = e->luminosityBlock(); newLumi_ = true; return IsLumi; } return IsEvent; }
std::auto_ptr< Event > edm::RawInputSource::makeEvent | ( | RunNumber_t | run, |
LuminosityBlockNumber_t | lumi, | ||
EventNumber_t | event, | ||
Timestamp const & | tstamp | ||
) | [protected] |
Definition at line 49 of file RawInputSource.cc.
References printConversionInfo::aux, alignCSCRings::e, eventCached_, edm::InputSource::eventPrincipalCache(), edm::EventPrincipal::fillEventPrincipal(), edm::Timestamp::invalidTimestamp(), edm::InputSource::luminosityBlockAuxiliary(), edm::InputSource::moduleDescription(), newLumi_, newRun_, edm::EventAuxiliary::PhysicsTrigger, edm::InputSource::processGUID(), edm::InputSource::runAuxiliary(), edm::InputSource::setLuminosityBlockAuxiliary(), and edm::InputSource::setRunAuxiliary().
Referenced by edm::DQMHttpSource::readOneEvent().
{ if(!runAuxiliary()) { newRun_ = newLumi_ = true; setRunAuxiliary(new RunAuxiliary(run, tstamp, Timestamp::invalidTimestamp())); } if(!luminosityBlockAuxiliary()) { setLuminosityBlockAuxiliary(new LuminosityBlockAuxiliary(run, lumi, tstamp, Timestamp::invalidTimestamp())); newLumi_ = true; } EventSourceSentry sentry(*this); EventAuxiliary aux(EventID(run, lumi, event), processGUID(), tstamp, true, EventAuxiliary::PhysicsTrigger); eventPrincipalCache()->fillEventPrincipal(aux, boost::shared_ptr<LuminosityBlockPrincipal>()); eventCached_ = true; std::auto_ptr<Event> e(new Event(*eventPrincipalCache(), moduleDescription())); return e; }
EventPrincipal * edm::RawInputSource::readEvent_ | ( | ) | [private, virtual] |
Implements edm::InputSource.
Definition at line 41 of file RawInputSource.cc.
References eventCached_, edm::InputSource::eventPrincipalCache(), edm::InputSource::luminosityBlockPrincipal(), and edm::EventPrincipal::setLuminosityBlockPrincipal().
{ assert(eventCached_); eventCached_ = false; eventPrincipalCache()->setLuminosityBlockPrincipal(luminosityBlockPrincipal()); return eventPrincipalCache(); }
EventPrincipal * edm::RawInputSource::readIt | ( | EventID const & | eventID | ) | [private, virtual] |
Reimplemented from edm::InputSource.
Definition at line 100 of file RawInputSource.cc.
References Exception, and edm::errors::LogicError.
{ throw Exception(errors::LogicError, "RawInputSource::readEvent_(EventID const& eventID)") << "Random access read cannot be used for RawInputSource.\n" << "Contact a Framework developer.\n"; }
boost::shared_ptr< LuminosityBlockAuxiliary > edm::RawInputSource::readLuminosityBlockAuxiliary_ | ( | ) | [private, virtual] |
Implements edm::InputSource.
Definition at line 34 of file RawInputSource.cc.
References edm::Timestamp::invalidTimestamp(), luminosityBlockNumber_, newLumi_, runNumber_, and edm::InputSource::timestamp().
{ newLumi_ = false; return boost::shared_ptr<LuminosityBlockAuxiliary>(new LuminosityBlockAuxiliary( runNumber_, luminosityBlockNumber_, timestamp(), Timestamp::invalidTimestamp())); }
virtual std::auto_ptr<Event> edm::RawInputSource::readOneEvent | ( | ) | [protected, pure virtual] |
Implemented in edm::DQMHttpSource.
Referenced by getNextItemType().
boost::shared_ptr< RunAuxiliary > edm::RawInputSource::readRunAuxiliary_ | ( | ) | [private, virtual] |
Implements edm::InputSource.
Definition at line 28 of file RawInputSource.cc.
References edm::Timestamp::invalidTimestamp(), newRun_, runNumber_, and edm::InputSource::timestamp().
{ newRun_ = false; return boost::shared_ptr<RunAuxiliary>(new RunAuxiliary(runNumber_, timestamp(), Timestamp::invalidTimestamp())); }
void edm::RawInputSource::skip | ( | int | offset | ) | [private, virtual] |
Reimplemented from edm::InputSource.
Definition at line 108 of file RawInputSource.cc.
References Exception, and edm::errors::LogicError.
{ throw Exception(errors::LogicError, "RawInputSource::skip(int offset)") << "Random access skip cannot be used for RawInputSource\n" << "Contact a Framework developer.\n"; }
bool edm::RawInputSource::eventCached_ [private] |
Definition at line 39 of file RawInputSource.h.
Referenced by getNextItemType(), makeEvent(), and readEvent_().
Definition at line 36 of file RawInputSource.h.
Referenced by getNextItemType(), and readLuminosityBlockAuxiliary_().
bool edm::RawInputSource::newLumi_ [private] |
Definition at line 38 of file RawInputSource.h.
Referenced by getNextItemType(), makeEvent(), and readLuminosityBlockAuxiliary_().
bool edm::RawInputSource::newRun_ [private] |
Definition at line 37 of file RawInputSource.h.
Referenced by getNextItemType(), makeEvent(), and readRunAuxiliary_().
RunNumber_t edm::RawInputSource::runNumber_ [private] |
Definition at line 35 of file RawInputSource.h.
Referenced by getNextItemType(), readLuminosityBlockAuxiliary_(), and readRunAuxiliary_().