CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PGeometricDetExtraBuilder.cc
Go to the documentation of this file.
2 
16 
18 
21 
23 
24 #include <iostream>
25 #include <string>
26 #include <vector>
27 
29 {
30 }
31 
33 {
34 }
35 
36 void
38 {
41  if( !mydbservice.isAvailable() ){
42  edm::LogError("PGeometricDetExtraBuilder")<<"PoolDBOutputService unavailable";
43  return;
44  }
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 
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 
std::string const & material() const
std::vector< Item > pgdes_
double weight() const
void putOne(const GeometricDetExtra &gde, PGeometricDetExtra *pgde)
bool isNewTagRequest(const std::string &recordName)
bool isAvailable() const
Definition: Service.h:47
double density() const
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
DetId geographicalId() const
const T & get() const
Definition: EventSetup.h:55
double volume() const
virtual void beginRun(const edm::Run &, edm::EventSetup const &)
PGeometricDetExtraBuilder(const edm::ParameterSet &iConfig)
Definition: Run.h:32