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 closeFile_ () override
 
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
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
 
RootInputFileSequenceoperator= (RootInputFileSequence const &)=delete
 
void readEvent (EventPrincipal &cache)
 
void readLuminosityBlock_ (LuminosityBlockPrincipal &lumiPrincipal)
 
std::shared_ptr< LuminosityBlockAuxiliaryreadLuminosityBlockAuxiliary_ ()
 
void 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 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 > & rootFile ()
 
std::shared_ptr< RootFile const > rootFile () const
 
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.

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  }

References enablePrefetching_, edm::RootInputFileSequence::fileNames(), 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(), StorageFactory::stagein(), and edm::ProductRegistry::updateFromInput().

◆ ~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_ ( )
overridevirtual

Implements edm::RootInputFileSequence.

Definition at line 57 of file RootSecondaryFileSequence.cc.

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  }

References edm::RootInputFileSequence::rootFile().

Referenced by endJob().

◆ endJob()

void edm::RootSecondaryFileSequence::endJob ( void  )

Definition at line 55 of file RootSecondaryFileSequence.cc.

55 { closeFile_(); }

References closeFile_().

◆ initAssociationsFromSecondary()

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

Definition at line 96 of file RootSecondaryFileSequence.cc.

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

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

◆ initFile_()

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

◆ makeRootFile()

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

Implements edm::RootInputFileSequence.

Definition at line 69 of file RootSecondaryFileSequence.cc.

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  }

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().

◆ 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().

edm::RootInputFileSequence::noMoreFiles
bool noMoreFiles() const
Definition: RootInputFileSequence.h:65
edm::RootSecondaryFileSequence::closeFile_
void closeFile_() override
Definition: RootSecondaryFileSequence.cc:57
input
static const std::string input
Definition: EdmProvDump.cc:48
edm::RootInputFileSequence::setAtFirstFile
void setAtFirstFile()
Definition: RootInputFileSequence.h:70
edm::RootSecondaryFileSequence::associationsFromSecondary_
std::vector< BranchID > associationsFromSecondary_
Definition: RootSecondaryFileSequence.h:45
edm::PoolSource::labelRawDataLikeMC
bool labelRawDataLikeMC() const
Definition: PoolSource.h:43
edm::PoolSource::productRegistryUpdate
ProductRegistry & productRegistryUpdate()
Definition: InputSource.h:326
getEcalConditions_orcoffint2r_cff.catalog
catalog
Definition: getEcalConditions_orcoffint2r_cff.py:40
edm::InputSource::thinnedAssociationsHelper
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper() const
Accessors for thinnedAssociationsHelper.
Definition: InputSource.h:165
edm::ProductRegistry::updateFromInput
void updateFromInput(ProductList const &other)
Definition: ProductRegistry.cc:221
edm::InputType::SecondaryFile
edm::PoolSource::nStreams
unsigned int nStreams() const
Definition: PoolSource.h:44
remoteMonitoring_LED_IterMethod_cfg.skipBadFiles
skipBadFiles
Definition: remoteMonitoring_LED_IterMethod_cfg.py:24
edm::RootInputFileSequence::logicalFileName
std::string const & logicalFileName() const
Definition: RootInputFileSequence.h:78
edm::PoolSource::skipBadFiles
bool skipBadFiles() const
Definition: PoolSource.h:40
edm::RootInputFileSequence::initFile
void initFile(bool skipBadFiles)
Definition: RootInputFileSequence.h:53
edm::RootSecondaryFileSequence::orderedProcessHistoryIDs_
std::vector< ProcessHistoryID > orderedProcessHistoryIDs_
Definition: RootSecondaryFileSequence.h:46
edm::PoolSource::processHistoryRegistryForUpdate
ProcessHistoryRegistry & processHistoryRegistryForUpdate()
Definition: InputSource.h:327
edm::RootSecondaryFileSequence::input_
PoolSource & input_
Definition: RootSecondaryFileSequence.h:44
edm::PoolSource::runHelper
RunHelperBase * runHelper()
Definition: PoolSource.h:47
StorageFactory::get
static const StorageFactory * get(void)
Definition: StorageFactory.cc:26
edm::RootInputFileSequence::setAtNextFile
void setAtNextFile()
Definition: RootInputFileSequence.h:73
Service
StorageFactory::stagein
void stagein(const std::string &url) const
Definition: StorageFactory.cc:157
edm::RootInputFileSequence::RootInputFileSequence
RootInputFileSequence(ParameterSet const &pset, InputFileCatalog const &catalog)
Definition: RootInputFileSequence.cc:22
edm::InputSource::processingMode
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:233
edm::RootSecondaryFileSequence::enforceGUIDInFileName_
bool enforceGUIDInFileName_
Definition: RootSecondaryFileSequence.h:48
edm::PoolSource::treeMaxVirtualSize
int treeMaxVirtualSize() const
Definition: PoolSource.h:45
edm::RootSecondaryFileSequence::enablePrefetching_
bool enablePrefetching_
Definition: RootSecondaryFileSequence.h:47
edm::RootInputFileSequence::rootFile
std::shared_ptr< RootFile const > rootFile() const
Definition: RootInputFileSequence.h:87
edm::InputSource::branchIDListHelper
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
Accessors for branchIDListHelper.
Definition: InputSource.h:159
edm::InputSource::processConfiguration
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:201
edm::PoolSource::dropDescendants
bool dropDescendants() const
Definition: PoolSource.h:41
edm::RootInputFileSequence::initTheFile
void initTheFile(bool skipBadFiles, bool deleteIndexIntoFile, InputSource *input, char const *inputTypeName, InputType inputType)
Definition: RootInputFileSequence.cc:182
edm::RootInputFileSequence::indexesIntoFiles
std::vector< std::shared_ptr< IndexIntoFile > > const & indexesIntoFiles() const
Definition: RootInputFileSequence.h:82
edm::PoolSource::productSelectorRules
ProductSelectorRules const & productSelectorRules() const
Definition: PoolSource.h:46
edm::PoolSource::bypassVersionCheck
bool bypassVersionCheck() const
Definition: PoolSource.h:42
edm::RootInputFileSequence::sequenceNumberOfFile
size_t sequenceNumberOfFile() const
Definition: RootInputFileSequence.h:67
edm::RootInputFileSequence::fileNames
std::vector< std::string > const & fileNames() const
Definition: RootInputFileSequence.h:76
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27