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
13 {
15  {
16  public:
18  std::cout<<"LHCInfoESAnalyzer"<<std::endl;
19  }
20  explicit LHCInfoESAnalyzer(int i) {
21  std::cout<<"LHCInfoESAnalyzer "<<i<<std::endl;
22  }
23  ~LHCInfoESAnalyzer() override {
24  std::cout<<"~LHCInfoESAnalyzer "<<std::endl;
25  }
26  void analyze(const edm::Event& e, const edm::EventSetup& c) override;
27  };
28 
30  std::cout<<"###LHCInfoESAnalyzer::analyze"<<std::endl;
31  std::cout <<" I AM IN RUN NUMBER "<<e.id().run() <<std::endl;
32  std::cout <<" ---EVENT NUMBER "<<e.id().event() <<std::endl;
35  //record not found
36  std::cout <<"Record \"LHCInfoRcd"<<"\" does not exist "<<std::endl;
37  }
39  std::cout<<"got eshandle"<<std::endl;
40  context.get<LHCInfoRcd>().get(sum);
41  std::cout<<"got context"<<std::endl;
42  const LHCInfo* summary=sum.product();
43  std::cout<<"got LHCInfo* "<< std::endl;
44  std::cout<< "print result" << std::endl;
45  std::cout << *summary;
46  }
48 }
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
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
void analyze(const edm::Event &e, const edm::EventSetup &c) override
const T & get() const
Definition: EventSetup.h:59
heterocontainer::HCTypeTag TypeTag
edm::EventID id() const
Definition: EventBase.h:60
T const * product() const
Definition: ESHandle.h:86