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 >)
 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)
 Called by framework at end of lumi block. More...
 
void doEndRun (RunPrincipal &rp)
 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 const 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...
 
ProcessHistoryID const & processHistoryID () const
 Accessor for the input process history ID of the current run. 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 ()
 Read next luminosity block. More...
 
void readAndCacheRun ()
 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...
 
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...
 
void wakeUp ()
 Wake up 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)
 
EventPrincipal *const eventPrincipalCache ()
 
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 setLumiPrematurelyRead ()
 
void setRunAuxiliary (RunAuxiliary *rp)
 
void setRunPrematurelyRead ()
 
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)
 

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

15  :
16  InputSource(pset, desc),
19  newRun_(false),
20  newLumi_(false),
21  eventCached_(false) {
23  }
RunNumber_t runNumber_
void setTimestamp(Timestamp const &theTime)
To set the current time, as seen by the input source.
Definition: InputSource.h:297
LuminosityBlockNumber_t luminosityBlockNumber_
tuple pset
Definition: CrabTask.py:85
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:74
edm::RawInputSource::~RawInputSource ( )
virtual

Definition at line 25 of file RawInputSource.cc.

25  {
26  }

Member Function Documentation

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

Implements edm::InputSource.

Definition at line 73 of file RawInputSource.cc.

References ExpressReco_HICollisions_FallBack::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().

73  {
74  if (state() == IsInvalid) {
75  return IsFile;
76  }
77  if (newRun_) {
78  return IsRun;
79  }
80  if (newLumi_) {
81  return IsLumi;
82  }
83  if(eventCached_) {
84  return IsEvent;
85  }
86  std::auto_ptr<Event> e(readOneEvent());
87  if (e.get() == 0) {
88  return IsStop;
89  } else {
90  e->commit_();
91  }
92  if (e->run() != runNumber_) {
93  newRun_ = newLumi_ = true;
94  runNumber_ = e->run();
95  luminosityBlockNumber_ = e->luminosityBlock();
96  return IsRun;
97  } else if (e->luminosityBlock() != luminosityBlockNumber_) {
98  luminosityBlockNumber_ = e->luminosityBlock();
99  newLumi_ = true;
100  return IsLumi;
101  }
102  return IsEvent;
103  }
RunNumber_t runNumber_
virtual std::auto_ptr< Event > readOneEvent()=0
LuminosityBlockNumber_t luminosityBlockNumber_
ItemType state() const
Definition: InputSource.h:300
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, ExpressReco_HICollisions_FallBack::e, eventCached_, edm::InputSource::eventPrincipalCache(), edm::EventPrincipal::fillEventPrincipal(), edm::Timestamp::invalidTimestamp(), edm::InputSource::luminosityBlockAuxiliary(), edm::InputSource::luminosityBlockPrincipal(), edm::InputSource::moduleDescription(), newLumi_, newRun_, edm::EventAuxiliary::PhysicsTrigger, edm::InputSource::processGUID(), edm::InputSource::readAndCacheLumi(), edm::InputSource::readAndCacheRun(), edm::InputSource::runAuxiliary(), edm::InputSource::setLuminosityBlockAuxiliary(), edm::InputSource::setLumiPrematurelyRead(), edm::InputSource::setRunAuxiliary(), and edm::InputSource::setRunPrematurelyRead().

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

49  {
50  if(!runAuxiliary()) {
51  newRun_ = newLumi_ = true;
52  setRunAuxiliary(new RunAuxiliary(run, tstamp, Timestamp::invalidTimestamp()));
55  }
57  setLuminosityBlockAuxiliary(new LuminosityBlockAuxiliary(run, lumi, tstamp, Timestamp::invalidTimestamp()));
58  newLumi_ = true;
61  }
62  EventSourceSentry sentry(*this);
63  std::auto_ptr<EventAuxiliary> aux(new EventAuxiliary(EventID(run, lumi, event),
66  eventCached_ = true;
67  std::auto_ptr<Event> e(new Event(*eventPrincipalCache(), moduleDescription()));
68  return e;
69  }
void setRunPrematurelyRead()
Definition: InputSource.h:321
tuple lumi
Definition: fjr2json.py:41
EventPrincipal *const eventPrincipalCache()
Definition: InputSource.cc:156
boost::shared_ptr< LuminosityBlockAuxiliary > luminosityBlockAuxiliary() const
Called by the framework to merge or insert lumi in principal cache.
Definition: InputSource.h:242
std::string const & processGUID() const
Accessor for global process identifier.
Definition: InputSource.h:196
void setLuminosityBlockAuxiliary(LuminosityBlockAuxiliary *lbp)
Definition: InputSource.h:302
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:582
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(std::auto_ptr< EventAuxiliary > aux, boost::shared_ptr< LuminosityBlockPrincipal > lbp, boost::shared_ptr< EventSelectionIDVector > eventSelectionIDs=boost::shared_ptr< EventSelectionIDVector >(new EventSelectionIDVector), boost::shared_ptr< BranchListIndexes > branchListIndexes=boost::shared_ptr< BranchListIndexes >(new BranchListIndexes), boost::shared_ptr< BranchMapper > mapper=boost::shared_ptr< BranchMapper >(new BranchMapper), boost::shared_ptr< DelayedReader > rtrv=boost::shared_ptr< DelayedReader >(new NoDelayedReader))
static Timestamp const & invalidTimestamp()
Definition: Timestamp.cc:83
void setLumiPrematurelyRead()
Definition: InputSource.h:322
boost::shared_ptr< RunAuxiliary > runAuxiliary() const
Called by the framework to merge or insert run in principal cache.
Definition: InputSource.h:239
void setRunAuxiliary(RunAuxiliary *rp)
Definition: InputSource.h:301
void readAndCacheRun()
Read next run.
Definition: InputSource.cc:285
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:187
boost::shared_ptr< LuminosityBlockPrincipal > const luminosityBlockPrincipal() const
Definition: InputSource.cc:280
void readAndCacheLumi()
Read next luminosity block.
Definition: InputSource.cc:309
EventPrincipal * edm::RawInputSource::readEvent_ ( )
privatevirtual

Implements edm::InputSource.

Definition at line 42 of file RawInputSource.cc.

References eventCached_, and edm::InputSource::eventPrincipalCache().

42  {
43  assert(eventCached_);
44  eventCached_ = false;
45  return eventPrincipalCache();
46  }
EventPrincipal *const eventPrincipalCache()
Definition: InputSource.cc:156
EventPrincipal * edm::RawInputSource::readIt ( EventID const &  eventID)
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 106 of file RawInputSource.cc.

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

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

Implements edm::InputSource.

Definition at line 35 of file RawInputSource.cc.

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

35  {
36  newLumi_ = false;
37  return boost::shared_ptr<LuminosityBlockAuxiliary>(new LuminosityBlockAuxiliary(
39  }
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:221
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 29 of file RawInputSource.cc.

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

29  {
30  newRun_ = false;
31  return boost::shared_ptr<RunAuxiliary>(new RunAuxiliary(runNumber_, timestamp(), Timestamp::invalidTimestamp()));
32  }
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:221
void edm::RawInputSource::skip ( int  offset)
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 114 of file RawInputSource.cc.

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

114  {
115  throw edm::Exception(errors::LogicError,"RawInputSource::skip(int offset)")
116  << "Random access skip cannot be used for RawInputSource\n"
117  << "Contact a Framework developer.\n";
118  }

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