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 #include "boost/shared_ptr.hpp"
28 
29 #include "Rtypes.h"
30 
31 // user include files
38 
39 // forward declarations
40 namespace edm {
41  class WrapperHolder;
42  class ProductRegistry;
43  class BranchDescription;
44  class EDProductGetter;
45  class LuminosityBlockAux;
46  class Timestamp;
47  class TriggerResults;
48  class TriggerNames;
49 }
50 
51 namespace fwlite {
52  class Event;
53  class BranchMapReader;
54  class HistoryGetterBase;
55  class DataGetterHelper;
56  class RunFactory;
57 
59  {
60 
61  public:
62  // NOTE: Does NOT take ownership so iFile must remain around
63  // at least as long as LuminosityBlock
64  LuminosityBlock(TFile* iFile);
65  LuminosityBlock(boost::shared_ptr<BranchMapReader> branchMap, boost::shared_ptr<RunFactory> runFactory);
66  virtual ~LuminosityBlock();
67 
68  const LuminosityBlock& operator++();
69 
72 
73  // Go to the very first Event.
74  const LuminosityBlock& toBegin();
75 
76  // ---------- const member functions ---------------------
77  virtual std::string const getBranchNameFor(std::type_info const&,
78  char const*,
79  char const*,
80  char const*) const;
81 
82  // This function should only be called by fwlite::Handle<>
84  virtual bool getByLabel(std::type_info const&, char const*, char const*, char const*, void*) const;
85  virtual bool getByLabel(std::type_info const&, char const*, char const*, char const*, edm::WrapperHolder&) const;
86  //void getByBranchName(std::type_info const&, char const*, void*&) const;
87 
88  bool isValid() const;
89  operator bool () const;
90  virtual bool atEnd() const;
91 
92  Long64_t size() const;
93 
95 
96  std::vector<edm::BranchDescription> const& getBranchDescriptions() const {
97  return branchMap_->getBranchDescriptions();
98  }
99 
100 // void setGetter(//Copy from Event if needed
101 
103 
104  // ---------- static member functions --------------------
105  static void throwProductNotFoundException(std::type_info const&, char const*, char const*, char const*);
106 
107  // ---------- member functions ---------------------------
108  fwlite::Run const& getRun() const;
109 
110  private:
112  friend class LumiHistoryGetter;
113 
114  LuminosityBlock(const LuminosityBlock&); // stop default
115 
116  const LuminosityBlock& operator=(const LuminosityBlock&); // stop default
117 
118  const edm::ProcessHistory& history() const;
119  void updateAux(Long_t lumiIndex) const;
120 
121 
122  // ---------- member data --------------------------------
123  mutable boost::shared_ptr<BranchMapReader> branchMap_;
124 
125  mutable boost::shared_ptr<fwlite::Run> run_;
126 
127  //takes ownership of the strings used by the DataKey keys in data_
128  mutable std::vector<char const*> labels_;
130  mutable std::vector<std::string> procHistoryNames_;
135  TBranch* auxBranch_;
137 
139  mutable boost::shared_ptr<RunFactory> runFactory_;
140  };
141 
142 }
143 #endif /*__CINT__ */
144 #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.
boost::shared_ptr< fwlite::Run > run_
edm::LuminosityBlockAuxiliary aux_
tuple lumi
Definition: fjr2json.py:35
ProcessHistoryRegistry::collection_type ProcessHistoryMap
LuminosityBlock(TFile *iFile)
edm::LuminosityBlockAux * pOldAux_
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
std::vector< char const * > labels_
boost::shared_ptr< RunFactory > runFactory_
edm::WrapperHolder getByProductID(edm::ProductID const &) const
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
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()
unsigned int RunNumber_t
Definition: EventRange.h:32
virtual edm::LuminosityBlockAuxiliary const & luminosityBlockAuxiliary() const
boost::shared_ptr< BranchMapReader > branchMap_