Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
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
$Id: EcalSeverityLevelESProducer.cc,v 1.1 2011/01/16 08:29:00 argiro Exp $
18
*/
19
20
class
EcalSeverityLevelESProducer
:
public
edm::ESProducer
{
21
22
public
:
23
EcalSeverityLevelESProducer
(
const
edm::ParameterSet
& iConfig);
24
25
typedef
boost::shared_ptr<EcalSeverityLevelAlgo>
ReturnType
;
26
27
ReturnType
produce
(
const
EcalSeverityLevelAlgoRcd
& iRecord);
28
29
30
31
private
:
32
33
void
chstatusCallback
(
const
EcalChannelStatusRcd
& chs);
34
35
ReturnType
algo_
;
36
};
37
38
EcalSeverityLevelESProducer::EcalSeverityLevelESProducer
(
const
edm::ParameterSet
& iConfig){
39
//the following line is needed to tell the framework what
40
// data is being produced
41
setWhatProduced
(
this
,
42
dependsOn
(&
EcalSeverityLevelESProducer::chstatusCallback
));
43
44
algo_
=
ReturnType
(
new
EcalSeverityLevelAlgo
(iConfig));
45
}
46
47
48
49
EcalSeverityLevelESProducer::ReturnType
50
EcalSeverityLevelESProducer::produce
(
const
EcalSeverityLevelAlgoRcd
& iRecord){
51
52
return
algo_
;
53
}
54
55
56
void
57
EcalSeverityLevelESProducer::chstatusCallback
(
const
EcalChannelStatusRcd
& chs){
58
edm::ESHandle <EcalChannelStatus>
h
;
59
chs.
get
(h);
60
algo_
->setChannelStatus(*h.
product
());
61
}
62
63
//define this as a plug-in
64
DEFINE_FWK_EVENTSETUP_MODULE
(
EcalSeverityLevelESProducer
);
65
66
EcalSeverityLevelESProducer::chstatusCallback
void chstatusCallback(const EcalChannelStatusRcd &chs)
Definition:
EcalSeverityLevelESProducer.cc:57
edm::eventsetup::dependsOn
depends_on::OneHolder< T, TDependsOnRecord > dependsOn(void(T::*iT)(const TDependsOnRecord &))
Definition:
eventsetup_dependsOn.h:191
EcalSeverityLevelAlgoRcd.h
EcalChannelStatusRcd.h
EcalSeverityLevelESProducer::ReturnType
boost::shared_ptr< EcalSeverityLevelAlgo > ReturnType
Definition:
EcalSeverityLevelESProducer.cc:25
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:35
edm::ESHandle
Definition:
DTSurvey.h:22
edm::eventsetup::EventSetupRecord::get
void get(HolderT &iHolder) const
Definition:
EventSetupRecord.h:87
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:20
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:62
EcalChannelStatusRcd
Definition:
EcalChannelStatusRcd.h:5
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:56
EcalSeverityLevelESProducer::EcalSeverityLevelESProducer
EcalSeverityLevelESProducer(const edm::ParameterSet &iConfig)
Definition:
EcalSeverityLevelESProducer.cc:38
ESProducer.h
edm::ParameterSet
Definition:
ParameterSet.h:35
ModuleFactory.h
EcalSeverityLevelAlgo
Definition:
EcalSeverityLevelAlgo.h:36
EcalSeverityLevelESProducer::produce
ReturnType produce(const EcalSeverityLevelAlgoRcd &iRecord)
Definition:
EcalSeverityLevelESProducer.cc:50
Generated for CMSSW Reference Manual by
1.8.5