#include <LmfSource.h>
Classes | |
struct | IndexRecord |
Public Member Functions | |
LmfSource (const edm::ParameterSet &pset, const edm::InputSourceDescription &isd) | |
~LmfSource () override | |
Public Member Functions inherited from edm::ProducerSourceBase | |
ProducerSourceBase (ParameterSet const &pset, InputSourceDescription const &desc, bool realData) | |
~ProducerSourceBase () noexcept(false) override | |
Public Member Functions inherited from edm::IDGeneratorSourceBase< PuttableSourceBase > | |
EventNumber_t | event () const |
unsigned int | eventCreationDelay () const |
EventID const & | eventID () const |
IDGeneratorSourceBase (ParameterSet const &pset, InputSourceDescription const &desc, bool realData) | |
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 |
~IDGeneratorSourceBase () noexcept(false) override | |
Public Member Functions inherited from edm::PuttableSourceBase | |
bool | hasAbilityToProduceInBeginLumis () const final |
bool | hasAbilityToProduceInBeginRuns () const final |
PuttableSourceBase & | operator= (const PuttableSourceBase &)=delete |
PuttableSourceBase (ParameterSet const &, InputSourceDescription const &) | |
PuttableSourceBase (const PuttableSourceBase &)=delete | |
void | registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &) |
void | registerProducts () final |
Register any produced products. More... | |
void | resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel) |
Public Member Functions inherited from edm::InputSource | |
std::shared_ptr< ActivityRegistry > | actReg () const |
Accessor for Activity Registry. More... | |
std::shared_ptr< BranchIDListHelper const > | branchIDListHelper () const |
Accessors for branchIDListHelper. More... | |
std::shared_ptr< BranchIDListHelper > & | branchIDListHelper () |
void | closeFile (FileBlock *, bool cleaningUpAfterException) |
close current file More... | |
void | doBeginJob () |
Called by framework at beginning of job. More... | |
void | doEndJob () |
Called by framework at end of job. More... | |
void | fillProcessBlockHelper () |
Fill the ProcessBlockHelper with info for the current file. 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, StreamID streamID) |
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... | |
ItemTypeInfo | nextItemType () |
Advances the source to the next item. More... | |
bool | nextProcessBlock (ProcessBlockPrincipal &) |
Next process block, return false if there is none, sets the processName in the principal. More... | |
InputSource & | operator= (InputSource const &)=delete |
std::shared_ptr< ProcessBlockHelper const > | processBlockHelper () const |
Accessors for processBlockHelper. More... | |
std::shared_ptr< ProcessBlockHelper > & | processBlockHelper () |
ProcessConfiguration const & | processConfiguration () const |
Accessor for Process Configuration. More... | |
std::string const & | processGUID () const |
Accessor for global process identifier. More... | |
ProcessHistoryRegistry const & | processHistoryRegistry () const |
Accessors for process history registry. More... | |
ProcessHistoryRegistry & | processHistoryRegistry () |
ProcessingMode | processingMode () const |
RunsLumisAndEvents (default), RunsAndLumis, or Runs. More... | |
std::shared_ptr< ProductRegistry const > | productRegistry () const |
Accessors 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::shared_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 | readProcessBlock (ProcessBlockPrincipal &) |
Read next process block. 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 |
int | remainingEvents () const |
int | remainingLuminosityBlocks () const |
void | repeat () |
Reset the remaining number of events/lumis to the maximum number. More... | |
std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > | resourceSharedWithDelayedReader () |
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) |
void | switchTo (std::shared_ptr< ProductRegistry > iOther) |
switch to a different ProductRegistry. More... | |
std::shared_ptr< ThinnedAssociationsHelper const > | thinnedAssociationsHelper () const |
Accessors for thinnedAssociationsHelper. More... | |
std::shared_ptr< ThinnedAssociationsHelper > & | thinnedAssociationsHelper () |
Timestamp const & | timestamp () const |
Accessor for the current time, as seen by the input source. More... | |
virtual | ~InputSource () noexcept(false) |
Destructor. More... | |
Public Member Functions inherited from edm::ProducerBase | |
void | callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func) |
std::vector< edm::ProductResolverIndex > const & | indiciesForPutProducts (BranchType iBranchType) const |
ProducerBase () | |
std::vector< edm::ProductResolverIndex > const & | putTokenIndexToProductResolverIndex () const |
std::vector< bool > const & | recordProvenanceList () const |
void | registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &) |
std::function< void(BranchDescription const &)> | registrationCallback () const |
used by the fwk to register list of products More... | |
void | resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel) |
TypeLabelList const & | typeLabelList () const |
used by the fwk to register the list of products of this module More... | |
~ProducerBase () noexcept(false) override | |
Private Member Functions | |
void | checkFileNames () |
bool | filter () const |
bool | nextEventWithinFile () |
bool | openFile (int iFile) |
void | produce (edm::Event &e) override |
bool | readEvent (bool doSkip=false) |
bool | readEventWithinFile (bool doSkip) |
bool | readFileHeader () |
void | readIndexTable () |
bool | setRunAndEventInfo (edm::EventID &id, edm::TimeValue_t &time, edm::EventAuxiliary::ExperimentType &eType) override |
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 | ItemPosition : char { ItemPosition::Invalid, ItemPosition::LastItemToBeMerged, ItemPosition::NotLastItemToBeMerged } |
enum | ItemType : char { ItemType::IsInvalid, ItemType::IsStop, ItemType::IsFile, ItemType::IsRun, ItemType::IsLumi, ItemType::IsEvent, ItemType::IsRepeat, ItemType::IsSynchronize } |
enum | ProcessingMode { Runs, RunsAndLumis, RunsLumisAndEvents } |
Public Types inherited from edm::ProducerBase | |
template<typename T > | |
using | BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T > |
using | ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > > |
typedef ProductRegistryHelper::TypeLabelList | TypeLabelList |
Static Public Member Functions inherited from edm::IDGeneratorSourceBase< PuttableSourceBase > | |
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 &) |
Public Attributes inherited from edm::InputSource | |
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> | postEventReadFromSourceSignal_ |
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> | preEventReadFromSourceSignal_ |
Protected Member Functions inherited from edm::IDGeneratorSourceBase< PuttableSourceBase > | |
void | doReadEvent (EventPrincipal &eventPrincipal, F &&f) |
void | doReadEventWithDelayedReader (EventPrincipal &eventPrincipal, ProcessHistoryID const &historyID, EventSelectionIDVector eventSelectionIDs, BranchListIndexes branchListIndexes, DelayedReader *reader) |
Protected Member Functions inherited from edm::InputSource | |
void | decreaseRemainingEventsBy (int iSkipped) |
bool | eventCached () const |
bool | newLumi () const |
bool | newRun () const |
ProcessHistoryRegistry & | processHistoryRegistryForUpdate () |
ProductRegistry & | productRegistryUpdate () |
void | reset () const |
void | resetEventCached () |
void | resetLuminosityBlockAuxiliary (bool isNewLumi=true) const |
void | resetNewLumi () |
void | resetNewRun () |
void | resetRunAuxiliary (bool isNewRun=true) 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... | |
ItemTypeInfo | state () const |
Protected Member Functions inherited from edm::ProducerBase | |
template<Transition Tr = Transition::Event> | |
auto | produces (std::string instanceName) noexcept |
declare what type of product will make and with which optional label More... | |
template<Transition B> | |
BranchAliasSetter | produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true) |
template<BranchType B> | |
BranchAliasSetter | produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true) |
BranchAliasSetter | produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true) |
template<typename ProductType , Transition B> | |
BranchAliasSetterT< ProductType > | produces (std::string instanceName) |
template<class ProductType > | |
BranchAliasSetterT< ProductType > | produces () |
template<typename ProductType , BranchType B> | |
BranchAliasSetterT< ProductType > | produces (std::string instanceName) |
template<typename ProductType , BranchType B> | |
BranchAliasSetterT< ProductType > | produces () |
template<class ProductType > | |
BranchAliasSetterT< ProductType > | produces (std::string instanceName) |
template<typename ProductType , Transition B> | |
BranchAliasSetterT< ProductType > | produces () |
template<Transition Tr = Transition::Event> | |
auto | produces () noexcept |
ProducesCollector | producesCollector () |
Definition at line 14 of file LmfSource.h.
LmfSource::LmfSource | ( | const edm::ParameterSet & | pset, |
const edm::InputSourceDescription & | isd | ||
) |
Definition at line 23 of file LmfSource.cc.
References checkFileNames(), Exception, fileList_, fileListName_, preScale_, and watchFileList_.
|
inlineoverride |
Definition at line 24 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 442 of file LmfSource.cc.
References Exception, MillePedeFileConverter_cfg::fileName, fileNames_, mps_fire::i, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by LmfSource().
|
private |
Filtering events. Used for prescale.
Definition at line 428 of file LmfSource.cc.
References iEvent_, and preScale_.
Referenced by setRunAndEventInfo().
|
private |
Move to next event within the same file. Called by nextEvent method.
Definition at line 176 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 129 of file LmfSource.cc.
References gather_cfg::cout, currentFileName_, Exception, fileList_, fileNames_, iEventInFile_, in_, inputDir_, nSecondsToSleep_, AlCaHLTBitMon_QueryRunRegistry::string, verbosity_, and watchFileList_.
Referenced by readEvent().
|
overrideprivatevirtual |
Called by the framework after setRunAndEventInfo()
Implements edm::ProducerSourceBase.
Definition at line 113 of file LmfSource.cc.
References gather_cfg::cout, fedColl_, eostools::move(), edm::Event::put(), and verbosity_.
|
private |
Reading next event
doSkip | if true skip event instead of reading it |
Definition at line 200 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 cms::cuda::assert(), visDQMUpload::buf, bx_, calibTrig_, filterCSVwithJSON::copy, gather_cfg::cout, currentFileName_, FEDRawData::data(), dataFormatVers_, TauDecayModes::dec, eventNum_, Exception, fedColl_, FEDRawDataCollection::FEDData(), fedId_, header_, mps_fire::i, iEvent_, iFile_, in_, FEDNumbering::inRange(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::iv, lumiBlock_, maxEventSize_, minDataFormatVersion_, nFeds_, orbitNum_, rcRead_, FEDRawData::resize(), runNum_, FEDRawData::size(), submitPVValidationJobs::t, timeStamp_, verbosity_, and testProducerWithPsetDescEmpty_cfi::x1.
Referenced by readEvent().
|
private |
Definition at line 56 of file LmfSource.cc.
References gather_cfg::cout, currentFileName_, dataFormatVers_, TauDecayModes::dec, Exception, fileHeader_, fileHeaderSize, mps_fire::i, iFile_, in_, indexTablePos_, createfilelist::int, maxDataFormatVersion_, minDataFormatVersion_, and verbosity_.
Referenced by readEvent().
|
private |
Reads event index table from input file. readFileHeader() must be called beforehand.
Definition at line 462 of file LmfSource.cc.
References currentFileName_, Exception, in_, indexTable_, indexTablePos_, maxEvents_, and jetmet_cfg::nevts.
Referenced by readEvent().
|
overrideprivatevirtual |
Callback funtion to set run and event information (lumi block, run number, event number, timestamp) Called by the framework before produce()
Implements edm::IDGeneratorSourceBase< PuttableSourceBase >.
Definition at line 222 of file LmfSource.cc.
References gather_cfg::cout, eventNum_, fedColl_, FEDRawDataCollection::FEDData(), fedId_, filter(), lumiBlock_, readEvent(), FEDRawData::resize(), runNum_, hcalRecHitTable_cff::time, timeStamp_, and verbosity_.
|
private |
timeval to string conversion
t | timestamp |
Definition at line 430 of file LmfSource.cc.
References visDQMUpload::buf, AlCaHLTBitMon_QueryRunRegistry::string, and submitPVValidationJobs::t.
|
private |
Definition at line 128 of file LmfSource.h.
Referenced by readEventWithinFile().
|
private |
Definition at line 152 of file LmfSource.h.
Referenced by readEventWithinFile().
|
private |
currently open file
Definition at line 191 of file LmfSource.h.
Referenced by nextEventWithinFile(), openFile(), readEventWithinFile(), readFileHeader(), and readIndexTable().
|
private |
Definition at line 132 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 129 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 193 of file LmfSource.h.
Referenced by LmfSource(), and openFile().
|
private |
name of the textfile with the input file list
Definition at line 183 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 144 of file LmfSource.h.
Referenced by filter(), and readEventWithinFile().
|
private |
Sequential number of event reset at each newly opened file
Definition at line 148 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 134 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 159 of file LmfSource.h.
Referenced by nextEventWithinFile(), and readIndexTable().
|
private |
Definition at line 150 of file LmfSource.h.
Referenced by readFileHeader(), and readIndexTable().
|
private |
absolute path from which filename in fileListName_ is valid
Definition at line 187 of file LmfSource.h.
Referenced by openFile().
|
private |
Definition at line 126 of file LmfSource.h.
Referenced by readEventWithinFile(), and setRunAndEventInfo().
|
staticprivate |
Maximal LMF data format version supported.
Definition at line 95 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 164 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 169 of file LmfSource.h.
Referenced by readEventWithinFile().
|
staticprivate |
Minimal LMF data format version supported.
Definition at line 91 of file LmfSource.h.
Referenced by readEventWithinFile(), and readFileHeader().
|
private |
Definition at line 154 of file LmfSource.h.
Referenced by readEventWithinFile().
|
private |
seconds to sleep before checking fileList_ for updates
Definition at line 197 of file LmfSource.h.
Referenced by openFile().
|
private |
Definition at line 130 of file LmfSource.h.
Referenced by readEventWithinFile().
|
private |
Switch for enabling reading event in ordered using event index table
Definition at line 174 of file LmfSource.h.
Referenced by nextEventWithinFile(), and readEvent().
|
private |
Definition at line 140 of file LmfSource.h.
Referenced by filter(), and LmfSource().
|
private |
Flags of last event read success: true->succeeded, false->failed
Definition at line 138 of file LmfSource.h.
Referenced by readEvent(), and readEventWithinFile().
|
private |
Definition at line 127 of file LmfSource.h.
Referenced by readEventWithinFile(), and setRunAndEventInfo().
|
private |
Definition at line 125 of file LmfSource.h.
Referenced by readEventWithinFile(), and setRunAndEventInfo().
|
private |
Debugging level
Definition at line 201 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 179 of file LmfSource.h.
Referenced by LmfSource(), and openFile().