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

24  :
26  input_(input),
28  enablePrefetching_(false) {
29 
30  // The SiteLocalConfig controls the TTreeCache size and the prefetching settings.
32  if(pSLC.isAvailable()) {
33  enablePrefetching_ = pSLC->enablePrefetching();
34  }
35 
36  // Prestage the files
37  //NOTE: we do not want to stage in all secondary files since we can be given a list of
38  // thousands of files and prestaging all those files can cause a site to fail.
39  // So, we stage in the first secondary file only.
42 
43  // Open the first file.
46  if(rootFile()) break;
47  }
48  if(rootFile()) {
49  input_.productRegistryUpdate().updateFromInput(rootFile()->productRegistry()->productList());
50  }
51  }
void initFile(bool skipBadFiles)
ProductRegistry & productRegistryUpdate()
Definition: InputSource.h:334
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 ( )
override

Definition at line 53 of file RootSecondaryFileSequence.cc.

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

Member Function Documentation

void edm::RootSecondaryFileSequence::closeFile_ ( )
overridevirtual

Implements edm::RootInputFileSequence.

Definition at line 62 of file RootSecondaryFileSequence.cc.

References edm::RootInputFileSequence::rootFile().

Referenced by endJob().

62  {
63  // close the currently open file, if any, and delete the RootFile object.
64  if(rootFile()) {
65  rootFile()->close();
66  rootFile().reset();
67  }
68  }
std::shared_ptr< RootFile const > rootFile() const
void edm::RootSecondaryFileSequence::endJob ( void  )

Definition at line 57 of file RootSecondaryFileSequence.cc.

References closeFile_().

57  {
58  closeFile_();
59  }
void edm::RootSecondaryFileSequence::initAssociationsFromSecondary ( std::set< BranchID > const &  associationsFromSecondary)

Definition at line 102 of file RootSecondaryFileSequence.cc.

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

102  {
103  for(auto const& branchID : associationsFromSecondary) {
104  associationsFromSecondary_.push_back(branchID);
105  }
106  rootFile()->initAssociationsFromSecondary(associationsFromSecondary_);
107  }
std::vector< BranchID > associationsFromSecondary_
std::shared_ptr< RootFile const > rootFile() const
void edm::RootSecondaryFileSequence::initFile_ ( bool  skipBadFiles)
overrideprivatevirtual

Implements edm::RootInputFileSequence.

Definition at line 70 of file RootSecondaryFileSequence.cc.

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

70  {
71  initTheFile(skipBadFiles, false, nullptr, "secondaryFiles", InputType::SecondaryFile);
72  }
void initTheFile(bool skipBadFiles, bool deleteIndexIntoFile, InputSource *input, char const *inputTypeName, InputType inputType)
RootSecondaryFileSequence::RootFileSharedPtr edm::RootSecondaryFileSequence::makeRootFile ( std::shared_ptr< InputFile filePtr)
overrideprivatevirtual

Implements edm::RootInputFileSequence.

Definition at line 75 of file RootSecondaryFileSequence.cc.

References associationsFromSecondary_, edm::InputSource::branchIDListHelper(), edm::PoolSource::bypassVersionCheck(), edm::PoolSource::dropDescendants(), enablePrefetching_, 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().

75  {
76  size_t currentIndexIntoFile = sequenceNumberOfFile();
77  return std::make_shared<RootFile>(
78  fileName(),
81  filePtr,
82  input_.nStreams(),
85  input_.runHelper(),
94  currentIndexIntoFile,
99  }
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:240
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:172
bool labelRawDataLikeMC() const
Definition: PoolSource.h:43
ProcessHistoryRegistry & processHistoryRegistryForUpdate()
Definition: InputSource.h:335
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper() const
Accessors for thinnedAssociationsHelper.
Definition: InputSource.h:176
std::vector< ProcessHistoryID > orderedProcessHistoryIDs_
ProcessConfiguration const & processConfiguration() const
Accessor for Process Configuration.
Definition: InputSource.h:208
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().

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