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 ()(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< Alignments, GlobalPositionRcdglobalPositionToken_
 
edm::ESGetToken< MuonDDDConstants, MuonNumberingRecordmdcToken_
 
edm::ESGetToken< RecoIdealGeometry, GEMRecoGeometryRcdriggemToken_
 
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 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 >
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 38 of file GEMGeometryESModule.cc.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 62 of file GEMGeometryESModule.cc.

References alignmentErrorsToken_, alignmentsLabel_, alignmentsToken_, applyAlignment_, cpvToken_, globalPositionToken_, mdcToken_, riggemToken_, edm::ESProducer::setWhatProduced(), and useDDD_.

63  : useDDD_(p.getParameter<bool>("useDDD")),
64  applyAlignment_(p.getParameter<bool>("applyAlignment")),
65  alignmentsLabel_(p.getParameter<std::string>("alignmentsLabel")) {
66  auto cc = setWhatProduced(this);
67  if (useDDD_) {
68  cc.setConsumes(cpvToken_).setConsumes(mdcToken_);
69  } else {
70  cc.setConsumes(riggemToken_);
71  }
72  if (applyAlignment_) {
76  }
77 }
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
edm::ESGetToken< AlignmentErrorsExtended, GEMAlignmentErrorExtendedRcd > alignmentErrorsToken_
edm::ESGetToken< Alignments, GlobalPositionRcd > globalPositionToken_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvToken_
edm::ESGetToken< RecoIdealGeometry, GEMRecoGeometryRcd > riggemToken_
edm::ESGetToken< MuonDDDConstants, MuonNumberingRecord > mdcToken_
edm::ESGetToken< Alignments, GEMAlignmentRcd > alignmentsToken_
const std::string alignmentsLabel_
GEMGeometryESModule::~GEMGeometryESModule ( )
override

Destructor.

Definition at line 79 of file GEMGeometryESModule.cc.

79 {}

Member Function Documentation

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

Produce GEMGeometry.

Definition at line 81 of file GEMGeometryESModule.cc.

References alignmentErrorsToken_, alignmentsLabel_, alignmentsToken_, applyAlignment_, GeometryAligner::applyAlignments(), GEMGeometryBuilderFromCondDB::build(), GEMGeometryBuilderFromDDD::build(), cpvToken_, DEFINE_FWK_EVENTSETUP_MODULE, align::DetectorGlobalPosition(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getTransientHandle(), globalPositionToken_, mdcToken_, DetId::Muon, riggemToken_, and useDDD_.

81  {
82  auto gemGeometry = std::make_unique<GEMGeometry>();
83 
84  if (useDDD_) {
85  auto cpv = record.getTransientHandle(cpvToken_);
86  const auto& mdc = record.get(mdcToken_);
88  builder.build(*gemGeometry, cpv.product(), mdc);
89  } else {
90  const auto& riggem = record.get(riggemToken_);
92  builder.build(*gemGeometry, riggem);
93  }
94 
95  if (applyAlignment_) {
96  const auto& globalPosition = record.get(globalPositionToken_);
97  const auto& alignments = record.get(alignmentsToken_);
98  const auto& alignmentErrors = record.get(alignmentErrorsToken_);
99 
100  // No alignment records, assume ideal geometry is wanted
101  if (alignments.empty() && alignmentErrors.empty() && globalPosition.empty()) {
102  edm::LogInfo("Config") << "@SUB=GEMGeometryRecord::produce"
103  << "Alignment(Error)s and global position (label '" << alignmentsLabel_
104  << "') empty: it is assumed fake and will not apply.";
105  } else {
106  GeometryAligner aligner;
107  aligner.applyAlignments<GEMGeometry>(gemGeometry.get(),
108  &alignments,
109  &alignmentErrors,
111  }
112  }
113 
114  return gemGeometry;
115 }
edm::ESGetToken< AlignmentErrorsExtended, GEMAlignmentErrorExtendedRcd > alignmentErrorsToken_
Class to update a given geometry with a set of alignments.
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
void build(GEMGeometry &theGeometry, const DDCompactView *cview, const MuonDDDConstants &muonConstants)
edm::ESGetToken< Alignments, GlobalPositionRcd > globalPositionToken_
Definition: DetId.h:17
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvToken_
edm::ESGetToken< RecoIdealGeometry, GEMRecoGeometryRcd > riggemToken_
edm::ESGetToken< MuonDDDConstants, MuonNumberingRecord > mdcToken_
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

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

Definition at line 59 of file GEMGeometryESModule.cc.

Referenced by GEMGeometryESModule(), and produce().

const std::string GEMGeometryESModule::alignmentsLabel_
private

Definition at line 53 of file GEMGeometryESModule.cc.

Referenced by GEMGeometryESModule(), and produce().

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

Definition at line 58 of file GEMGeometryESModule.cc.

Referenced by GEMGeometryESModule(), and produce().

bool GEMGeometryESModule::applyAlignment_
private

Definition at line 52 of file GEMGeometryESModule.cc.

Referenced by GEMGeometryESModule(), and produce().

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

Definition at line 54 of file GEMGeometryESModule.cc.

Referenced by GEMGeometryESModule(), and produce().

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

Definition at line 57 of file GEMGeometryESModule.cc.

Referenced by GEMGeometryESModule(), and produce().

edm::ESGetToken<MuonDDDConstants, MuonNumberingRecord> GEMGeometryESModule::mdcToken_
private

Definition at line 55 of file GEMGeometryESModule.cc.

Referenced by GEMGeometryESModule(), and produce().

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

Definition at line 56 of file GEMGeometryESModule.cc.

Referenced by GEMGeometryESModule(), and produce().

bool GEMGeometryESModule::useDDD_
private

Definition at line 51 of file GEMGeometryESModule.cc.

Referenced by GEMGeometryESModule(), and produce().