RecoLocalCalo
HcalRecAlgos
src
fetchHcalAlgoData.cc
Go to the documentation of this file.
1
#include "
RecoLocalCalo/HcalRecAlgos/interface/fetchHcalAlgoData.h
"
2
#include "
FWCore/Framework/interface/ESHandle.h
"
3
4
// Includes for AbsHcalAlgoData descendants
5
// and their corresponding records
6
#include "
CondFormats/HcalObjects/interface/HFPhase1PMTParams.h
"
7
#include "
CondFormats/DataRecord/interface/HFPhase1PMTParamsRcd.h
"
8
9
namespace
{
10
// Class Data must inherit from AbsHcalAlgoData
11
// and must have a copy constructor. This function
12
// returns an object allocated on the heap.
13
template
<
class
Data,
class
Record>
14
Data* fetchHcalAlgoDataHelper(
const
edm::EventSetup
& es) {
15
edm::ESHandle<Data>
p
;
16
es.
get
<
Record
>().
get
(
p
);
17
return
new
Data(*
p
.product());
18
}
19
}
// namespace
20
21
std::unique_ptr<AbsHcalAlgoData>
fetchHcalAlgoData
(
const
std::string
&
className
,
const
edm::EventSetup
& es) {
22
AbsHcalAlgoData
*
data
=
nullptr
;
23
24
// Compare with possibe class names
25
//
26
if
(
className
==
"HFPhase1PMTParams"
)
27
data
= fetchHcalAlgoDataHelper<HFPhase1PMTParams, HFPhase1PMTParamsRcd>(es);
28
29
return
std::unique_ptr<AbsHcalAlgoData>(
data
);
30
}
AbsHcalAlgoData
Definition:
AbsHcalAlgoData.h:10
ESHandle.h
AlCaHLTBitMon_ParallelJobs.p
p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:73
edm::ESHandle
Definition:
DTSurvey.h:22
fetchHcalAlgoData
std::unique_ptr< AbsHcalAlgoData > fetchHcalAlgoData(const std::string &className, const edm::EventSetup &es)
Definition:
fetchHcalAlgoData.cc:21
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::EventSetup
Definition:
EventSetup.h:57
get
#define get
HFPhase1PMTParamsRcd.h
Record
data
char data[epos_bytes_allocation]
Definition:
EPOS_Wrapper.h:79
className
std::string className(const T &t)
Definition:
ClassName.h:31
fetchHcalAlgoData.h
HFPhase1PMTParams.h
Generated for CMSSW Reference Manual by
1.8.16