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, PrincipalCache& cache, 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;
47  EventPrincipal* readEvent(EventPrincipal& cache, boost::shared_ptr<LuminosityBlockPrincipal> lb);
48  boost::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_();
49  boost::shared_ptr<LuminosityBlockPrincipal> readLuminosityBlock_(boost::shared_ptr<LuminosityBlockPrincipal> lbCache);
50  boost::shared_ptr<RunAuxiliary> readRunAuxiliary_();
51  boost::shared_ptr<RunPrincipal> readRun_(boost::shared_ptr<RunPrincipal> rpCache);
52  boost::shared_ptr<FileBlock> readFile_(PrincipalCache& cache);
53  void closeFile_();
54  void endJob();
56  bool skipEvents(int offset, PrincipalCache& cache);
57  bool goToEvent(EventID const& eventID);
58  bool skipToItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, bool currentFileFirst = true);
60  void rewind_();
61  void reset(PrincipalCache& cache);
67 
68  void dropUnwantedBranches_(std::vector<std::string> const& wantedBranches);
69  boost::shared_ptr<ProductRegistry const> fileProductRegistry() const;
70  static void fillDescription(ParameterSetDescription & desc);
73  private:
74  void initFile(bool skipBadFiles);
75  bool nextFile(PrincipalCache& cache);
76  bool previousFile(PrincipalCache& cache);
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_;
90  std::vector<FileCatalogItem>::const_iterator fileIterBegin_;
91  std::vector<FileCatalogItem>::const_iterator fileIterEnd_;
92  std::vector<FileCatalogItem>::const_iterator fileIter_;
93  std::vector<FileCatalogItem>::const_iterator fileIterLastOpened_;
97 
98  std::unique_ptr<CLHEP::RandFlat> flatDistribution_;
99  std::vector<boost::shared_ptr<IndexIntoFile> > indexesIntoFiles_;
100  std::vector<ProcessHistoryID> orderedProcessHistoryIDs_;
101 
102  boost::shared_ptr<EventSkipperByID> eventSkipperByID_;
108  unsigned int treeCacheSize_;
112  boost::shared_ptr<DuplicateChecker> duplicateChecker_;
116  }; // class RootInputFileSequence
117 }
118 #endif
boost::shared_ptr< RunPrincipal > readRun_(boost::shared_ptr< RunPrincipal > rpCache)
ProcessingController::ForwardState forwardState() const
boost::shared_ptr< ProductRegistry const > fileProductRegistry() const
std::vector< boost::shared_ptr< IndexIntoFile > > indexesIntoFiles_
void initFile(bool skipBadFiles)
bool goToEvent(EventID const &eventID)
ProcessConfiguration const & processConfiguration() const
unsigned int EventNumber_t
Definition: EventID.h:30
EventPrincipal * readEvent(EventPrincipal &cache, boost::shared_ptr< LuminosityBlockPrincipal > lb)
boost::shared_ptr< RunAuxiliary > readRunAuxiliary_()
EventPrincipal * readOneRandomWithID(LuminosityBlockID const &id)
std::vector< FileCatalogItem >::const_iterator fileIter_
tuple lumi
Definition: fjr2json.py:35
ProductRegistry & productRegistryUpdate() const
GroupSelectorRules groupSelectorRules_
boost::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_()
EventPrincipal * readOneSequentialWithID(LuminosityBlockID const &id)
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)
bool skipEvents(int offset, PrincipalCache &cache)
void reset(PrincipalCache &cache)
boost::shared_ptr< LuminosityBlockPrincipal > readLuminosityBlock_(boost::shared_ptr< LuminosityBlockPrincipal > lbCache)
std::vector< FileCatalogItem >::const_iterator fileIterLastOpened_
std::vector< FileCatalogItem > const & fileCatalogItems() const
boost::shared_ptr< DuplicateChecker > duplicateChecker_
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)
bool nextFile(PrincipalCache &cache)
RootInputFileSequence(ParameterSet const &pset, PoolSource const &input, InputFileCatalog const &catalog, PrincipalCache &cache, InputType::InputType inputType)
std::unique_ptr< CLHEP::RandFlat > flatDistribution_
boost::shared_ptr< FileBlock > readFile_(PrincipalCache &cache)
std::vector< ProcessHistoryID > orderedProcessHistoryIDs_
bool skipToItemInNewFile(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
std::vector< FileCatalogItem >::const_iterator fileIterBegin_
tuple skipBadFiles
Definition: example_cfg.py:64
author Stefano ARGIRO author Bill Tanenbaum
EventPrincipal * readOneSpecified(EventID const &id)
InputSource::ItemType getNextItemType()
boost::shared_ptr< EventSkipperByID > eventSkipperByID_
RootInputFileSequence & operator=(RootInputFileSequence const &)=delete
bool previousFile(PrincipalCache &cache)
std::vector< FileCatalogItem >::const_iterator fileIterEnd_
unsigned int RunNumber_t
Definition: EventRange.h:32
BranchDescription::MatchMode branchesMustMatch_
ProcessingController::ReverseState reverseState() const
BranchDescription::MatchMode parametersMustMatch_
InputType::InputType inputType_
boost::shared_ptr< RootFile > RootFileSharedPtr
boost::shared_ptr< ProductRegistry const > productRegistry() const
InputFileCatalog const & catalog_