CMS 3D CMS Logo

Run.h
Go to the documentation of this file.
1 #ifndef DataFormats_FWLite_Run_h
2 #define DataFormats_FWLite_Run_h
3 // -*- C++ -*-
4 //
5 // Package: FWLite/DataFormats
6 // Class : Run
7 //
16 //
17 // Original Author: Eric Vaandering
18 // Created: Wed Jan 13 15:01:20 EDT 2007
19 //
20 // system include files
21 #include <typeinfo>
22 #include <map>
23 #include <vector>
24 #include <memory>
25 #include <cstring>
26 
27 #include "Rtypes.h"
28 
29 // user include files
38 
39 // forward declarations
40 namespace edm {
41  class WrapperBase;
42  class ProductRegistry;
43  class BranchDescription;
44  class EDProductGetter;
45  class RunAux;
46  class Timestamp;
47  class TriggerResults;
48  class TriggerNames;
49 }
50 
51 namespace fwlite {
52  class Event;
53  class Run : public RunBase
54  {
55 
56  public:
57  // NOTE: Does NOT take ownership so iFile must remain around
58  // at least as long as Run
59  Run(TFile* iFile);
60  Run(std::shared_ptr<BranchMapReader> branchMap);
61  ~Run() override;
62 
63  const Run& operator++() override;
64 
66  bool to (edm::RunNumber_t run);
67 
68  // Go to the very first Event.
69  const Run& toBegin() override;
70 
71  // ---------- const member functions ---------------------
72  virtual std::string const getBranchNameFor(std::type_info const&,
73  char const*,
74  char const*,
75  char const*) const;
76 
77  // This function should only be called by fwlite::Handle<>
79  bool getByLabel(std::type_info const&, char const*, char const*, char const*, void*) const override;
80  //void getByBranchName(std::type_info const&, char const*, void*&) const;
81 
82  bool isValid() const;
83  operator bool () const;
84  bool atEnd() const override;
85 
86  Long64_t size() const;
87 
88  edm::RunAuxiliary const& runAuxiliary() const override;
89 
90  std::vector<edm::BranchDescription> const& getBranchDescriptions() const {
91  return branchMap_->getBranchDescriptions();
92  }
93 
94 // void setGetter(//Copy from Event if needed
95 
96  edm::WrapperBase const* getByProductID(edm::ProductID const&) const;
97 
98  // ---------- static member functions --------------------
99  static void throwProductNotFoundException(std::type_info const&, char const*, char const*, char const*);
100 
101  // ---------- member functions ---------------------------
102 
103  private:
105  friend class RunHistoryGetter;
106 
107  Run(const Run&) = delete; // stop default
108 
109  const Run& operator=(const Run&) = delete; // stop default
110 
111  const edm::ProcessHistory& history() const;
112  void updateAux(Long_t runIndex) const;
113 
114  // ---------- member data --------------------------------
115  mutable std::shared_ptr<BranchMapReader> branchMap_;
116 
117  //takes ownership of the strings used by the DataKey keys in data_
118  mutable std::vector<char const*> labels_;
120  mutable std::vector<std::string> procHistoryNames_;
125  TBranch* auxBranch_;
127 
129  };
130 
131 }
132 #endif
size
Write out results.
edm::RunAuxiliary const * pAux_
Definition: Run.h:123
TBranch * auxBranch_
Definition: Run.h:125
int fileVersion_
Definition: Run.h:126
virtual bool getByLabel(std::type_info const &, char const *, char const *, char const *, void *) const =0
EntryFinder entryFinder_
Definition: Run.h:122
std::vector< std::string > procHistoryNames_
Definition: Run.h:120
std::vector< edm::BranchDescription > const & getBranchDescriptions() const
Definition: Run.h:90
edm::RunAux const * pOldAux_
Definition: Run.h:124
edm::RunAuxiliary aux_
Definition: Run.h:121
std::shared_ptr< BranchMapReader > branchMap_
Definition: Run.h:115
fwlite::DataGetterHelper dataHelper_
Definition: Run.h:128
HLT enums.
edm::ProcessHistoryMap historyMap_
Definition: Run.h:119
std::vector< char const * > labels_
Definition: Run.h:118
unsigned int RunNumber_t
static void throwProductNotFoundException(char const *where, errors::ErrorCodes error, BranchID const &bid)
Definition: Principal.cc:48
std::map< ProcessHistoryID, ProcessHistory > ProcessHistoryMap