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
{
16
edm::ESHandle<Data>
p
;
17
es.
get
<
Record
>().
get
(p);
18
return
new
Data(*p.
product
());
19
}
20
}
21
22
std::unique_ptr<AbsHcalAlgoData>
23
fetchHcalAlgoData
(
const
std::string
&
className
,
const
edm::EventSetup
& es)
24
{
25
AbsHcalAlgoData
*
data
=
nullptr
;
26
27
// Compare with possibe class names
28
//
29
if
(className ==
"HFPhase1PMTParams"
)
30
data = fetchHcalAlgoDataHelper<HFPhase1PMTParams, HFPhase1PMTParamsRcd>(es);
31
32
return
std::unique_ptr<AbsHcalAlgoData>(
data
);
33
}
fetchHcalAlgoData
std::unique_ptr< AbsHcalAlgoData > fetchHcalAlgoData(const std::string &className, const edm::EventSetup &es)
Definition:
fetchHcalAlgoData.cc:23
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:82
HFPhase1PMTParamsRcd.h
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:71
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:30
Generated for CMSSW Reference Manual by
1.8.11