CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 #if !defined(__CINT__) && !defined(__MAKECINT__)
21 // system include files
22 #include <typeinfo>
23 #include <map>
24 #include <vector>
25 #include <memory>
26 #include <cstring>
27 
28 #include "Rtypes.h"
29 
30 // user include files
39 
40 // forward declarations
41 namespace edm {
42  class WrapperBase;
43  class ProductRegistry;
44  class BranchDescription;
45  class EDProductGetter;
46  class RunAux;
47  class Timestamp;
48  class TriggerResults;
49  class TriggerNames;
50 }
51 
52 namespace fwlite {
53  class Event;
54  class Run : public RunBase
55  {
56 
57  public:
58  // NOTE: Does NOT take ownership so iFile must remain around
59  // at least as long as Run
60  Run(TFile* iFile);
61  Run(std::shared_ptr<BranchMapReader> branchMap);
62  virtual ~Run();
63 
64  const Run& operator++();
65 
67  bool to (edm::RunNumber_t run);
68 
69  // Go to the very first Event.
70  const Run& toBegin();
71 
72  // ---------- const member functions ---------------------
73  virtual std::string const getBranchNameFor(std::type_info const&,
74  char const*,
75  char const*,
76  char const*) const;
77 
78  // This function should only be called by fwlite::Handle<>
80  virtual bool getByLabel(std::type_info const&, char const*, char const*, char const*, void*) const;
81  //void getByBranchName(std::type_info const&, char const*, void*&) const;
82 
83  bool isValid() const;
84  operator bool () const;
85  virtual bool atEnd() const;
86 
87  Long64_t size() const;
88 
89  virtual edm::RunAuxiliary const& runAuxiliary() const;
90 
91  std::vector<edm::BranchDescription> const& getBranchDescriptions() const {
92  return branchMap_->getBranchDescriptions();
93  }
94 
95 // void setGetter(//Copy from Event if needed
96 
97  edm::WrapperBase const* getByProductID(edm::ProductID const&) const;
98 
99  // ---------- static member functions --------------------
100  static void throwProductNotFoundException(std::type_info const&, char const*, char const*, char const*);
101 
102  // ---------- member functions ---------------------------
103 
104  private:
106  friend class RunHistoryGetter;
107 
108  Run(const Run&); // stop default
109 
110  const Run& operator=(const Run&); // stop default
111 
112  const edm::ProcessHistory& history() const;
113  void updateAux(Long_t runIndex) const;
114 
115  // ---------- member data --------------------------------
116  mutable std::shared_ptr<BranchMapReader> branchMap_;
117 
118  //takes ownership of the strings used by the DataKey keys in data_
119  mutable std::vector<char const*> labels_;
121  mutable std::vector<std::string> procHistoryNames_;
126  TBranch* auxBranch_;
128 
130  };
131 
132 }
133 #endif /*__CINT__ */
134 #endif
TBranch * auxBranch_
Definition: Run.h:126
edm::RunAuxiliary * pAux_
Definition: Run.h:124
bool isValid() const
Definition: Run.cc:189
RunNumber_t run() const
Definition: RunBase.h:42
void updateAux(Long_t runIndex) const
Definition: Run.cc:242
Run(TFile *iFile)
Definition: Run.cc:44
int fileVersion_
Definition: Run.h:127
EntryFinder entryFinder_
Definition: Run.h:123
virtual ~Run()
Definition: Run.cc:135
virtual edm::RunAuxiliary const & runAuxiliary() const
Definition: Run.cc:234
virtual std::string const getBranchNameFor(std::type_info const &, char const *, char const *, char const *) const
Definition: Run.cc:210
virtual bool getByLabel(std::type_info const &, char const *, char const *, char const *, void *) const =0
std::vector< std::string > procHistoryNames_
Definition: Run.h:121
const edm::ProcessHistory & history() const
Definition: Run.cc:254
edm::RunAux * pOldAux_
Definition: Run.h:125
std::vector< edm::BranchDescription > const & getBranchDescriptions() const
Definition: Run.h:91
edm::RunAuxiliary aux_
Definition: Run.h:122
edm::WrapperBase const * getByProductID(edm::ProductID const &) const
Definition: Run.cc:317
static void throwProductNotFoundException(std::type_info const &, char const *, char const *, char const *)
Definition: Run.cc:328
const Run & operator=(const Run &)
std::shared_ptr< BranchMapReader > branchMap_
Definition: Run.h:116
const Run & operator++()
Definition: Run.cc:150
const Run & toBegin()
Definition: Run.cc:173
virtual bool getByLabel(std::type_info const &, char const *, char const *, char const *, void *) const
Definition: Run.cc:219
fwlite::DataGetterHelper dataHelper_
Definition: Run.h:129
virtual bool atEnd() const
Definition: Run.cc:202
edm::ProcessHistoryMap historyMap_
Definition: Run.h:120
std::vector< char const * > labels_
Definition: Run.h:119
unsigned int RunNumber_t
Long64_t size() const
Definition: Run.cc:183
std::map< ProcessHistoryID, ProcessHistory > ProcessHistoryMap
bool to(edm::RunNumber_t run)
Go to event by Run &amp; Run number.
Definition: Run.cc:162