CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
PGeometricDetExtraBuilder Class Reference

#include <PGeometricDetExtraBuilder.h>

Inheritance diagram for PGeometricDetExtraBuilder:
edm::EDAnalyzer edm::EDConsumerBase

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 ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 14 of file PGeometricDetExtraBuilder.h.

Constructor & Destructor Documentation

PGeometricDetExtraBuilder::PGeometricDetExtraBuilder ( const edm::ParameterSet iConfig)
explicit

Definition at line 27 of file PGeometricDetExtraBuilder.cc.

28 {
29 }
PGeometricDetExtraBuilder::~PGeometricDetExtraBuilder ( )

Definition at line 31 of file PGeometricDetExtraBuilder.cc.

32 {
33 }

Member Function Documentation

virtual void PGeometricDetExtraBuilder::analyze ( const edm::Event ,
const edm::EventSetup  
)
inlinevirtual

Implements edm::EDAnalyzer.

Definition at line 20 of file PGeometricDetExtraBuilder.h.

20 {}
void PGeometricDetExtraBuilder::beginRun ( const edm::Run ,
edm::EventSetup const &  es 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 36 of file PGeometricDetExtraBuilder.cc.

References cond::service::PoolDBOutputService::beginOfTime(), cond::service::PoolDBOutputService::createNewIOV(), cond::service::PoolDBOutputService::endOfTime(), edm::EventSetup::get(), edm::Service< T >::isAvailable(), cond::service::PoolDBOutputService::isNewTagRequest(), and putOne().

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 }
void putOne(const GeometricDetExtra &gde, PGeometricDetExtra *pgde)
bool isNewTagRequest(const std::string &recordName)
bool isAvailable() const
Definition: Service.h:47
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
virtual void PGeometricDetExtraBuilder::endJob ( void  )
inlinevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 21 of file PGeometricDetExtraBuilder.h.

21 {};
void PGeometricDetExtraBuilder::putOne ( const GeometricDetExtra gde,
PGeometricDetExtra pgde 
)

Definition at line 63 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().

63  {
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 }
std::string const & material() const
std::vector< Item > pgdes_
double weight() const
double density() const
DetId geographicalId() const
double volume() const