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