CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EmbeddedRootSource.cc
Go to the documentation of this file.
1 /*----------------------------------------------------------------------
2 ----------------------------------------------------------------------*/
3 #include "EmbeddedRootSource.h"
4 #include "InputFile.h"
9 
10 namespace edm {
11 
12  class EventID;
13  class EventPrincipal;
14 
16  VectorInputSource(pset, desc),
17  rootServiceChecker_(),
18  catalog_(pset.getUntrackedParameter<std::vector<std::string> >("fileNames"),
19  pset.getUntrackedParameter<std::string>("overrideCatalog", std::string())),
20  fileSequence_(new RootEmbeddedFileSequence(pset, *this, catalog_, desc.allocations_->numberOfStreams())) {
21  }
22 
24 
25  void
27  }
28 
29  void
31  fileSequence_->endJob();
33  }
34 
36  fileSequence_->closeFile_();
37  }
38 
39  bool
40  EmbeddedRootSource::readOneEvent(EventPrincipal& cache, size_t& fileNameHash, CLHEP::HepRandomEngine* engine, EventID const* id) {
41  return fileSequence_->readOneEvent(cache, fileNameHash, engine, id);
42  }
43 
44  void
46  fileSequence_->readOneSpecified(cache, fileNameHash, id);
47  }
48 
49  void
50  EmbeddedRootSource::dropUnwantedBranches_(std::vector<std::string> const& wantedBranches) {
51  fileSequence_->dropUnwantedBranches_(wantedBranches);
52  }
53 
54  void
56 
58 
59  std::vector<std::string> defaultStrings;
60  desc.setComment("Reads EDM/Root files for mixing.");
61  desc.addUntracked<std::vector<std::string> >("fileNames")
62  ->setComment("Names of files to be processed.");
63  desc.addUntracked<std::string>("overrideCatalog", std::string());
65 
66  descriptions.add("source", desc);
67  }
68 }
virtual void dropUnwantedBranches_(std::vector< std::string > const &wantedBranches)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
std::unique_ptr< RootEmbeddedFileSequence > fileSequence_
void setComment(std::string const &value)
virtual void readOneSpecified(EventPrincipal &cache, size_t &fileNameHash, SecondaryEventIDAndFileInfo const &id)
static void reportReadBranches()
Definition: InputFile.cc:113
EmbeddedRootSource(ParameterSet const &pset, VectorInputSourceDescription const &desc)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
virtual bool readOneEvent(EventPrincipal &cache, size_t &fileNameHash, CLHEP::HepRandomEngine *, EventID const *id) override
static void fillDescription(ParameterSetDescription &desc)
void add(std::string const &label, ParameterSetDescription const &psetDescription)