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 <set>
22 #include <string>
23 #include <vector>
24 
25 namespace CLHEP {
26  class HepRandomEngine;
27 }
28 
29 namespace edm {
30 
31  class BranchID;
32  class DuplicateChecker;
33  class FileCatalogItem;
34  class InputFileCatalog;
36  class PoolSource;
37  class RootFile;
38 
40  public:
41  explicit RootInputFileSequence(ParameterSet const& pset,
44  unsigned int nStreams,
45  InputType inputType);
46  virtual ~RootInputFileSequence();
47 
48  RootInputFileSequence(RootInputFileSequence const&) = delete; // Disallow copying and moving
49  RootInputFileSequence& operator=(RootInputFileSequence const&) = delete; // Disallow copying and moving
50 
51  typedef std::shared_ptr<RootFile> RootFileSharedPtr;
52  void readEvent(EventPrincipal& cache);
53  std::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_();
55  std::shared_ptr<RunAuxiliary> readRunAuxiliary_();
56  void readRun_(RunPrincipal& runPrincipal);
57  std::unique_ptr<FileBlock> readFile_();
58  void closeFile_();
59  void endJob();
62  bool skipEvents(int offset);
63  bool goToEvent(EventID const& eventID);
64  bool skipToItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, bool currentFileFirst = true);
66  void rewind_();
67  void readOneRandom(EventPrincipal& cache, CLHEP::HepRandomEngine*);
68  bool readOneRandomWithID(EventPrincipal& cache, LuminosityBlockID const& id, CLHEP::HepRandomEngine*);
69  bool readOneSequential(EventPrincipal& cache);
71  void readOneSpecified(EventPrincipal& cache, EventID const& id);
72 
73  void dropUnwantedBranches_(std::vector<std::string> const& wantedBranches);
74  std::shared_ptr<ProductRegistry const> fileProductRegistry() const;
75  std::shared_ptr<BranchIDListHelper const> fileBranchIDListHelper() const;
78  static void fillDescription(ParameterSetDescription & desc);
81  void initAssociationsFromSecondary(std::set<BranchID> const&);
82  private:
83  void initFile(bool skipBadFiles);
84  bool nextFile();
85  bool previousFile();
86  void rewindFile();
87  std::vector<FileCatalogItem> const& fileCatalogItems() const;
88 
89  std::shared_ptr<ProductRegistry const> productRegistry() const;
92  int remainingEvents() const;
93  int remainingLuminosityBlocks() const;
94 
98  bool firstFile_;
100  std::vector<FileCatalogItem>::const_iterator fileIterBegin_;
101  std::vector<FileCatalogItem>::const_iterator fileIterEnd_;
102  std::vector<FileCatalogItem>::const_iterator fileIter_;
103  std::vector<FileCatalogItem>::const_iterator fileIterLastOpened_;
106 
107  std::vector<std::shared_ptr<IndexIntoFile> > indexesIntoFiles_;
108  std::vector<ProcessHistoryID> orderedProcessHistoryIDs_;
109  std::vector<BranchID> associationsFromSecondary_;
110 
111  unsigned int nStreams_;
112  std::shared_ptr<EventSkipperByID> eventSkipperByID_;
118  unsigned int treeCacheSize_;
122  std::shared_ptr<DuplicateChecker> duplicateChecker_;
128  }; // class RootInputFileSequence
129 }
130 #endif
void readOneSpecified(EventPrincipal &cache, EventID const &id)
ProcessingController::ForwardState forwardState() const
void readOneRandom(EventPrincipal &cache, CLHEP::HepRandomEngine *)
bool readOneRandomWithID(EventPrincipal &cache, LuminosityBlockID const &id, CLHEP::HepRandomEngine *)
InputType
Definition: InputType.h:5
void initFile(bool skipBadFiles)
bool goToEvent(EventID const &eventID)
ProductSelectorRules productSelectorRules_
ProcessConfiguration const & processConfiguration() const
std::vector< FileCatalogItem >::const_iterator fileIter_
tuple lumi
Definition: fjr2json.py:35
std::shared_ptr< EventSkipperByID > eventSkipperByID_
ProductRegistry & productRegistryUpdate() const
void initAssociationsFromSecondary(std::set< BranchID > const &)
std::shared_ptr< BranchIDListHelper const > fileBranchIDListHelper() const
unsigned long long EventNumber_t
unsigned int LuminosityBlockNumber_t
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)
std::shared_ptr< RootFile > RootFileSharedPtr
std::vector< BranchID > associationsFromSecondary_
std::shared_ptr< DuplicateChecker > duplicateChecker_
std::vector< FileCatalogItem >::const_iterator fileIterLastOpened_
std::vector< FileCatalogItem > const & fileCatalogItems() const
ProcessHistoryRegistry const & processHistoryRegistry() const
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)
std::vector< std::shared_ptr< IndexIntoFile > > indexesIntoFiles_
void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal)
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_()
std::shared_ptr< RunAuxiliary > readRunAuxiliary_()
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
std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_()
RootInputFileSequence & operator=(RootInputFileSequence const &)=delete
ProcessHistoryRegistry & processHistoryRegistryForUpdate()
std::vector< FileCatalogItem >::const_iterator fileIterEnd_
unsigned int RunNumber_t
BranchDescription::MatchMode branchesMustMatch_
void readEvent(EventPrincipal &cache)
std::shared_ptr< ProductRegistry const > fileProductRegistry() const
ProcessingController::ReverseState reverseState() const
std::shared_ptr< ProductRegistry const > productRegistry() const
InputFileCatalog const & catalog_