#include <PGeometricDetExtraBuilder.h>
Public Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | beginRun (const edm::Run &, edm::EventSetup const &) |
virtual void | endJob () |
PGeometricDetExtraBuilder (const edm::ParameterSet &iConfig) | |
void | putOne (const GeometricDetExtra &gde, PGeometricDetExtra *pgde) |
~PGeometricDetExtraBuilder () |
Definition at line 14 of file PGeometricDetExtraBuilder.h.
PGeometricDetExtraBuilder::PGeometricDetExtraBuilder | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 28 of file PGeometricDetExtraBuilder.cc.
{ }
PGeometricDetExtraBuilder::~PGeometricDetExtraBuilder | ( | ) |
Definition at line 32 of file PGeometricDetExtraBuilder.cc.
{ }
virtual void PGeometricDetExtraBuilder::analyze | ( | const edm::Event & | , |
const edm::EventSetup & | |||
) | [inline, virtual] |
void PGeometricDetExtraBuilder::beginRun | ( | const edm::Run & | , |
edm::EventSetup const & | es | ||
) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 37 of file PGeometricDetExtraBuilder.cc.
References edm::EventSetup::get(), edm::Service< T >::isAvailable(), and putOne().
{ PGeometricDetExtra* pgde = new PGeometricDetExtra; edm::Service<cond::service::PoolDBOutputService> mydbservice; if( !mydbservice.isAvailable() ){ edm::LogError("PGeometricDetExtraBuilder")<<"PoolDBOutputService unavailable"; return; } edm::ESTransientHandle<DDCompactView> cpvH; edm::ESHandle<std::vector<GeometricDetExtra> > gdeH; es.get<IdealGeometryRecord>().get( cpvH ); es.get<IdealGeometryRecord>().get( gdeH ); const std::vector<GeometricDetExtra>& gdes = (*gdeH); std::vector<GeometricDetExtra>::const_iterator git = gdes.begin(); std::vector<GeometricDetExtra>::const_iterator egit = gdes.end(); for (; git!= egit; ++git) { // one level below "tracker" putOne(*git, pgde); } if ( mydbservice->isNewTagRequest("PGeometricDetExtraRcd") ) { mydbservice->createNewIOV<PGeometricDetExtra>( pgde,mydbservice->beginOfTime(),mydbservice->endOfTime(),"PGeometricDetExtraRcd"); } else { edm::LogError("PGeometricDetExtraBuilder")<<"PGeometricDetExtra and PGeometricDetExtraRcd Tag already present"; } }
virtual void PGeometricDetExtraBuilder::endJob | ( | void | ) | [inline, virtual] |
void PGeometricDetExtraBuilder::putOne | ( | const GeometricDetExtra & | gde, |
PGeometricDetExtra * | pgde | ||
) |
Definition at line 64 of file PGeometricDetExtraBuilder.cc.
References PGeometricDetExtra::Item::_copy, PGeometricDetExtra::Item::_density, PGeometricDetExtra::Item::_geographicalId, PGeometricDetExtra::Item::_material, PGeometricDetExtra::Item::_volume, PGeometricDetExtra::Item::_weight, GeometricDetExtra::copyno(), GeometricDetExtra::density(), GeometricDetExtra::geographicalId(), GeometricDetExtra::material(), PGeometricDetExtra::pgdes_, GeometricDetExtra::volume(), and GeometricDetExtra::weight().
Referenced by beginRun().
{ PGeometricDetExtra::Item item; item._geographicalId = gde.geographicalId(); item._volume = gde.volume(); item._density = gde.density(); item._weight = gde.weight(); item._copy = gde.copyno(); item._material = gde.material(); pgde->pgdes_.push_back ( item ); }