Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
RecoLocalCalo
EcalRecAlgos
plugins
EcalSeverityLevelESProducer.cc
Go to the documentation of this file.
1
#include "boost/shared_ptr.hpp"
2
#include "
FWCore/Framework/interface/ModuleFactory.h
"
3
#include "
FWCore/Framework/interface/ESProducer.h
"
4
#include "
FWCore/Framework/interface/ESHandle.h
"
5
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
6
#include "
RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgoRcd.h
"
7
#include "
CondFormats/DataRecord/interface/EcalChannelStatusRcd.h
"
8
#include "
RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgo.h
"
9
10
/*
11
Provide a hook to retrieve the EcalSeverityLevelAlgo
12
through the EventSetup
13
14
Appartently there is no smarter way to do it in CMSSW
15
16
Author: Stefano Argiro
17
*/
18
19
class
EcalSeverityLevelESProducer
:
public
edm::ESProducer
{
20
21
public
:
22
EcalSeverityLevelESProducer
(
const
edm::ParameterSet
& iConfig);
23
24
typedef
boost::shared_ptr<EcalSeverityLevelAlgo>
ReturnType
;
25
26
ReturnType
produce
(
const
EcalSeverityLevelAlgoRcd
& iRecord);
27
28
29
30
private
:
31
32
void
chstatusCallback
(
const
EcalChannelStatusRcd
& chs);
33
34
ReturnType
algo_
;
35
};
36
37
EcalSeverityLevelESProducer::EcalSeverityLevelESProducer
(
const
edm::ParameterSet
& iConfig){
38
//the following line is needed to tell the framework what
39
// data is being produced
40
setWhatProduced
(
this
,
41
dependsOn
(&
EcalSeverityLevelESProducer::chstatusCallback
));
42
43
algo_
=
ReturnType
(
new
EcalSeverityLevelAlgo
(iConfig));
44
}
45
46
47
48
EcalSeverityLevelESProducer::ReturnType
49
EcalSeverityLevelESProducer::produce
(
const
EcalSeverityLevelAlgoRcd
& iRecord){
50
51
return
algo_
;
52
}
53
54
55
void
56
EcalSeverityLevelESProducer::chstatusCallback
(
const
EcalChannelStatusRcd
& chs){
57
edm::ESHandle <EcalChannelStatus>
h
;
58
chs.
get
(h);
59
algo_
->setChannelStatus(*h.
product
());
60
}
61
62
//define this as a plug-in
63
DEFINE_FWK_EVENTSETUP_MODULE
(
EcalSeverityLevelESProducer
);
64
65
EcalSeverityLevelESProducer::chstatusCallback
void chstatusCallback(const EcalChannelStatusRcd &chs)
Definition:
EcalSeverityLevelESProducer.cc:56
edm::eventsetup::dependsOn
depends_on::OneHolder< T, TDependsOnRecord > dependsOn(void(T::*iT)(const TDependsOnRecord &))
Definition:
eventsetup_dependsOn.h:190
EcalSeverityLevelAlgoRcd.h
EcalChannelStatusRcd.h
EcalSeverityLevelESProducer::ReturnType
boost::shared_ptr< EcalSeverityLevelAlgo > ReturnType
Definition:
EcalSeverityLevelESProducer.cc:24
EcalSeverityLevelAlgoRcd
Definition:
EcalSeverityLevelAlgoRcd.h:13
edm::ESProducer::setWhatProduced
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition:
ESProducer.h:115
edm::ESProducer
Definition:
ESProducer.h:97
ParameterSet.h
EcalSeverityLevelAlgo.h
EcalSeverityLevelESProducer::algo_
ReturnType algo_
Definition:
EcalSeverityLevelESProducer.cc:34
edm::ESHandle
Definition:
DTSurvey.h:22
edm::eventsetup::EventSetupRecord::get
void get(HolderT &iHolder) const
Definition:
EventSetupRecord.h:93
ESHandle.h
h
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition:
Activities.doc:4
EcalSeverityLevelESProducer
Definition:
EcalSeverityLevelESProducer.cc:19
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:86
EcalChannelStatusRcd
Definition:
EcalChannelStatusRcd.h:5
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
EcalSeverityLevelESProducer::EcalSeverityLevelESProducer
EcalSeverityLevelESProducer(const edm::ParameterSet &iConfig)
Definition:
EcalSeverityLevelESProducer.cc:37
ESProducer.h
edm::ParameterSet
Definition:
ParameterSet.h:35
ModuleFactory.h
EcalSeverityLevelAlgo
Definition:
EcalSeverityLevelAlgo.h:35
EcalSeverityLevelESProducer::produce
ReturnType produce(const EcalSeverityLevelAlgoRcd &iRecord)
Definition:
EcalSeverityLevelESProducer.cc:49
Generated for CMSSW Reference Manual by
1.8.5