CMS 3D CMS Logo

List of all members | 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...
 
 ~GEMGeometryESModule () override
 Destructor. More...
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename Record >
void updateFromMayConsumes (unsigned int iIndex, const Record &iRecord)
 
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)
 

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_
 
edm::ESGetToken< Alignments, GlobalPositionRcdglobalPositionToken_
 
edm::ESGetToken< MuonGeometryConstants, IdealGeometryRecordmdcToken_
 
edm::ESGetToken< RecoIdealGeometry, GEMRecoGeometryRcdriggemToken_
 
const bool useDD4hep_
 
const bool useDDD_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- 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={})
 
- 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 47 of file GEMGeometryESModule.cc.

Constructor & Destructor Documentation

◆ GEMGeometryESModule()

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

Constructor.

Definition at line 73 of file GEMGeometryESModule.cc.

74  : useDDD_{p.getParameter<bool>("useDDD")},
75  useDD4hep_{p.getUntrackedParameter<bool>("useDD4hep", false)},
76  applyAlignment_(p.getParameter<bool>("applyAlignment")),
77  alignmentsLabel_(p.getParameter<std::string>("alignmentsLabel")) {
78  auto cc = setWhatProduced(this);
79  if (useDDD_ || useDD4hep_) {
80  cc.setConsumes(cpvToken_).setConsumes(mdcToken_);
81  } else {
82  cc.setConsumes(riggemToken_);
83  }
84  if (applyAlignment_) {
88  }
89 }

References AlCaHLTBitMon_ParallelJobs::p.

◆ ~GEMGeometryESModule()

GEMGeometryESModule::~GEMGeometryESModule ( )
override

Destructor.

Definition at line 91 of file GEMGeometryESModule.cc.

91 {}

Member Function Documentation

◆ produce()

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

Produce GEMGeometry.

Definition at line 93 of file GEMGeometryESModule.cc.

93  {
94  auto gemGeometry = std::make_unique<GEMGeometry>();
95 
96  if (useDDD_) {
97  auto cpv = record.getTransientHandle(cpvToken_);
98  const auto& mdc = record.get(mdcToken_);
100  builder.build(*gemGeometry, cpv.product(), mdc);
101  } else if (useDD4hep_) {
103  const auto& mdc = record.get(mdcToken_);
105  builder.build(*gemGeometry, cpv.product(), mdc);
106  } else {
107  const auto& riggem = record.get(riggemToken_);
109  builder.build(*gemGeometry, riggem);
110  }
111 
112  if (applyAlignment_) {
113  const auto& globalPosition = record.get(globalPositionToken_);
114  const auto& alignments = record.get(alignmentsToken_);
115  const auto& alignmentErrors = record.get(alignmentErrorsToken_);
116 
117  // No alignment records, assume ideal geometry is wanted
118  if (alignments.empty() && alignmentErrors.empty() && globalPosition.empty()) {
119  edm::LogInfo("Config") << "@SUB=GEMGeometryRecord::produce"
120  << "Alignment(Error)s and global position (label '" << alignmentsLabel_
121  << "') empty: it is assumed fake and will not apply.";
122  } else {
123  GeometryAligner aligner;
124  aligner.applyAlignments<GEMGeometry>(gemGeometry.get(),
125  &alignments,
126  &alignmentErrors,
128  }
129  }
130 
131  return gemGeometry;
132 }

References alignmentErrorsToken_, alignmentsLabel_, alignmentsToken_, applyAlignment_, GeometryAligner::applyAlignments(), GEMGeometryBuilderFromCondDB::build(), GEMGeometryBuilderFromDDD::build(), cpvToken_, dd4hepcpvToken_, align::DetectorGlobalPosition(), globalPositionToken_, mdcToken_, DetId::Muon, edm::ESTransientHandle< T >::product(), GlobalPosition_Frontier_DevDB_cff::record, riggemToken_, useDD4hep_, and useDDD_.

Member Data Documentation

◆ alignmentErrorsToken_

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

Definition at line 70 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ alignmentsLabel_

const std::string GEMGeometryESModule::alignmentsLabel_
private

Definition at line 63 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ alignmentsToken_

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

Definition at line 69 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ applyAlignment_

bool GEMGeometryESModule::applyAlignment_
private

Definition at line 62 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ cpvToken_

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

Definition at line 64 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ dd4hepcpvToken_

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

Definition at line 66 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ globalPositionToken_

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

Definition at line 68 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ mdcToken_

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

Definition at line 65 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ riggemToken_

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

Definition at line 67 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ useDD4hep_

const bool GEMGeometryESModule::useDD4hep_
private

Definition at line 61 of file GEMGeometryESModule.cc.

Referenced by produce().

◆ useDDD_

const bool GEMGeometryESModule::useDDD_
private

Definition at line 60 of file GEMGeometryESModule.cc.

Referenced by produce().

edm::ESInputTag
Definition: ESInputTag.h:87
edm::ESTransientHandle::product
T const * product() const
Definition: ESTransientHandle.h:51
GEMGeometryESModule::alignmentsLabel_
const std::string alignmentsLabel_
Definition: GEMGeometryESModule.cc:63
GEMGeometryESModule::useDDD_
const bool useDDD_
Definition: GEMGeometryESModule.cc:60
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::LogInfo
Definition: MessageLogger.h:254
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
GlobalPosition_Frontier_DevDB_cff.record
record
Definition: GlobalPosition_Frontier_DevDB_cff.py:10
GEMGeometryBuilderFromDDD
Definition: GEMGeometryBuilderFromDDD.h:34
GEMGeometryBuilderFromDDD::build
void build(GEMGeometry &theGeometry, const DDCompactView *cview, const MuonGeometryConstants &muonConstants)
Definition: GEMGeometryBuilderFromDDD.cc:45
cc
DetId
Definition: DetId.h:17
GEMGeometryBuilderFromCondDB
Definition: GEMGeometryBuilderFromCondDB.h:14
GEMGeometryESModule::mdcToken_
edm::ESGetToken< MuonGeometryConstants, IdealGeometryRecord > mdcToken_
Definition: GEMGeometryESModule.cc:65
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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:68
GEMGeometryESModule::cpvToken_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvToken_
Definition: GEMGeometryESModule.cc:64
GEMGeometryESModule::riggemToken_
edm::ESGetToken< RecoIdealGeometry, GEMRecoGeometryRcd > riggemToken_
Definition: GEMGeometryESModule.cc:67
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
GEMGeometryESModule::alignmentsToken_
edm::ESGetToken< Alignments, GEMAlignmentRcd > alignmentsToken_
Definition: GEMGeometryESModule.cc:69
GEMGeometryESModule::dd4hepcpvToken_
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > dd4hepcpvToken_
Definition: GEMGeometryESModule.cc:66
GEMGeometryBuilderFromCondDB::build
void build(GEMGeometry &theGeometry, const RecoIdealGeometry &rgeo)
Definition: GEMGeometryBuilderFromCondDB.cc:20
GEMGeometry
Definition: GEMGeometry.h:24
DetId::Muon
Definition: DetId.h:26
GEMGeometryESModule::applyAlignment_
bool applyAlignment_
Definition: GEMGeometryESModule.cc:62
GEMGeometryESModule::alignmentErrorsToken_
edm::ESGetToken< AlignmentErrorsExtended, GEMAlignmentErrorExtendedRcd > alignmentErrorsToken_
Definition: GEMGeometryESModule.cc:70
GeometryAligner::applyAlignments
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
Definition: GeometryAligner.h:52
GEMGeometryESModule::useDD4hep_
const bool useDD4hep_
Definition: GEMGeometryESModule.cc:61
GeometryAligner
Class to update a given geometry with a set of alignments.
Definition: GeometryAligner.h:33