test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PoolSource.h
Go to the documentation of this file.
1 #ifndef IOPool_Input_PoolSource_h
2 #define IOPool_Input_PoolSource_h
3 
4 /*----------------------------------------------------------------------
5 
6 PoolSource: This is an InputSource
7 
8 ----------------------------------------------------------------------*/
9 
18 
19 #include <array>
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 namespace edm {
25 
27  class FileCatalogItem;
28  class RootPrimaryFileSequence;
29  class RootSecondaryFileSequence;
30  class RunHelperBase;
31 
32  class PoolSource : public InputSource {
33  public:
34  explicit PoolSource(ParameterSet const& pset, InputSourceDescription const& desc);
35  virtual ~PoolSource();
38 
39  // const accessors
40  bool skipBadFiles() const {return skipBadFiles_;}
41  bool dropDescendants() const {return dropDescendants_;}
42  bool bypassVersionCheck() const {return bypassVersionCheck_;}
43  bool labelRawDataLikeMC() const {return labelRawDataLikeMC_;}
44  unsigned int nStreams() const {return nStreams_;}
47  RunHelperBase* runHelper() {return runHelper_.get();}
48 
49  static void fillDescriptions(ConfigurationDescriptions& descriptions);
50 
51  private:
52  virtual void readEvent_(EventPrincipal& eventPrincipal) override;
53  virtual std::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_() override;
54  virtual void readLuminosityBlock_(LuminosityBlockPrincipal& lumiPrincipal) override;
55  virtual std::shared_ptr<RunAuxiliary> readRunAuxiliary_() override;
56  virtual void readRun_(RunPrincipal& runPrincipal) override;
57  virtual std::unique_ptr<FileBlock> readFile_() override;
58  virtual void closeFile_() override;
59  virtual void endJob() override;
60  virtual ItemType getNextItemType() override;
61  virtual bool readIt(EventID const& id, EventPrincipal& eventPrincipal, StreamContext& streamContext) override;
62  virtual void skip(int offset) override;
63  virtual bool goToEvent_(EventID const& eventID) override;
64  virtual void rewind_() override;
65  virtual void preForkReleaseResources() override;
66  virtual bool randomAccess_() const override;
67  virtual ProcessingController::ForwardState forwardState_() const override;
68  virtual ProcessingController::ReverseState reverseState_() const override;
69 
70  std::pair<SharedResourcesAcquirer*,std::recursive_mutex*> resourceSharedWithDelayedReader_() override;
71 
77  std::vector<edm::propagate_const<std::unique_ptr<EventPrincipal>>> secondaryEventPrincipals_;
78  std::array<std::vector<BranchID>, NumBranchTypes> branchIDsToReplace_;
79 
80  unsigned int nStreams_;
87 
89  std::unique_ptr<SharedResourcesAcquirer> resourceSharedWithDelayedReaderPtr_; // We do not use propagate_const because the acquirer is itself mutable.
90  std::shared_ptr<std::recursive_mutex> mutexSharedWithDelayedReader_;
93  }; // class PoolSource
94 }
95 #endif
bool bypassVersionCheck_
Definition: PoolSource.h:82
virtual void preForkReleaseResources() override
Definition: PoolSource.cc:277
edm::propagate_const< std::unique_ptr< RootSecondaryFileSequence > > secondaryFileSequence_
Definition: PoolSource.h:92
PoolSource(ParameterSet const &pset, InputSourceDescription const &desc)
Definition: PoolSource.cc:65
virtual bool goToEvent_(EventID const &eventID) override
Definition: PoolSource.cc:299
InputFileCatalog catalog_
Definition: PoolSource.h:73
std::unique_ptr< SharedResourcesAcquirer > resourceSharedWithDelayedReaderPtr_
Definition: PoolSource.h:89
ProductRegistry & productRegistryUpdate()
Definition: InputSource.h:356
edm::propagate_const< std::unique_ptr< RunHelperBase > > runHelper_
Definition: PoolSource.h:88
edm::propagate_const< std::shared_ptr< RunPrincipal > > secondaryRunPrincipal_
Definition: PoolSource.h:75
bool dropDescendants_
Definition: PoolSource.h:85
virtual void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal) override
Definition: PoolSource.cc:205
unsigned int nStreams_
Definition: PoolSource.h:80
virtual std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_() override
Definition: PoolSource.cc:176
std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > resourceSharedWithDelayedReader_() override
Definition: PoolSource.cc:282
RunHelperBase * runHelper()
Definition: PoolSource.h:47
virtual bool randomAccess_() const override
Definition: PoolSource.cc:338
virtual ProcessingController::ReverseState reverseState_() const override
Definition: PoolSource.cc:348
virtual void readRun_(RunPrincipal &runPrincipal) override
Definition: PoolSource.cc:181
std::vector< edm::propagate_const< std::unique_ptr< EventPrincipal > > > secondaryEventPrincipals_
Definition: PoolSource.h:77
virtual void readEvent_(EventPrincipal &eventPrincipal) override
Definition: PoolSource.cc:230
bool labelRawDataLikeMC_
Definition: PoolSource.h:86
virtual std::shared_ptr< RunAuxiliary > readRunAuxiliary_() override
Definition: PoolSource.cc:171
unsigned int nStreams() const
Definition: PoolSource.h:44
bool dropDescendants() const
Definition: PoolSource.h:41
virtual ~PoolSource()
Definition: PoolSource.cc:148
bool bypassVersionCheck() const
Definition: PoolSource.h:42
virtual ItemType getNextItemType() override
Definition: PoolSource.cc:261
int const treeMaxVirtualSize_
Definition: PoolSource.h:83
int treeMaxVirtualSize() const
Definition: PoolSource.h:45
InputFileCatalog secondaryCatalog_
Definition: PoolSource.h:74
bool skipBadFiles() const
Definition: PoolSource.h:40
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: PoolSource.cc:304
virtual ProcessingController::ForwardState forwardState_() const override
Definition: PoolSource.cc:343
virtual bool readIt(EventID const &id, EventPrincipal &eventPrincipal, StreamContext &streamContext) override
Definition: PoolSource.cc:252
bool labelRawDataLikeMC() const
Definition: PoolSource.h:43
std::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
Definition: PoolSource.h:78
ProductSelectorRules productSelectorRules_
Definition: PoolSource.h:84
bool skipBadFiles_
Definition: PoolSource.h:81
virtual void endJob() override
Definition: PoolSource.cc:151
ProcessHistoryRegistry & processHistoryRegistryForUpdate()
Definition: InputSource.h:357
virtual void skip(int offset) override
Definition: PoolSource.cc:294
RootServiceChecker rootServiceChecker_
Definition: PoolSource.h:72
virtual std::unique_ptr< FileBlock > readFile_() override
Definition: PoolSource.cc:158
std::shared_ptr< std::recursive_mutex > mutexSharedWithDelayedReader_
Definition: PoolSource.h:90
virtual void rewind_() override
Definition: PoolSource.cc:288
edm::propagate_const< std::shared_ptr< LuminosityBlockPrincipal > > secondaryLumiPrincipal_
Definition: PoolSource.h:76
edm::propagate_const< std::unique_ptr< RootPrimaryFileSequence > > primaryFileSequence_
Definition: PoolSource.h:91
virtual void closeFile_() override
Definition: PoolSource.cc:166
ProductSelectorRules const & productSelectorRules() const
Definition: PoolSource.h:46