CMS 3D CMS Logo

LHCInfoESAnalyzer.cc
Go to the documentation of this file.
1 #include <string>
2 #include <iostream>
3 #include <map>
11 
12 namespace edmtest {
14  public:
15  explicit LHCInfoESAnalyzer(edm::ParameterSet const& p) { std::cout << "LHCInfoESAnalyzer" << std::endl; }
16  explicit LHCInfoESAnalyzer(int i) { std::cout << "LHCInfoESAnalyzer " << i << std::endl; }
17  ~LHCInfoESAnalyzer() override { std::cout << "~LHCInfoESAnalyzer " << std::endl; }
18  void analyze(const edm::Event& e, const edm::EventSetup& c) override;
19  };
20 
21  void LHCInfoESAnalyzer::analyze(const edm::Event& e, const edm::EventSetup& context) {
22  std::cout << "###LHCInfoESAnalyzer::analyze" << std::endl;
23  std::cout << " I AM IN RUN NUMBER " << e.id().run() << std::endl;
24  std::cout << " ---EVENT NUMBER " << e.id().event() << std::endl;
28  //record not found
29  std::cout << "Record \"LHCInfoRcd"
30  << "\" does not exist " << std::endl;
31  }
33  std::cout << "got eshandle" << std::endl;
34  context.get<LHCInfoRcd>().get(sum);
35  std::cout << "got context" << std::endl;
36  const LHCInfo* summary = sum.product();
37  std::cout << "got LHCInfo* " << std::endl;
38  std::cout << "print result" << std::endl;
39  std::cout << *summary;
40  }
42 } // namespace edmtest
RunNumber_t run() const
Definition: EventID.h:38
EventNumber_t event() const
Definition: EventID.h:40
LHCInfoESAnalyzer(edm::ParameterSet const &p)
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void analyze(const edm::Event &e, const edm::EventSetup &c) override
heterocontainer::HCTypeTag TypeTag
edm::EventID id() const
Definition: EventBase.h:59
T get() const
Definition: EventSetup.h:73
T const * product() const
Definition: ESHandle.h:86