CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
edm::RootSecondaryFileSequence Class Reference

#include <RootSecondaryFileSequence.h>

Inheritance diagram for edm::RootSecondaryFileSequence:
edm::RootInputFileSequence

Public Member Functions

void endJob ()
 
void initAssociationsFromSecondary (std::set< BranchID > const &)
 
RootSecondaryFileSequenceoperator= (RootSecondaryFileSequence const &)=delete
 
 RootSecondaryFileSequence (ParameterSet const &pset, PoolSource &input, InputFileCatalog const &catalog)
 
 RootSecondaryFileSequence (RootSecondaryFileSequence const &)=delete
 
 ~RootSecondaryFileSequence () override
 
- Public Member Functions inherited from edm::RootInputFileSequence
void closeFile ()
 
bool containedInCurrentFile (RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
 
std::shared_ptr< BranchIDListHelper const > fileBranchIDListHelper () const
 
std::shared_ptr< ProductRegistry const > fileProductRegistry () const
 
void fillProcessBlockHelper_ ()
 
bool nextProcessBlock_ (ProcessBlockPrincipal &)
 
RootInputFileSequenceoperator= (RootInputFileSequence const &)=delete
 
bool readEvent (EventPrincipal &cache)
 
bool readLuminosityBlock_ (LuminosityBlockPrincipal &lumiPrincipal)
 
std::shared_ptr< LuminosityBlockAuxiliaryreadLuminosityBlockAuxiliary_ ()
 
void readProcessBlock_ (ProcessBlockPrincipal &)
 
bool readRun_ (RunPrincipal &runPrincipal)
 
std::shared_ptr< RunAuxiliaryreadRunAuxiliary_ ()
 
 RootInputFileSequence (ParameterSet const &pset, InputFileCatalog const &catalog)
 
 RootInputFileSequence (RootInputFileSequence const &)=delete
 
bool skipToItem (RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, size_t fileNameHash=0U, bool currentFileFirst=true)
 
virtual ~RootInputFileSequence ()
 

Private Member Functions

void closeFile_ () override
 
void initFile_ (bool skipBadFiles) override
 
RootFileSharedPtr makeRootFile (std::shared_ptr< InputFile > filePtr) override
 

Private Attributes

std::vector< BranchIDassociationsFromSecondary_
 
bool enablePrefetching_
 
bool enforceGUIDInFileName_
 
PoolSourceinput_
 
std::vector< ProcessHistoryIDorderedProcessHistoryIDs_
 

Additional Inherited Members

- Protected Types inherited from edm::RootInputFileSequence
typedef std::shared_ptr< RootFileRootFileSharedPtr
 
- Protected Member Functions inherited from edm::RootInputFileSequence
bool atFirstFile () const
 
bool atLastFile () const
 
std::vector< FileCatalogItem > const & fileCatalogItems () const
 
std::vector< std::string > const & fileNames () const
 
std::vector< std::shared_ptr< IndexIntoFile > > const & indexesIntoFiles () const
 
void initFile (bool skipBadFiles)
 
void initTheFile (bool skipBadFiles, bool deleteIndexIntoFile, InputSource *input, char const *inputTypeName, InputType inputType)
 
std::string const & lfn () const
 
size_t lfnHash () const
 
std::string const & logicalFileName () const
 
bool noFiles () const
 
bool noMoreFiles () const
 
size_t numberOfFiles () const
 
std::shared_ptr< RootFile const > rootFile () const
 
std::shared_ptr< RootFile > & rootFile ()
 
size_t sequenceNumberOfFile () const
 
void setAtFileSequenceNumber (size_t offset)
 
void setAtFirstFile ()
 
void setAtNextFile ()
 
void setAtPreviousFile ()
 
void setIndexIntoFile (size_t index)
 
void setNoMoreFiles ()
 
bool skipToItemInNewFile (RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
 
bool skipToItemInNewFile (RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, size_t fileNameHash)
 
bool usedFallback () const
 

Detailed Description

Definition at line 28 of file RootSecondaryFileSequence.h.

Constructor & Destructor Documentation

◆ RootSecondaryFileSequence() [1/2]

edm::RootSecondaryFileSequence::RootSecondaryFileSequence ( ParameterSet const &  pset,
PoolSource input,
InputFileCatalog const &  catalog 
)
explicit

Definition at line 21 of file RootSecondaryFileSequence.cc.

References enablePrefetching_, edm::RootInputFileSequence::fileNames(), edm::storage::StorageFactory::get(), edm::RootInputFileSequence::initFile(), input_, edm::Service< T >::isAvailable(), edm::RootInputFileSequence::noMoreFiles(), edm::PoolSource::productRegistryUpdate(), edm::RootInputFileSequence::rootFile(), edm::RootInputFileSequence::setAtFirstFile(), edm::RootInputFileSequence::setAtNextFile(), edm::PoolSource::skipBadFiles(), edm::storage::StorageFactory::stagein(), and edm::ProductRegistry::updateFromInput().

25  input_(input),
27  enablePrefetching_(false),
28  enforceGUIDInFileName_(pset.getUntrackedParameter<bool>("enforceGUIDInFileName")) {
29  // The SiteLocalConfig controls the TTreeCache size and the prefetching settings.
31  if (pSLC.isAvailable()) {
32  enablePrefetching_ = pSLC->enablePrefetching();
33  }
34 
35  // Prestage the files
36  //NOTE: we do not want to stage in all secondary files since we can be given a list of
37  // thousands of files and prestaging all those files can cause a site to fail.
38  // So, we stage in the first secondary file only.
41 
42  // Open the first file.
45  if (rootFile())
46  break;
47  }
48  if (rootFile()) {
49  input_.productRegistryUpdate().updateFromInput(rootFile()->productRegistry()->productList());
50  }
51  }
void initFile(bool skipBadFiles)
bool skipBadFiles() const
Definition: PoolSource.h:40
ProductRegistry & productRegistryUpdate()
Definition: InputSource.h:330
std::vector< std::string > const & fileNames() const
static std::string const input
Definition: EdmProvDump.cc:50
std::shared_ptr< RootFile const > rootFile() const
void stagein(const std::string &url) const
void updateFromInput(ProductList const &other)
RootInputFileSequence(ParameterSet const &pset, InputFileCatalog const &catalog)
std::vector< ProcessHistoryID > orderedProcessHistoryIDs_
static const StorageFactory * get(void)

◆ ~RootSecondaryFileSequence()

edm::RootSecondaryFileSequence::~RootSecondaryFileSequence ( )
override

Definition at line 53 of file RootSecondaryFileSequence.cc.

53 {}

◆ RootSecondaryFileSequence() [2/2]

edm::RootSecondaryFileSequence::RootSecondaryFileSequence ( RootSecondaryFileSequence const &  )
delete

Member Function Documentation

◆ closeFile_()

void edm::RootSecondaryFileSequence::closeFile_ ( )
overrideprivatevirtual

Implements edm::RootInputFileSequence.

Definition at line 57 of file RootSecondaryFileSequence.cc.

References edm::RootInputFileSequence::rootFile().

57  {
58  // close the currently open file, if any, and delete the RootFile object.
59  if (rootFile()) {
60  rootFile()->close();
61  rootFile().reset();
62  }
63  }
std::shared_ptr< RootFile const > rootFile() const

◆ endJob()

void edm::RootSecondaryFileSequence::endJob ( void  )

◆ initAssociationsFromSecondary()

void edm::RootSecondaryFileSequence::initAssociationsFromSecondary ( std::set< BranchID > const &  associationsFromSecondary)

Definition at line 96 of file RootSecondaryFileSequence.cc.

References associationsFromSecondary_, and edm::RootInputFileSequence::rootFile().

96  {
97  for (auto const& branchID : associationsFromSecondary) {
98  associationsFromSecondary_.push_back(branchID);
99  }
100  rootFile()->initAssociationsFromSecondary(associationsFromSecondary_);
101  }
std::vector< BranchID > associationsFromSecondary_
std::shared_ptr< RootFile const > rootFile() const

◆ initFile_()

void edm::RootSecondaryFileSequence::initFile_ ( bool  skipBadFiles)
overrideprivatevirtual

Implements edm::RootInputFileSequence.

Definition at line 65 of file RootSecondaryFileSequence.cc.

References edm::RootInputFileSequence::initTheFile(), edm::SecondaryFile, and remoteMonitoring_LASER_era2018_cfg::skipBadFiles.

65  {
66  initTheFile(skipBadFiles, false, nullptr, "secondaryFiles", InputType::SecondaryFile);
67  }
void initTheFile(bool skipBadFiles, bool deleteIndexIntoFile, InputSource *input, char const *inputTypeName, InputType inputType)

◆ makeRootFile()

RootSecondaryFileSequence::RootFileSharedPtr edm::RootSecondaryFileSequence::makeRootFile ( std::shared_ptr< InputFile filePtr)
overrideprivatevirtual

Implements edm::RootInputFileSequence.

Definition at line 69 of file RootSecondaryFileSequence.cc.

References associationsFromSecondary_, edm::InputSource::branchIDListHelper(), edm::PoolSource::bypassVersionCheck(), edm::PoolSource::dropDescendants(), enablePrefetching_, enforceGUIDInFileName_, edm::RootInputFileSequence::fileNames(), edm::RootInputFileSequence::indexesIntoFiles(), input_, edm::PoolSource::labelRawDataLikeMC(), edm::RootInputFileSequence::logicalFileName(), edm::PoolSource::nStreams(), orderedProcessHistoryIDs_, edm::InputSource::processConfiguration(), edm::PoolSource::processHistoryRegistryForUpdate(), edm::InputSource::processingMode(), edm::PoolSource::productSelectorRules(), edm::PoolSource::runHelper(), edm::SecondaryFile, edm::RootInputFileSequence::sequenceNumberOfFile(), edm::InputSource::thinnedAssociationsHelper(), and edm::PoolSource::treeMaxVirtualSize().

70  {
71  size_t currentIndexIntoFile = sequenceNumberOfFile();
72  return std::make_shared<RootFile>(fileNames()[0],
75  filePtr,
76  input_.nStreams(),
79  input_.runHelper(),
88  currentIndexIntoFile,
94  }
bool labelRawDataLikeMC() const
Definition: PoolSource.h:43
std::string const & logicalFileName() const
std::vector< BranchID > associationsFromSecondary_
unsigned int nStreams() const
Definition: PoolSource.h:44
ProcessHistoryRegistry & processHistoryRegistryForUpdate()
Definition: InputSource.h:331
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper() const
Accessors for thinnedAssociationsHelper.
Definition: InputSource.h:155
std::vector< std::string > const & fileNames() const
RunHelperBase * runHelper()
Definition: PoolSource.h:47
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
Accessors for branchIDListHelper.
Definition: InputSource.h:143
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:194
int treeMaxVirtualSize() const
Definition: PoolSource.h:45
ProductSelectorRules const & productSelectorRules() const
Definition: PoolSource.h:46
bool bypassVersionCheck() const
Definition: PoolSource.h:42
std::vector< ProcessHistoryID > orderedProcessHistoryIDs_
bool dropDescendants() const
Definition: PoolSource.h:41
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:226
std::vector< std::shared_ptr< IndexIntoFile > > const & indexesIntoFiles() const

◆ operator=()

RootSecondaryFileSequence& edm::RootSecondaryFileSequence::operator= ( RootSecondaryFileSequence const &  )
delete

Member Data Documentation

◆ associationsFromSecondary_

std::vector<BranchID> edm::RootSecondaryFileSequence::associationsFromSecondary_
private

Definition at line 45 of file RootSecondaryFileSequence.h.

Referenced by initAssociationsFromSecondary(), and makeRootFile().

◆ enablePrefetching_

bool edm::RootSecondaryFileSequence::enablePrefetching_
private

Definition at line 47 of file RootSecondaryFileSequence.h.

Referenced by makeRootFile(), and RootSecondaryFileSequence().

◆ enforceGUIDInFileName_

bool edm::RootSecondaryFileSequence::enforceGUIDInFileName_
private

Definition at line 48 of file RootSecondaryFileSequence.h.

Referenced by makeRootFile().

◆ input_

PoolSource& edm::RootSecondaryFileSequence::input_
private

Definition at line 44 of file RootSecondaryFileSequence.h.

Referenced by makeRootFile(), and RootSecondaryFileSequence().

◆ orderedProcessHistoryIDs_

std::vector<ProcessHistoryID> edm::RootSecondaryFileSequence::orderedProcessHistoryIDs_
private

Definition at line 46 of file RootSecondaryFileSequence.h.

Referenced by makeRootFile().