CondTools
DT
plugins
DTKeyedConfigDBDump.cc
Go to the documentation of this file.
1
/*
2
* See header file for a description of this class.
3
*
4
* $Date: 2010/05/14 11:43:08 $
5
* $Revision: 1.2 $
6
* \author Paolo Ronchese INFN Padova
7
*
8
*/
9
10
//-----------------------
11
// This Class' Header --
12
//-----------------------
13
#include "
CondTools/DT/plugins/DTKeyedConfigDBDump.h
"
14
15
//-------------------------------
16
// Collaborating Class Headers --
17
//-------------------------------
18
#include "
CondFormats/DTObjects/interface/DTKeyedConfig.h
"
19
#include "
CondFormats/DataRecord/interface/DTKeyedConfigListRcd.h
"
20
#include "
CondCore/CondDB/interface/KeyList.h
"
21
#include "
FWCore/Framework/interface/ESHandle.h
"
22
#include "
FWCore/Framework/interface/MakerMacros.h
"
23
24
//---------------
25
// C++ Headers --
26
//---------------
27
#include <iostream>
28
#include <memory>
29
30
//-------------------
31
// Initializations --
32
//-------------------
33
34
//----------------
35
// Constructors --
36
//----------------
37
DTKeyedConfigDBDump::DTKeyedConfigDBDump
(
const
edm::ParameterSet
& ps) {}
38
39
//--------------
40
// Destructor --
41
//--------------
42
DTKeyedConfigDBDump::~DTKeyedConfigDBDump
() {}
43
44
//--------------
45
// Operations --
46
//--------------
47
void
DTKeyedConfigDBDump::beginJob
() {
return
; }
48
49
void
DTKeyedConfigDBDump::analyze
(
const
edm::Event
&
e
,
const
edm::EventSetup
&
c
) {
50
edm::eventsetup::EventSetupRecordKey
recordKey(
51
edm::eventsetup::EventSetupRecordKey::TypeTag::findType
(
"DTKeyedConfigListRcd"
));
52
if
(recordKey.
type
() ==
edm::eventsetup::EventSetupRecordKey::TypeTag
()) {
53
//record not found
54
std::cout
<<
"Record \"DTKeyedConfigListRcd "
55
<<
"\" does not exist "
<< std::endl;
56
}
57
edm::ESHandle<cond::persistency::KeyList>
klh;
58
std::cout
<<
"got eshandle"
<< std::endl;
59
c
.get<
DTKeyedConfigListRcd
>().
get
(klh);
60
std::cout
<<
"got context"
<< std::endl;
61
cond::persistency::KeyList
const
& kl = *klh.
product
();
62
cond::persistency::KeyList
const
*
kp
= &kl;
63
std::cout
<<
"now load and get"
<< std::endl;
64
auto
pkc =
kp
->getUsingKey<
DTKeyedConfig
>(999999999);
65
std::cout
<<
"now check"
<< std::endl;
66
if
(pkc.get())
67
std::cout
<< pkc->getId() <<
" "
<< *(pkc->dataBegin()) << std::endl;
68
else
69
std::cout
<<
"not found"
<< std::endl;
70
std::cout
<< std::endl;
71
return
;
72
}
73
74
DEFINE_FWK_MODULE
(
DTKeyedConfigDBDump
);
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
ESHandle.h
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
DTKeyedConfigListRcd.h
edm::eventsetup::EventSetupRecordKey
Definition:
EventSetupRecordKey.h:30
MakerMacros.h
DTKeyedConfigDBDump::~DTKeyedConfigDBDump
~DTKeyedConfigDBDump() override
Definition:
DTKeyedConfigDBDump.cc:42
DTKeyedConfigDBDump.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
DTKeyedConfigListRcd
Definition:
DTKeyedConfigListRcd.h:5
edm::ESHandle
Definition:
DTSurvey.h:22
edm::eventsetup::EventSetupRecordKey::TypeTag
heterocontainer::HCTypeTag TypeTag
Definition:
EventSetupRecordKey.h:32
edm::ParameterSet
Definition:
ParameterSet.h:47
DTKeyedConfig.h
edm::eventsetup::EventSetupRecordKey::type
const TypeTag & type() const
Definition:
EventSetupRecordKey.h:40
DTKeyedConfig
Definition:
DTKeyedConfig.h:35
DTKeyedConfigDBDump::beginJob
void beginJob() override
Definition:
DTKeyedConfigDBDump.cc:47
edm::EventSetup
Definition:
EventSetup.h:58
get
#define get
DTKeyedConfigDBDump
Definition:
DTKeyedConfigDBDump.h:35
KeyList.h
DTKeyedConfigDBDump::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition:
DTKeyedConfigDBDump.cc:49
cond::persistency::KeyList
Definition:
KeyList.h:33
c
auto & c
Definition:
CAHitNtupletGeneratorKernelsImpl.h:46
DTKeyedConfigDBDump::DTKeyedConfigDBDump
DTKeyedConfigDBDump(const edm::ParameterSet &ps)
Definition:
DTKeyedConfigDBDump.cc:37
edm::Event
Definition:
Event.h:73
kp
int kp
Definition:
CascadeWrapper.h:13
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
Generated for CMSSW Reference Manual by
1.8.16