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::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  enforceGUIDInFileName_(pset.getUntrackedParameter<bool>("enforceGUIDInFileName")) {
30 
31  // The SiteLocalConfig controls the TTreeCache size and the prefetching settings.
33  if(pSLC.isAvailable()) {
34  enablePrefetching_ = pSLC->enablePrefetching();
35  }
36 
37  // Prestage the files
38  //NOTE: we do not want to stage in all secondary files since we can be given a list of
39  // thousands of files and prestaging all those files can cause a site to fail.
40  // So, we stage in the first secondary file only.
43 
44  // Open the first file.
47  if(rootFile()) break;
48  }
49  if(rootFile()) {
50  input_.productRegistryUpdate().updateFromInput(rootFile()->productRegistry()->productList());
51  }
52  }
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 54 of file RootSecondaryFileSequence.cc.

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

Member Function Documentation

void edm::RootSecondaryFileSequence::closeFile_ ( )
overridevirtual

Implements edm::RootInputFileSequence.

Definition at line 63 of file RootSecondaryFileSequence.cc.

References edm::RootInputFileSequence::rootFile().

Referenced by endJob().

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

Definition at line 58 of file RootSecondaryFileSequence.cc.

References closeFile_().

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

Definition at line 104 of file RootSecondaryFileSequence.cc.

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

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

Implements edm::RootInputFileSequence.

Definition at line 71 of file RootSecondaryFileSequence.cc.

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

71  {
72  initTheFile(skipBadFiles, false, nullptr, "secondaryFiles", InputType::SecondaryFile);
73  }
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 76 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().

76  {
77  size_t currentIndexIntoFile = sequenceNumberOfFile();
78  return std::make_shared<RootFile>(
79  fileName(),
82  filePtr,
83  input_.nStreams(),
86  input_.runHelper(),
95  currentIndexIntoFile,
101  }
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().

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