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 41 of file GEMGeometryESModule.cc.

Constructor & Destructor Documentation

◆ GEMGeometryESModule()

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

Constructor.

Definition at line 67 of file GEMGeometryESModule.cc.

68  : fromDDD_{p.getParameter<bool>("fromDDD")},
69  fromDD4hep_{p.getParameter<bool>("fromDD4Hep")},
70  applyAlignment_(p.getParameter<bool>("applyAlignment")),
71  alignmentsLabel_(p.getParameter<std::string>("alignmentsLabel")) {
72  auto cc = setWhatProduced(this);
73  if (fromDDD_) {
74  cpvToken_ = cc.consumes();
75  mdcToken_ = cc.consumes();
76  } else if (fromDD4hep_) {
77  dd4hepcpvToken_ = cc.consumes();
78  mdcToken_ = cc.consumes();
79  } else {
80  riggemToken_ = cc.consumes();
81  }
82  if (applyAlignment_) {
86  }
87  edm::LogVerbatim("GEMGeometry") << "GEMGeometryESModule::initailized with flags " << fromDDD_ << ":" << fromDD4hep_;
88 }

References AlCaHLTBitMon_ParallelJobs::p.

Member Function Documentation

◆ fillDescriptions()

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

Define the cfi file.

Definition at line 90 of file GEMGeometryESModule.cc.

90  {
92  desc.add<bool>("fromDDD", true);
93  desc.add<bool>("fromDD4Hep", false);
94  desc.add<bool>("applyAlignment", false);
95  desc.add<std::string>("alignmentsLabel", "");
96  descriptions.add("gemGeometry", desc);
97 }

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 99 of file GEMGeometryESModule.cc.

99  {
100  auto gemGeometry = std::make_unique<GEMGeometry>();
101 
102  if (fromDDD_) {
103  edm::LogVerbatim("GEMGeometry") << "GEMGeometryESModule::produce :: GEMGeometryBuilder builder ddd";
104  auto cpv = record.getTransientHandle(cpvToken_);
105  const auto& mdc = record.get(mdcToken_);
106  GEMGeometryBuilder builder;
107  builder.build(*gemGeometry, cpv.product(), mdc);
108  } else if (fromDD4hep_) {
109  edm::LogVerbatim("GEMGeometry") << "GEMGeometryESModule::produce :: GEMGeometryBuilder builder dd4hep";
111  const auto& mdc = record.get(mdcToken_);
112  GEMGeometryBuilder builder;
113  builder.build(*gemGeometry, cpv.product(), mdc);
114  } else {
115  edm::LogVerbatim("GEMGeometry") << "GEMGeometryESModule::produce :: GEMGeometryBuilder builder db";
116  const auto& riggem = record.get(riggemToken_);
118  builder.build(*gemGeometry, riggem);
119  }
120 
121  if (applyAlignment_) {
122  const auto& globalPosition = record.get(globalPositionToken_);
123  const auto& alignments = record.get(alignmentsToken_);
124  const auto& alignmentErrors = record.get(alignmentErrorsToken_);
125 
126  // No alignment records, assume ideal geometry is wanted
127  if (alignments.empty() && alignmentErrors.empty() && globalPosition.empty()) {
128  edm::LogInfo("Config") << "@SUB=GEMGeometryRecord::produce"
129  << "Alignment(Error)s and global position (label '" << alignmentsLabel_
130  << "') empty: it is assumed fake and will not apply.";
131  } else {
132  GeometryAligner aligner;
133  aligner.applyAlignments<GEMGeometry>(gemGeometry.get(),
134  &alignments,
135  &alignmentErrors,
137  }
138  }
139 
140  return gemGeometry;
141 }

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(), GlobalPosition_Frontier_DevDB_cff::record, and riggemToken_.

Member Data Documentation

◆ alignmentErrorsToken_

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

Definition at line 64 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ alignmentsLabel_

const std::string GEMGeometryESModule::alignmentsLabel_
private

Definition at line 57 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ alignmentsToken_

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

Definition at line 63 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ applyAlignment_

bool GEMGeometryESModule::applyAlignment_
private

Definition at line 56 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ cpvToken_

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

Definition at line 58 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ dd4hepcpvToken_

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

Definition at line 60 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ fromDD4hep_

const bool GEMGeometryESModule::fromDD4hep_
private

Definition at line 55 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ fromDDD_

const bool GEMGeometryESModule::fromDDD_
private

Definition at line 54 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ globalPositionToken_

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

Definition at line 62 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ mdcToken_

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

Definition at line 59 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ riggemToken_

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

Definition at line 61 of file GEMGeometryESModule.cc.

Referenced by produce().

edm::ESInputTag
Definition: ESInputTag.h:87
GEMGeometryESModule::fromDDD_
const bool fromDDD_
Definition: GEMGeometryESModule.cc:54
edm::ESTransientHandle::product
T const * product() const
Definition: ESTransientHandle.h:51
GEMGeometryESModule::alignmentsLabel_
const std::string alignmentsLabel_
Definition: GEMGeometryESModule.cc:57
GEMGeometryESModule::fromDD4hep_
const bool fromDD4hep_
Definition: GEMGeometryESModule.cc:55
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
GlobalPosition_Frontier_DevDB_cff.record
record
Definition: GlobalPosition_Frontier_DevDB_cff.py:10
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:59
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GEMGeometryBuilder
Definition: GEMGeometryBuilder.h:33
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:62
GEMGeometryESModule::cpvToken_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvToken_
Definition: GEMGeometryESModule.cc:58
GEMGeometryESModule::riggemToken_
edm::ESGetToken< RecoIdealGeometry, GEMRecoGeometryRcd > riggemToken_
Definition: GEMGeometryESModule.cc:61
cc
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:63
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:60
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:56
GEMGeometryESModule::alignmentErrorsToken_
edm::ESGetToken< AlignmentErrorsExtended, GEMAlignmentErrorExtendedRcd > alignmentErrorsToken_
Definition: GEMGeometryESModule.cc:64
GeometryAligner
Class to update a given geometry with a set of alignments.
Definition: GeometryAligner.h:33