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 
20 
22 
23 #include <iostream>
24 #include <string>
25 #include <vector>
26 
28 {
29 }
30 
32 {
33 }
34 
35 void
37 {
40  if( !mydbservice.isAvailable() ){
41  edm::LogError("PGeometricDetExtraBuilder")<<"PoolDBOutputService unavailable";
42  return;
43  }
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 
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 
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:36