CondTools
RunInfo
plugins
LHCInfoESAnalyzer.cc
Go to the documentation of this file.
1
#include <string>
2
#include <iostream>
3
#include <map>
4
#include "
FWCore/Framework/interface/EDAnalyzer.h
"
5
#include "
FWCore/Framework/interface/ESHandle.h
"
6
#include "
FWCore/Framework/interface/Event.h
"
7
#include "
FWCore/Framework/interface/EventSetup.h
"
8
#include "
FWCore/Framework/interface/MakerMacros.h
"
9
#include "
CondFormats/RunInfo/interface/LHCInfo.h
"
10
#include "
CondFormats/DataRecord/interface/LHCInfoRcd.h
"
11
12
namespace
edmtest
{
13
class
LHCInfoESAnalyzer
:
public
edm::EDAnalyzer
{
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;
25
edm::eventsetup::EventSetupRecordKey
recordKey(
26
edm::eventsetup::EventSetupRecordKey::TypeTag::findType
(
"LHCInfoRcd"
));
27
if
(recordKey.
type
() ==
edm::eventsetup::EventSetupRecordKey::TypeTag
()) {
28
//record not found
29
std::cout
<<
"Record \"LHCInfoRcd"
30
<<
"\" does not exist "
<< std::endl;
31
}
32
edm::ESHandle<LHCInfo>
sum;
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
}
41
DEFINE_FWK_MODULE
(
LHCInfoESAnalyzer
);
42
}
// namespace edmtest
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:86
edm::eventsetup::heterocontainer::HCTypeTag::findType
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
Definition:
HCTypeTag.cc:121
mps_fire.i
i
Definition:
mps_fire.py:355
edmtest::LHCInfoESAnalyzer::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition:
LHCInfoESAnalyzer.cc:21
ESHandle.h
edmtest
Definition:
AlignPCLThresholdsReader.cc:12
AlCaHLTBitMon_ParallelJobs.p
p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
LHCInfo.h
LHCInfo
Definition:
LHCInfo.h:12
EDAnalyzer.h
edm::eventsetup::EventSetupRecordKey
Definition:
EventSetupRecordKey.h:30
edm::EDAnalyzer
Definition:
EDAnalyzer.h:29
MakerMacros.h
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:73
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
edmtest::LHCInfoESAnalyzer::LHCInfoESAnalyzer
LHCInfoESAnalyzer(int i)
Definition:
LHCInfoESAnalyzer.cc:16
edm::ESHandle< LHCInfo >
edm::eventsetup::EventSetupRecordKey::TypeTag
heterocontainer::HCTypeTag TypeTag
Definition:
EventSetupRecordKey.h:32
LHCInfoRcd
Definition:
LHCInfoRcd.h:24
edmtest::LHCInfoESAnalyzer
Definition:
LHCInfoESAnalyzer.cc:13
edm::ParameterSet
Definition:
ParameterSet.h:36
Event.h
edm::eventsetup::EventSetupRecordKey::type
const TypeTag & type() const
Definition:
EventSetupRecordKey.h:40
edmLumisInFiles.summary
summary
Definition:
edmLumisInFiles.py:39
edm::EventSetup
Definition:
EventSetup.h:57
HltBtagPostValidation_cff.c
c
Definition:
HltBtagPostValidation_cff.py:31
get
#define get
edmtest::LHCInfoESAnalyzer::LHCInfoESAnalyzer
LHCInfoESAnalyzer(edm::ParameterSet const &p)
Definition:
LHCInfoESAnalyzer.cc:15
EventSetup.h
LHCInfoRcd.h
edm::Event
Definition:
Event.h:73
edmtest::LHCInfoESAnalyzer::~LHCInfoESAnalyzer
~LHCInfoESAnalyzer() override
Definition:
LHCInfoESAnalyzer.cc:17
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
Generated for CMSSW Reference Manual by
1.8.16