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 40 of file DDDetectorESProducer.cc.

Member Typedef Documentation

◆ Detector

using DDDetectorESProducer::Detector = dd4hep::Detector

Definition at line 46 of file DDDetectorESProducer.cc.

◆ ReturnType

Definition at line 45 of file DDDetectorESProducer.cc.

Constructor & Destructor Documentation

◆ DDDetectorESProducer()

DDDetectorESProducer::DDDetectorESProducer ( const ParameterSet iConfig)

Definition at line 66 of file DDDetectorESProducer.cc.

67  : fromDB_(iConfig.getParameter<bool>("fromDB")),
68  appendToDataLabel_(iConfig.getParameter<string>("appendToDataLabel")),
69  confGeomXMLFiles_(fromDB_ ? "none" : iConfig.getParameter<FileInPath>("confGeomXMLFiles").fullPath()),
70  rootDDName_(iConfig.getParameter<string>("rootDDName")),
71  label_(iConfig.getParameter<string>("label")) {
73  if (rootDDName_ == "MagneticFieldVolumes:MAGF" || rootDDName_ == "cmsMagneticField:MAGF") {
74  auto c = setWhatProduced(this,
76  edm::es::Label(iConfig.getParameter<std::string>("@module_label")));
77  if (fromDB_) {
78  mfToken_ = c.consumes(edm::ESInputTag("", label_));
79  }
80  findingRecord<IdealMagneticFieldRecord>();
81  } else {
83  if (fromDB_) {
84  geomToken_ = c.consumes(edm::ESInputTag("", label_));
85  }
86  findingRecord<IdealGeometryRecord>();
87  }
88 }

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

◆ ~DDDetectorESProducer()

DDDetectorESProducer::~DDDetectorESProducer ( )
override

Definition at line 90 of file DDDetectorESProducer.cc.

90 {}

Member Function Documentation

◆ fillDescriptions()

void DDDetectorESProducer::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 92 of file DDDetectorESProducer.cc.

92  {
94 
95  desc.addOptional<FileInPath>("confGeomXMLFiles");
96  desc.add<string>("rootDDName", "cms:OCMS");
97  desc.add<string>("label", "");
98  desc.add<bool>("fromDB", false);
99  descriptions.add("DDDetectorESProducer", desc);
100 
102  descDB.add<string>("rootDDName", "cms:OCMS");
103  descDB.add<string>("label", "Extended");
104  descDB.add<bool>("fromDB", true);
105  descriptions.add("DDDetectorESProducerFromDB", descDB);
106 }

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

◆ produce()

DDDetectorESProducer::ReturnType DDDetectorESProducer::produce ( )

Definition at line 138 of file DDDetectorESProducer.cc.

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

References appendToDataLabel_, and confGeomXMLFiles_.

◆ produceGeom()

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

Definition at line 126 of file DDDetectorESProducer.cc.

126  {
127  LogVerbatim("Geometry") << "DDDetectorESProducer::Produce " << appendToDataLabel_;
128  if (fromDB_) {
130  unique_ptr<vector<unsigned char> > tb = (*gdd).getUncompressedBlob();
131 
132  return make_unique<cms::DDDetector>(label_, string(tb->begin(), tb->end()), true);
133  } else {
134  return make_unique<DDDetector>(appendToDataLabel_, confGeomXMLFiles_, false);
135  }
136 }

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 114 of file DDDetectorESProducer.cc.

114  {
115  LogVerbatim("Geometry") << "DDDetectorESProducer::Produce MF " << appendToDataLabel_;
116  if (fromDB_) {
118  unique_ptr<vector<unsigned char> > tb = (*gdd).getUncompressedBlob();
119 
120  return make_unique<cms::DDDetector>(label_, string(tb->begin(), tb->end()), true);
121  } else {
122  return make_unique<DDDetector>(appendToDataLabel_, confGeomXMLFiles_);
123  }
124 }

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 108 of file DDDetectorESProducer.cc.

110  {
111  oInterval = ValidityInterval(IOVSyncValue::beginOfTime(), IOVSyncValue::endOfTime()); //infinite
112 }

Member Data Documentation

◆ appendToDataLabel_

const string DDDetectorESProducer::appendToDataLabel_
private

Definition at line 58 of file DDDetectorESProducer.cc.

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

◆ confGeomXMLFiles_

const string DDDetectorESProducer::confGeomXMLFiles_
private

Definition at line 59 of file DDDetectorESProducer.cc.

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

◆ fromDB_

const bool DDDetectorESProducer::fromDB_
private

Definition at line 57 of file DDDetectorESProducer.cc.

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

◆ geomToken_

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

Definition at line 63 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 62 of file DDDetectorESProducer.cc.

Referenced by DDDetectorESProducer(), and produceMagField().

◆ rootDDName_

const string DDDetectorESProducer::rootDDName_
private

Definition at line 60 of file DDDetectorESProducer.cc.

Referenced by DDDetectorESProducer().

DDDetectorESProducer::appendToDataLabel_
const string appendToDataLabel_
Definition: DDDetectorESProducer.cc:58
DDDetectorESProducer::geomToken_
edm::ESGetToken< FileBlob, GeometryFileRcd > geomToken_
Definition: DDDetectorESProducer.cc:63
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:126
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::ESSharedResourceNames::kDD4Hep
static const std::string kDD4Hep
Definition: SharedResourceNames.h:38
edm::FileInPath
Definition: FileInPath.h:61
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:98
edm::ESProducer::usesResources
void usesResources(std::vector< std::string > const &)
Definition: ESProducer.cc:117
edm::es::Label
Definition: es_Label.h:56
DDDetectorESProducer::label_
const string label_
Definition: DDDetectorESProducer.cc:61
DDDetectorESProducer::rootDDName_
const string rootDDName_
Definition: DDDetectorESProducer.cc:60
DDDetectorESProducer::fromDB_
const bool fromDB_
Definition: DDDetectorESProducer.cc:57
DDDetectorESProducer::produceMagField
ReturnType produceMagField(const IdealMagneticFieldRecord &)
Definition: DDDetectorESProducer.cc:114
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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:59
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:62
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:161