CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
CSCGeometryESModule Class Reference

#include <CSCGeometryESModule.h>

Inheritance diagram for CSCGeometryESModule:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 CSCGeometryESModule (const edm::ParameterSet &p)
 Constructor. More...
 
std::shared_ptr< CSCGeometryproduce (const MuonGeometryRecord &record)
 Produce CSCGeometry. More...
 
 ~CSCGeometryESModule () 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 Types

using HostType = edm::ESProductHost< CSCGeometry, MuonNumberingRecord, CSCRecoGeometryRcd, CSCRecoDigiParametersRcd >
 

Private Member Functions

void initCSCGeometry_ (const MuonGeometryRecord &, std::shared_ptr< HostType > &host)
 

Private Attributes

edm::ESGetToken< AlignmentErrorsExtended, CSCAlignmentErrorExtendedRcdalignmentErrorsToken_
 
const std::string alignmentsLabel_
 
edm::ESGetToken< Alignments, CSCAlignmentRcdalignmentsToken_
 
bool applyAlignment_
 
edm::ESGetToken< DDCompactView, IdealGeometryRecordcpvToken_
 
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecordcpvTokendd4hep_
 
bool debugV
 
edm::ESGetToken< Alignments, GlobalPositionRcdglobalPositionToken_
 
edm::ReusableObjectHolder< HostTypeholder_
 
edm::ESGetToken< MuonGeometryConstants, IdealGeometryRecordmdcToken_
 
edm::ESGetToken< cms::MuonNumbering, MuonNumberingRecordmdcTokendd4hep_
 
const std::string myLabel_
 
edm::ESGetToken< CSCRecoDigiParameters, CSCRecoDigiParametersRcdrdpToken_
 
edm::ESGetToken< RecoIdealGeometry, CSCRecoGeometryRcdrigToken_
 
bool useCentreTIOffsets
 
bool useDD4hep_
 
bool useDDD_
 
bool useGangedStripsInME1a
 
bool useOnlyWiresInME1a
 
bool useRealWireGeometry
 

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 45 of file CSCGeometryESModule.h.

Member Typedef Documentation

◆ HostType

Definition at line 57 of file CSCGeometryESModule.h.

Constructor & Destructor Documentation

◆ CSCGeometryESModule()

CSCGeometryESModule::CSCGeometryESModule ( const edm::ParameterSet p)

Constructor.

Definition at line 30 of file CSCGeometryESModule.cc.

31  : useDDD_(p.getParameter<bool>("useDDD")),
32  useDD4hep_{p.getUntrackedParameter<bool>("useDD4hep", false)},
33  alignmentsLabel_(p.getParameter<std::string>("alignmentsLabel")),
34  myLabel_(p.getParameter<std::string>("appendToDataLabel")) {
35  auto cc = setWhatProduced(this);
36 
37  // Choose wire geometry modelling
38  // We now _require_ some wire geometry specification in the CSCOrcaSpec.xml file
39  // in the DDD Geometry.
40  // Default as of transition to CMSSW is to use real values.
41  // Alternative is to use pseudo-values which match reasonably closely
42  // the calculated geometry values used up to and including ORCA_8_8_1.
43  // (This was the default in ORCA.)
44 
45  useRealWireGeometry = p.getParameter<bool>("useRealWireGeometry");
46 
47  // Suppress strips altogether in ME1a region of ME11?
48 
49  useOnlyWiresInME1a = p.getParameter<bool>("useOnlyWiresInME1a");
50 
51  // Allow strips in ME1a region of ME11 but gang them?
52  // Default is now to treat ME1a with ganged strips (e.g. in clusterizer)
53 
54  useGangedStripsInME1a = p.getParameter<bool>("useGangedStripsInME1a");
55 
57  useOnlyWiresInME1a = false; // override possible inconsistentcy
58 
59  // Use the backed-out offsets that correct the CTI
60  useCentreTIOffsets = p.getParameter<bool>("useCentreTIOffsets");
61 
62  // Debug printout etc. in CSCGeometry etc.
63 
64  debugV = p.getUntrackedParameter<bool>("debugV", false);
65 
66  // Find out if using the DDD or CondDB Geometry source.
67  useDDD_ = p.getParameter<bool>("useDDD");
68  if (useDDD_) {
71  } else if (useDD4hep_) {
74  } else {
77  }
78 
79  // Feed these value to where I need them
80  applyAlignment_ = p.getParameter<bool>("applyAlignment");
81  if (applyAlignment_) {
86  }
87 
88  edm::LogInfo("Geometry") << "@SUB=CSCGeometryESModule"
89  << "Label '" << myLabel_ << "' " << (applyAlignment_ ? "looking for" : "IGNORING")
90  << " alignment labels '" << alignmentsLabel_ << "'.";
91 }

References AlCaHLTBitMon_ParallelJobs::p.

◆ ~CSCGeometryESModule()

CSCGeometryESModule::~CSCGeometryESModule ( )
override

Destructor.

Definition at line 93 of file CSCGeometryESModule.cc.

93 {}

Member Function Documentation

◆ initCSCGeometry_()

void CSCGeometryESModule::initCSCGeometry_ ( const MuonGeometryRecord record,
std::shared_ptr< HostType > &  host 
)
private

Definition at line 125 of file CSCGeometryESModule.cc.

125  {
126  if (useDDD_) {
127  host->ifRecordChanges<MuonNumberingRecord>(record, [&host, &record, this](auto const& rec) {
128  host->clear();
129  edm::ESTransientHandle<DDCompactView> cpv = record.getTransientHandle(cpvToken_);
130  const auto& mdc = rec.get(mdcToken_);
132  builder.build(*host, cpv.product(), mdc);
133  });
134  } else if (useDD4hep_) {
135  host->ifRecordChanges<MuonNumberingRecord>(record, [&host, &record, this](auto const& rec) {
136  host->clear();
138  const auto& mdc = rec.get(mdcTokendd4hep_);
140  builder.build(*host, cpv.product(), mdc);
141  });
142  } else {
143  bool recreateGeometry = false;
144 
145  host->ifRecordChanges<CSCRecoGeometryRcd>(record,
146  [&recreateGeometry](auto const& rec) { recreateGeometry = true; });
147 
148  host->ifRecordChanges<CSCRecoDigiParametersRcd>(record,
149  [&recreateGeometry](auto const& rec) { recreateGeometry = true; });
150 
151  if (recreateGeometry) {
152  host->clear();
153  const auto& rig = record.get(rigToken_);
154  const auto& rdp = record.get(rdpToken_);
155  CSCGeometryBuilder cscgb;
156  cscgb.build(*host, rig, rdp);
157  }
158  }
159 }

References CSCGeometryBuilder::build(), CSCGeometryBuilderFromDDD::build(), cpvToken_, cpvTokendd4hep_, query::host, mdcToken_, mdcTokendd4hep_, edm::ESTransientHandle< T >::product(), rdpToken_, GlobalPosition_Frontier_DevDB_cff::record, rigToken_, useDD4hep_, and useDDD_.

Referenced by produce().

◆ produce()

std::shared_ptr< CSCGeometry > CSCGeometryESModule::produce ( const MuonGeometryRecord record)

Produce CSCGeometry.

Definition at line 95 of file CSCGeometryESModule.cc.

95  {
96  auto host = holder_.makeOrGet([this]() {
98  });
99 
101 
102  // Called whenever the alignments or alignment errors change
103 
104  if (applyAlignment_) {
105  // applyAlignment_ is scheduled for removal.
106  // Ideal geometry obtained by using 'fake alignment' (with applyAlignment_ = true)
107  const auto& globalPosition = record.get(globalPositionToken_);
108  const auto& alignments = record.get(alignmentsToken_);
109  const auto& alignmentErrors = record.get(alignmentErrorsToken_);
110  // Only apply alignment if values exist
111  if (alignments.empty() && alignmentErrors.empty() && globalPosition.empty()) {
112  edm::LogInfo("Config") << "@SUB=CSCGeometryRecord::produce"
113  << "Alignment(Error)s and global position (label '" << alignmentsLabel_
114  << "') empty: Geometry producer (label "
115  << "'" << myLabel_ << "') assumes fake and does not apply.";
116  } else {
117  GeometryAligner aligner;
118  aligner.applyAlignments<CSCGeometry>(
119  &(*host), &alignments, &alignmentErrors, align::DetectorGlobalPosition(globalPosition, DetId(DetId::Muon)));
120  }
121  }
122  return host; // automatically converts to std::shared_ptr<CSCGeometry>
123 }

References alignmentErrorsToken_, alignmentsLabel_, alignmentsToken_, applyAlignment_, GeometryAligner::applyAlignments(), debugV, align::DetectorGlobalPosition(), globalPositionToken_, holder_, query::host, initCSCGeometry_(), edm::ReusableObjectHolder< T, Deleter >::makeOrGet(), DetId::Muon, myLabel_, GlobalPosition_Frontier_DevDB_cff::record, useCentreTIOffsets, useGangedStripsInME1a, useOnlyWiresInME1a, and useRealWireGeometry.

Member Data Documentation

◆ alignmentErrorsToken_

edm::ESGetToken<AlignmentErrorsExtended, CSCAlignmentErrorExtendedRcd> CSCGeometryESModule::alignmentErrorsToken_
private

Definition at line 74 of file CSCGeometryESModule.h.

Referenced by produce().

◆ alignmentsLabel_

const std::string CSCGeometryESModule::alignmentsLabel_
private

Definition at line 85 of file CSCGeometryESModule.h.

Referenced by produce().

◆ alignmentsToken_

edm::ESGetToken<Alignments, CSCAlignmentRcd> CSCGeometryESModule::alignmentsToken_
private

Definition at line 73 of file CSCGeometryESModule.h.

Referenced by produce().

◆ applyAlignment_

bool CSCGeometryESModule::applyAlignment_
private

Definition at line 82 of file CSCGeometryESModule.h.

Referenced by produce().

◆ cpvToken_

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

Definition at line 63 of file CSCGeometryESModule.h.

Referenced by initCSCGeometry_().

◆ cpvTokendd4hep_

edm::ESGetToken<cms::DDCompactView, IdealGeometryRecord> CSCGeometryESModule::cpvTokendd4hep_
private

Definition at line 66 of file CSCGeometryESModule.h.

Referenced by initCSCGeometry_().

◆ debugV

bool CSCGeometryESModule::debugV
private

Definition at line 81 of file CSCGeometryESModule.h.

Referenced by produce().

◆ globalPositionToken_

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

Definition at line 72 of file CSCGeometryESModule.h.

Referenced by produce().

◆ holder_

edm::ReusableObjectHolder<HostType> CSCGeometryESModule::holder_
private

Definition at line 61 of file CSCGeometryESModule.h.

Referenced by produce().

◆ mdcToken_

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

Definition at line 64 of file CSCGeometryESModule.h.

Referenced by initCSCGeometry_().

◆ mdcTokendd4hep_

edm::ESGetToken<cms::MuonNumbering, MuonNumberingRecord> CSCGeometryESModule::mdcTokendd4hep_
private

Definition at line 67 of file CSCGeometryESModule.h.

Referenced by initCSCGeometry_().

◆ myLabel_

const std::string CSCGeometryESModule::myLabel_
private

Definition at line 86 of file CSCGeometryESModule.h.

Referenced by produce().

◆ rdpToken_

edm::ESGetToken<CSCRecoDigiParameters, CSCRecoDigiParametersRcd> CSCGeometryESModule::rdpToken_
private

Definition at line 70 of file CSCGeometryESModule.h.

Referenced by initCSCGeometry_().

◆ rigToken_

edm::ESGetToken<RecoIdealGeometry, CSCRecoGeometryRcd> CSCGeometryESModule::rigToken_
private

Definition at line 69 of file CSCGeometryESModule.h.

Referenced by initCSCGeometry_().

◆ useCentreTIOffsets

bool CSCGeometryESModule::useCentreTIOffsets
private

Definition at line 80 of file CSCGeometryESModule.h.

Referenced by produce().

◆ useDD4hep_

bool CSCGeometryESModule::useDD4hep_
private

Definition at line 84 of file CSCGeometryESModule.h.

Referenced by initCSCGeometry_().

◆ useDDD_

bool CSCGeometryESModule::useDDD_
private

Definition at line 83 of file CSCGeometryESModule.h.

Referenced by initCSCGeometry_().

◆ useGangedStripsInME1a

bool CSCGeometryESModule::useGangedStripsInME1a
private

Definition at line 79 of file CSCGeometryESModule.h.

Referenced by produce().

◆ useOnlyWiresInME1a

bool CSCGeometryESModule::useOnlyWiresInME1a
private

Definition at line 78 of file CSCGeometryESModule.h.

Referenced by produce().

◆ useRealWireGeometry

bool CSCGeometryESModule::useRealWireGeometry
private

Definition at line 77 of file CSCGeometryESModule.h.

Referenced by produce().

MuonGeometryConstants
Definition: MuonGeometryConstants.h:20
edm::ESInputTag
Definition: ESInputTag.h:87
edm::ESTransientHandle::product
T const * product() const
Definition: ESTransientHandle.h:51
CSCRecoDigiParameters
Definition: CSCRecoDigiParameters.h:18
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
CSCGeometryESModule::useGangedStripsInME1a
bool useGangedStripsInME1a
Definition: CSCGeometryESModule.h:79
CSCGeometryESModule::globalPositionToken_
edm::ESGetToken< Alignments, GlobalPositionRcd > globalPositionToken_
Definition: CSCGeometryESModule.h:72
CSCGeometryESModule::useRealWireGeometry
bool useRealWireGeometry
Definition: CSCGeometryESModule.h:77
GlobalPositionRcd
Definition: GlobalPositionRcd.h:6
cc
query.host
host
Definition: query.py:115
edm::ReusableObjectHolder::makeOrGet
std::shared_ptr< T > makeOrGet(F iFunc)
If there isn't an object already available, creates a new one using iFunc.
Definition: ReusableObjectHolder.h:126
CSCGeometry
Definition: CSCGeometry.h:24
DetId
Definition: DetId.h:17
CSCGeometryESModule::alignmentErrorsToken_
edm::ESGetToken< AlignmentErrorsExtended, CSCAlignmentErrorExtendedRcd > alignmentErrorsToken_
Definition: CSCGeometryESModule.h:74
CSCGeometryBuilder
Definition: CSCGeometryBuilder.h:20
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
CSCGeometryESModule::mdcTokendd4hep_
edm::ESGetToken< cms::MuonNumbering, MuonNumberingRecord > mdcTokendd4hep_
Definition: CSCGeometryESModule.h:67
CSCGeometryBuilder::build
void build(CSCGeometry &theGeometry, const RecoIdealGeometry &rig, const CSCRecoDigiParameters &cscpars)
Build the geometry.
Definition: CSCGeometryBuilder.cc:17
CSCGeometryESModule::useOnlyWiresInME1a
bool useOnlyWiresInME1a
Definition: CSCGeometryESModule.h:78
CSCGeometryESModule::mdcToken_
edm::ESGetToken< MuonGeometryConstants, IdealGeometryRecord > mdcToken_
Definition: CSCGeometryESModule.h:64
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CSCGeometryESModule::useDD4hep_
bool useDD4hep_
Definition: CSCGeometryESModule.h:84
CSCAlignmentErrorExtendedRcd
Definition: CSCAlignmentErrorExtendedRcd.h:6
align::DetectorGlobalPosition
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
Definition: DetectorGlobalPosition.cc:10
CSCRecoDigiParametersRcd
Definition: CSCRecoDigiParametersRcd.h:5
CSCGeometryBuilderFromDDD::build
void build(CSCGeometry &geom, const DDCompactView *fv, const MuonGeometryConstants &muonConstants)
Definition: CSCGeometryBuilderFromDDD.cc:32
cms::MuonNumbering
Definition: DD4hep_MuonNumbering.h:37
CSCGeometryESModule::debugV
bool debugV
Definition: CSCGeometryESModule.h:81
CSCGeometryESModule::cpvToken_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvToken_
Definition: CSCGeometryESModule.h:63
AlignmentErrorsExtended
Definition: AlignmentErrorsExtended.h:10
CSCGeometryESModule::alignmentsToken_
edm::ESGetToken< Alignments, CSCAlignmentRcd > alignmentsToken_
Definition: CSCGeometryESModule.h:73
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
CSCGeometryBuilderFromDDD
Definition: CSCGeometryBuilderFromDDD.h:30
CSCGeometryESModule::cpvTokendd4hep_
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokendd4hep_
Definition: CSCGeometryESModule.h:66
CSCGeometryESModule::useCentreTIOffsets
bool useCentreTIOffsets
Definition: CSCGeometryESModule.h:80
cms::DDCompactView
Definition: DDCompactView.h:29
CSCGeometryESModule::rigToken_
edm::ESGetToken< RecoIdealGeometry, CSCRecoGeometryRcd > rigToken_
Definition: CSCGeometryESModule.h:69
CSCGeometryESModule::applyAlignment_
bool applyAlignment_
Definition: CSCGeometryESModule.h:82
CSCGeometryESModule::rdpToken_
edm::ESGetToken< CSCRecoDigiParameters, CSCRecoDigiParametersRcd > rdpToken_
Definition: CSCGeometryESModule.h:70
DetId::Muon
Definition: DetId.h:26
MuonNumberingRecord
Definition: MuonNumberingRecord.h:30
CSCGeometryESModule::myLabel_
const std::string myLabel_
Definition: CSCGeometryESModule.h:86
Alignments
Definition: Alignments.h:10
CSCGeometryESModule::holder_
edm::ReusableObjectHolder< HostType > holder_
Definition: CSCGeometryESModule.h:61
GeometryAligner::applyAlignments
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
Definition: GeometryAligner.h:52
IdealGeometryRecord
Definition: IdealGeometryRecord.h:27
RecoIdealGeometry
Definition: RecoIdealGeometry.h:28
CSCAlignmentRcd
Definition: CSCAlignmentRcd.h:6
CSCGeometryESModule::useDDD_
bool useDDD_
Definition: CSCGeometryESModule.h:83
GeometryAligner
Class to update a given geometry with a set of alignments.
Definition: GeometryAligner.h:33
CSCGeometryESModule::alignmentsLabel_
const std::string alignmentsLabel_
Definition: CSCGeometryESModule.h:85
CSCRecoGeometryRcd
Definition: CSCRecoGeometryRcd.h:5
CSCGeometryESModule::HostType
edm::ESProductHost< CSCGeometry, MuonNumberingRecord, CSCRecoGeometryRcd, CSCRecoDigiParametersRcd > HostType
Definition: CSCGeometryESModule.h:57
CSCGeometryESModule::initCSCGeometry_
void initCSCGeometry_(const MuonGeometryRecord &, std::shared_ptr< HostType > &host)
Definition: CSCGeometryESModule.cc:125