File indexing completed on 2023-03-17 10:49:50
0001 #ifndef DataFormats_FWLite_Run_h
0002 #define DataFormats_FWLite_Run_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/RunBase.h"
0031 #include "DataFormats/FWLite/interface/InternalDataKey.h"
0032 #include "DataFormats/FWLite/interface/EntryFinder.h"
0033 #include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h"
0034 #include "DataFormats/Provenance/interface/RunAuxiliary.h"
0035 #include "DataFormats/Provenance/interface/RunID.h"
0036 #include "FWCore/FWLite/interface/BranchMapReader.h"
0037 #include "DataFormats/FWLite/interface/DataGetterHelper.h"
0038 #include "FWCore/Utilities/interface/thread_safety_macros.h"
0039
0040
0041 namespace edm {
0042 class WrapperBase;
0043 class ProductRegistry;
0044 class BranchDescription;
0045 class EDProductGetter;
0046 class RunAux;
0047 class Timestamp;
0048 class TriggerResults;
0049 class TriggerNames;
0050 }
0051
0052 namespace fwlite {
0053 class Event;
0054 class Run : public RunBase {
0055 public:
0056
0057
0058 Run(TFile* iFile);
0059 Run(std::shared_ptr<BranchMapReader> branchMap);
0060 Run(const Run&) = delete;
0061 const Run& operator=(const Run&) = delete;
0062
0063 ~Run() override;
0064
0065 const Run& operator++() override;
0066
0067
0068 bool to(edm::RunNumber_t run);
0069
0070
0071 const Run& toBegin() override;
0072
0073
0074 virtual std::string const getBranchNameFor(std::type_info const&, char const*, char const*, char const*) const;
0075
0076
0077 using fwlite::RunBase::getByLabel;
0078 bool getByLabel(std::type_info const&, char const*, char const*, char const*, void*) const override;
0079
0080
0081 bool isValid() const;
0082 operator bool() const;
0083 bool atEnd() const override;
0084
0085 Long64_t size() const;
0086
0087 edm::RunAuxiliary const& runAuxiliary() const override;
0088
0089 std::vector<edm::BranchDescription> const& getBranchDescriptions() const {
0090 return branchMap_->getBranchDescriptions();
0091 }
0092
0093
0094
0095 edm::WrapperBase const* getByProductID(edm::ProductID const&) const;
0096
0097
0098 static void throwProductNotFoundException(std::type_info const&, char const*, char const*, char const*);
0099
0100
0101
0102 private:
0103 friend class internal::ProductGetter;
0104 friend class RunHistoryGetter;
0105
0106 const edm::ProcessHistory& history() const;
0107 void updateAux(Long_t runIndex) const;
0108
0109
0110
0111 CMS_SA_ALLOW mutable std::shared_ptr<BranchMapReader> branchMap_;
0112
0113
0114 CMS_SA_ALLOW mutable std::vector<char const*> labels_;
0115 CMS_SA_ALLOW mutable edm::ProcessHistoryMap historyMap_;
0116 CMS_SA_ALLOW mutable std::vector<std::string> procHistoryNames_;
0117 CMS_SA_ALLOW mutable edm::RunAuxiliary aux_;
0118 CMS_SA_ALLOW mutable EntryFinder entryFinder_;
0119 edm::RunAuxiliary const* pAux_;
0120 edm::RunAux const* pOldAux_;
0121 TBranch* auxBranch_;
0122 int fileVersion_;
0123
0124 fwlite::DataGetterHelper dataHelper_;
0125 };
0126
0127 }
0128 #endif