CMS 3D CMS Logo

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

Public Member Functions

 GEMGeometryESModule (const edm::ParameterSet &p)
 Constructor. More...
 
std::unique_ptr< GEMGeometryproduce (const MuonGeometryRecord &record)
 Produce GEMGeometry. More...
 
- 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)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 Define the cfi file. More...
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 

Private Attributes

edm::ESGetToken< AlignmentErrorsExtended, GEMAlignmentErrorExtendedRcdalignmentErrorsToken_
 
const std::string alignmentsLabel_
 
edm::ESGetToken< Alignments, GEMAlignmentRcdalignmentsToken_
 
bool applyAlignment_
 
edm::ESGetToken< DDCompactView, IdealGeometryRecordcpvToken_
 
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecorddd4hepcpvToken_
 
const bool fromDD4hep_
 
const bool fromDDD_
 
edm::ESGetToken< Alignments, GlobalPositionRcdglobalPositionToken_
 
edm::ESGetToken< MuonGeometryConstants, IdealGeometryRecordmdcToken_
 
edm::ESGetToken< RecoIdealGeometry, GEMRecoGeometryRcdriggemToken_
 

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 > >>
 
- 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 >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TArg &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::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)
 

Detailed Description

Definition at line 40 of file GEMGeometryESModule.cc.

Constructor & Destructor Documentation

◆ GEMGeometryESModule()

GEMGeometryESModule::GEMGeometryESModule ( const edm::ParameterSet p)

Constructor.

Definition at line 66 of file GEMGeometryESModule.cc.

References AlCaHLTBitMon_ParallelJobs::p.

67  : fromDDD_{p.getParameter<bool>("fromDDD")},
68  fromDD4hep_{p.getParameter<bool>("fromDD4hep")},
69  applyAlignment_(p.getParameter<bool>("applyAlignment")),
70  alignmentsLabel_(p.getParameter<std::string>("alignmentsLabel")) {
71  auto cc = setWhatProduced(this);
72  if (fromDDD_) {
73  cpvToken_ = cc.consumes();
74  mdcToken_ = cc.consumes();
75  } else if (fromDD4hep_) {
76  dd4hepcpvToken_ = cc.consumes();
77  mdcToken_ = cc.consumes();
78  } else {
79  riggemToken_ = cc.consumes();
80  }
81  if (applyAlignment_) {
85  }
86  edm::LogVerbatim("GEMGeometry") << "GEMGeometryESModule::initailized with flags " << fromDDD_ << ":" << fromDD4hep_;
87 }
Log< level::Info, true > LogVerbatim
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ESGetToken< AlignmentErrorsExtended, GEMAlignmentErrorExtendedRcd > alignmentErrorsToken_
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > dd4hepcpvToken_
edm::ESGetToken< Alignments, GlobalPositionRcd > globalPositionToken_
edm::ESGetToken< MuonGeometryConstants, IdealGeometryRecord > mdcToken_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvToken_
edm::ESGetToken< RecoIdealGeometry, GEMRecoGeometryRcd > riggemToken_
edm::ESGetToken< Alignments, GEMAlignmentRcd > alignmentsToken_
const std::string alignmentsLabel_

Member Function Documentation

◆ fillDescriptions()

void GEMGeometryESModule::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Define the cfi file.

Definition at line 89 of file GEMGeometryESModule.cc.

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

89  {
91  desc.add<bool>("fromDDD", true);
92  desc.add<bool>("fromDD4hep", false);
93  desc.add<bool>("applyAlignment", false);
94  desc.add<std::string>("alignmentsLabel", "");
95  descriptions.add("gemGeometry", desc);
96 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

std::unique_ptr< GEMGeometry > GEMGeometryESModule::produce ( const MuonGeometryRecord record)

Produce GEMGeometry.

Definition at line 98 of file GEMGeometryESModule.cc.

References alignmentErrorsToken_, alignmentsLabel_, alignmentsToken_, applyAlignment_, GeometryAligner::applyAlignments(), GEMGeometryBuilderFromCondDB::build(), GEMGeometryBuilder::build(), cpvToken_, dd4hepcpvToken_, align::DetectorGlobalPosition(), fromDD4hep_, fromDDD_, gemGeometry_cff::gemGeometry, globalPositionToken_, mdcToken_, DetId::Muon, edm::ESTransientHandle< T >::product(), AlCaHarvesting_cff::record, and riggemToken_.

98  {
99  auto gemGeometry = std::make_unique<GEMGeometry>();
100 
101  if (fromDDD_) {
102  edm::LogVerbatim("GEMGeometry") << "GEMGeometryESModule::produce :: GEMGeometryBuilder builder ddd";
103  auto cpv = record.getTransientHandle(cpvToken_);
104  const auto& mdc = record.get(mdcToken_);
105  GEMGeometryBuilder builder;
106  builder.build(*gemGeometry, cpv.product(), mdc);
107  } else if (fromDD4hep_) {
108  edm::LogVerbatim("GEMGeometry") << "GEMGeometryESModule::produce :: GEMGeometryBuilder builder dd4hep";
110  const auto& mdc = record.get(mdcToken_);
111  GEMGeometryBuilder builder;
112  builder.build(*gemGeometry, cpv.product(), mdc);
113  } else {
114  edm::LogVerbatim("GEMGeometry") << "GEMGeometryESModule::produce :: GEMGeometryBuilder builder db";
115  const auto& riggem = record.get(riggemToken_);
117  builder.build(*gemGeometry, riggem);
118  }
119 
120  if (applyAlignment_) {
121  const auto& globalPosition = record.get(globalPositionToken_);
122  const auto& alignments = record.get(alignmentsToken_);
123  const auto& alignmentErrors = record.get(alignmentErrorsToken_);
124 
125  // No alignment records, assume ideal geometry is wanted
126  if (alignments.empty() && alignmentErrors.empty() && globalPosition.empty()) {
127  edm::LogInfo("Config") << "@SUB=GEMGeometryRecord::produce"
128  << "Alignment(Error)s and global position (label '" << alignmentsLabel_
129  << "') empty: it is assumed fake and will not apply.";
130  } else {
131  GeometryAligner aligner;
132  aligner.applyAlignments<GEMGeometry>(gemGeometry.get(),
133  &alignments,
134  &alignmentErrors,
136  }
137  }
138 
139  return gemGeometry;
140 }
Log< level::Info, true > LogVerbatim
edm::ESGetToken< AlignmentErrorsExtended, GEMAlignmentErrorExtendedRcd > alignmentErrorsToken_
Class to update a given geometry with a set of alignments.
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > dd4hepcpvToken_
void applyAlignments(const C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
void build(GEMGeometry &theGeometry, const DDCompactView *cview, const MuonGeometryConstants &muonConstants)
edm::ESGetToken< Alignments, GlobalPositionRcd > globalPositionToken_
edm::ESGetToken< MuonGeometryConstants, IdealGeometryRecord > mdcToken_
Log< level::Info, false > LogInfo
Definition: DetId.h:17
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvToken_
edm::ESGetToken< RecoIdealGeometry, GEMRecoGeometryRcd > riggemToken_
T const * product() const
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
edm::ESGetToken< Alignments, GEMAlignmentRcd > alignmentsToken_
const std::string alignmentsLabel_
void build(GEMGeometry &theGeometry, const RecoIdealGeometry &rgeo)

Member Data Documentation

◆ alignmentErrorsToken_

edm::ESGetToken<AlignmentErrorsExtended, GEMAlignmentErrorExtendedRcd> GEMGeometryESModule::alignmentErrorsToken_
private

Definition at line 63 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ alignmentsLabel_

const std::string GEMGeometryESModule::alignmentsLabel_
private

Definition at line 56 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ alignmentsToken_

edm::ESGetToken<Alignments, GEMAlignmentRcd> GEMGeometryESModule::alignmentsToken_
private

Definition at line 62 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ applyAlignment_

bool GEMGeometryESModule::applyAlignment_
private

Definition at line 55 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ cpvToken_

edm::ESGetToken<DDCompactView, IdealGeometryRecord> GEMGeometryESModule::cpvToken_
private

Definition at line 57 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ dd4hepcpvToken_

edm::ESGetToken<cms::DDCompactView, IdealGeometryRecord> GEMGeometryESModule::dd4hepcpvToken_
private

Definition at line 59 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ fromDD4hep_

const bool GEMGeometryESModule::fromDD4hep_
private

Definition at line 54 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ fromDDD_

const bool GEMGeometryESModule::fromDDD_
private

Definition at line 53 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ globalPositionToken_

edm::ESGetToken<Alignments, GlobalPositionRcd> GEMGeometryESModule::globalPositionToken_
private

Definition at line 61 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ mdcToken_

edm::ESGetToken<MuonGeometryConstants, IdealGeometryRecord> GEMGeometryESModule::mdcToken_
private

Definition at line 58 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ riggemToken_

edm::ESGetToken<RecoIdealGeometry, GEMRecoGeometryRcd> GEMGeometryESModule::riggemToken_
private

Definition at line 60 of file GEMGeometryESModule.cc.

Referenced by produce().