File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed
Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -563,9 +563,13 @@ namespace edm {
563563 processingOrderMerge (*processHistoryRegistry_, processingOrder);
564564 newReg->setProcessOrder (processingOrder);
565565
566- // freeze the product registry
567- newReg->setFrozen (inputType != InputType::Primary);
568- productRegistry_.reset (newReg.release ());
566+ if (not processingOrder.empty ()) {
567+ // freeze the product registry
568+ newReg->setFrozen (inputType != InputType::Primary);
569+ productRegistry_.reset (newReg.release ());
570+ } else {
571+ productRegistry_ = std::make_shared<ProductRegistry>();
572+ }
569573 }
570574
571575 // Set up information from the product registry.
@@ -626,6 +630,7 @@ namespace edm {
626630
627631 RootFile::~RootFile () {}
628632
633+ bool RootFile::empty () const { return runTree_.entries () == 0 ; }
629634 void RootFile::readEntryDescriptionTree (EntryDescriptionMap& entryDescriptionMap, InputType inputType) {
630635 // Called only for old format files.
631636 // We use a smart pointer so the tree will be deleted after use, and not kept for the life of the file.
Original file line number Diff line number Diff line change @@ -155,6 +155,8 @@ namespace edm {
155155 std::array<bool , NumBranchTypes> const & hasNewlyDroppedBranch () const { return hasNewlyDroppedBranch_; }
156156 bool branchListIndexesUnchanged () const { return branchListIndexesUnchanged_; }
157157 bool modifiedIDs () const { return daqProvenanceHelper_.get () != nullptr ; }
158+ // Are there no data stored in the file?
159+ bool empty () const ;
158160 std::shared_ptr<FileBlock> createFileBlock ();
159161 void updateFileBlock (FileBlock&);
160162
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ namespace edm {
6666 // Open the first file.
6767 for (setAtFirstFile (); !noMoreFiles (); setAtNextFile ()) {
6868 initFile (input_.skipBadFiles ());
69- if (rootFile ())
69+ if (rootFile () and not rootFile ()-> empty () )
7070 break ;
7171 }
7272 if (rootFile ()) {
You can’t perform that action at this time.
0 commit comments