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 
21 #include <iostream>
22 #include <string>
23 #include <vector>
24 
26 {
27 }
28 
30 {
31 }
32 
33 void
35 {
38  if( !mydbservice.isAvailable() ){
39  edm::LogError("PGeometricDetExtraBuilder")<<"PoolDBOutputService unavailable";
40  return;
41  }
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 
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 
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:46
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:41