CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RawInputSource.cc
Go to the documentation of this file.
1 /*----------------------------------------------------------------------
2 ----------------------------------------------------------------------*/
3 
5 
12 
13 namespace edm {
15  InputSource(pset, desc),
17  luminosityBlockNumber_(),
18  newRun_(false),
19  newLumi_(false),
20  eventCached_(false) {
22  }
23 
25  }
26 
27  boost::shared_ptr<RunAuxiliary>
29  newRun_ = false;
30  return boost::shared_ptr<RunAuxiliary>(new RunAuxiliary(runNumber_, timestamp(), Timestamp::invalidTimestamp()));
31  }
32 
33  boost::shared_ptr<LuminosityBlockAuxiliary>
35  newLumi_ = false;
36  return boost::shared_ptr<LuminosityBlockAuxiliary>(new LuminosityBlockAuxiliary(
38  }
39 
42  assert(eventCached_);
43  eventCached_ = false;
45  return eventPrincipalCache();
46  }
47 
48  std::auto_ptr<Event>
50  if(!runAuxiliary()) {
51  newRun_ = newLumi_ = true;
53  }
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  }
65 
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  }
98 
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  }
105 
106  // Not yet implemented
107  void
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  }
113 }
static const char runNumber_[]
void setLuminosityBlockPrincipal(boost::shared_ptr< LuminosityBlockPrincipal > const &lbp)
virtual EventPrincipal * readEvent_()
RunNumber_t runNumber_
unsigned int EventNumber_t
Definition: EventID.h:30
std::auto_ptr< Event > makeEvent(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, Timestamp const &tstamp)
tuple lumi
Definition: fjr2json.py:35
virtual void skip(int offset)
boost::shared_ptr< LuminosityBlockAuxiliary > luminosityBlockAuxiliary() const
Called by the framework to merge or insert lumi in principal cache.
Definition: InputSource.h:238
void setTimestamp(Timestamp const &theTime)
To set the current time, as seen by the input source.
Definition: InputSource.h:293
RawInputSource(ParameterSet const &pset, InputSourceDescription const &desc)
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
boost::shared_ptr< LuminosityBlockPrincipal > const luminosityBlockPrincipal() const
Definition: InputSource.cc:281
std::string const & processGUID() const
Accessor for global process identifier.
Definition: InputSource.h:190
virtual boost::shared_ptr< RunAuxiliary > readRunAuxiliary_()
void setLuminosityBlockAuxiliary(LuminosityBlockAuxiliary *lbp)
Definition: InputSource.h:298
virtual std::auto_ptr< Event > readOneEvent()=0
LuminosityBlockNumber_t luminosityBlockNumber_
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
virtual boost::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_()
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)
virtual EventPrincipal * readIt(EventID const &eventID)
ItemType state() const
Definition: InputSource.h:296
virtual ItemType getNextItemType()
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
boost::shared_ptr< RunAuxiliary > runAuxiliary() const
Called by the framework to merge or insert run in principal cache.
Definition: InputSource.h:235
static Timestamp const & beginOfTime()
Definition: Timestamp.cc:96
void setRunAuxiliary(RunAuxiliary *rp)
Definition: InputSource.h:297
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:181
unsigned int RunNumber_t
Definition: EventRange.h:32
EventPrincipal * eventPrincipalCache()
Definition: InputSource.cc:139