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 
10 #include "InputType.h"
11 
20 
21 #include <memory>
22 #include <string>
23 #include <vector>
24 
25 namespace CLHEP {
26  class RandFlat;
27 }
28 
29 namespace edm {
30 
31  class DuplicateChecker;
32  class FileCatalogItem;
33  class InputFileCatalog;
35  class PoolSource;
36  class RootFile;
37 
39  public:
40  explicit RootInputFileSequence(ParameterSet const& pset, PoolSource const& input, InputFileCatalog const& catalog, InputType::InputType inputType);
41  virtual ~RootInputFileSequence();
42 
43  RootInputFileSequence(RootInputFileSequence const&) = delete; // Disallow copying and moving
44  RootInputFileSequence& operator=(RootInputFileSequence const&) = delete; // Disallow copying and moving
45 
46  typedef boost::shared_ptr<RootFile> RootFileSharedPtr;
48  boost::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_();
49  boost::shared_ptr<LuminosityBlockPrincipal> readLuminosityBlock_(boost::shared_ptr<LuminosityBlockPrincipal> lumiPrincipal);
50  boost::shared_ptr<RunAuxiliary> readRunAuxiliary_();
51  boost::shared_ptr<RunPrincipal> readRun_(boost::shared_ptr<RunPrincipal> runPrincipal);
52  std::unique_ptr<FileBlock> readFile_();
53  void closeFile_();
54  void endJob();
56  bool skipEvents(int offset);
57  bool goToEvent(EventID const& eventID);
58  bool skipToItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, bool currentFileFirst = true);
60  void rewind_();
66 
67  void dropUnwantedBranches_(std::vector<std::string> const& wantedBranches);
68  boost::shared_ptr<ProductRegistry const> fileProductRegistry() const;
69  boost::shared_ptr<BranchIDListHelper const> fileBranchIDListHelper() const;
70  static void fillDescription(ParameterSetDescription & desc);
73  private:
74  void initFile(bool skipBadFiles);
75  bool nextFile();
76  bool previousFile();
77  void rewindFile();
78  std::vector<FileCatalogItem> const& fileCatalogItems() const;
79 
80  boost::shared_ptr<ProductRegistry const> productRegistry() const;
83  int remainingEvents() const;
84  int remainingLuminosityBlocks() const;
85 
89  bool firstFile_;
91  std::vector<FileCatalogItem>::const_iterator fileIterBegin_;
92  std::vector<FileCatalogItem>::const_iterator fileIterEnd_;
93  std::vector<FileCatalogItem>::const_iterator fileIter_;
94  std::vector<FileCatalogItem>::const_iterator fileIterLastOpened_;
98 
99  std::unique_ptr<CLHEP::RandFlat> flatDistribution_;
100  std::vector<boost::shared_ptr<IndexIntoFile> > indexesIntoFiles_;
101  std::vector<ProcessHistoryID> orderedProcessHistoryIDs_;
102 
103  boost::shared_ptr<EventSkipperByID> eventSkipperByID_;
108  unsigned int treeCacheSize_;
112  boost::shared_ptr<DuplicateChecker> duplicateChecker_;
118  }; // class RootInputFileSequence
119 }
120 #endif
ProcessingController::ForwardState forwardState() const
boost::shared_ptr< ProductRegistry const > fileProductRegistry() const
std::vector< boost::shared_ptr< IndexIntoFile > > indexesIntoFiles_
EventPrincipal * readOneSpecified(EventPrincipal &cache, EventID const &id)
void initFile(bool skipBadFiles)
bool goToEvent(EventID const &eventID)
ProductSelectorRules productSelectorRules_
boost::shared_ptr< BranchIDListHelper const > fileBranchIDListHelper() const
ProcessConfiguration const & processConfiguration() const
EventPrincipal * readEvent(EventPrincipal &cache)
unsigned int EventNumber_t
Definition: EventID.h:30
boost::shared_ptr< LuminosityBlockPrincipal > readLuminosityBlock_(boost::shared_ptr< LuminosityBlockPrincipal > lumiPrincipal)
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)
EventPrincipal * readOneSequentialWithID(EventPrincipal &cache, LuminosityBlockID const &id)
std::vector< FileCatalogItem >::const_iterator fileIterLastOpened_
EventPrincipal * readOneRandomWithID(EventPrincipal &cache, LuminosityBlockID const &id)
std::vector< FileCatalogItem > const & fileCatalogItems() const
RootInputFileSequence(ParameterSet const &pset, PoolSource const &input, InputFileCatalog const &catalog, InputType::InputType inputType)
boost::shared_ptr< DuplicateChecker > duplicateChecker_
EventPrincipal * readOneRandom(EventPrincipal &cache)
EventPrincipal * 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)
std::unique_ptr< CLHEP::RandFlat > flatDistribution_
std::vector< ProcessHistoryID > orderedProcessHistoryIDs_
bool skipToItemInNewFile(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
std::unique_ptr< FileBlock > readFile_()
std::vector< FileCatalogItem >::const_iterator fileIterBegin_
tuple skipBadFiles
Definition: example_cfg.py:64
InputSource::ItemType getNextItemType()
boost::shared_ptr< EventSkipperByID > eventSkipperByID_
RootInputFileSequence & operator=(RootInputFileSequence const &)=delete
std::vector< FileCatalogItem >::const_iterator fileIterEnd_
unsigned int RunNumber_t
Definition: EventRange.h:32
BranchDescription::MatchMode branchesMustMatch_
ProcessingController::ReverseState reverseState() const
BranchDescription::MatchMode parametersMustMatch_
boost::shared_ptr< RunPrincipal > readRun_(boost::shared_ptr< RunPrincipal > runPrincipal)
InputType::InputType inputType_
boost::shared_ptr< RootFile > RootFileSharedPtr
boost::shared_ptr< ProductRegistry const > productRegistry() const
InputFileCatalog const & catalog_