CMS 3D CMS Logo

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  ~PoolSource() override;
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_; }
45  int treeMaxVirtualSize() const { return treeMaxVirtualSize_; }
47  RunHelperBase* runHelper() { return runHelper_.get(); }
48 
49  static void fillDescriptions(ConfigurationDescriptions& descriptions);
50 
51  protected:
52  ItemType getNextItemType() override;
53  void readLuminosityBlock_(LuminosityBlockPrincipal& lumiPrincipal) override;
54  std::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_() override;
55  void readEvent_(EventPrincipal& eventPrincipal) override;
56 
57  private:
58  std::shared_ptr<RunAuxiliary> readRunAuxiliary_() override;
59  void readRun_(RunPrincipal& runPrincipal) override;
60  std::unique_ptr<FileBlock> readFile_() override;
61  void closeFile_() override;
62  void endJob() override;
63  bool readIt(EventID const& id, EventPrincipal& eventPrincipal, StreamContext& streamContext) override;
64  void skip(int offset) override;
65  bool goToEvent_(EventID const& eventID) override;
66  void rewind_() override;
67  bool randomAccess_() const override;
70 
71  std::pair<SharedResourcesAcquirer*, std::recursive_mutex*> resourceSharedWithDelayedReader_() override;
72 
78  std::vector<edm::propagate_const<std::unique_ptr<EventPrincipal>>> secondaryEventPrincipals_;
79  std::array<std::vector<BranchID>, NumBranchTypes> branchIDsToReplace_;
80 
81  unsigned int nStreams_;
89 
91  std::unique_ptr<SharedResourcesAcquirer>
92  resourceSharedWithDelayedReaderPtr_; // We do not use propagate_const because the acquirer is itself mutable.
93  std::shared_ptr<std::recursive_mutex> mutexSharedWithDelayedReader_;
96  }; // class PoolSource
97 } // namespace edm
98 #endif
edm::PoolSource::primaryFileSequence_
edm::propagate_const< std::unique_ptr< RootPrimaryFileSequence > > primaryFileSequence_
Definition: PoolSource.h:94
edm::PoolSource::secondaryRunPrincipal_
edm::propagate_const< std::shared_ptr< RunPrincipal > > secondaryRunPrincipal_
Definition: PoolSource.h:76
edm::PoolSource
Definition: PoolSource.h:32
edm::PoolSource::dropDescendants_
bool dropDescendants_
Definition: PoolSource.h:86
edm::PoolSource::labelRawDataLikeMC
bool labelRawDataLikeMC() const
Definition: PoolSource.h:43
RootServiceChecker.h
propagate_const.h
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::PoolSource::bypassVersionCheck_
bool bypassVersionCheck_
Definition: PoolSource.h:83
edm::LuminosityBlockPrincipal
Definition: LuminosityBlockPrincipal.h:31
edm::PoolSource::readLuminosityBlock_
void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal) override
Definition: PoolSource.cc:195
edm::InputSourceDescription
Definition: InputSourceDescription.h:20
edm::PoolSource::runHelper_
edm::propagate_const< std::unique_ptr< RunHelperBase > > runHelper_
Definition: PoolSource.h:90
edm::InputFileCatalog
Definition: InputFileCatalog.h:32
edm::PoolSource::resourceSharedWithDelayedReaderPtr_
std::unique_ptr< SharedResourcesAcquirer > resourceSharedWithDelayedReaderPtr_
Definition: PoolSource.h:92
edm::PoolSource::secondaryEventPrincipals_
std::vector< edm::propagate_const< std::unique_ptr< EventPrincipal > > > secondaryEventPrincipals_
Definition: PoolSource.h:78
InputFileCatalog.h
edm::PoolSource::nStreams
unsigned int nStreams() const
Definition: PoolSource.h:44
edm::PoolSource::skipBadFiles
bool skipBadFiles() const
Definition: PoolSource.h:40
edm::InputSource::processHistoryRegistryForUpdate
ProcessHistoryRegistry & processHistoryRegistryForUpdate()
Definition: InputSource.h:330
edm::PoolSource::~PoolSource
~PoolSource() override
Definition: PoolSource.cc:148
edm::NumBranchTypes
Definition: BranchType.h:11
edm::propagate_const
Definition: propagate_const.h:32
edm::ProcessingController::ForwardState
ForwardState
Definition: ProcessingController.h:31
edm::PoolSource::labelRawDataLikeMC_
bool labelRawDataLikeMC_
Definition: PoolSource.h:87
edm::EventPrincipal
Definition: EventPrincipal.h:46
edm::StreamContext
Definition: StreamContext.h:31
edm::RootServiceChecker
Definition: RootServiceChecker.h:5
edm::PoolSource::runHelper
RunHelperBase * runHelper()
Definition: PoolSource.h:47
edm::PoolSource::delayReadingEventProducts_
bool delayReadingEventProducts_
Definition: PoolSource.h:88
edm::PoolSource::readRun_
void readRun_(RunPrincipal &runPrincipal) override
Definition: PoolSource.cc:173
edm::PoolSource::nStreams_
unsigned int nStreams_
Definition: PoolSource.h:81
edm::PoolSource::readRunAuxiliary_
std::shared_ptr< RunAuxiliary > readRunAuxiliary_() override
Definition: PoolSource.cc:167
edm::PoolSource::readLuminosityBlockAuxiliary_
std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_() override
Definition: PoolSource.cc:169
edm::PoolSource::secondaryCatalog_
InputFileCatalog secondaryCatalog_
Definition: PoolSource.h:75
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
edm::ProductSelectorRules
Definition: ProductSelectorRules.h:24
edm::RunHelperBase
Definition: RunHelper.h:15
edm::PoolSource::resourceSharedWithDelayedReader_
std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > resourceSharedWithDelayedReader_() override
Definition: PoolSource.cc:264
edm::PoolSource::randomAccess_
bool randomAccess_() const override
Definition: PoolSource.cc:313
ProcessingController.h
edm::PoolSource::reverseState_
ProcessingController::ReverseState reverseState_() const override
Definition: PoolSource.cc:317
edm::PoolSource::forwardState_
ProcessingController::ForwardState forwardState_() const override
Definition: PoolSource.cc:315
edm::ParameterSet
Definition: ParameterSet.h:47
edm::PoolSource::treeMaxVirtualSize_
const int treeMaxVirtualSize_
Definition: PoolSource.h:84
edm::InputSource::productRegistryUpdate
ProductRegistry & productRegistryUpdate()
Definition: InputSource.h:329
edm::PoolSource::treeMaxVirtualSize
int treeMaxVirtualSize() const
Definition: PoolSource.h:45
edm::PoolSource::readIt
bool readIt(EventID const &id, EventPrincipal &eventPrincipal, StreamContext &streamContext) override
Definition: PoolSource.cc:240
edm::PoolSource::readEvent_
void readEvent_(EventPrincipal &eventPrincipal) override
Definition: PoolSource.cc:217
edm::PoolSource::skipBadFiles_
bool skipBadFiles_
Definition: PoolSource.h:82
edm::PoolSource::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: PoolSource.cc:276
BranchType.h
edm::PoolSource::mutexSharedWithDelayedReader_
std::shared_ptr< std::recursive_mutex > mutexSharedWithDelayedReader_
Definition: PoolSource.h:93
edm::InputSource::ItemType
ItemType
Definition: InputSource.h:78
edm::PoolSource::getNextItemType
ItemType getNextItemType() override
Definition: PoolSource.cc:249
edm::PoolSource::skip
void skip(int offset) override
Definition: PoolSource.cc:272
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
ConfigurationDescriptions
edm::PoolSource::productSelectorRules_
ProductSelectorRules productSelectorRules_
Definition: PoolSource.h:85
Frameworkfwd.h
InputSource.h
edm::PoolSource::readFile_
std::unique_ptr< FileBlock > readFile_() override
Definition: PoolSource.cc:157
edm::PoolSource::dropDescendants
bool dropDescendants() const
Definition: PoolSource.h:41
edm::PoolSource::endJob
void endJob() override
Definition: PoolSource.cc:150
edm::PoolSource::rootServiceChecker_
RootServiceChecker rootServiceChecker_
Definition: PoolSource.h:73
edm::PoolSource::rewind_
void rewind_() override
Definition: PoolSource.cc:269
edm::PoolSource::PoolSource
PoolSource(ParameterSet const &pset, InputSourceDescription const &desc)
Definition: PoolSource.cc:65
edm::PoolSource::branchIDsToReplace_
std::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
Definition: PoolSource.h:79
edm::InputSource
Definition: InputSource.h:76
edm::PoolSource::catalog_
InputFileCatalog catalog_
Definition: PoolSource.h:74
edm::PoolSource::productSelectorRules
ProductSelectorRules const & productSelectorRules() const
Definition: PoolSource.h:46
edm::RunPrincipal
Definition: RunPrincipal.h:34
edm::EventID
Definition: EventID.h:31
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
edm::ProcessingController::ReverseState
ReverseState
Definition: ProcessingController.h:38
edm::PoolSource::bypassVersionCheck
bool bypassVersionCheck() const
Definition: PoolSource.h:42
edm::PoolSource::closeFile_
void closeFile_() override
Definition: PoolSource.cc:165
edm::PoolSource::secondaryLumiPrincipal_
edm::propagate_const< std::shared_ptr< LuminosityBlockPrincipal > > secondaryLumiPrincipal_
Definition: PoolSource.h:77
edm::PoolSource::secondaryFileSequence_
edm::propagate_const< std::unique_ptr< RootSecondaryFileSequence > > secondaryFileSequence_
Definition: PoolSource.h:95
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
ProductSelectorRules.h
edm::PoolSource::goToEvent_
bool goToEvent_(EventID const &eventID) override
Definition: PoolSource.cc:274