Main Page
Namespaces
Classes
Package Documentation
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
}
fetchHcalAlgoData
std::unique_ptr< AbsHcalAlgoData > fetchHcalAlgoData(const std::string &className, const edm::EventSetup &es)
Definition:
fetchHcalAlgoData.cc:21
HFPhase1PMTParams.h
AlCaHLTBitMon_ParallelJobs.p
p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ESHandle
Definition:
DTSurvey.h:22
ESHandle.h
edm::EventSetup
Definition:
EventSetup.h:57
Record
data
char data[epos_bytes_allocation]
Definition:
EPOS_Wrapper.h:79
HFPhase1PMTParamsRcd.h
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:73
fetchHcalAlgoData.h
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:86
AbsHcalAlgoData
Definition:
AbsHcalAlgoData.h:10
className
std::string className(const T &t)
Definition:
ClassName.h:31
Generated for CMSSW Reference Manual by
1.8.11