Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
CondTools
Geometry
plugins
PHcalParametersDBBuilder.cc
Go to the documentation of this file.
1
#include "
PHcalParametersDBBuilder.h
"
2
3
#include "
FWCore/Framework/interface/ESTransientHandle.h
"
4
#include "
FWCore/ServiceRegistry/interface/Service.h
"
5
#include "
CondCore/DBOutputService/interface/PoolDBOutputService.h
"
6
#include "
CondFormats/GeometryObjects/interface/PHcalParameters.h
"
7
#include "
DetectorDescription/Core/interface/DDCompactView.h
"
8
#include "
Geometry/Records/interface/IdealGeometryRecord.h
"
9
#include "
Geometry/HcalTowerAlgo/interface/HcalParametersFromDD.h
"
10
11
void
12
PHcalParametersDBBuilder::beginRun
(
const
edm::Run
&,
edm::EventSetup
const
& es )
13
{
14
PHcalParameters
* php =
new
PHcalParameters
;
15
edm::Service<cond::service::PoolDBOutputService>
mydbservice;
16
if
( !mydbservice.
isAvailable
())
17
{
18
edm::LogError
(
"PHcalParametersDBBuilder"
) <<
"PoolDBOutputService unavailable"
;
19
return
;
20
}
21
edm::ESTransientHandle<DDCompactView>
cpv;
22
es.
get
<
IdealGeometryRecord
>().
get
( cpv );
23
24
HcalParametersFromDD
builder;
25
builder.
build
( &(*cpv), *php );
26
27
if
( mydbservice->
isNewTagRequest
(
"PHcalParametersRcd"
))
28
{
29
mydbservice->
createNewIOV
<
PHcalParameters
>( php, mydbservice->
beginOfTime
(), mydbservice->
endOfTime
(),
"PHcalParametersRcd"
);
30
}
else
31
{
32
edm::LogError
(
"PHcalParametersDBBuilder"
) <<
"PHcalParameters and PHcalParametersRcd Tag already present"
;
33
}
34
}
edm::Service< cond::service::PoolDBOutputService >
HcalParametersFromDD::build
bool build(const DDCompactView *, PHcalParameters &)
Definition:
HcalParametersFromDD.cc:33
HcalParametersFromDD.h
edm::LogError
Definition:
MessageLogger.h:164
PHcalParameters.h
PoolDBOutputService.h
cond::service::PoolDBOutputService::isNewTagRequest
bool isNewTagRequest(const std::string &recordName)
Definition:
PoolDBOutputService.cc:118
PHcalParametersDBBuilder.h
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition:
PoolDBOutputService.cc:194
edm::Service::isAvailable
bool isAvailable() const
Definition:
Service.h:46
Service.h
edm::EventSetup
Definition:
EventSetup.h:44
cond::service::PoolDBOutputService::createNewIOV
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
Definition:
PoolDBOutputService.h:77
PHcalParameters
Definition:
PHcalParameters.h:6
IdealGeometryRecord
Definition:
IdealGeometryRecord.h:26
PHcalParametersDBBuilder::beginRun
virtual void beginRun(const edm::Run &, edm::EventSetup const &)
Definition:
PHcalParametersDBBuilder.cc:12
edm::EventSetup::get
const T & get() const
Definition:
EventSetup.h:55
cond::service::PoolDBOutputService::endOfTime
cond::Time_t endOfTime() const
Definition:
PoolDBOutputService.cc:189
IdealGeometryRecord.h
ESTransientHandle.h
edm::ESTransientHandle
Definition:
ESTransientHandle.h:41
DDCompactView.h
HcalParametersFromDD
Definition:
HcalParametersFromDD.h:7
edm::Run
Definition:
Run.h:41
Generated for CMSSW Reference Manual by
1.8.5