CMS 3D CMS Logo

edm::RawInputSource Class Reference

#include <FWCore/Sources/interface/RawInputSource.h>

Inheritance diagram for edm::RawInputSource:

edm::InputSource edm::ProductRegistryHelper edm::DQMHttpSource

List of all members.

Public Member Functions

 RawInputSource (ParameterSet const &pset, InputSourceDescription const &desc)
virtual ~RawInputSource ()

Protected Member Functions

std::auto_ptr< EventmakeEvent (RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, Timestamp const &tstamp)
virtual std::auto_ptr< EventreadOneEvent ()=0

Private Member Functions

virtual ItemType getNextItemType ()
virtual std::auto_ptr
< EventPrincipal
readEvent_ ()
virtual std::auto_ptr
< EventPrincipal
readIt (EventID const &eventID)
virtual boost::shared_ptr
< LuminosityBlockPrincipal
readLuminosityBlock_ ()
virtual boost::shared_ptr
< RunPrincipal
readRun_ ()
virtual void skip (int offset)

Private Attributes

std::auto_ptr< EventPrincipalep_
LuminosityBlockNumber_t luminosityBlockNumber_
bool newLumi_
bool newRun_
RunNumber_t runNumber_


Detailed Description

Definition at line 18 of file RawInputSource.h.


Constructor & Destructor Documentation

edm::RawInputSource::RawInputSource ( ParameterSet const &  pset,
InputSourceDescription const &  desc 
) [explicit]

Definition at line 16 of file RawInputSource.cc.

References edm::Timestamp::beginOfTime(), and edm::InputSource::setTimestamp().

00017                                                                            :
00018     InputSource(pset, desc),
00019     runNumber_(RunNumber_t()),
00020     newRun_(false),
00021     newLumi_(false),
00022     ep_(0) {
00023       setTimestamp(Timestamp::beginOfTime());
00024   }

edm::RawInputSource::~RawInputSource (  )  [virtual]

Definition at line 26 of file RawInputSource.cc.

00026                                   {
00027   }


Member Function Documentation

InputSource::ItemType edm::RawInputSource::getNextItemType (  )  [private, virtual]

Implements edm::InputSource.

Definition at line 69 of file RawInputSource.cc.

References e, ep_, edm::InputSource::IsEvent, edm::InputSource::IsFile, edm::InputSource::IsInvalid, edm::InputSource::IsLumi, edm::InputSource::IsRun, edm::InputSource::IsStop, luminosityBlockNumber_, newLumi_, newRun_, readOneEvent(), edm::InputSource::resetLuminosityBlockPrincipal(), edm::InputSource::resetRunPrincipal(), runNumber_, and edm::InputSource::state().

00069                                   {
00070     if (state() == IsInvalid) {
00071       return IsFile;
00072     }
00073     if (newRun_) {
00074       return IsRun;
00075     }
00076     if (newLumi_) {
00077       return IsLumi;
00078     }
00079     if(ep_.get() != 0) {
00080       return IsEvent;
00081     }
00082     std::auto_ptr<Event> e(readOneEvent());
00083     if (e.get() == 0) {
00084       return IsStop;
00085     } else {
00086       e->commit_();
00087     }
00088     if (e->run() != runNumber_) {
00089       newRun_ = newLumi_ = true;
00090       resetLuminosityBlockPrincipal();
00091       resetRunPrincipal();
00092       runNumber_ = e->run();
00093       luminosityBlockNumber_ = e->luminosityBlock();
00094       return IsRun;
00095     } else if (e->luminosityBlock() != luminosityBlockNumber_) {
00096       luminosityBlockNumber_ = e->luminosityBlock();
00097       newLumi_ = true;
00098       resetLuminosityBlockPrincipal();
00099       return IsLumi;
00100     }
00101     return IsEvent;
00102   }

std::auto_ptr< Event > edm::RawInputSource::makeEvent ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi,
EventNumber_t  event,
Timestamp const &  tstamp 
) [protected]

Definition at line 57 of file RawInputSource.cc.

References edm::EventAuxiliary::Data, e, ep_, edm::eventAux, edm::InputSource::moduleDescription(), edm::InputSource::processConfiguration(), edm::InputSource::processGUID(), and edm::InputSource::productRegistry().

Referenced by edm::DQMHttpSource::getOneDQMEvent().

00057                                                                                                                        {
00058     EventSourceSentry sentry(*this);
00059     EventAuxiliary eventAux(EventID(run, event),
00060       processGUID(), tstamp, lumi, true, EventAuxiliary::Data);
00061     ep_ = std::auto_ptr<EventPrincipal>(
00062         new EventPrincipal(eventAux, productRegistry(), processConfiguration()));
00063     std::auto_ptr<Event> e(new Event(*ep_, moduleDescription()));
00064     return e;
00065   }

std::auto_ptr< EventPrincipal > edm::RawInputSource::readEvent_ (  )  [private, virtual]

Implements edm::InputSource.

Definition at line 51 of file RawInputSource.cc.

References ep_.

00051                              {
00052     assert(ep_.get() != 0);
00053     return ep_;
00054   }

std::auto_ptr< EventPrincipal > edm::RawInputSource::readIt ( EventID const &  eventID  )  [private, virtual]

Reimplemented from edm::InputSource.

Definition at line 105 of file RawInputSource.cc.

References edm::errors::LogicError.

00105                                        {
00106       throw edm::Exception(errors::LogicError,"RawInputSource::readEvent_(EventID const& eventID)")
00107         << "Random access read cannot be used for RawInputSource.\n"
00108         << "Contact a Framework developer.\n";
00109   }

boost::shared_ptr< LuminosityBlockPrincipal > edm::RawInputSource::readLuminosityBlock_ (  )  [private, virtual]

Implements edm::InputSource.

Definition at line 40 of file RawInputSource.cc.

References edm::Timestamp::invalidTimestamp(), edm::lumiAux, luminosityBlockNumber_, newLumi_, edm::InputSource::processConfiguration(), edm::InputSource::productRegistry(), runNumber_, and edm::InputSource::timestamp().

00040                                        {
00041     newLumi_ = false;
00042     LuminosityBlockAuxiliary lumiAux(runNumber_,
00043         luminosityBlockNumber_, timestamp(), Timestamp::invalidTimestamp());
00044     return boost::shared_ptr<LuminosityBlockPrincipal>(
00045         new LuminosityBlockPrincipal(lumiAux,
00046                                      productRegistry(),
00047                                      processConfiguration()));
00048   }

virtual std::auto_ptr<Event> edm::RawInputSource::readOneEvent (  )  [protected, pure virtual]

Implemented in edm::DQMHttpSource.

Referenced by getNextItemType().

boost::shared_ptr< RunPrincipal > edm::RawInputSource::readRun_ (  )  [private, virtual]

Implements edm::InputSource.

Definition at line 30 of file RawInputSource.cc.

References edm::Timestamp::invalidTimestamp(), newRun_, edm::InputSource::processConfiguration(), edm::InputSource::productRegistry(), edm::runAux, runNumber_, and edm::InputSource::timestamp().

00030                            {
00031     newRun_ = false;
00032     RunAuxiliary runAux(runNumber_, timestamp(), Timestamp::invalidTimestamp());
00033     return boost::shared_ptr<RunPrincipal>(
00034         new RunPrincipal(runAux,
00035                          productRegistry(),
00036                          processConfiguration()));
00037   }

void edm::RawInputSource::skip ( int  offset  )  [private, virtual]

Reimplemented from edm::InputSource.

Definition at line 113 of file RawInputSource.cc.

References edm::errors::LogicError.

00113                           {
00114       throw edm::Exception(errors::LogicError,"RawInputSource::skip(int offset)")
00115         << "Random access skip cannot be used for RawInputSource\n"
00116         << "Contact a Framework developer.\n";
00117   }


Member Data Documentation

std::auto_ptr<EventPrincipal> edm::RawInputSource::ep_ [private]

Definition at line 39 of file RawInputSource.h.

Referenced by getNextItemType(), makeEvent(), and readEvent_().

LuminosityBlockNumber_t edm::RawInputSource::luminosityBlockNumber_ [private]

Definition at line 36 of file RawInputSource.h.

Referenced by getNextItemType(), and readLuminosityBlock_().

bool edm::RawInputSource::newLumi_ [private]

Definition at line 38 of file RawInputSource.h.

Referenced by getNextItemType(), and readLuminosityBlock_().

bool edm::RawInputSource::newRun_ [private]

Definition at line 37 of file RawInputSource.h.

Referenced by getNextItemType(), and readRun_().

RunNumber_t edm::RawInputSource::runNumber_ [private]

Definition at line 35 of file RawInputSource.h.

Referenced by getNextItemType(), readLuminosityBlock_(), and readRun_().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:43:25 2009 for CMSSW by  doxygen 1.5.4