CondTools
Geometry
plugins
CSCRecoIdealDBLoader.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/one/EDAnalyzer.h
"
2
#include "
FWCore/Framework/interface/EventSetup.h
"
3
#include "
FWCore/Framework/interface/ESTransientHandle.h
"
4
#include "
FWCore/Framework/interface/ESHandle.h
"
5
#include "
FWCore/Framework/interface/MakerMacros.h
"
6
#include "
FWCore/ServiceRegistry/interface/Service.h
"
7
#include "
CondCore/DBOutputService/interface/PoolDBOutputService.h
"
8
#include "
CondFormats/GeometryObjects/interface/RecoIdealGeometry.h
"
9
#include "
CondFormats/GeometryObjects/interface/CSCRecoDigiParameters.h
"
10
#include "
Geometry/Records/interface/CSCRecoGeometryRcd.h
"
11
#include "
Geometry/Records/interface/CSCRecoDigiParametersRcd.h
"
12
#include "
Geometry/Records/interface/MuonGeometryRecord.h
"
13
#include "
Geometry/MuonNumbering/interface/MuonGeometryConstants.h
"
14
#include "
Geometry/CSCGeometryBuilder/src/CSCGeometryParsFromDD.h
"
15
#include "
DetectorDescription/Core/interface/DDCompactView.h
"
16
17
class
CSCRecoIdealDBLoader
:
public
edm::one::EDAnalyzer
<edm::one::WatchRuns> {
18
public
:
19
CSCRecoIdealDBLoader
(
edm::ParameterSet
const
&) {}
20
21
void
beginRun
(
edm::Run
const
&
iEvent
,
edm::EventSetup
const
&)
override
;
22
void
analyze
(
edm::Event
const
&
iEvent
,
edm::EventSetup
const
&)
override
{}
23
void
endRun
(
edm::Run
const
&
iEvent
,
edm::EventSetup
const
&)
override
{}
24
};
25
26
void
CSCRecoIdealDBLoader::beginRun
(
const
edm::Run
&,
edm::EventSetup
const
& es) {
27
edm::LogInfo
(
"CSCRecoIdealDBLoader"
) <<
"CSCRecoIdealDBLoader::beginRun"
;
28
29
RecoIdealGeometry
* rig =
new
RecoIdealGeometry
;
30
CSCRecoDigiParameters
* rdp =
new
CSCRecoDigiParameters
;
31
edm::Service<cond::service::PoolDBOutputService>
mydbservice;
32
if
(!mydbservice.
isAvailable
()) {
33
edm::LogError
(
"CSCRecoIdealDBLoader"
) <<
"PoolDBOutputService unavailable"
;
34
return
;
35
}
36
37
edm::ESTransientHandle<DDCompactView>
pDD;
38
edm::ESHandle<MuonGeometryConstants>
pMNDC;
39
es.
get
<
IdealGeometryRecord
>().
get
(pDD);
40
es.
get
<
IdealGeometryRecord
>().
get
(pMNDC);
41
42
const
DDCompactView
& cpv = *pDD;
43
CSCGeometryParsFromDD
cscgp;
44
45
cscgp.
build
(&cpv, *pMNDC, *rig, *rdp);
46
47
if
(mydbservice->
isNewTagRequest
(
"CSCRecoGeometryRcd"
)) {
48
mydbservice->
createNewIOV
<
RecoIdealGeometry
>(
49
rig, mydbservice->
beginOfTime
(), mydbservice->
endOfTime
(),
"CSCRecoGeometryRcd"
);
50
}
else
{
51
edm::LogError
(
"CSCRecoIdealDBLoader"
) <<
"CSCRecoGeometryRcd Tag is already present."
;
52
}
53
if
(mydbservice->
isNewTagRequest
(
"CSCRecoDigiParametersRcd"
)) {
54
mydbservice->
createNewIOV
<
CSCRecoDigiParameters
>(
55
rdp, mydbservice->
beginOfTime
(), mydbservice->
endOfTime
(),
"CSCRecoDigiParametersRcd"
);
56
}
else
{
57
edm::LogError
(
"CSCRecoIdealDBLoader"
) <<
"CSCRecoDigiParametersRcd Tag is already present."
;
58
}
59
}
60
61
DEFINE_FWK_MODULE
(
CSCRecoIdealDBLoader
);
CSCGeometryParsFromDD::build
bool build(const DDCompactView *cview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig, CSCRecoDigiParameters &rdp)
Build the geometry returning the RecoIdealGeometry and the CSCRecoDigiParameters objects.
Definition:
CSCGeometryParsFromDD.cc:48
EDAnalyzer.h
ESTransientHandle.h
CSCRecoDigiParameters
Definition:
CSCRecoDigiParameters.h:18
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition:
PoolDBOutputService.cc:177
ESHandle.h
edm::Run
Definition:
Run.h:45
CSCRecoIdealDBLoader::endRun
void endRun(edm::Run const &iEvent, edm::EventSetup const &) override
Definition:
CSCRecoIdealDBLoader.cc:23
MuonGeometryConstants.h
edm::LogInfo
Definition:
MessageLogger.h:254
CSCRecoIdealDBLoader::CSCRecoIdealDBLoader
CSCRecoIdealDBLoader(edm::ParameterSet const &)
Definition:
CSCRecoIdealDBLoader.cc:19
edm::one::EDAnalyzer
Definition:
EDAnalyzer.h:30
edm::Service::isAvailable
bool isAvailable() const
Definition:
Service.h:40
DDCompactView.h
MakerMacros.h
PoolDBOutputService.h
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:73
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
cond::service::PoolDBOutputService::createNewIOV
void createNewIOV(const T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t, const std::string &recordName)
Definition:
PoolDBOutputService.h:107
Service.h
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition:
DDCompactView.h:80
CSCRecoGeometryRcd.h
edm::ESHandle
Definition:
DTSurvey.h:22
CSCGeometryParsFromDD
Definition:
CSCGeometryParsFromDD.h:32
CSCRecoIdealDBLoader::analyze
void analyze(edm::Event const &iEvent, edm::EventSetup const &) override
Definition:
CSCRecoIdealDBLoader.cc:22
RecoIdealGeometry.h
CSCRecoDigiParameters.h
edm::ParameterSet
Definition:
ParameterSet.h:36
edm::LogError
Definition:
MessageLogger.h:183
edm::Service< cond::service::PoolDBOutputService >
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::EventSetup
Definition:
EventSetup.h:57
get
#define get
edm::ESTransientHandle
Definition:
ESTransientHandle.h:41
cond::service::PoolDBOutputService::endOfTime
cond::Time_t endOfTime() const
Definition:
PoolDBOutputService.cc:175
CSCRecoIdealDBLoader
Definition:
CSCRecoIdealDBLoader.cc:17
CSCGeometryParsFromDD.h
EventSetup.h
cond::service::PoolDBOutputService::isNewTagRequest
bool isNewTagRequest(const std::string &recordName)
Definition:
PoolDBOutputService.cc:90
CSCRecoDigiParametersRcd.h
MuonGeometryRecord.h
CSCRecoIdealDBLoader::beginRun
void beginRun(edm::Run const &iEvent, edm::EventSetup const &) override
Definition:
CSCRecoIdealDBLoader.cc:26
edm::Event
Definition:
Event.h:73
IdealGeometryRecord
Definition:
IdealGeometryRecord.h:27
RecoIdealGeometry
Definition:
RecoIdealGeometry.h:28
Generated for CMSSW Reference Manual by
1.8.16