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::ESProductResolverFactoryProducer edm::eventsetup::ESProductResolverProvider

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
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () 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::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 

Protected Member Functions

void setIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &, ValidityInterval &) override
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
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 TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProductResolverFactoryProducer
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::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
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::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 

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.

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

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  edm::LogVerbatim("Geometry") << "DDDetectorESProducer::fromDB " << fromDB_ << " appendToDataLabel "
74  << appendToDataLabel_ << " rootDDName " << rootDDName_ << " label " << label_
75  << " confGeomXMLFiles " << confGeomXMLFiles_;
76  if (rootDDName_ == "MagneticFieldVolumes:MAGF" || rootDDName_ == "cmsMagneticField:MAGF") {
77  auto c = setWhatProduced(this,
79  edm::es::Label(iConfig.getParameter<std::string>("@module_label")));
80  if (fromDB_) {
81  mfToken_ = c.consumes(edm::ESInputTag("", label_));
82  }
83  findingRecord<IdealMagneticFieldRecord>();
84  } else {
86  if (fromDB_) {
87  geomToken_ = c.consumes(edm::ESInputTag("", label_));
88  }
89  findingRecord<IdealGeometryRecord>();
90  }
91 }
edm::ESGetToken< FileBlob, GeometryFileRcd > geomToken_
Log< level::Info, true > LogVerbatim
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
static const std::string kDD4hep
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::string fullPath() const
Definition: FileInPath.cc:161
edm::ESGetToken< FileBlob, MFGeometryFileRcd > mfToken_
void usesResources(std::vector< std::string > const &)
Definition: ESProducer.cc:86
ReturnType produceMagField(const IdealMagneticFieldRecord &)
ReturnType produceGeom(const IdealGeometryRecord &)

◆ ~DDDetectorESProducer()

DDDetectorESProducer::~DDDetectorESProducer ( )
override

Definition at line 93 of file DDDetectorESProducer.cc.

93 {}

Member Function Documentation

◆ fillDescriptions()

void DDDetectorESProducer::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 95 of file DDDetectorESProducer.cc.

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

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

◆ produce()

DDDetectorESProducer::ReturnType DDDetectorESProducer::produce ( )

Definition at line 141 of file DDDetectorESProducer.cc.

References appendToDataLabel_, and confGeomXMLFiles_.

141  {
142  LogVerbatim("Geometry") << "DDDetectorESProducer::Produce " << appendToDataLabel_;
143  return make_unique<DDDetector>(appendToDataLabel_, confGeomXMLFiles_, false);
144 }
Log< level::Info, true > LogVerbatim

◆ produceGeom()

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

Definition at line 129 of file DDDetectorESProducer.cc.

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

Referenced by DDDetectorESProducer().

129  {
130  LogVerbatim("Geometry") << "DDDetectorESProducer::Produce " << appendToDataLabel_;
131  if (fromDB_) {
133  unique_ptr<vector<unsigned char> > tb = (*gdd).getUncompressedBlob();
134 
135  return make_unique<cms::DDDetector>(label_, string(tb->begin(), tb->end()), true);
136  } else {
137  return make_unique<DDDetector>(appendToDataLabel_, confGeomXMLFiles_, false);
138  }
139 }
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESGetToken< FileBlob, GeometryFileRcd > geomToken_
Log< level::Info, true > LogVerbatim

◆ produceMagField()

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

Definition at line 117 of file DDDetectorESProducer.cc.

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

Referenced by DDDetectorESProducer().

117  {
118  LogVerbatim("Geometry") << "DDDetectorESProducer::Produce MF " << appendToDataLabel_;
119  if (fromDB_) {
121  unique_ptr<vector<unsigned char> > tb = (*gdd).getUncompressedBlob();
122 
123  return make_unique<cms::DDDetector>(label_, string(tb->begin(), tb->end()), true);
124  } else {
125  return make_unique<DDDetector>(appendToDataLabel_, confGeomXMLFiles_);
126  }
127 }
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Log< level::Info, true > LogVerbatim
edm::ESGetToken< FileBlob, MFGeometryFileRcd > mfToken_

◆ setIntervalFor()

void DDDetectorESProducer::setIntervalFor ( const eventsetup::EventSetupRecordKey iKey,
const IOVSyncValue iTime,
ValidityInterval oInterval 
)
overrideprotectedvirtual

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 111 of file DDDetectorESProducer.cc.

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

Member Data Documentation

◆ appendToDataLabel_

const string DDDetectorESProducer::appendToDataLabel_
private

◆ confGeomXMLFiles_

const string DDDetectorESProducer::confGeomXMLFiles_
private

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