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 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)
 

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.

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 }

References AlCaHLTBitMon_ParallelJobs::p.

Member Function Documentation

◆ fillDescriptions()

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

Define the cfi file.

Definition at line 89 of file GEMGeometryESModule.cc.

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 }

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

◆ produce()

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

Produce GEMGeometry.

Definition at line 98 of file GEMGeometryESModule.cc.

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 }

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_.

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

edm::ESInputTag
Definition: ESInputTag.h:87
GEMGeometryESModule::fromDDD_
const bool fromDDD_
Definition: GEMGeometryESModule.cc:53
edm::ESTransientHandle::product
T const * product() const
Definition: ESTransientHandle.h:51
GEMGeometryESModule::alignmentsLabel_
const std::string alignmentsLabel_
Definition: GEMGeometryESModule.cc:56
GEMGeometryESModule::fromDD4hep_
const bool fromDD4hep_
Definition: GEMGeometryESModule.cc:54
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
GeometryAligner::applyAlignments
void applyAlignments(const C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
Definition: GeometryAligner.h:52
DetId
Definition: DetId.h:17
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
GEMGeometryBuilderFromCondDB
Definition: GEMGeometryBuilderFromCondDB.h:14
GEMGeometryESModule::mdcToken_
edm::ESGetToken< MuonGeometryConstants, IdealGeometryRecord > mdcToken_
Definition: GEMGeometryESModule.cc:58
GEMGeometryBuilder
Definition: GEMGeometryBuilder.h:33
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
align::DetectorGlobalPosition
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
Definition: DetectorGlobalPosition.cc:10
GEMGeometryESModule::globalPositionToken_
edm::ESGetToken< Alignments, GlobalPositionRcd > globalPositionToken_
Definition: GEMGeometryESModule.cc:61
GEMGeometryESModule::cpvToken_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvToken_
Definition: GEMGeometryESModule.cc:57
AlCaHarvesting_cff.record
record
Definition: AlCaHarvesting_cff.py:42
GEMGeometryESModule::riggemToken_
edm::ESGetToken< RecoIdealGeometry, GEMRecoGeometryRcd > riggemToken_
Definition: GEMGeometryESModule.cc:60
cc
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GEMGeometryBuilder::build
void build(GEMGeometry &theGeometry, const DDCompactView *cview, const MuonGeometryConstants &muonConstants)
Definition: GEMGeometryBuilder.cc:45
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
GEMGeometryESModule::alignmentsToken_
edm::ESGetToken< Alignments, GEMAlignmentRcd > alignmentsToken_
Definition: GEMGeometryESModule.cc:62
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
GEMGeometryESModule::dd4hepcpvToken_
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > dd4hepcpvToken_
Definition: GEMGeometryESModule.cc:59
gemGeometry_cff.gemGeometry
gemGeometry
Definition: gemGeometry_cff.py:5
GEMGeometryBuilderFromCondDB::build
void build(GEMGeometry &theGeometry, const RecoIdealGeometry &rgeo)
Definition: GEMGeometryBuilderFromCondDB.cc:21
GEMGeometry
Definition: GEMGeometry.h:24
DetId::Muon
Definition: DetId.h:26
GEMGeometryESModule::applyAlignment_
bool applyAlignment_
Definition: GEMGeometryESModule.cc:55
GEMGeometryESModule::alignmentErrorsToken_
edm::ESGetToken< AlignmentErrorsExtended, GEMAlignmentErrorExtendedRcd > alignmentErrorsToken_
Definition: GEMGeometryESModule.cc:63
GeometryAligner
Class to update a given geometry with a set of alignments.
Definition: GeometryAligner.h:33