CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
PGeometricDetExtraBuilder Class Reference
Inheritance diagram for PGeometricDetExtraBuilder:
edm::one::EDAnalyzer< edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (edm::Event const &iEvent, edm::EventSetup const &) override
 
void beginRun (edm::Run const &iEvent, edm::EventSetup const &) override
 
void endRun (edm::Run const &iEvent, edm::EventSetup const &) override
 
 PGeometricDetExtraBuilder (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns >
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void putOne (const GeometricDetExtra &gde, PGeometricDetExtra *pgde)
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 18 of file PGeometricDetExtraBuilder.cc.

Constructor & Destructor Documentation

◆ PGeometricDetExtraBuilder()

PGeometricDetExtraBuilder::PGeometricDetExtraBuilder ( const edm::ParameterSet )
inline

Definition at line 20 of file PGeometricDetExtraBuilder.cc.

20 {}

Member Function Documentation

◆ analyze()

void PGeometricDetExtraBuilder::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &   
)
inlineoverridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 23 of file PGeometricDetExtraBuilder.cc.

23 {}

◆ beginRun()

void PGeometricDetExtraBuilder::beginRun ( edm::Run const &  iEvent,
edm::EventSetup const &  es 
)
override

Definition at line 30 of file PGeometricDetExtraBuilder.cc.

30  {
33  if (!mydbservice.isAvailable()) {
34  edm::LogError("PGeometricDetExtraBuilder") << "PoolDBOutputService unavailable";
35  return;
36  }
39  es.get<IdealGeometryRecord>().get(cpvH);
40  es.get<IdealGeometryRecord>().get(gdeH);
41  const std::vector<GeometricDetExtra>& gdes = (*gdeH);
42 
43  std::vector<GeometricDetExtra>::const_iterator git = gdes.begin();
44  std::vector<GeometricDetExtra>::const_iterator egit = gdes.end();
45 
46  for (; git != egit; ++git) { // one level below "tracker"
47  putOne(*git, pgde);
48  }
49  if (mydbservice->isNewTagRequest("PGeometricDetExtraRcd")) {
50  mydbservice->createNewIOV<PGeometricDetExtra>(
51  pgde, mydbservice->beginOfTime(), mydbservice->endOfTime(), "PGeometricDetExtraRcd");
52  } else {
53  edm::LogError("PGeometricDetExtraBuilder") << "PGeometricDetExtra and PGeometricDetExtraRcd Tag already present";
54  }
55 }

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

◆ endRun()

void PGeometricDetExtraBuilder::endRun ( edm::Run const &  iEvent,
edm::EventSetup const &   
)
inlineoverride

Definition at line 24 of file PGeometricDetExtraBuilder.cc.

24 {}

◆ putOne()

void PGeometricDetExtraBuilder::putOne ( const GeometricDetExtra gde,
PGeometricDetExtra pgde 
)
private

Definition at line 57 of file PGeometricDetExtraBuilder.cc.

57  {
59  item._geographicalId = gde.geographicalId();
60  item._volume = gde.volume();
61  item._density = gde.density();
62  item._weight = gde.weight();
63  item._copy = gde.copyno();
64  item._material = gde.material();
65  pgde->pgdes_.push_back(item);
66 }

References GeometricDetExtra::copyno(), GeometricDetExtra::density(), GeometricDetExtra::geographicalId(), B2GTnPMonitor_cfi::item, GeometricDetExtra::material(), PGeometricDetExtra::pgdes_, GeometricDetExtra::volume(), and GeometricDetExtra::weight().

Referenced by beginRun().

cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition: PoolDBOutputService.cc:177
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
PGeometricDetExtraBuilder::putOne
void putOne(const GeometricDetExtra &gde, PGeometricDetExtra *pgde)
Definition: PGeometricDetExtraBuilder.cc:57
cond::service::PoolDBOutputService::createNewIOV
void createNewIOV(const T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t, const std::string &recordName)
Definition: PoolDBOutputService.h:107
edm::ESHandle
Definition: DTSurvey.h:22
GeometricDetExtra::weight
double weight() const
Definition: GeometricDetExtra.h:53
GeometricDetExtra::volume
double volume() const
Definition: GeometricDetExtra.h:51
GeometricDetExtra::geographicalId
DetId geographicalId() const
Definition: GeometricDetExtra.h:48
edm::LogError
Definition: MessageLogger.h:183
edm::Service< cond::service::PoolDBOutputService >
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
get
#define get
PGeometricDetExtra::Item
Definition: PGeometricDetExtra.h:14
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
cond::service::PoolDBOutputService::endOfTime
cond::Time_t endOfTime() const
Definition: PoolDBOutputService.cc:175
GeometricDetExtra::material
std::string const & material() const
Definition: GeometricDetExtra.h:54
PGeometricDetExtra
Definition: PGeometricDetExtra.h:9
cond::service::PoolDBOutputService::isNewTagRequest
bool isNewTagRequest(const std::string &recordName)
Definition: PoolDBOutputService.cc:90
GeometricDetExtra::density
double density() const
Definition: GeometricDetExtra.h:52
GeometricDetExtra::copyno
int copyno() const
Definition: GeometricDetExtra.h:50
IdealGeometryRecord
Definition: IdealGeometryRecord.h:27
PGeometricDetExtra::pgdes_
std::vector< Item > pgdes_
Definition: PGeometricDetExtra.h:27