CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 
virtual ~RootSecondaryFileSequence ()
 
- 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
 
RootInputFileSequenceoperator= (RootInputFileSequence const &)=delete
 
void readEvent (EventPrincipal &cache)
 
void readLuminosityBlock_ (LuminosityBlockPrincipal &lumiPrincipal)
 
std::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary_ ()
 
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 closeFile_ () override
 
virtual void initFile_ (bool skipBadFiles) override
 
virtual 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::string const & fallbackFileName () const
 
std::vector< FileCatalogItem >
const & 
fileCatalogItems () const
 
std::string const & fileName () 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

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

Definition at line 21 of file RootSecondaryFileSequence.cc.

References enablePrefetching_, edm::RootInputFileSequence::fileName(), StorageFactory::get(), edm::RootInputFileSequence::initFile(), input_, edm::Service< T >::isAvailable(), edm::RootInputFileSequence::noMoreFiles(), edm::InputSource::productRegistryUpdate(), edm::RootInputFileSequence::rootFile(), edm::RootInputFileSequence::setAtFirstFile(), edm::RootInputFileSequence::setAtNextFile(), edm::PoolSource::skipBadFiles(), 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)
ProductRegistry & productRegistryUpdate()
Definition: InputSource.h:350
std::string const & fileName() const
static std::string const input
Definition: EdmProvDump.cc:44
static const StorageFactory * get(void)
void stagein(const std::string &url) const
std::shared_ptr< RootFile const > rootFile() const
bool skipBadFiles() const
Definition: PoolSource.h:40
void updateFromInput(ProductList const &other)
RootInputFileSequence(ParameterSet const &pset, InputFileCatalog const &catalog)
std::vector< ProcessHistoryID > orderedProcessHistoryIDs_
edm::RootSecondaryFileSequence::~RootSecondaryFileSequence ( )
virtual

Definition at line 53 of file RootSecondaryFileSequence.cc.

53 {}
edm::RootSecondaryFileSequence::RootSecondaryFileSequence ( RootSecondaryFileSequence const &  )
delete

Member Function Documentation

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
void edm::RootSecondaryFileSequence::endJob ( void  )
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
void edm::RootSecondaryFileSequence::initFile_ ( bool  skipBadFiles)
overrideprivatevirtual

Implements edm::RootInputFileSequence.

Definition at line 65 of file RootSecondaryFileSequence.cc.

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

65  {
66  initTheFile(skipBadFiles, false, nullptr, "secondaryFiles", InputType::SecondaryFile);
67  }
void initTheFile(bool skipBadFiles, bool deleteIndexIntoFile, InputSource *input, char const *inputTypeName, InputType inputType)
tuple skipBadFiles
Definition: example_cfg.py:64
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::fileName(), edm::RootInputFileSequence::indexesIntoFiles(), input_, edm::PoolSource::labelRawDataLikeMC(), edm::RootInputFileSequence::logicalFileName(), edm::PoolSource::nStreams(), orderedProcessHistoryIDs_, edm::InputSource::processConfiguration(), edm::InputSource::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>(fileName(),
75  filePtr,
76  input_.nStreams(),
79  input_.runHelper(),
88  currentIndexIntoFile,
94  }
std::string const & logicalFileName() const
std::string const & fileName() const
std::vector< std::shared_ptr< IndexIntoFile > > const & indexesIntoFiles() const
ProcessingMode processingMode() const
RunsLumisAndEvents (default), RunsAndLumis, or Runs.
Definition: InputSource.h:256
std::vector< BranchID > associationsFromSecondary_
RunHelperBase * runHelper()
Definition: PoolSource.h:47
unsigned int nStreams() const
Definition: PoolSource.h:44
bool dropDescendants() const
Definition: PoolSource.h:41
bool bypassVersionCheck() const
Definition: PoolSource.h:42
int treeMaxVirtualSize() const
Definition: PoolSource.h:45
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
Accessors for branchIDListHelper.
Definition: InputSource.h:178
bool labelRawDataLikeMC() const
Definition: PoolSource.h:43
ProcessHistoryRegistry & processHistoryRegistryForUpdate()
Definition: InputSource.h:351
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper() const
Accessors for thinnedAssociationsHelper.
Definition: InputSource.h:182
std::vector< ProcessHistoryID > orderedProcessHistoryIDs_
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:214
ProductSelectorRules const & productSelectorRules() const
Definition: PoolSource.h:46
RootSecondaryFileSequence& edm::RootSecondaryFileSequence::operator= ( RootSecondaryFileSequence const &  )
delete

Member Data Documentation

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

Definition at line 46 of file RootSecondaryFileSequence.h.

Referenced by initAssociationsFromSecondary(), and makeRootFile().

bool edm::RootSecondaryFileSequence::enablePrefetching_
private

Definition at line 48 of file RootSecondaryFileSequence.h.

Referenced by makeRootFile(), and RootSecondaryFileSequence().

bool edm::RootSecondaryFileSequence::enforceGUIDInFileName_
private

Definition at line 49 of file RootSecondaryFileSequence.h.

Referenced by makeRootFile().

PoolSource& edm::RootSecondaryFileSequence::input_
private

Definition at line 45 of file RootSecondaryFileSequence.h.

Referenced by makeRootFile(), and RootSecondaryFileSequence().

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

Definition at line 47 of file RootSecondaryFileSequence.h.

Referenced by makeRootFile().