File indexing completed on 2025-01-31 02:19:07
0001 #ifndef DataFormats_FWLite_LuminosityBlock_h
0002 #define DataFormats_FWLite_LuminosityBlock_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #include <typeinfo>
0022 #include <map>
0023 #include <vector>
0024 #include <memory>
0025 #include <cstring>
0026
0027 #include "Rtypes.h"
0028
0029
0030 #include "DataFormats/FWLite/interface/Run.h"
0031 #include "DataFormats/FWLite/interface/LuminosityBlockBase.h"
0032 #include "DataFormats/FWLite/interface/InternalDataKey.h"
0033 #include "DataFormats/FWLite/interface/EntryFinder.h"
0034 #include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h"
0035 #include "DataFormats/Provenance/interface/LuminosityBlockAuxiliary.h"
0036 #include "DataFormats/Provenance/interface/ProductDescriptionFwd.h"
0037 #include "FWCore/Utilities/interface/thread_safety_macros.h"
0038
0039
0040 namespace edm {
0041 class WrapperBase;
0042 class ProductRegistry;
0043 class EDProductGetter;
0044 class LuminosityBlockAux;
0045 class Timestamp;
0046 class TriggerResults;
0047 class TriggerNames;
0048 }
0049
0050 namespace fwlite {
0051 class Event;
0052 class BranchMapReader;
0053 class HistoryGetterBase;
0054 class DataGetterHelper;
0055 class RunFactory;
0056
0057 class LuminosityBlock : public LuminosityBlockBase {
0058 public:
0059
0060
0061 LuminosityBlock(TFile* iFile);
0062 LuminosityBlock(std::shared_ptr<BranchMapReader> branchMap, std::shared_ptr<RunFactory> runFactory);
0063 LuminosityBlock(const LuminosityBlock&) = delete;
0064 const LuminosityBlock& operator=(const LuminosityBlock&) = delete;
0065
0066 ~LuminosityBlock() override;
0067
0068 const LuminosityBlock& operator++() override;
0069
0070
0071 bool to(edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi);
0072
0073
0074 const LuminosityBlock& toBegin() override;
0075
0076
0077 virtual std::string const getBranchNameFor(std::type_info const&, char const*, char const*, char const*) const;
0078
0079
0080 using fwlite::LuminosityBlockBase::getByLabel;
0081 bool getByLabel(std::type_info const&, char const*, char const*, char const*, void*) const override;
0082
0083
0084 bool isValid() const;
0085 operator bool() const;
0086 bool atEnd() const override;
0087
0088 Long64_t size() const;
0089
0090 edm::LuminosityBlockAuxiliary const& luminosityBlockAuxiliary() const override;
0091
0092 std::vector<edm::ProductDescription> const& getProductDescriptions() const {
0093 return branchMap_->getProductDescriptions();
0094 }
0095
0096
0097
0098 edm::WrapperBase const* getByProductID(edm::ProductID const&) const;
0099
0100
0101 static void throwProductNotFoundException(std::type_info const&, char const*, char const*, char const*);
0102
0103
0104 fwlite::Run const& getRun() const;
0105
0106 private:
0107 friend class internal::ProductGetter;
0108 friend class LumiHistoryGetter;
0109
0110 const edm::ProcessHistory& history() const;
0111 void updateAux(Long_t lumiIndex) const;
0112
0113
0114
0115 CMS_SA_ALLOW mutable std::shared_ptr<BranchMapReader> branchMap_;
0116
0117 CMS_SA_ALLOW mutable std::shared_ptr<fwlite::Run> run_;
0118
0119
0120 CMS_SA_ALLOW mutable std::vector<char const*> labels_;
0121 CMS_SA_ALLOW mutable edm::ProcessHistoryMap historyMap_;
0122 CMS_SA_ALLOW mutable std::vector<std::string> procHistoryNames_;
0123 CMS_SA_ALLOW mutable edm::LuminosityBlockAuxiliary aux_;
0124 CMS_SA_ALLOW mutable EntryFinder entryFinder_;
0125 edm::LuminosityBlockAuxiliary const* pAux_;
0126 edm::LuminosityBlockAux const* pOldAux_;
0127 TBranch* auxBranch_;
0128 int fileVersion_;
0129
0130 DataGetterHelper dataHelper_;
0131 CMS_SA_ALLOW mutable std::shared_ptr<RunFactory> runFactory_;
0132 };
0133
0134 }
0135 #endif