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/TrackerGeometryBuilder/interface/GeomDetTypeIdToEnum.h
"
20
#include "
Geometry/TrackerNumberingBuilder/interface/CmsTrackerStringToEnum.h
"
21
22
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
23
24
#include <iostream>
25
#include <string>
26
#include <vector>
27
28
PGeometricDetExtraBuilder::PGeometricDetExtraBuilder
(
const
edm::ParameterSet
& iConfig)
29
{
30
}
31
32
PGeometricDetExtraBuilder::~PGeometricDetExtraBuilder
()
33
{
34
}
35
36
void
37
PGeometricDetExtraBuilder::beginRun
(
const
edm::Run
&,
edm::EventSetup
const
& es)
38
{
39
PGeometricDetExtra
* pgde =
new
PGeometricDetExtra
;
40
edm::Service<cond::service::PoolDBOutputService>
mydbservice;
41
if
( !mydbservice.
isAvailable
() ){
42
edm::LogError
(
"PGeometricDetExtraBuilder"
)<<
"PoolDBOutputService unavailable"
;
43
return
;
44
}
45
edm::ESTransientHandle<DDCompactView>
cpvH;
46
edm::ESHandle<std::vector<GeometricDetExtra>
> gdeH;
47
es.
get
<
IdealGeometryRecord
>().
get
( cpvH );
48
es.
get
<
IdealGeometryRecord
>().
get
( gdeH );
49
const
std::vector<GeometricDetExtra>& gdes = (*gdeH);
50
51
std::vector<GeometricDetExtra>::const_iterator git = gdes.begin();
52
std::vector<GeometricDetExtra>::const_iterator egit = gdes.end();
53
54
for
(; git!= egit; ++git) {
// one level below "tracker"
55
putOne
(*git, pgde);
56
}
57
if
( mydbservice->
isNewTagRequest
(
"PGeometricDetExtraRcd"
) ) {
58
mydbservice->
createNewIOV
<
PGeometricDetExtra
>( pgde,mydbservice->
beginOfTime
(),mydbservice->
endOfTime
(),
"PGeometricDetExtraRcd"
);
59
}
else
{
60
edm::LogError
(
"PGeometricDetExtraBuilder"
)<<
"PGeometricDetExtra and PGeometricDetExtraRcd Tag already present"
;
61
}
62
}
63
64
void
PGeometricDetExtraBuilder::putOne
(
const
GeometricDetExtra
& gde,
PGeometricDetExtra
* pgde ) {
65
PGeometricDetExtra::Item
item;
66
item.
_geographicalId
= gde.
geographicalId
();
67
item.
_volume
= gde.
volume
();
68
item.
_density
= gde.
density
();
69
item.
_weight
= gde.
weight
();
70
item.
_copy
= gde.
copyno
();
71
item.
_material
= gde.
material
();
72
pgde->
pgdes_
.push_back ( item );
73
}
74
TrackerDigiGeometryRecord.h
DDExpandedNode.h
MessageLogger.h
edm::Service< cond::service::PoolDBOutputService >
GeometricDetExtra::material
std::string const & material() const
Definition:
GeometricDetExtra.h:91
PGeometricDetExtraBuilder.h
GeomDetTypeIdToEnum.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:32
edm::LogError
Definition:
MessageLogger.h:164
PoolDBOutputService.h
PGeometricDetExtraBuilder::putOne
void putOne(const GeometricDetExtra &gde, PGeometricDetExtra *pgde)
Definition:
PGeometricDetExtraBuilder.cc:64
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:130
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:37
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:28
PGeometricDetExtra
Definition:
PGeometricDetExtra.h:7
GeometricDetExtra::copyno
int copyno() const
Definition:
GeometricDetExtra.h:75
PGeometricDetExtraRcd.h
edm::Run
Definition:
Run.h:33
CmsTrackerStringToEnum.h
Generated for CMSSW Reference Manual by
1.8.5