Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
CondTools
Geometry
plugins
PGeometricDetExtraBuilder.cc
Go to the documentation of this file.
1
#include "
PGeometricDetExtraBuilder.h
"
2
3
#include "
FWCore/ServiceRegistry/interface/Service.h
"
4
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
5
#include "
FWCore/Framework/interface/Event.h
"
6
#include "
CondCore/DBOutputService/interface/PoolDBOutputService.h
"
7
#include "
FWCore/Framework/interface/EventSetup.h
"
8
#include "
FWCore/Framework/interface/ESTransientHandle.h
"
9
#include "
FWCore/Framework/interface/ESHandle.h
"
10
#include "
CondFormats/GeometryObjects/interface/PGeometricDetExtra.h
"
11
#include "
Geometry/Records/interface/PGeometricDetExtraRcd.h
"
12
#include "
Geometry/TrackerNumberingBuilder/interface/GeometricDetExtra.h
"
13
#include <
DetectorDescription/Core/interface/DDCompactView.h
>
14
#include <
DetectorDescription/Core/interface/DDExpandedView.h
>
15
#include "
DetectorDescription/Core/interface/DDExpandedNode.h
"
16
17
#include "
Geometry/Records/interface/TrackerDigiGeometryRecord.h
"
18
19
#include "
Geometry/TrackerNumberingBuilder/interface/CmsTrackerStringToEnum.h
"
20
21
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
22
23
#include <iostream>
24
#include <string>
25
#include <vector>
26
27
PGeometricDetExtraBuilder::PGeometricDetExtraBuilder
(
const
edm::ParameterSet
& iConfig)
28
{
29
}
30
31
PGeometricDetExtraBuilder::~PGeometricDetExtraBuilder
()
32
{
33
}
34
35
void
36
PGeometricDetExtraBuilder::beginRun
(
const
edm::Run
&,
edm::EventSetup
const
& es)
37
{
38
PGeometricDetExtra
* pgde =
new
PGeometricDetExtra
;
39
edm::Service<cond::service::PoolDBOutputService>
mydbservice;
40
if
( !mydbservice.
isAvailable
() ){
41
edm::LogError
(
"PGeometricDetExtraBuilder"
)<<
"PoolDBOutputService unavailable"
;
42
return
;
43
}
44
edm::ESTransientHandle<DDCompactView>
cpvH;
45
edm::ESHandle<std::vector<GeometricDetExtra>
> gdeH;
46
es.
get
<
IdealGeometryRecord
>().
get
( cpvH );
47
es.
get
<
IdealGeometryRecord
>().
get
( gdeH );
48
const
std::vector<GeometricDetExtra>& gdes = (*gdeH);
49
50
std::vector<GeometricDetExtra>::const_iterator git = gdes.begin();
51
std::vector<GeometricDetExtra>::const_iterator egit = gdes.end();
52
53
for
(; git!= egit; ++git) {
// one level below "tracker"
54
putOne
(*git, pgde);
55
}
56
if
( mydbservice->
isNewTagRequest
(
"PGeometricDetExtraRcd"
) ) {
57
mydbservice->
createNewIOV
<
PGeometricDetExtra
>( pgde,mydbservice->
beginOfTime
(),mydbservice->
endOfTime
(),
"PGeometricDetExtraRcd"
);
58
}
else
{
59
edm::LogError
(
"PGeometricDetExtraBuilder"
)<<
"PGeometricDetExtra and PGeometricDetExtraRcd Tag already present"
;
60
}
61
}
62
63
void
PGeometricDetExtraBuilder::putOne
(
const
GeometricDetExtra
& gde,
PGeometricDetExtra
* pgde ) {
64
PGeometricDetExtra::Item
item;
65
item.
_geographicalId
= gde.
geographicalId
();
66
item.
_volume
= gde.
volume
();
67
item.
_density
= gde.
density
();
68
item.
_weight
= gde.
weight
();
69
item.
_copy
= gde.
copyno
();
70
item.
_material
= gde.
material
();
71
pgde->
pgdes_
.push_back ( item );
72
}
73
TrackerDigiGeometryRecord.h
DDExpandedNode.h
MessageLogger.h
edm::Service< cond::service::PoolDBOutputService >
GeometricDetExtra::material
std::string const & material() const
Definition:
GeometricDetExtra.h:91
PGeometricDetExtraBuilder.h
Event.h
PGeometricDetExtra::Item::_weight
double _weight
Definition:
PGeometricDetExtra.h:19
EventSetup.h
PGeometricDetExtra::pgdes_
std::vector< Item > pgdes_
Definition:
PGeometricDetExtra.h:24
GeometricDetExtra::weight
double weight() const
Definition:
GeometricDetExtra.h:87
PGeometricDetExtra::Item::_volume
double _volume
Definition:
PGeometricDetExtra.h:17
ParameterSet.h
PGeometricDetExtraBuilder::~PGeometricDetExtraBuilder
~PGeometricDetExtraBuilder()
Definition:
PGeometricDetExtraBuilder.cc:31
edm::LogError
Definition:
MessageLogger.h:164
PoolDBOutputService.h
PGeometricDetExtraBuilder::putOne
void putOne(const GeometricDetExtra &gde, PGeometricDetExtra *pgde)
Definition:
PGeometricDetExtraBuilder.cc:63
cond::service::PoolDBOutputService::isNewTagRequest
bool isNewTagRequest(const std::string &recordName)
Definition:
PoolDBOutputService.cc:106
PGeometricDetExtra::Item::_geographicalId
int _geographicalId
Definition:
PGeometricDetExtra.h:14
edm::ESHandle
Definition:
DTSurvey.h:22
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition:
PoolDBOutputService.cc:178
edm::Service::isAvailable
bool isAvailable() const
Definition:
Service.h:47
ESHandle.h
Service.h
GeometricDetExtra::density
double density() const
Definition:
GeometricDetExtra.h:83
PGeometricDetExtra::Item
Definition:
PGeometricDetExtra.h:13
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:129
DDExpandedView.h
IdealGeometryRecord
Definition:
IdealGeometryRecord.h:27
GeometricDetExtra::geographicalId
DetId geographicalId() const
Definition:
GeometricDetExtra.h:65
edm::EventSetup::get
const T & get() const
Definition:
EventSetup.h:55
PGeometricDetExtra::Item::_density
double _density
Definition:
PGeometricDetExtra.h:18
GeometricDetExtra::volume
double volume() const
Definition:
GeometricDetExtra.h:79
cond::service::PoolDBOutputService::endOfTime
cond::Time_t endOfTime() const
Definition:
PoolDBOutputService.cc:173
GeometricDetExtra.h
PGeometricDetExtra::Item::_copy
int _copy
Definition:
PGeometricDetExtra.h:20
PGeometricDetExtra.h
ESTransientHandle.h
edm::ParameterSet
Definition:
ParameterSet.h:35
edm::ESTransientHandle
Definition:
ESTransientHandle.h:39
DDCompactView.h
PGeometricDetExtraBuilder::beginRun
virtual void beginRun(const edm::Run &, edm::EventSetup const &)
Definition:
PGeometricDetExtraBuilder.cc:36
PGeometricDetExtra::Item::_material
std::string _material
Definition:
PGeometricDetExtra.h:21
GeometricDetExtra
Definition:
GeometricDetExtra.h:25
PGeometricDetExtraBuilder::PGeometricDetExtraBuilder
PGeometricDetExtraBuilder(const edm::ParameterSet &iConfig)
Definition:
PGeometricDetExtraBuilder.cc:27
PGeometricDetExtra
Definition:
PGeometricDetExtra.h:7
GeometricDetExtra::copyno
int copyno() const
Definition:
GeometricDetExtra.h:75
PGeometricDetExtraRcd.h
edm::Run
Definition:
Run.h:36
CmsTrackerStringToEnum.h
Generated for CMSSW Reference Manual by
1.8.5