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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- 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::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 25 of file PGeometricDetExtraBuilder.cc.

26 {
27 }
PGeometricDetExtraBuilder::~PGeometricDetExtraBuilder ( )

Definition at line 29 of file PGeometricDetExtraBuilder.cc.

30 {
31 }

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 34 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().

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 }
void putOne(const GeometricDetExtra &gde, PGeometricDetExtra *pgde)
bool isNewTagRequest(const std::string &recordName)
bool isAvailable() const
Definition: Service.h:46
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 61 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().

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