CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RootInputFileSequence.h
Go to the documentation of this file.
1 #ifndef IOPool_Input_RootInputFileSequence_h
2 #define IOPool_Input_RootInputFileSequence_h
3 
4 /*----------------------------------------------------------------------
5 
6 RootInputFileSequence: This is an InputSource
7 
8 ----------------------------------------------------------------------*/
9 
19 
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 namespace CLHEP {
25  class RandFlat;
26 }
27 
28 namespace edm {
29 
30  class DuplicateChecker;
31  class FileCatalogItem;
32  class InputFileCatalog;
34  class PoolSource;
35  class RootFile;
36 
38  public:
39  explicit RootInputFileSequence(ParameterSet const& pset,
42  unsigned int nStreams,
43  InputType inputType);
44  virtual ~RootInputFileSequence();
45 
46  RootInputFileSequence(RootInputFileSequence const&) = delete; // Disallow copying and moving
47  RootInputFileSequence& operator=(RootInputFileSequence const&) = delete; // Disallow copying and moving
48 
49  typedef boost::shared_ptr<RootFile> RootFileSharedPtr;
50  void readEvent(EventPrincipal& cache);
51  boost::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_();
53  boost::shared_ptr<RunAuxiliary> readRunAuxiliary_();
54  void readRun_(RunPrincipal& runPrincipal);
55  std::unique_ptr<FileBlock> readFile_();
56  void closeFile_();
57  void endJob();
60  bool skipEvents(int offset);
61  bool goToEvent(EventID const& eventID);
62  bool skipToItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, bool currentFileFirst = true);
64  void rewind_();
65  void readOneRandom(EventPrincipal& cache);
67  bool readOneSequential(EventPrincipal& cache);
69  void readOneSpecified(EventPrincipal& cache, EventID const& id);
70 
71  void dropUnwantedBranches_(std::vector<std::string> const& wantedBranches);
72  boost::shared_ptr<ProductRegistry const> fileProductRegistry() const;
73  boost::shared_ptr<BranchIDListHelper const> fileBranchIDListHelper() const;
76  static void fillDescription(ParameterSetDescription & desc);
79  private:
80  void initFile(bool skipBadFiles);
81  bool nextFile();
82  bool previousFile();
83  void rewindFile();
84  std::vector<FileCatalogItem> const& fileCatalogItems() const;
85 
86  boost::shared_ptr<ProductRegistry const> productRegistry() const;
89  int remainingEvents() const;
90  int remainingLuminosityBlocks() const;
91 
95  bool firstFile_;
97  std::vector<FileCatalogItem>::const_iterator fileIterBegin_;
98  std::vector<FileCatalogItem>::const_iterator fileIterEnd_;
99  std::vector<FileCatalogItem>::const_iterator fileIter_;
100  std::vector<FileCatalogItem>::const_iterator fileIterLastOpened_;
103 
104  std::unique_ptr<CLHEP::RandFlat> flatDistribution_;
105  std::vector<boost::shared_ptr<IndexIntoFile> > indexesIntoFiles_;
106  std::vector<ProcessHistoryID> orderedProcessHistoryIDs_;
107 
108  unsigned int nStreams_;
109  boost::shared_ptr<EventSkipperByID> eventSkipperByID_;
114  unsigned int treeCacheSize_;
118  boost::shared_ptr<DuplicateChecker> duplicateChecker_;
124  }; // class RootInputFileSequence
125 }
126 #endif
void readOneSpecified(EventPrincipal &cache, EventID const &id)
ProcessingController::ForwardState forwardState() const
boost::shared_ptr< ProductRegistry const > fileProductRegistry() const
std::vector< boost::shared_ptr< IndexIntoFile > > indexesIntoFiles_
InputType
Definition: InputType.h:5
void initFile(bool skipBadFiles)
bool goToEvent(EventID const &eventID)
ProductSelectorRules productSelectorRules_
boost::shared_ptr< BranchIDListHelper const > fileBranchIDListHelper() const
ProcessConfiguration const & processConfiguration() const
unsigned int EventNumber_t
Definition: EventID.h:30
boost::shared_ptr< RunAuxiliary > readRunAuxiliary_()
std::vector< FileCatalogItem >::const_iterator fileIter_
tuple lumi
Definition: fjr2json.py:35
ProductRegistry & productRegistryUpdate() const
boost::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_()
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
static void fillDescription(ParameterSetDescription &desc)
bool skipToItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, bool currentFileFirst=true)
static std::string const input
Definition: EdmProvDump.cc:44
bool readOneSequentialWithID(EventPrincipal &cache, LuminosityBlockID const &id)
void readOneRandom(EventPrincipal &cache)
std::vector< FileCatalogItem >::const_iterator fileIterLastOpened_
std::vector< FileCatalogItem > const & fileCatalogItems() const
ProcessHistoryRegistry const & processHistoryRegistry() const
boost::shared_ptr< DuplicateChecker > duplicateChecker_
bool readOneSequential(EventPrincipal &cache)
unsigned int offset(bool)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void dropUnwantedBranches_(std::vector< std::string > const &wantedBranches)
void readRun_(RunPrincipal &runPrincipal)
void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal)
std::unique_ptr< CLHEP::RandFlat > flatDistribution_
std::vector< ProcessHistoryID > orderedProcessHistoryIDs_
bool containedInCurrentFile(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
bool skipToItemInNewFile(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
std::unique_ptr< FileBlock > readFile_()
bool readOneRandomWithID(EventPrincipal &cache, LuminosityBlockID const &id)
InputSource::ItemType getNextItemType(RunNumber_t &run, LuminosityBlockNumber_t &lumi, EventNumber_t &event)
RootInputFileSequence(ParameterSet const &pset, PoolSource &input, InputFileCatalog const &catalog, unsigned int nStreams, InputType inputType)
std::vector< FileCatalogItem >::const_iterator fileIterBegin_
tuple skipBadFiles
Definition: example_cfg.py:64
boost::shared_ptr< EventSkipperByID > eventSkipperByID_
RootInputFileSequence & operator=(RootInputFileSequence const &)=delete
ProcessHistoryRegistry & processHistoryRegistryForUpdate()
std::vector< FileCatalogItem >::const_iterator fileIterEnd_
unsigned int RunNumber_t
Definition: EventRange.h:32
BranchDescription::MatchMode branchesMustMatch_
void readEvent(EventPrincipal &cache)
ProcessingController::ReverseState reverseState() const
boost::shared_ptr< RootFile > RootFileSharedPtr
boost::shared_ptr< ProductRegistry const > productRegistry() const
InputFileCatalog const & catalog_