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 #include "boost/shared_ptr.hpp"
28 
29 #include "Rtypes.h"
30 
31 // user include files
40 
41 // forward declarations
42 namespace edm {
43  class WrapperHolder;
44  class ProductRegistry;
45  class BranchDescription;
46  class EDProductGetter;
47  class RunAux;
48  class Timestamp;
49  class TriggerResults;
50  class TriggerNames;
51 }
52 
53 namespace fwlite {
54  class Event;
55  class Run : public RunBase
56  {
57 
58  public:
59  // NOTE: Does NOT take ownership so iFile must remain around
60  // at least as long as Run
61  Run(TFile* iFile);
62  Run(boost::shared_ptr<BranchMapReader> branchMap);
63  virtual ~Run();
64 
65  const Run& operator++();
66 
68  bool to (edm::RunNumber_t run);
69 
70  // Go to the very first Event.
71  const Run& toBegin();
72 
73  // ---------- const member functions ---------------------
74  virtual std::string const getBranchNameFor(std::type_info const&,
75  char const*,
76  char const*,
77  char const*) const;
78 
79  // This function should only be called by fwlite::Handle<>
81  virtual bool getByLabel(std::type_info const&, char const*, char const*, char const*, void*) const;
82  virtual bool getByLabel(std::type_info const&, char const*, char const*, char const*, edm::WrapperHolder&) const;
83  //void getByBranchName(std::type_info const&, char const*, void*&) const;
84 
85  bool isValid() const;
86  operator bool () const;
87  virtual bool atEnd() const;
88 
89  Long64_t size() const;
90 
91  virtual edm::RunAuxiliary const& runAuxiliary() const;
92 
93  std::vector<edm::BranchDescription> const& getBranchDescriptions() const {
94  return branchMap_->getBranchDescriptions();
95  }
96 
97 // void setGetter(//Copy from Event if needed
98 
100 
101  // ---------- static member functions --------------------
102  static void throwProductNotFoundException(std::type_info const&, char const*, char const*, char const*);
103 
104  // ---------- member functions ---------------------------
105 
106  private:
108  friend class RunHistoryGetter;
109 
110  Run(const Run&); // stop default
111 
112  const Run& operator=(const Run&); // stop default
113 
114  const edm::ProcessHistory& history() const;
115  void updateAux(Long_t runIndex) const;
116 
117  // ---------- member data --------------------------------
118  mutable boost::shared_ptr<BranchMapReader> branchMap_;
119 
120  //takes ownership of the strings used by the DataKey keys in data_
121  mutable std::vector<char const*> labels_;
123  mutable std::vector<std::string> procHistoryNames_;
128  TBranch* auxBranch_;
130 
132  };
133 
134 }
135 #endif /*__CINT__ */
136 #endif
TBranch * auxBranch_
Definition: Run.h:128
edm::RunAuxiliary * pAux_
Definition: Run.h:126
bool isValid() const
Definition: Run.cc:189
RunNumber_t run() const
Definition: RunBase.h:42
void updateAux(Long_t runIndex) const
Definition: Run.cc:255
Run(TFile *iFile)
Definition: Run.cc:44
int fileVersion_
Definition: Run.h:129
edm::WrapperHolder getByProductID(edm::ProductID const &) const
Definition: Run.cc:331
ProcessHistoryRegistry::collection_type ProcessHistoryMap
EntryFinder entryFinder_
Definition: Run.h:125
virtual ~Run()
Definition: Run.cc:135
virtual edm::RunAuxiliary const & runAuxiliary() const
Definition: Run.cc:247
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:123
const edm::ProcessHistory & history() const
Definition: Run.cc:267
edm::RunAux * pOldAux_
Definition: Run.h:127
std::vector< edm::BranchDescription > const & getBranchDescriptions() const
Definition: Run.h:93
edm::RunAuxiliary aux_
Definition: Run.h:124
static void throwProductNotFoundException(std::type_info const &, char const *, char const *, char const *)
Definition: Run.cc:342
const Run & operator=(const Run &)
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:131
virtual bool atEnd() const
Definition: Run.cc:202
edm::ProcessHistoryMap historyMap_
Definition: Run.h:122
std::vector< char const * > labels_
Definition: Run.h:121
boost::shared_ptr< BranchMapReader > branchMap_
Definition: Run.h:118
unsigned int RunNumber_t
Definition: EventRange.h:32
Long64_t size() const
Definition: Run.cc:183
bool to(edm::RunNumber_t run)
Go to event by Run &amp; Run number.
Definition: Run.cc:162