#include <LmfSource.h>
Classes | |
struct | IndexRecord |
Public Member Functions | |
LmfSource (const edm::ParameterSet &pset, const edm::InputSourceDescription &isd) | |
virtual | ~LmfSource () |
Public Member Functions inherited from edm::ProducerSourceBase | |
EventNumber_t | event () const |
unsigned int | eventCreationDelay () const |
EventID const & | eventID () const |
LuminosityBlockNumber_t | luminosityBlock () const |
unsigned int | numberEventsInLumi () const |
unsigned int | numberEventsInRun () const |
unsigned int | numberEventsInThisLumi () const |
unsigned int | numberEventsInThisRun () const |
TimeValue_t | presentTime () const |
ProducerSourceBase (ParameterSet const &pset, InputSourceDescription const &desc, bool realData) | |
RunNumber_t | run () const |
unsigned int | timeBetweenEvents () const |
virtual | ~ProducerSourceBase () |
Public Member Functions inherited from edm::InputSource | |
std::shared_ptr< ActivityRegistry > | actReg () const |
Accessor for Activity Registry. More... | |
std::shared_ptr < BranchIDListHelper > | branchIDListHelper () const |
Accessor for branchIDListHelper. More... | |
void | closeFile (FileBlock *, bool cleaningUpAfterException) |
close current file More... | |
void | doBeginJob () |
Called by framework at beginning of job. More... | |
void | doBeginLumi (LuminosityBlockPrincipal &lbp, ProcessContext const *) |
Called by framework at beginning of lumi block. More... | |
void | doBeginRun (RunPrincipal &rp, ProcessContext const *) |
Called by framework at beginning of run. More... | |
void | doEndJob () |
Called by framework at end of job. More... | |
void | doEndLumi (LuminosityBlockPrincipal &lbp, bool cleaningUpAfterException, ProcessContext const *) |
Called by framework at end of lumi block. More... | |
void | doEndRun (RunPrincipal &rp, bool cleaningUpAfterException, ProcessContext const *) |
Called by framework at end of run. More... | |
void | doPostForkReacquireResources (std::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... | |
InputSource (InputSource const &)=delete | |
void | issueReports (EventID const &eventID) |
issue an event report More... | |
LuminosityBlockNumber_t | luminosityBlock () const |
Accessor for current luminosity block number. More... | |
std::shared_ptr < LuminosityBlockAuxiliary > | luminosityBlockAuxiliary () const |
Called by the framework to merge or insert lumi in principal cache. More... | |
int | maxEvents () const |
int | maxLuminosityBlocks () const |
ModuleDescription const & | moduleDescription () const |
Accessor for 'module' description. More... | |
ItemType | nextItemType () |
Advances the source to the next item. More... | |
InputSource & | operator= (InputSource const &)=delete |
ProcessConfiguration const & | processConfiguration () const |
Accessor for Process Configuration. More... | |
std::string const & | processGUID () const |
Accessor for global process identifier. More... | |
ProcessHistoryRegistry const & | processHistoryRegistry () const |
Const accessor for process history registry. More... | |
ProcessingMode | processingMode () const |
RunsLumisAndEvents (default), RunsAndLumis, or Runs. More... | |
std::shared_ptr < ProductRegistry const > | productRegistry () const |
Accessor for product registry. More... | |
bool | randomAccess () const |
void | readAndMergeLumi (LuminosityBlockPrincipal &lbp) |
Read next luminosity block (same as a prior lumi) More... | |
void | readAndMergeRun (RunPrincipal &rp) |
Read next run (same as a prior run) More... | |
void | readEvent (EventPrincipal &ep, StreamContext &) |
Read next event. More... | |
bool | readEvent (EventPrincipal &ep, EventID const &, StreamContext &) |
Read a specific event. More... | |
std::unique_ptr< FileBlock > | readFile () |
Read next file. More... | |
void | readLuminosityBlock (LuminosityBlockPrincipal &lumiPrincipal, HistoryAppender &historyAppender) |
Read next luminosity block (new lumi) More... | |
std::shared_ptr < LuminosityBlockAuxiliary > | readLuminosityBlockAuxiliary () |
Read next luminosity block Auxilary. More... | |
void | readRun (RunPrincipal &runPrincipal, HistoryAppender &historyAppender) |
Read next run (new run) More... | |
std::shared_ptr< RunAuxiliary > | readRunAuxiliary () |
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... | |
SharedResourcesAcquirer * | resourceSharedWithDelayedReader () const |
Returns nullptr if no resource shared between the Source and a DelayedReader. More... | |
ProcessingController::ReverseState | reverseState () const |
void | rewind () |
Begin again at the first event. More... | |
RunNumber_t | run () const |
Accessor for current run number. More... | |
std::shared_ptr< RunAuxiliary > | runAuxiliary () 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) |
bool | skipForForking () |
std::shared_ptr < ThinnedAssociationsHelper > | thinnedAssociationsHelper () const |
Accessor for thinnedAssociationsHelper. More... | |
Timestamp const & | timestamp () const |
Accessor for the current time, as seen by the input source. More... | |
virtual | ~InputSource () |
Destructor. More... | |
Private Member Functions | |
void | checkFileNames () |
bool | filter () const |
bool | nextEventWithinFile () |
bool | openFile (int iFile) |
virtual void | produce (edm::Event &e) |
bool | readEvent (bool doSkip=false) |
bool | readEventWithinFile (bool doSkip) |
bool | readFileHeader () |
void | readIndexTable () |
virtual bool | setRunAndEventInfo (edm::EventID &id, edm::TimeValue_t &time, edm::EventAuxiliary::ExperimentType &eType) |
std::string | toString (edm::TimeValue_t &t) const |
Private Attributes | |
uint32_t | bx_ |
int | calibTrig_ |
std::string | currentFileName_ |
unsigned char | dataFormatVers_ |
FEDRawData | emptyFedBlock_ |
uint32_t | eventNum_ |
FEDRawDataCollection | fedColl_ |
int | fedId_ |
std::vector< uint32_t > | fileHeader_ |
std::ifstream | fileList_ |
std::string | fileListName_ |
std::vector< std::string > | fileNames_ |
std::vector< uint32_t > | header_ |
uint32_t | iEvent_ |
uint32_t | iEventInFile_ |
int | iFile_ |
std::ifstream | in_ |
std::vector< IndexRecord > | indexTable_ |
uint32_t | indexTablePos_ |
std::string | inputDir_ |
uint32_t | lumiBlock_ |
int | nFeds_ |
int | nSecondsToSleep_ |
uint32_t | orbitNum_ |
bool | orderedRead_ |
unsigned | preScale_ |
bool | rcRead_ |
uint32_t | runNum_ |
uint64_t | timeStamp_ |
int | verbosity_ |
bool | watchFileList_ |
Static Private Attributes | |
static const unsigned | fileHeaderSize = 2 |
static const unsigned char | maxDataFormatVersion_ = 5 |
static const unsigned | maxEvents_ = 1<<20 |
static const unsigned | maxEventSize_ = 1<<20 |
static const unsigned char | minDataFormatVersion_ = 4 |
Additional Inherited Members | |
Public Types inherited from edm::InputSource | |
enum | ItemType { IsInvalid, IsStop, IsFile, IsRun, IsLumi, IsEvent, IsRepeat, IsSynchronize } |
enum | ProcessingMode { Runs, RunsAndLumis, RunsLumisAndEvents } |
typedef ProductRegistryHelper::TypeLabelList | TypeLabelList |
Static Public Member Functions inherited from edm::ProducerSourceBase | |
static void | fillDescription (ParameterSetDescription &desc) |
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 &) |
Protected Member Functions inherited from edm::InputSource | |
void | decreaseRemainingEventsBy (int iSkipped) |
bool | eventCached () const |
std::shared_ptr < LuminosityBlockPrincipal > const | luminosityBlockPrincipal () const |
bool | newLumi () const |
bool | newRun () const |
ProcessHistoryRegistry & | processHistoryRegistryForUpdate () const |
ProductRegistry & | productRegistryUpdate () const |
void | reset () const |
void | resetEventCached () |
void | resetLuminosityBlockAuxiliary (bool isNewLumi=true) const |
void | resetNewLumi () |
void | resetNewRun () |
void | resetRunAuxiliary (bool isNewRun=true) const |
std::shared_ptr< RunPrincipal > const | runPrincipal () const |
void | setEventCached () |
Called by the framework to merge or ached() const {return eventCached_;}. More... | |
void | setLuminosityBlockAuxiliary (LuminosityBlockAuxiliary *lbp) |
void | setNewLumi () |
void | setNewRun () |
void | setRunAuxiliary (RunAuxiliary *rp) |
void | setTimestamp (Timestamp const &theTime) |
To set the current time, as seen by the input source. More... | |
ItemType | state () const |
Definition at line 14 of file LmfSource.h.
LmfSource::LmfSource | ( | const edm::ParameterSet & | pset, |
const edm::InputSourceDescription & | isd | ||
) |
Definition at line 24 of file LmfSource.cc.
References checkFileNames(), edm::hlt::Exception, fileList_, fileListName_, preScale_, and watchFileList_.
|
inlinevirtual |
Definition at line 25 of file LmfSource.h.
|
private |
Checks paths specified in fileNames_ and remove eventual file: prefix.
cms::Exception | in case of a non valid path |
Definition at line 450 of file LmfSource.cc.
References edm::hlt::Exception, convertXMLtoSQLite_cfg::fileName, fileNames_, i, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by LmfSource().
|
private |
Filtering events. Used for prescale.
Definition at line 434 of file LmfSource.cc.
References iEvent_, and preScale_.
Referenced by Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filter(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setDataAccessor(), setRunAndEventInfo(), and Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView().
|
private |
Move to next event within the same file. Called by nextEvent method.
Definition at line 177 of file LmfSource.cc.
References gather_cfg::cout, currentFileName_, TauDecayModes::dec, iEventInFile_, iFile_, in_, indexTable_, orderedRead_, and verbosity_.
Referenced by readEvent().
|
private |
Definition at line 132 of file LmfSource.cc.
References gather_cfg::cout, currentFileName_, edm::hlt::Exception, fileList_, fileNames_, iEventInFile_, in_, inputDir_, nSecondsToSleep_, AlCaHLTBitMon_QueryRunRegistry::string, verbosity_, and watchFileList_.
Referenced by Vispa.Main.Application.Application::_readCommandLineAttributes(), Vispa.Main.Application.Application::doubleClickOnFile(), Vispa.Main.Application.Application::openFileDialog(), Vispa.Main.Application.Application::openRecentFileSlot(), and readEvent().
|
privatevirtual |
Called by the framework after setRunAndEventInfo()
Implements edm::ProducerSourceBase.
Definition at line 117 of file LmfSource.cc.
References coll, gather_cfg::cout, fedColl_, edm::Event::put(), and verbosity_.
Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().
|
private |
Reading next event
doSkip | if true skip event instead of reading it |
Definition at line 204 of file LmfSource.cc.
References gather_cfg::cout, iFile_, in_, nextEventWithinFile(), openFile(), orderedRead_, rcRead_, readEventWithinFile(), readFileHeader(), readIndexTable(), and verbosity_.
Referenced by setRunAndEventInfo().
|
private |
Read event from current opened file. Called by readEvent, which deals with file chaining Beware: readEventHeader must be called beforehand.
doSkip | if true skip event instead of reading it |
Definition at line 258 of file LmfSource.cc.
References assert(), bx_, calibTrig_, filterCSVwithJSON::copy, gather_cfg::cout, currentFileName_, FEDRawData::data(), dataFormatVers_, TauDecayModes::dec, eventNum_, edm::hlt::Exception, fedColl_, FEDRawDataCollection::FEDData(), fedId_, header_, i, iEvent_, iFile_, in_, FEDNumbering::inRange(), lumiBlock_, maxEventSize_, minDataFormatVersion_, nFeds_, orbitNum_, rcRead_, FEDRawData::resize(), runNum_, FEDRawData::size(), tree::t, timeStamp_, and verbosity_.
Referenced by readEvent().
|
private |
Definition at line 59 of file LmfSource.cc.
References gather_cfg::cout, currentFileName_, dataFormatVers_, TauDecayModes::dec, edm::hlt::Exception, fileHeader_, fileHeaderSize, i, iFile_, in_, indexTablePos_, maxDataFormatVersion_, minDataFormatVersion_, and verbosity_.
Referenced by readEvent().
|
private |
Reads event index table from input file. readFileHeader() must be called beforehand.
Definition at line 473 of file LmfSource.cc.
References currentFileName_, edm::hlt::Exception, in_, indexTable_, indexTablePos_, maxEvents_, and jetmet_cfg::nevts.
Referenced by readEvent().
|
privatevirtual |
Callback funtion to set run and event information (lumi block, run number, event number, timestamp) Called by the framework before produce()
Implements edm::ProducerSourceBase.
Definition at line 224 of file LmfSource.cc.
References gather_cfg::cout, eventNum_, fedColl_, FEDRawDataCollection::FEDData(), fedId_, filter(), lumiBlock_, readEvent(), FEDRawData::resize(), runNum_, timeStamp_, and verbosity_.
|
private |
timeval to string conversion
t | timestamp |
Definition at line 438 of file LmfSource.cc.
References AlCaHLTBitMon_QueryRunRegistry::string.
|
private |
Definition at line 129 of file LmfSource.h.
Referenced by readEventWithinFile().
|
private |
Definition at line 153 of file LmfSource.h.
Referenced by readEventWithinFile().
|
private |
currently open file
Definition at line 192 of file LmfSource.h.
Referenced by nextEventWithinFile(), openFile(), readEventWithinFile(), readFileHeader(), and readIndexTable().
|
private |
Definition at line 133 of file LmfSource.h.
Referenced by readEventWithinFile(), and readFileHeader().
|
private |
empty fed block
Definition at line 72 of file LmfSource.h.
|
private |
Definition at line 130 of file LmfSource.h.
Referenced by readEventWithinFile(), and setRunAndEventInfo().
|
private |
Buffer for FED block collection
Definition at line 68 of file LmfSource.h.
Referenced by produce(), readEventWithinFile(), and setRunAndEventInfo().
|
private |
FED ID present in FED data collection (only one FED at a time)
Definition at line 77 of file LmfSource.h.
Referenced by readEventWithinFile(), and setRunAndEventInfo().
|
private |
Buffer for file header readout
Definition at line 87 of file LmfSource.h.
Referenced by readFileHeader().
|
staticprivate |
Definition at line 83 of file LmfSource.h.
Referenced by readFileHeader().
|
private |
Definition at line 194 of file LmfSource.h.
Referenced by LmfSource(), and openFile().
|
private |
name of the textfile with the input file list
Definition at line 184 of file LmfSource.h.
Referenced by LmfSource().
|
private |
List of names of the input files
Definition at line 60 of file LmfSource.h.
Referenced by checkFileNames(), and openFile().
|
private |
Buffer for event header readout
Definition at line 81 of file LmfSource.h.
Referenced by readEventWithinFile().
|
private |
Sequential number of event.
Definition at line 145 of file LmfSource.h.
Referenced by filter(), and readEventWithinFile().
|
private |
Sequential number of event reset at each newly opened file
Definition at line 149 of file LmfSource.h.
Referenced by nextEventWithinFile(), and openFile().
|
private |
Index of the current process file
Definition at line 64 of file LmfSource.h.
Referenced by nextEventWithinFile(), readEvent(), readEventWithinFile(), and readFileHeader().
|
private |
Definition at line 135 of file LmfSource.h.
Referenced by nextEventWithinFile(), openFile(), readEvent(), readEventWithinFile(), readFileHeader(), and readIndexTable().
|
private |
Table with file position of each event order by event time (orbit id used as time measurement).
Definition at line 160 of file LmfSource.h.
Referenced by nextEventWithinFile(), and readIndexTable().
|
private |
Definition at line 151 of file LmfSource.h.
Referenced by readFileHeader(), and readIndexTable().
|
private |
absolute path from which filename in fileListName_ is valid
Definition at line 188 of file LmfSource.h.
Referenced by openFile().
|
private |
Definition at line 127 of file LmfSource.h.
Referenced by readEventWithinFile(), and setRunAndEventInfo().
|
staticprivate |
Maximal LMF data format version supported.
Definition at line 96 of file LmfSource.h.
Referenced by readFileHeader().
|
staticprivate |
Limit of number of events to prevent exhausting memory with indexTable_ in case of file corruption.
Definition at line 165 of file LmfSource.h.
Referenced by readIndexTable().
|
staticprivate |
Limit on event size to prevent exhausting memory in case of error in the event size read from file.
Definition at line 170 of file LmfSource.h.
Referenced by readEventWithinFile().
|
staticprivate |
Minimal LMF data format version supported.
Definition at line 92 of file LmfSource.h.
Referenced by readEventWithinFile(), and readFileHeader().
|
private |
Definition at line 155 of file LmfSource.h.
Referenced by readEventWithinFile().
|
private |
seconds to sleep before checking fileList_ for updates
Definition at line 198 of file LmfSource.h.
Referenced by openFile().
|
private |
Definition at line 131 of file LmfSource.h.
Referenced by readEventWithinFile().
|
private |
Switch for enabling reading event in ordered using event index table
Definition at line 175 of file LmfSource.h.
Referenced by nextEventWithinFile(), and readEvent().
|
private |
Definition at line 141 of file LmfSource.h.
Referenced by filter(), and LmfSource().
|
private |
Flags of last event read success: true->succeeded, false->failed
Definition at line 139 of file LmfSource.h.
Referenced by readEvent(), and readEventWithinFile().
|
private |
Definition at line 128 of file LmfSource.h.
Referenced by readEventWithinFile(), and setRunAndEventInfo().
|
private |
Definition at line 126 of file LmfSource.h.
Referenced by readEventWithinFile(), and setRunAndEventInfo().
|
private |
Debugging level
Definition at line 202 of file LmfSource.h.
Referenced by nextEventWithinFile(), openFile(), produce(), readEvent(), readEventWithinFile(), readFileHeader(), and setRunAndEventInfo().
|
private |
enable reading input file list from text file and keep watching the text file for updates
Definition at line 180 of file LmfSource.h.
Referenced by LmfSource(), and openFile().