CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LuminosityBlock.h
Go to the documentation of this file.
1 #ifndef DataFormats_FWLite_LuminosityBlock_h
2 #define DataFormats_FWLite_LuminosityBlock_h
3 // -*- C++ -*-
4 //
5 // Package: FWLite/DataFormats
6 // Class : LuminosityBlock
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
37 
38 // forward declarations
39 namespace edm {
40  class WrapperBase;
41  class ProductRegistry;
42  class BranchDescription;
43  class EDProductGetter;
44  class LuminosityBlockAux;
45  class Timestamp;
46  class TriggerResults;
47  class TriggerNames;
48 }
49 
50 namespace fwlite {
51  class Event;
52  class BranchMapReader;
53  class HistoryGetterBase;
54  class DataGetterHelper;
55  class RunFactory;
56 
58  {
59 
60  public:
61  // NOTE: Does NOT take ownership so iFile must remain around
62  // at least as long as LuminosityBlock
63  LuminosityBlock(TFile* iFile);
64  LuminosityBlock(std::shared_ptr<BranchMapReader> branchMap, std::shared_ptr<RunFactory> runFactory);
65  virtual ~LuminosityBlock();
66 
67  const LuminosityBlock& operator++();
68 
71 
72  // Go to the very first Event.
73  const LuminosityBlock& toBegin();
74 
75  // ---------- const member functions ---------------------
76  virtual std::string const getBranchNameFor(std::type_info const&,
77  char const*,
78  char const*,
79  char const*) const;
80 
81  // This function should only be called by fwlite::Handle<>
83  virtual bool getByLabel(std::type_info const&, char const*, char const*, char const*, void*) const;
84  //void getByBranchName(std::type_info const&, char const*, void*&) const;
85 
86  bool isValid() const;
87  operator bool () const;
88  virtual bool atEnd() const;
89 
90  Long64_t size() const;
91 
93 
94  std::vector<edm::BranchDescription> const& getBranchDescriptions() const {
95  return branchMap_->getBranchDescriptions();
96  }
97 
98 // void setGetter(//Copy from Event if needed
99 
100  edm::WrapperBase const* getByProductID(edm::ProductID const&) const;
101 
102  // ---------- static member functions --------------------
103  static void throwProductNotFoundException(std::type_info const&, char const*, char const*, char const*);
104 
105  // ---------- member functions ---------------------------
106  fwlite::Run const& getRun() const;
107 
108  private:
110  friend class LumiHistoryGetter;
111 
112  LuminosityBlock(const LuminosityBlock&); // stop default
113 
114  const LuminosityBlock& operator=(const LuminosityBlock&); // stop default
115 
116  const edm::ProcessHistory& history() const;
117  void updateAux(Long_t lumiIndex) const;
118 
119 
120  // ---------- member data --------------------------------
121  mutable std::shared_ptr<BranchMapReader> branchMap_;
122 
123  mutable std::shared_ptr<fwlite::Run> run_;
124 
125  //takes ownership of the strings used by the DataKey keys in data_
126  mutable std::vector<char const*> labels_;
128  mutable std::vector<std::string> procHistoryNames_;
133  TBranch* auxBranch_;
135 
137  mutable std::shared_ptr<RunFactory> runFactory_;
138  };
139 
140 }
141 #endif /*__CINT__ */
142 #endif
DataGetterHelper dataHelper_
static void throwProductNotFoundException(std::type_info const &, char const *, char const *, char const *)
bool to(edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi)
Go to event by Run &amp; LuminosityBlock number.
edm::LuminosityBlockAuxiliary aux_
tuple lumi
Definition: fjr2json.py:35
edm::WrapperBase const * getByProductID(edm::ProductID const &) const
LuminosityBlock(TFile *iFile)
edm::LuminosityBlockAux * pOldAux_
unsigned int LuminosityBlockNumber_t
std::vector< char const * > labels_
virtual bool atEnd() const
const LuminosityBlock & operator=(const LuminosityBlock &)
Long64_t size() const
virtual std::string const getBranchNameFor(std::type_info const &, char const *, char const *, char const *) const
fwlite::Run const & getRun() const
std::shared_ptr< fwlite::Run > run_
edm::LuminosityBlockAuxiliary * pAux_
std::vector< std::string > procHistoryNames_
RunNumber_t run() const
virtual bool getByLabel(std::type_info const &, char const *, char const *, char const *, void *) const =0
const edm::ProcessHistory & history() const
const LuminosityBlock & operator++()
std::vector< edm::BranchDescription > const & getBranchDescriptions() const
void updateAux(Long_t lumiIndex) const
virtual bool getByLabel(std::type_info const &, char const *, char const *, char const *, void *) const
edm::ProcessHistoryMap historyMap_
const LuminosityBlock & toBegin()
std::shared_ptr< BranchMapReader > branchMap_
unsigned int RunNumber_t
virtual edm::LuminosityBlockAuxiliary const & luminosityBlockAuxiliary() const
std::shared_ptr< RunFactory > runFactory_
std::map< ProcessHistoryID, ProcessHistory > ProcessHistoryMap