CMS 3D CMS Logo

EventContainer.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 #if !defined(EventContainer_H)
4 #define EventContainer_H
5 
6 #include <map>
7 #include <string>
8 #include <typeinfo>
9 
10 #include "TH1.h"
11 #include "TFile.h"
12 
18 
19 namespace fwlite {
20 
21  class EventContainer : public EventBase {
22  public:
24  // Public Constants //
26 
27  typedef std::map<std::string, std::string> SSMap;
28  typedef void (*FuncPtr)(std::string&);
29 
31  // friends //
33  // tells particle data how to print itself out
34  friend std::ostream& operator<<(std::ostream& o_stream, const EventContainer& rhs);
35 
37  // _ //
38  // |\/| |_ //
39  // | |EMBER | UNCTIONS //
40  // //
42 
44  // Constructors and Destructor //
47  ~EventContainer() override;
48 
50  // One Liners //
52 
53  // return number of events seen
54  int eventsSeen() const { return m_eventsSeen; }
55 
57  // Regular Member Functions //
59 
60  // adds a histogram pointer to the map. You can specify a
61  // directory as well if you wish.
62  void add(TH1* histPtr, const std::string& directory = "");
63 
64  // given a string, returns corresponding histogram pointer
65  TH1* hist(const std::string& name);
66  TH1* hist(const char* name) { return hist((const std::string)name); }
67  TH1* hist(const TString& name) { return hist((const char*)name); }
68 
69  // return this containers parser
71 
73  // Implement the two functions needed to make this an EventBase. //
75  bool getByLabel(const std::type_info& iInfo,
76  const char* iModuleLabel,
77  const char* iProductInstanceLabel,
78  const char* iProcessLabel,
79  void* oData) const override;
80 
81  const std::string getBranchNameFor(const std::type_info& iInfo,
82  const char* iModuleLabel,
83  const char* iProductInstanceLabel,
84  const char* iProcessLabel) const override;
85 
86  const EventContainer& operator++() override;
87 
88  const EventContainer& toBegin() override;
89 
90  bool atEnd() const override;
91 
94  }
95 
98  }
99 
100  Long64_t fileIndex() const override { return m_eventBasePtr->fileIndex(); }
101  Long64_t secondaryFileIndex() const override { return m_eventBasePtr->secondaryFileIndex(); }
102 
103  edm::EventAuxiliary const& eventAuxiliary() const override { return m_eventBasePtr->eventAuxiliary(); }
104 
105  template <class T>
108  }
110  // Static Member Functions //
112 
113  private:
115  // Private Member Functions //
117 
118  // stop the copy constructor
120 
122  // Private Member Data //
124 
132 
134  // Private Static Member Data //
136 
137  static bool sm_autoloaderCalled;
138  };
139 } // namespace fwlite
140 
141 #endif // EventContainer_H
Handle.h
fwlite::EventContainer::EventContainer
EventContainer(const EventContainer &rhs)
Definition: EventContainer.h:119
CommandLineParser.h
edm::EventBase::triggerResultsByName
virtual TriggerResultsByName triggerResultsByName(edm::TriggerResults const &triggerResults) const =0
fwlite::EventContainer::~EventContainer
~EventContainer() override
Definition: EventContainer.cc:59
fwlite::EventContainer::m_maxWanted
int m_maxWanted
Definition: EventContainer.h:129
fwlite::EventContainer::fileIndex
Long64_t fileIndex() const override
Definition: EventContainer.h:100
fwlite::EventContainer::EventContainer
EventContainer(optutl::CommandLineParser &parser, FuncPtr funcPtr=nullptr)
Definition: EventContainer.cc:23
TH1Store.h
fwlite
Definition: TFileDirectory.h:16
patZpeak.handle
handle
Definition: patZpeak.py:23
fwlite::EventContainer::operator++
const EventContainer & operator++() override
Definition: EventContainer.cc:102
fwlite::EventBase::secondaryFileIndex
virtual Long64_t secondaryFileIndex() const
Definition: EventBase.h:57
fwlite::EventContainer::triggerNames
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: EventContainer.h:92
triggerResults
static const std::string triggerResults
Definition: EdmProvDump.cc:45
edm::EventBase::triggerNames
virtual TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const =0
fwlite::EventContainer::toBegin
const EventContainer & toBegin() override
Definition: EventContainer.cc:113
fwlite::EventBase::fileIndex
virtual Long64_t fileIndex() const
Definition: EventBase.h:56
edm::Handle
Definition: AssociativeIterator.h:50
fwlite::EventContainer::m_outputName
std::string m_outputName
Definition: EventContainer.h:127
fwlite::EventContainer::hist
TH1 * hist(const TString &name)
Definition: EventContainer.h:67
fwlite::EventContainer::FuncPtr
void(* FuncPtr)(std::string &)
Definition: EventContainer.h:28
EventBase.h
fwlite::EventContainer::m_eventsSeen
int m_eventsSeen
Definition: EventContainer.h:128
fwlite::EventContainer::eventsSeen
int eventsSeen() const
Definition: EventContainer.h:54
fwlite::EventContainer::sm_autoloaderCalled
static bool sm_autoloaderCalled
Definition: EventContainer.h:137
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
fwlite::EventContainer::SSMap
std::map< std::string, std::string > SSMap
Definition: EventContainer.h:27
fwlite::EventContainer::secondaryFileIndex
Long64_t secondaryFileIndex() const override
Definition: EventContainer.h:101
TH1Store
Definition: TH1Store.h:15
fwlite::EventBase::getByLabel
virtual bool getByLabel(std::type_info const &, char const *, char const *, char const *, void *) const =0
fwlite::EventContainer::m_eventBasePtr
fwlite::EventBase * m_eventBasePtr
Definition: EventContainer.h:125
edm::EventBase::eventAuxiliary
virtual edm::EventAuxiliary const & eventAuxiliary() const =0
edm::EventAuxiliary
Definition: EventAuxiliary.h:14
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
fwlite::EventContainer::eventAuxiliary
edm::EventAuxiliary const & eventAuxiliary() const override
Definition: EventContainer.h:103
fwlite::EventContainer::add
void add(TH1 *histPtr, const std::string &directory="")
Definition: EventContainer.cc:76
fwlite::EventContainer::m_outputEvery
int m_outputEvery
Definition: EventContainer.h:130
fwlite::EventContainer::hist
TH1 * hist(const char *name)
Definition: EventContainer.h:66
fwlite::EventContainer
Definition: EventContainer.h:21
edm::TriggerResultsByName
Definition: TriggerResultsByName.h:48
fwlite::EventContainer::getByLabel
bool getByLabel(const std::type_info &iInfo, const char *iModuleLabel, const char *iProductInstanceLabel, const char *iProcessLabel, void *oData) const override
Definition: EventContainer.cc:85
fwlite::EventContainer::parser
optutl::CommandLineParser & parser()
Definition: EventContainer.cc:78
InputTag.h
fwlite::EventBase
Definition: EventBase.h:36
fwlite::EventContainer::m_parserPtr
optutl::CommandLineParser * m_parserPtr
Definition: EventContainer.h:131
fwlite::EventContainer::getBranchNameFor
const std::string getBranchNameFor(const std::type_info &iInfo, const char *iModuleLabel, const char *iProductInstanceLabel, const char *iProcessLabel) const override
Definition: EventContainer.cc:94
fwlite::EventContainer::triggerResultsByName
edm::TriggerResultsByName triggerResultsByName(edm::TriggerResults const &triggerResults) const override
Definition: EventContainer.h:96
createBeamHaloJobs.directory
string directory
Definition: createBeamHaloJobs.py:211
edm::TriggerNames
Definition: TriggerNames.h:55
fwlite::EventContainer::getByLabel
bool getByLabel(const edm::InputTag &tag, edm::Handle< T > &handle) const
Definition: EventContainer.h:106
fwlite::EventContainer::atEnd
bool atEnd() const override
Definition: EventContainer.cc:124
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
fwlite::EventContainer::hist
TH1 * hist(const std::string &name)
funct::void
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
fwlite::EventContainer::m_histStore
TH1Store m_histStore
Definition: EventContainer.h:126
edm::InputTag
Definition: InputTag.h:15
edm::TriggerResults
Definition: TriggerResults.h:35
fwlite::EventContainer::operator<<
friend std::ostream & operator<<(std::ostream &o_stream, const EventContainer &rhs)
optutl::CommandLineParser
Definition: CommandLineParser.h:10