#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::ConfigurableInputSource | |
ConfigurableInputSource (ParameterSet const &pset, InputSourceDescription const &desc, bool realData=true) | |
EventNumber_t | event () const |
unsigned int | eventCreationDelay () 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 |
RunNumber_t | run () const |
unsigned int | timeBetweenEvents () const |
virtual | ~ConfigurableInputSource () |
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... | |
EventPrincipal * | readEvent (boost::shared_ptr< LuminosityBlockPrincipal > lbCache) |
EventPrincipal * | readEvent (EventID const &) |
Read a specific event. More... | |
boost::shared_ptr< FileBlock > | readFile () |
Read next file. More... | |
boost::shared_ptr < LuminosityBlockAuxiliary > | readLuminosityBlockAuxiliary () |
Read next luminosity block Auxilary. More... | |
boost::shared_ptr< RunAuxiliary > | readRunAuxiliary () |
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< 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) |
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... | |
Private Member Functions | |
void | checkFileNames () |
bool | filter () const |
bool | nextEventWithinFile () |
bool | openFile (int iFile) |
virtual bool | produce (edm::Event &e) |
bool | readEvent (bool doSkip=false) |
bool | readEventWithinFile (bool doSkip) |
bool | readFileHeader () |
void | readIndexTable () |
virtual void | setRunAndEventInfo () |
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 unsigned | fileHeaderSize = 2 |
static unsigned char | maxDataFormatVersion_ = 5 |
static const unsigned | maxEvents_ = 1<<20 |
static const unsigned | maxEventSize_ = 1<<20 |
static unsigned char | minDataFormatVersion_ = 4 |
Definition at line 14 of file LmfSource.h.
LmfSource::LmfSource | ( | const edm::ParameterSet & | pset, |
const edm::InputSourceDescription & | isd | ||
) |
Definition at line 26 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 449 of file LmfSource.cc.
References edm::hlt::Exception, convertXMLtoSQLite_cfg::fileName, fileNames_, i, and asciidump::s.
Referenced by LmfSource().
|
private |
Filtering events. Used for prescale.
Definition at line 433 of file LmfSource.cc.
References iEvent_, and preScale_.
Referenced by python.Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filter(), python.Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), python.Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setDataAccessor(), setRunAndEventInfo(), and python.Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView().
|
private |
Move to next event within the same file. Called by nextEvent method.
Definition at line 182 of file LmfSource.cc.
References gather_cfg::cout, currentFileName_, iEventInFile_, iFile_, in_, indexTable_, orderedRead_, pos, and verbosity_.
Referenced by readEvent().
|
private |
Definition at line 137 of file LmfSource.cc.
References gather_cfg::cout, currentFileName_, edm::hlt::Exception, fileList_, fileNames_, iEventInFile_, in_, inputDir_, nSecondsToSleep_, stor::utils::sleep(), verbosity_, and watchFileList_.
Referenced by python.Vispa.Main.Application.Application::_readCommandLineAttributes(), python.Vispa.Main.Application.Application::doubleClickOnFile(), python.Vispa.Main.Application.Application::openFileDialog(), python.Vispa.Main.Application.Application::openRecentFileSlot(), and readEvent().
|
privatevirtual |
Called by the framework after setRunAndEventInfo()
Implements edm::ConfigurableInputSource.
Definition at line 119 of file LmfSource.cc.
References coll, gather_cfg::cout, fedColl_, edm::Event::put(), rcRead_, and verbosity_.
Referenced by python.JSONExport.JsonExport::export(), and python.HTMLExport.HTMLExport::export().
|
private |
Reading next event
doSkip | if true skip event instead of reading it |
Definition at line 209 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 264 of file LmfSource.cc.
References bx_, calibTrig_, filterCSVwithJSON::copy, gather_cfg::cout, currentFileName_, FEDRawData::data(), dataFormatVers_, 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(), timeStamp_, and verbosity_.
Referenced by readEvent().
|
private |
Definition at line 61 of file LmfSource.cc.
References gather_cfg::cout, currentFileName_, dataFormatVers_, 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 472 of file LmfSource.cc.
References currentFileName_, edm::hlt::Exception, in_, indexTable_, indexTablePos_, maxEvents_, launcher::nevts, and pos.
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()
Reimplemented from edm::ConfigurableInputSource.
Definition at line 229 of file LmfSource.cc.
References gather_cfg::cout, eventNum_, fedColl_, FEDRawDataCollection::FEDData(), fedId_, filter(), lumiBlock_, readEvent(), FEDRawData::resize(), runNum_, edm::ConfigurableInputSource::setEventNumber(), edm::InputSource::setLuminosityBlockNumber_t(), edm::InputSource::setRunNumber(), edm::ConfigurableInputSource::setTime(), timeStamp_, and verbosity_.
|
private |
timeval to string conversion
t | timestamp |
Definition at line 437 of file LmfSource.cc.
|
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 produce(), 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().