CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
edm::RawInputSource Class Referenceabstract

#include <RawInputSource.h>

Inheritance diagram for edm::RawInputSource:
edm::InputSource edm::ProductRegistryHelper edm::DQMHttpSource

Public Member Functions

 RawInputSource (ParameterSet const &pset, InputSourceDescription const &desc)
 
virtual ~RawInputSource ()
 
- Public Member Functions inherited from edm::InputSource
boost::shared_ptr
< ActivityRegistry
actReg () const
 Accessor for Activity Registry. More...
 
void closeFile (boost::shared_ptr< FileBlock >, bool cleaningUpAfterException)
 close current file More...
 
void doBeginJob ()
 Called by framework at beginning of job. More...
 
void doBeginLumi (LuminosityBlockPrincipal &lbp)
 Called by framework at beginning of lumi block. More...
 
void doBeginRun (RunPrincipal &rp)
 Called by framework at beginning of run. More...
 
void doEndJob ()
 Called by framework at end of job. More...
 
void doEndLumi (LuminosityBlockPrincipal &lbp, bool cleaningUpAfterException)
 Called by framework at end of lumi block. More...
 
void doEndRun (RunPrincipal &rp, bool cleaningUpAfterException)
 Called by framework at end of run. More...
 
void doPostForkReacquireResources (boost::shared_ptr< multicore::MessageReceiverForSource >)
 
void doPreForkReleaseResources ()
 Called by the framework before forking the process. More...
 
ProcessingController::ForwardState forwardState () const
 
bool goToEvent (EventID const &eventID)
 
 InputSource (ParameterSet const &, InputSourceDescription const &)
 Constructor. More...
 
void issueReports (EventID const &eventID)
 issue an event report More...
 
LuminosityBlockNumber_t luminosityBlock () const
 Accessor for current luminosity block number. More...
 
boost::shared_ptr
< LuminosityBlockAuxiliary
luminosityBlockAuxiliary () const
 Called by the framework to merge or insert lumi in principal cache. More...
 
int markLumi ()
 Mark lumi as read. More...
 
int markRun ()
 Mark run as read. More...
 
int maxEvents () const
 
int maxLuminosityBlocks () const
 
ModuleDescription const & moduleDescription () const
 Accessor for 'module' description. More...
 
ItemType nextItemType ()
 
bool primary () const
 Accessor for primary input source flag. More...
 
ProcessConfiguration const & processConfiguration () const
 Accessor for Process Configuration. More...
 
std::string const & processGUID () const
 Accessor for global process identifier. More...
 
ProcessingMode processingMode () const
 RunsLumisAndEvents (default), RunsAndLumis, or Runs. More...
 
boost::shared_ptr
< ProductRegistry const > 
productRegistry () const
 Accessor for product registry. More...
 
bool randomAccess () const
 
void readAndCacheLumi (bool merge, HistoryAppender &historyAppender)
 Read next luminosity block. More...
 
void readAndCacheRun (bool merge, HistoryAppender &historyAppender)
 Read next run. More...
 
EventPrincipalreadEvent (boost::shared_ptr< LuminosityBlockPrincipal > lbCache)
 
EventPrincipalreadEvent (EventID const &)
 Read a specific event. More...
 
boost::shared_ptr< FileBlockreadFile ()
 Read next file. More...
 
boost::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary ()
 Read next luminosity block Auxilary. More...
 
boost::shared_ptr< RunAuxiliaryreadRunAuxiliary ()
 Read next run Auxiliary. More...
 
ProcessHistoryID const & reducedProcessHistoryID () const
 
void registerProducts ()
 Register any produced products. More...
 
int remainingEvents () const
 
int remainingLuminosityBlocks () const
 
void repeat ()
 Reset the remaining number of events/lumis to the maximum number. More...
 
ProcessingController::ReverseState reverseState () const
 
void rewind ()
 Begin again at the first event. More...
 
RunNumber_t run () const
 Accessor for current run number. More...
 
boost::shared_ptr< RunAuxiliaryrunAuxiliary () const
 Called by the framework to merge or insert run in principal cache. More...
 
void setLuminosityBlockNumber_t (LuminosityBlockNumber_t lb)
 Set the luminosity block ID. More...
 
void setRunNumber (RunNumber_t r)
 Set the run number. More...
 
void skipEvents (int offset)
 
Timestamp const & timestamp () const
 Accessor for the current time, as seen by the input source. More...
 
virtual ~InputSource ()
 Destructor. More...
 

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
 
- Protected Member Functions inherited from edm::InputSource
void decreaseRemainingEventsBy (int iSkipped)
 
EventPrincipaleventPrincipalCache ()
 
boost::shared_ptr
< LuminosityBlockPrincipal >
const 
luminosityBlockPrincipal () const
 
PrincipalCache const & principalCache () const
 
PrincipalCacheprincipalCache ()
 
ProductRegistryproductRegistryUpdate () const
 
void reset () const
 
void resetLuminosityBlockAuxiliary () const
 
void resetRunAuxiliary () const
 
boost::shared_ptr
< RunPrincipal > const 
runPrincipal () const
 
void setLuminosityBlockAuxiliary (LuminosityBlockAuxiliary *lbp)
 
void setRunAuxiliary (RunAuxiliary *rp)
 
void setTimestamp (Timestamp const &theTime)
 To set the current time, as seen by the input source. More...
 
ItemType state () const
 

Private Member Functions

virtual ItemType getNextItemType ()
 
virtual EventPrincipalreadEvent_ ()
 
virtual EventPrincipalreadIt (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_
 

Additional Inherited Members

- Public Types inherited from edm::InputSource
enum  ItemType {
  IsInvalid, IsStop, IsFile, IsRun,
  IsLumi, IsEvent, IsRepeat
}
 
enum  ProcessingMode { Runs, RunsAndLumis, RunsLumisAndEvents }
 
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::InputSource
static const std::string & baseType ()
 
static void fillDescription (ParameterSetDescription &desc)
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

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 14 of file RawInputSource.cc.

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

14  :
15  InputSource(pset, desc),
18  newRun_(false),
19  newLumi_(false),
20  eventCached_(false) {
22  }
RunNumber_t runNumber_
void setTimestamp(Timestamp const &theTime)
To set the current time, as seen by the input source.
Definition: InputSource.h:293
LuminosityBlockNumber_t luminosityBlockNumber_
static Timestamp const & beginOfTime()
Definition: Timestamp.cc:96
unsigned int RunNumber_t
Definition: EventRange.h:32
InputSource(ParameterSet const &, InputSourceDescription const &)
Constructor.
Definition: InputSource.cc:54
edm::RawInputSource::~RawInputSource ( )
virtual

Definition at line 24 of file RawInputSource.cc.

24  {
25  }

Member Function Documentation

InputSource::ItemType edm::RawInputSource::getNextItemType ( )
privatevirtual

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().

67  {
68  if(state() == IsInvalid) {
69  return IsFile;
70  }
71  if(newRun_) {
72  return IsRun;
73  }
74  if(newLumi_) {
75  return IsLumi;
76  }
77  if(eventCached_) {
78  return IsEvent;
79  }
80  std::auto_ptr<Event> e(readOneEvent());
81  if(e.get() == 0) {
82  return IsStop;
83  } else {
84  e->commit_();
85  }
86  if(e->run() != runNumber_) {
87  newRun_ = newLumi_ = true;
88  runNumber_ = e->run();
89  luminosityBlockNumber_ = e->luminosityBlock();
90  return IsRun;
91  } else if(e->luminosityBlock() != luminosityBlockNumber_) {
92  luminosityBlockNumber_ = e->luminosityBlock();
93  newLumi_ = true;
94  return IsLumi;
95  }
96  return IsEvent;
97  }
RunNumber_t runNumber_
virtual std::auto_ptr< Event > readOneEvent()=0
LuminosityBlockNumber_t luminosityBlockNumber_
ItemType state() const
Definition: InputSource.h:296
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().

49  {
50  if(!runAuxiliary()) {
51  newRun_ = newLumi_ = true;
52  setRunAuxiliary(new RunAuxiliary(run, tstamp, Timestamp::invalidTimestamp()));
53  }
55  setLuminosityBlockAuxiliary(new LuminosityBlockAuxiliary(run, lumi, tstamp, Timestamp::invalidTimestamp()));
56  newLumi_ = true;
57  }
58  EventSourceSentry sentry(*this);
59  EventAuxiliary aux(EventID(run, lumi, event), processGUID(), tstamp, true, EventAuxiliary::PhysicsTrigger);
60  eventPrincipalCache()->fillEventPrincipal(aux, boost::shared_ptr<LuminosityBlockPrincipal>());
61  eventCached_ = true;
62  std::auto_ptr<Event> e(new Event(*eventPrincipalCache(), moduleDescription()));
63  return e;
64  }
tuple lumi
Definition: fjr2json.py:35
boost::shared_ptr< LuminosityBlockAuxiliary > luminosityBlockAuxiliary() const
Called by the framework to merge or insert lumi in principal cache.
Definition: InputSource.h:238
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:606
std::string const & processGUID() const
Accessor for global process identifier.
Definition: InputSource.h:190
void setLuminosityBlockAuxiliary(LuminosityBlockAuxiliary *lbp)
Definition: InputSource.h:298
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void fillEventPrincipal(EventAuxiliary const &aux, boost::shared_ptr< LuminosityBlockPrincipal > lbp, boost::shared_ptr< EventSelectionIDVector > eventSelectionIDs=boost::shared_ptr< EventSelectionIDVector >(), boost::shared_ptr< BranchListIndexes > branchListIndexes=boost::shared_ptr< BranchListIndexes >(), boost::shared_ptr< BranchMapper > mapper=boost::shared_ptr< BranchMapper >(new BranchMapper), DelayedReader *reader=0)
static Timestamp const & invalidTimestamp()
Definition: Timestamp.cc:83
boost::shared_ptr< RunAuxiliary > runAuxiliary() const
Called by the framework to merge or insert run in principal cache.
Definition: InputSource.h:235
void setRunAuxiliary(RunAuxiliary *rp)
Definition: InputSource.h:297
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:181
EventPrincipal * eventPrincipalCache()
Definition: InputSource.cc:139
EventPrincipal * edm::RawInputSource::readEvent_ ( )
privatevirtual

Implements edm::InputSource.

Definition at line 41 of file RawInputSource.cc.

References eventCached_, edm::InputSource::eventPrincipalCache(), edm::InputSource::luminosityBlockPrincipal(), and edm::EventPrincipal::setLuminosityBlockPrincipal().

41  {
42  assert(eventCached_);
43  eventCached_ = false;
45  return eventPrincipalCache();
46  }
void setLuminosityBlockPrincipal(boost::shared_ptr< LuminosityBlockPrincipal > const &lbp)
boost::shared_ptr< LuminosityBlockPrincipal > const luminosityBlockPrincipal() const
Definition: InputSource.cc:281
EventPrincipal * eventPrincipalCache()
Definition: InputSource.cc:139
EventPrincipal * edm::RawInputSource::readIt ( EventID const &  eventID)
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 100 of file RawInputSource.cc.

References edm::hlt::Exception, and edm::errors::LogicError.

100  {
101  throw Exception(errors::LogicError, "RawInputSource::readEvent_(EventID const& eventID)")
102  << "Random access read cannot be used for RawInputSource.\n"
103  << "Contact a Framework developer.\n";
104  }
boost::shared_ptr< LuminosityBlockAuxiliary > edm::RawInputSource::readLuminosityBlockAuxiliary_ ( )
privatevirtual

Implements edm::InputSource.

Definition at line 34 of file RawInputSource.cc.

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

34  {
35  newLumi_ = false;
36  return boost::shared_ptr<LuminosityBlockAuxiliary>(new LuminosityBlockAuxiliary(
38  }
RunNumber_t runNumber_
LuminosityBlockNumber_t luminosityBlockNumber_
static Timestamp const & invalidTimestamp()
Definition: Timestamp.cc:83
Timestamp const & timestamp() const
Accessor for the current time, as seen by the input source.
Definition: InputSource.h:215
virtual std::auto_ptr<Event> edm::RawInputSource::readOneEvent ( )
protectedpure virtual

Implemented in edm::DQMHttpSource.

Referenced by getNextItemType().

boost::shared_ptr< RunAuxiliary > edm::RawInputSource::readRunAuxiliary_ ( )
privatevirtual

Implements edm::InputSource.

Definition at line 28 of file RawInputSource.cc.

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

28  {
29  newRun_ = false;
30  return boost::shared_ptr<RunAuxiliary>(new RunAuxiliary(runNumber_, timestamp(), Timestamp::invalidTimestamp()));
31  }
RunNumber_t runNumber_
static Timestamp const & invalidTimestamp()
Definition: Timestamp.cc:83
Timestamp const & timestamp() const
Accessor for the current time, as seen by the input source.
Definition: InputSource.h:215
void edm::RawInputSource::skip ( int  offset)
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 108 of file RawInputSource.cc.

References edm::hlt::Exception, and edm::errors::LogicError.

108  {
109  throw Exception(errors::LogicError, "RawInputSource::skip(int offset)")
110  << "Random access skip cannot be used for RawInputSource\n"
111  << "Contact a Framework developer.\n";
112  }

Member Data Documentation

bool edm::RawInputSource::eventCached_
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 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