CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes
DDDetectorESProducer Class Reference
Inheritance diagram for DDDetectorESProducer:
edm::ESProducer edm::EventSetupRecordIntervalFinder edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

using Detector = dd4hep::Detector
 
using ReturnType = unique_ptr< DDDetector >
 

Public Member Functions

 DDDetectorESProducer (const ParameterSet &)
 
ReturnType produce ()
 
ReturnType produceGeom (const IdealGeometryRecord &)
 
ReturnType produceMagField (const IdealMagneticFieldRecord &)
 
 ~DDDetectorESProducer () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename Record >
void updateFromMayConsumes (unsigned int iIndex, const Record &iRecord)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 
- Public Member Functions inherited from edm::EventSetupRecordIntervalFinder
bool concurrentFinder () const
 
const eventsetup::ComponentDescriptiondescriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
 EventSetupRecordIntervalFinder (const EventSetupRecordIntervalFinder &)=delete
 
std::set< eventsetup::EventSetupRecordKeyfindingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
bool nonconcurrentAndIOVNeedsUpdate (const eventsetup::EventSetupRecordKey &key, const IOVSyncValue &syncValue) const
 
const EventSetupRecordIntervalFinderoperator= (const EventSetupRecordIntervalFinder &)=delete
 
void resetInterval (const eventsetup::EventSetupRecordKey &)
 
void setDescriptionForFinder (const eventsetup::ComponentDescription &iDescription)
 
virtual ~EventSetupRecordIntervalFinder () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 

Protected Member Functions

void setIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &, ValidityInterval &) override
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 
- Protected Member Functions inherited from edm::EventSetupRecordIntervalFinder
template<class T >
void findingRecord ()
 
void findingRecordWithKey (const eventsetup::EventSetupRecordKey &)
 

Private Attributes

const string appendToDataLabel_
 
const string confGeomXMLFiles_
 
const bool fromDB_
 
edm::ESGetToken< FileBlob, GeometryFileRcdgeomToken_
 
const string label_
 
edm::ESGetToken< FileBlob, MFGeometryFileRcdmfToken_
 
const string rootDDName_
 

Additional Inherited Members

- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy >>>
 

Detailed Description

Description: Produce Detector description

Implementation: Detector is described in XML

Definition at line 39 of file DDDetectorESProducer.cc.

Member Typedef Documentation

using DDDetectorESProducer::Detector = dd4hep::Detector

Definition at line 45 of file DDDetectorESProducer.cc.

Definition at line 44 of file DDDetectorESProducer.cc.

Constructor & Destructor Documentation

DDDetectorESProducer::DDDetectorESProducer ( const ParameterSet iConfig)

Definition at line 65 of file DDDetectorESProducer.cc.

References HltBtagPostValidation_cff::c, fromDB_, geomToken_, edm::ParameterSet::getParameter(), label_, mfToken_, produceGeom(), produceMagField(), rootDDName_, edm::ESProducer::setWhatProduced(), and AlCaHLTBitMon_QueryRunRegistry::string.

66  : fromDB_(iConfig.getParameter<bool>("fromDB")),
67  appendToDataLabel_(iConfig.getParameter<string>("appendToDataLabel")),
68  confGeomXMLFiles_(iConfig.getParameter<FileInPath>("confGeomXMLFiles").fullPath()),
69  rootDDName_(iConfig.getParameter<string>("rootDDName")),
70  label_(iConfig.getParameter<string>("label")) {
71  if (rootDDName_ == "MagneticFieldVolumes:MAGF" || rootDDName_ == "cmsMagneticField:MAGF") {
72  auto c = setWhatProduced(this,
74  edm::es::Label(iConfig.getParameter<std::string>("@module_label")));
75  if (fromDB_) {
76  c.setConsumes(mfToken_, edm::ESInputTag("", label_));
77  }
78  findingRecord<IdealMagneticFieldRecord>();
79  } else {
80  auto c = setWhatProduced(
82  if (fromDB_) {
83  c.setConsumes(geomToken_, edm::ESInputTag("", label_));
84  }
85  findingRecord<IdealGeometryRecord>();
86  }
87 }
edm::ESGetToken< FileBlob, GeometryFileRcd > geomToken_
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
edm::ESGetToken< FileBlob, MFGeometryFileRcd > mfToken_
ReturnType produceMagField(const IdealMagneticFieldRecord &)
std::string fullPath() const
Definition: FileInPath.cc:163
ReturnType produceGeom(const IdealGeometryRecord &)
DDDetectorESProducer::~DDDetectorESProducer ( )
override

Definition at line 89 of file DDDetectorESProducer.cc.

89 {}

Member Function Documentation

void DDDetectorESProducer::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 91 of file DDDetectorESProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and edm::ParameterSetDescription::addOptional().

91  {
93 
94  desc.addOptional<FileInPath>("confGeomXMLFiles");
95  desc.add<string>("rootDDName", "cms:OCMS");
96  desc.add<string>("label", "");
97  desc.add<bool>("fromDB", false);
98  descriptions.add("DDDetectorESProducer", desc);
99 
101  descDB.add<string>("rootDDName", "cms:OCMS");
102  descDB.add<string>("label", "Extended");
103  descDB.add<bool>("fromDB", true);
104  descriptions.add("DDDetectorESProducerFromDB", descDB);
105 }
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
DDDetectorESProducer::ReturnType DDDetectorESProducer::produce ( )

Definition at line 137 of file DDDetectorESProducer.cc.

References appendToDataLabel_, confGeomXMLFiles_, and DEFINE_FWK_EVENTSETUP_SOURCE.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

137  {
138  LogVerbatim("Geometry") << "DDDetectorESProducer::Produce " << appendToDataLabel_;
139  return make_unique<DDDetector>(appendToDataLabel_, confGeomXMLFiles_);
140 }
DDDetectorESProducer::ReturnType DDDetectorESProducer::produceGeom ( const IdealGeometryRecord iRecord)

Definition at line 125 of file DDDetectorESProducer.cc.

References appendToDataLabel_, confGeomXMLFiles_, fromDB_, geomToken_, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getTransientHandle(), label_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by DDDetectorESProducer().

125  {
126  LogVerbatim("Geometry") << "DDDetectorESProducer::Produce " << appendToDataLabel_;
127  if (fromDB_) {
129  unique_ptr<vector<unsigned char> > tb = (*gdd).getUncompressedBlob();
130 
131  return make_unique<cms::DDDetector>(label_, string(tb->begin(), tb->end()), true);
132  } else {
133  return make_unique<DDDetector>(appendToDataLabel_, confGeomXMLFiles_);
134  }
135 }
edm::ESGetToken< FileBlob, GeometryFileRcd > geomToken_
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
DDDetectorESProducer::ReturnType DDDetectorESProducer::produceMagField ( const IdealMagneticFieldRecord iRecord)

Definition at line 113 of file DDDetectorESProducer.cc.

References appendToDataLabel_, confGeomXMLFiles_, fromDB_, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getTransientHandle(), label_, mfToken_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by DDDetectorESProducer().

113  {
114  LogVerbatim("Geometry") << "DDDetectorESProducer::Produce MF " << appendToDataLabel_;
115  if (fromDB_) {
117  unique_ptr<vector<unsigned char> > tb = (*gdd).getUncompressedBlob();
118 
119  return make_unique<cms::DDDetector>(label_, string(tb->begin(), tb->end()), true);
120  } else {
121  return make_unique<DDDetector>(appendToDataLabel_, confGeomXMLFiles_);
122  }
123 }
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESGetToken< FileBlob, MFGeometryFileRcd > mfToken_
void DDDetectorESProducer::setIntervalFor ( const eventsetup::EventSetupRecordKey iKey,
const IOVSyncValue iTime,
ValidityInterval oInterval 
)
overrideprotectedvirtual

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 107 of file DDDetectorESProducer.cc.

109  {
110  oInterval = ValidityInterval(IOVSyncValue::beginOfTime(), IOVSyncValue::endOfTime()); //infinite
111 }
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:17

Member Data Documentation

const string DDDetectorESProducer::appendToDataLabel_
private

Definition at line 57 of file DDDetectorESProducer.cc.

Referenced by produce(), produceGeom(), and produceMagField().

const string DDDetectorESProducer::confGeomXMLFiles_
private

Definition at line 58 of file DDDetectorESProducer.cc.

Referenced by produce(), produceGeom(), and produceMagField().

const bool DDDetectorESProducer::fromDB_
private

Definition at line 56 of file DDDetectorESProducer.cc.

Referenced by DDDetectorESProducer(), produceGeom(), and produceMagField().

edm::ESGetToken<FileBlob, GeometryFileRcd> DDDetectorESProducer::geomToken_
private

Definition at line 62 of file DDDetectorESProducer.cc.

Referenced by DDDetectorESProducer(), and produceGeom().

const string DDDetectorESProducer::label_
private
edm::ESGetToken<FileBlob, MFGeometryFileRcd> DDDetectorESProducer::mfToken_
private

Definition at line 61 of file DDDetectorESProducer.cc.

Referenced by DDDetectorESProducer(), and produceMagField().

const string DDDetectorESProducer::rootDDName_
private

Definition at line 59 of file DDDetectorESProducer.cc.

Referenced by DDDetectorESProducer().