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
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESProxyIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(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 char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &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={})
 
void usesResources (std::vector< std::string > const &)
 
- 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

◆ Detector

using DDDetectorESProducer::Detector = dd4hep::Detector

Definition at line 45 of file DDDetectorESProducer.cc.

◆ ReturnType

Definition at line 44 of file DDDetectorESProducer.cc.

Constructor & Destructor Documentation

◆ DDDetectorESProducer()

DDDetectorESProducer::DDDetectorESProducer ( const ParameterSet iConfig)

Definition at line 65 of file DDDetectorESProducer.cc.

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  mfToken_ = c.consumes(edm::ESInputTag("", label_));
77  }
78  findingRecord<IdealMagneticFieldRecord>();
79  } else {
80  auto c = setWhatProduced(
82  if (fromDB_) {
83  geomToken_ = c.consumes(edm::ESInputTag("", label_));
84  }
85  findingRecord<IdealGeometryRecord>();
86  }
87 }

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

◆ ~DDDetectorESProducer()

DDDetectorESProducer::~DDDetectorESProducer ( )
override

Definition at line 89 of file DDDetectorESProducer.cc.

89 {}

Member Function Documentation

◆ fillDescriptions()

void DDDetectorESProducer::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 91 of file DDDetectorESProducer.cc.

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 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and submitPVResolutionJobs::desc.

◆ produce()

DDDetectorESProducer::ReturnType DDDetectorESProducer::produce ( )

Definition at line 137 of file DDDetectorESProducer.cc.

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

References appendToDataLabel_, and confGeomXMLFiles_.

◆ produceGeom()

DDDetectorESProducer::ReturnType DDDetectorESProducer::produceGeom ( const IdealGeometryRecord iRecord)

Definition at line 125 of file DDDetectorESProducer.cc.

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 }

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

Referenced by DDDetectorESProducer().

◆ produceMagField()

DDDetectorESProducer::ReturnType DDDetectorESProducer::produceMagField ( const IdealMagneticFieldRecord iRecord)

Definition at line 113 of file DDDetectorESProducer.cc.

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 }

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

Referenced by DDDetectorESProducer().

◆ setIntervalFor()

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 }

Member Data Documentation

◆ appendToDataLabel_

const string DDDetectorESProducer::appendToDataLabel_
private

Definition at line 57 of file DDDetectorESProducer.cc.

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

◆ confGeomXMLFiles_

const string DDDetectorESProducer::confGeomXMLFiles_
private

Definition at line 58 of file DDDetectorESProducer.cc.

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

◆ fromDB_

const bool DDDetectorESProducer::fromDB_
private

Definition at line 56 of file DDDetectorESProducer.cc.

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

◆ geomToken_

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

Definition at line 62 of file DDDetectorESProducer.cc.

Referenced by DDDetectorESProducer(), and produceGeom().

◆ label_

const string DDDetectorESProducer::label_
private

◆ mfToken_

edm::ESGetToken<FileBlob, MFGeometryFileRcd> DDDetectorESProducer::mfToken_
private

Definition at line 61 of file DDDetectorESProducer.cc.

Referenced by DDDetectorESProducer(), and produceMagField().

◆ rootDDName_

const string DDDetectorESProducer::rootDDName_
private

Definition at line 59 of file DDDetectorESProducer.cc.

Referenced by DDDetectorESProducer().

DDDetectorESProducer::appendToDataLabel_
const string appendToDataLabel_
Definition: DDDetectorESProducer.cc:57
DDDetectorESProducer::geomToken_
edm::ESGetToken< FileBlob, GeometryFileRcd > geomToken_
Definition: DDDetectorESProducer.cc:62
edm::ESInputTag
Definition: ESInputTag.h:87
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
DDDetectorESProducer::produceGeom
ReturnType produceGeom(const IdealGeometryRecord &)
Definition: DDDetectorESProducer.cc:125
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::FileInPath
Definition: FileInPath.h:64
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::eventsetup::DependentRecordImplementation::getTransientHandle
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:92
edm::es::Label
Definition: es_Label.h:56
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DDDetectorESProducer::label_
const string label_
Definition: DDDetectorESProducer.cc:60
DDDetectorESProducer::rootDDName_
const string rootDDName_
Definition: DDDetectorESProducer.cc:59
DDDetectorESProducer::fromDB_
const bool fromDB_
Definition: DDDetectorESProducer.cc:56
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
DDDetectorESProducer::produceMagField
ReturnType produceMagField(const IdealMagneticFieldRecord &)
Definition: DDDetectorESProducer.cc:113
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
cond::ValidityInterval
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:17
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
DDDetectorESProducer::confGeomXMLFiles_
const string confGeomXMLFiles_
Definition: DDDetectorESProducer.cc:58
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
DDDetectorESProducer::mfToken_
edm::ESGetToken< FileBlob, MFGeometryFileRcd > mfToken_
Definition: DDDetectorESProducer.cc:61
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:163