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 {
14 
16  InputSource(pset, desc),
17  // The default value for the following parameter get defined in at least one derived class
18  // where it has a different default value.
19  inputFileTransitionsEachEvent_(pset.getUntrackedParameter<bool>("inputFileTransitionsEachEvent", false)) {
21  }
22 
24  }
25 
26  boost::shared_ptr<RunAuxiliary>
28  assert(newRun());
29  assert(runAuxiliary());
30  resetNewRun();
31  return runAuxiliary();
32  }
33 
34  boost::shared_ptr<LuminosityBlockAuxiliary>
36  assert(!newRun());
37  assert(newLumi());
38  assert(luminosityBlockAuxiliary());
39  resetNewLumi();
40  return luminosityBlockAuxiliary();
41  }
42 
43  void
45  assert(!newRun());
46  assert(!newLumi());
47  assert(eventCached());
49  read(eventPrincipal);
50  }
51 
52  void
53  RawInputSource::makeEvent(EventPrincipal& eventPrincipal, EventAuxiliary const& eventAuxiliary) {
54  eventPrincipal.fillEventPrincipal(eventAuxiliary, processHistoryRegistry());
55  }
56 
57  void
59  closeFile(nullptr, false);
60  }
61 
64  if(state() == IsInvalid) {
65  return IsFile;
66  }
67  if(newRun() && runAuxiliary()) {
68  return IsRun;
69  }
71  return IsLumi;
72  }
73  if(eventCached()) {
74  return IsEvent;
75  }
79  }
80  bool another = checkNextEvent();
81  if(!another || (!newLumi() && !eventCached())) {
82  return IsStop;
84  return IsFile;
85  }
86  if(newRun()) {
87  return IsRun;
88  } else if(newLumi()) {
89  return IsLumi;
90  }
91  return IsEvent;
92  }
93 
94  void
97  << "RawInputSource::reset()\n"
98  << "Forking is not implemented for this type of RawInputSource\n"
99  << "Contact a Framework Developer\n";
100  }
101 
102  void
104  reset_();
105  }
106 
107  void
109  // The default value for "inputFileTransitionsEachEvent" gets defined in the derived class
110  // as it depends on the derived class. So, we cannot redefine it here.
111  InputSource::fillDescription(description);
112  }
113 }
ProcessHistoryRegistry const & processHistoryRegistry() const
Const accessor for process history registry.
Definition: InputSource.h:171
virtual void readEvent_(EventPrincipal &eventPrincipal) override
bool newLumi() const
Definition: InputSource.h:376
void resetRunAuxiliary(bool isNewRun=true) const
Definition: InputSource.h:358
boost::shared_ptr< LuminosityBlockAuxiliary > luminosityBlockAuxiliary() const
Called by the framework to merge or insert lumi in principal cache.
Definition: InputSource.h:262
void setTimestamp(Timestamp const &theTime)
To set the current time, as seen by the input source.
Definition: InputSource.h:345
RawInputSource(ParameterSet const &pset, InputSourceDescription const &desc)
void closeFile(FileBlock *, bool cleaningUpAfterException)
close current file
Definition: InputSource.cc:280
static Timestamp beginOfTime()
Definition: Timestamp.h:103
virtual bool checkNextEvent()=0
virtual void preForkReleaseResources() override
bool inputFileTransitionsEachEvent_
virtual void read(EventPrincipal &eventPrincipal)=0
bool newRun() const
Definition: InputSource.h:373
virtual void rewind_() override
virtual boost::shared_ptr< RunAuxiliary > readRunAuxiliary_() override
virtual ItemType getNextItemType() override
virtual boost::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_() override
ItemType state() const
Definition: InputSource.h:349
void resetEventCached()
Definition: InputSource.h:382
tuple description
Definition: idDealer.py:66
virtual void reset_()
void resetLuminosityBlockAuxiliary(bool isNewLumi=true) const
Definition: InputSource.h:362
boost::shared_ptr< RunAuxiliary > runAuxiliary() const
Called by the framework to merge or insert run in principal cache.
Definition: InputSource.h:259
void fillEventPrincipal(EventAuxiliary const &aux, ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
void makeEvent(EventPrincipal &eventPrincipal, EventAuxiliary const &eventAuxiliary)
static void fillDescription(ParameterSetDescription &desc)
Definition: InputSource.cc:132
volatile std::atomic< bool > shutdown_flag false
static void fillDescription(ParameterSetDescription &description)
bool eventCached() const
Definition: InputSource.h:379