CMS 3D CMS Logo

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 // 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
36 
37 // forward declarations
38 namespace edm {
39  class WrapperBase;
40  class ProductRegistry;
41  class BranchDescription;
42  class EDProductGetter;
43  class LuminosityBlockAux;
44  class Timestamp;
45  class TriggerResults;
46  class TriggerNames;
47 }
48 
49 namespace fwlite {
50  class Event;
51  class BranchMapReader;
52  class HistoryGetterBase;
53  class DataGetterHelper;
54  class RunFactory;
55 
57  {
58 
59  public:
60  // NOTE: Does NOT take ownership so iFile must remain around
61  // at least as long as LuminosityBlock
62  LuminosityBlock(TFile* iFile);
63  LuminosityBlock(std::shared_ptr<BranchMapReader> branchMap, std::shared_ptr<RunFactory> runFactory);
64  ~LuminosityBlock() override;
65 
66  const LuminosityBlock& operator++() override;
67 
70 
71  // Go to the very first Event.
72  const LuminosityBlock& toBegin() override;
73 
74  // ---------- const member functions ---------------------
75  virtual std::string const getBranchNameFor(std::type_info const&,
76  char const*,
77  char const*,
78  char const*) const;
79 
80  // This function should only be called by fwlite::Handle<>
82  bool getByLabel(std::type_info const&, char const*, char const*, char const*, void*) const override;
83  //void getByBranchName(std::type_info const&, char const*, void*&) const;
84 
85  bool isValid() const;
86  operator bool () const;
87  bool atEnd() const override;
88 
89  Long64_t size() const;
90 
91  edm::LuminosityBlockAuxiliary const& luminosityBlockAuxiliary() const override;
92 
93  std::vector<edm::BranchDescription> const& getBranchDescriptions() const {
94  return branchMap_->getBranchDescriptions();
95  }
96 
97 // void setGetter(//Copy from Event if needed
98 
99  edm::WrapperBase const* getByProductID(edm::ProductID const&) const;
100 
101  // ---------- static member functions --------------------
102  static void throwProductNotFoundException(std::type_info const&, char const*, char const*, char const*);
103 
104  // ---------- member functions ---------------------------
105  fwlite::Run const& getRun() const;
106 
107  private:
109  friend class LumiHistoryGetter;
110 
111  LuminosityBlock(const LuminosityBlock&) = delete; // stop default
112 
113  const LuminosityBlock& operator=(const LuminosityBlock&) = delete; // stop default
114 
115  const edm::ProcessHistory& history() const;
116  void updateAux(Long_t lumiIndex) const;
117 
118 
119  // ---------- member data --------------------------------
120  mutable std::shared_ptr<BranchMapReader> branchMap_;
121 
122  mutable std::shared_ptr<fwlite::Run> run_;
123 
124  //takes ownership of the strings used by the DataKey keys in data_
125  mutable std::vector<char const*> labels_;
127  mutable std::vector<std::string> procHistoryNames_;
132  TBranch* auxBranch_;
134 
136  mutable std::shared_ptr<RunFactory> runFactory_;
137  };
138 
139 }
140 #endif
size
Write out results.
DataGetterHelper dataHelper_
edm::LuminosityBlockAuxiliary aux_
unsigned int LuminosityBlockNumber_t
std::vector< char const * > labels_
virtual bool getByLabel(std::type_info const &, char const *, char const *, char const *, void *) const =0
std::shared_ptr< fwlite::Run > run_
std::vector< std::string > procHistoryNames_
std::vector< edm::BranchDescription > const & getBranchDescriptions() const
edm::LuminosityBlockAuxiliary const * pAux_
edm::ProcessHistoryMap historyMap_
HLT enums.
std::shared_ptr< BranchMapReader > branchMap_
unsigned int RunNumber_t
static void throwProductNotFoundException(char const *where, errors::ErrorCodes error, BranchID const &bid)
Definition: Principal.cc:48
std::shared_ptr< RunFactory > runFactory_
std::map< ProcessHistoryID, ProcessHistory > ProcessHistoryMap
edm::LuminosityBlockAux const * pOldAux_