CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
CSCGeometryESModule Class Reference
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...
 
- 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 &)
 Creation of configuration file. More...
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 

Private Types

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

Private Member Functions

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

Private Attributes

edm::ESGetToken
< AlignmentErrorsExtended,
CSCAlignmentErrorExtendedRcd
alignmentErrorsToken_
 
const std::string alignmentsLabel_
 
edm::ESGetToken< Alignments,
CSCAlignmentRcd
alignmentsToken_
 
bool applyAlignment_
 
edm::ESGetToken< DDCompactView,
IdealGeometryRecord
cpvToken_
 
edm::ESGetToken
< cms::DDCompactView,
IdealGeometryRecord
cpvTokendd4hep_
 
bool debugV_
 
bool fromDD4hep_
 
bool fromDDD_
 
edm::ESGetToken< Alignments,
GlobalPositionRcd
globalPositionToken_
 
edm::ReusableObjectHolder
< HostType
holder_
 
edm::ESGetToken
< MuonGeometryConstants,
IdealGeometryRecord
mdcToken_
 
const std::string myLabel_
 
edm::ESGetToken
< CSCRecoDigiParameters,
CSCRecoDigiParametersRcd
rdpToken_
 
edm::ESGetToken
< RecoIdealGeometry,
CSCRecoGeometryRcd
rigToken_
 
bool useCentreTIOffsets_
 
bool useGangedStripsInME1a_
 
bool useOnlyWiresInME1a_
 
bool useRealWireGeometry_
 

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 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={})
 
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 49 of file CSCGeometryESModule.cc.

Member Typedef Documentation

Definition at line 61 of file CSCGeometryESModule.cc.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 94 of file CSCGeometryESModule.cc.

References alignmentErrorsToken_, alignmentsLabel_, alignmentsToken_, applyAlignment_, cpvToken_, cpvTokendd4hep_, debugV_, fromDD4hep_, fromDDD_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), globalPositionToken_, mdcToken_, myLabel_, rdpToken_, rigToken_, edm::ESProducer::setWhatProduced(), useCentreTIOffsets_, useGangedStripsInME1a_, useOnlyWiresInME1a_, and useRealWireGeometry_.

95  : fromDDD_(p.getParameter<bool>("fromDDD")),
96  fromDD4hep_(p.getParameter<bool>("fromDD4hep")),
97  alignmentsLabel_(p.getParameter<std::string>("alignmentsLabel")),
98  myLabel_(p.getParameter<std::string>("appendToDataLabel")) {
99  auto cc = setWhatProduced(this);
100 
101  // Choose wire geometry modelling
102  // We now _require_ some wire geometry specification in the CSCOrcaSpec.xml file
103  // in the DDD Geometry.
104  // Default as of transition to CMSSW is to use real values.
105  // Alternative is to use pseudo-values which match reasonably closely
106  // the calculated geometry values used up to and including ORCA_8_8_1.
107  // (This was the default in ORCA.)
108 
109  useRealWireGeometry_ = p.getParameter<bool>("useRealWireGeometry");
110 
111  // Suppress strips altogether in ME1a region of ME11?
112 
113  useOnlyWiresInME1a_ = p.getParameter<bool>("useOnlyWiresInME1a");
114 
115  // Allow strips in ME1a region of ME11 but gang them?
116  // Default is now to treat ME1a with ganged strips (e.g. in clusterizer)
117 
118  useGangedStripsInME1a_ = p.getParameter<bool>("useGangedStripsInME1a");
119 
120  if (useGangedStripsInME1a_)
121  useOnlyWiresInME1a_ = false; // override possible inconsistentcy
122 
123  // Use the backed-out offsets that correct the CTI
124  useCentreTIOffsets_ = p.getParameter<bool>("useCentreTIOffsets");
125 
126  // Debug printout etc. in CSCGeometry etc.
127 
128  debugV_ = p.getUntrackedParameter<bool>("debugV", false);
129 
130  if (fromDDD_) {
131  cpvToken_ = cc.consumes();
132  mdcToken_ = cc.consumes();
133  } else if (fromDD4hep_) {
134  cpvTokendd4hep_ = cc.consumes();
135  mdcToken_ = cc.consumes();
136  } else {
139  }
140 
141  // Feed these value to where I need them
142  applyAlignment_ = p.getParameter<bool>("applyAlignment");
143  if (applyAlignment_) {
148  }
149 
150  edm::LogVerbatim("Geometry") << "@SUB=CSCGeometryESModule Label '" << myLabel_ << "' "
151  << (applyAlignment_ ? "looking for" : "IGNORING") << " alignment labels '"
152  << alignmentsLabel_ << "'.";
153 }
Log< level::Info, true > LogVerbatim
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< Alignments, CSCAlignmentRcd > alignmentsToken_
const std::string alignmentsLabel_
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokendd4hep_
const std::string myLabel_
edm::ESGetToken< CSCRecoDigiParameters, CSCRecoDigiParametersRcd > rdpToken_
edm::ESGetToken< Alignments, GlobalPositionRcd > globalPositionToken_
edm::ESGetToken< AlignmentErrorsExtended, CSCAlignmentErrorExtendedRcd > alignmentErrorsToken_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< MuonGeometryConstants, IdealGeometryRecord > mdcToken_
edm::ESGetToken< RecoIdealGeometry, CSCRecoGeometryRcd > rigToken_

Member Function Documentation

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

Creation of configuration file.

Definition at line 155 of file CSCGeometryESModule.cc.

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

155  {
156  //
157  // This cfi should be included to build the CSC geometry model.
158  //
159  // modelling flags (for completeness - internal defaults are already sane)
160  // GF would like to have a shorter name (e.g. CSCGeometry), but since originally
161  // there was no name, replace statements in other configs would not work anymore...
163  desc.add<bool>("fromDDD", true);
164  desc.add<bool>("fromDD4hep", false);
165  desc.add<std::string>("alignmentsLabel", "");
166  desc.add<std::string>("appendToDataLabel", "");
167  desc.add<bool>("useRealWireGeometry", true);
168  desc.add<bool>("useOnlyWiresInME1a", false);
169  desc.add<bool>("useGangedStripsInME1a", true);
170  desc.add<bool>("useCentreTIOffsets", false);
171  desc.add<bool>("applyAlignment", true); //GF: to be abandoned
172  desc.addUntracked<bool>("debugV", false);
173  descriptions.add("CSCGeometryESModule", desc);
174 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void CSCGeometryESModule::initCSCGeometry_ ( const MuonGeometryRecord record,
std::shared_ptr< HostType > &  host 
)
private

Definition at line 206 of file CSCGeometryESModule.cc.

References CSCGeometryBuilder::build(), CSCGeometryBuilderFromDDD::build(), edm::eventsetup::EventSetupRecordImplementation< T >::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getTransientHandle(), query::host, edm::ESTransientHandle< T >::product(), and GlobalPosition_Frontier_DevDB_cff::record.

206  {
207  if (fromDDD_) {
208  edm::LogVerbatim("CSCGeoemtryESModule") << "(0) CSCGeometryESModule - DDD ";
209  host->ifRecordChanges<IdealGeometryRecord>(record, [&host, &record, this](auto const& rec) {
210  host->clear();
212  const auto& mdc = rec.get(mdcToken_);
214  builder.build(*host, cpv.product(), mdc);
215  });
216  } else if (fromDD4hep_) {
217  edm::LogVerbatim("CSCGeoemtryESModule") << "(0) CSCGeometryESModule - DD4hep ";
218  host->ifRecordChanges<IdealGeometryRecord>(record, [&host, &record, this](auto const& rec) {
219  host->clear();
221  const auto& mdc = rec.get(mdcToken_);
223  builder.build(*host, cpv.product(), mdc);
224  });
225  } else {
226  bool recreateGeometry = false;
227 
228  host->ifRecordChanges<CSCRecoGeometryRcd>(record,
229  [&recreateGeometry](auto const& rec) { recreateGeometry = true; });
230 
231  host->ifRecordChanges<CSCRecoDigiParametersRcd>(record,
232  [&recreateGeometry](auto const& rec) { recreateGeometry = true; });
233  edm::LogVerbatim("CSCGeoemtryESModule") << "(0) CSCGeometryESModule - DB recreateGeometry=false ";
234  if (recreateGeometry) {
235  edm::LogVerbatim("CSCGeoemtryESModule") << "(0) CSCGeometryESModule - DB recreateGeometry=true ";
236  host->clear();
237  const auto& rig = record.get(rigToken_);
238  const auto& rdp = record.get(rdpToken_);
239  CSCGeometryBuilder cscgb;
240  cscgb.build(*host, rig, rdp);
241  }
242  }
243 }
Log< level::Info, true > LogVerbatim
void build(CSCGeometry &geom, const DDCompactView *fv, const MuonGeometryConstants &muonConstants)
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokendd4hep_
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
void build(CSCGeometry &theGeometry, const RecoIdealGeometry &rig, const CSCRecoDigiParameters &cscpars)
Build the geometry.
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
edm::ESGetToken< CSCRecoDigiParameters, CSCRecoDigiParametersRcd > rdpToken_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvToken_
string host
Definition: query.py:115
T const * product() const
edm::ESGetToken< MuonGeometryConstants, IdealGeometryRecord > mdcToken_
edm::ESGetToken< RecoIdealGeometry, CSCRecoGeometryRcd > rigToken_
std::shared_ptr< CSCGeometry > CSCGeometryESModule::produce ( const MuonGeometryRecord record)

Produce CSCGeometry.

Definition at line 176 of file CSCGeometryESModule.cc.

References GeometryAligner::applyAlignments(), align::DetectorGlobalPosition(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), query::host, and DetId::Muon.

176  {
177  auto host = holder_.makeOrGet([this]() {
178  return new HostType(
180  });
181 
182  initCSCGeometry_(record, host);
183 
184  // Called whenever the alignments or alignment errors change
185 
186  if (applyAlignment_) {
187  // applyAlignment_ is scheduled for removal.
188  // Ideal geometry obtained by using 'fake alignment' (with applyAlignment_ = true)
189  const auto& globalPosition = record.get(globalPositionToken_);
190  const auto& alignments = record.get(alignmentsToken_);
191  const auto& alignmentErrors = record.get(alignmentErrorsToken_);
192  // Only apply alignment if values exist
193  if (alignments.empty() && alignmentErrors.empty() && globalPosition.empty()) {
194  edm::LogVerbatim("Config") << "@SUB=CSCGeometryRecord::produce Alignment(Error)s and global position (label '"
195  << alignmentsLabel_ << "') empty: Geometry producer (label "
196  << "'" << myLabel_ << "') assumes fake and does not apply.";
197  } else {
198  GeometryAligner aligner;
199  aligner.applyAlignments<CSCGeometry>(
200  &(*host), &alignments, &alignmentErrors, align::DetectorGlobalPosition(globalPosition, DetId(DetId::Muon)));
201  }
202  }
203  return host; // automatically converts to std::shared_ptr<CSCGeometry>
204 }
Log< level::Info, true > LogVerbatim
edm::ESGetToken< Alignments, CSCAlignmentRcd > alignmentsToken_
const std::string alignmentsLabel_
Class to update a given geometry with a set of alignments.
const std::string myLabel_
edm::ESProductHost< CSCGeometry, IdealGeometryRecord, CSCRecoGeometryRcd, CSCRecoDigiParametersRcd > HostType
void initCSCGeometry_(const MuonGeometryRecord &, std::shared_ptr< HostType > &host)
edm::ESGetToken< Alignments, GlobalPositionRcd > globalPositionToken_
void applyAlignments(const C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESGetToken< AlignmentErrorsExtended, CSCAlignmentErrorExtendedRcd > alignmentErrorsToken_
std::shared_ptr< T > makeOrGet(FM &&iMakeFunc)
Takes an object from the queue if one is available, or creates one using iMakeFunc.
string host
Definition: query.py:115
Definition: DetId.h:17
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
edm::ReusableObjectHolder< HostType > holder_

Member Data Documentation

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

Definition at line 77 of file CSCGeometryESModule.cc.

Referenced by CSCGeometryESModule().

const std::string CSCGeometryESModule::alignmentsLabel_
private

Definition at line 88 of file CSCGeometryESModule.cc.

Referenced by CSCGeometryESModule().

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

Definition at line 76 of file CSCGeometryESModule.cc.

Referenced by CSCGeometryESModule().

bool CSCGeometryESModule::applyAlignment_
private

Definition at line 85 of file CSCGeometryESModule.cc.

Referenced by CSCGeometryESModule().

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

Definition at line 67 of file CSCGeometryESModule.cc.

Referenced by CSCGeometryESModule().

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

Definition at line 70 of file CSCGeometryESModule.cc.

Referenced by CSCGeometryESModule().

bool CSCGeometryESModule::debugV_
private

Definition at line 84 of file CSCGeometryESModule.cc.

Referenced by CSCGeometryESModule().

bool CSCGeometryESModule::fromDD4hep_
private

Definition at line 87 of file CSCGeometryESModule.cc.

Referenced by CSCGeometryESModule().

bool CSCGeometryESModule::fromDDD_
private

Definition at line 86 of file CSCGeometryESModule.cc.

Referenced by CSCGeometryESModule().

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

Definition at line 75 of file CSCGeometryESModule.cc.

Referenced by CSCGeometryESModule().

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

Definition at line 65 of file CSCGeometryESModule.cc.

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

Definition at line 68 of file CSCGeometryESModule.cc.

Referenced by CSCGeometryESModule().

const std::string CSCGeometryESModule::myLabel_
private

Definition at line 89 of file CSCGeometryESModule.cc.

Referenced by CSCGeometryESModule().

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

Definition at line 73 of file CSCGeometryESModule.cc.

Referenced by CSCGeometryESModule().

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

Definition at line 72 of file CSCGeometryESModule.cc.

Referenced by CSCGeometryESModule().

bool CSCGeometryESModule::useCentreTIOffsets_
private

Definition at line 83 of file CSCGeometryESModule.cc.

Referenced by CSCGeometryESModule().

bool CSCGeometryESModule::useGangedStripsInME1a_
private

Definition at line 82 of file CSCGeometryESModule.cc.

Referenced by CSCGeometryESModule().

bool CSCGeometryESModule::useOnlyWiresInME1a_
private

Definition at line 81 of file CSCGeometryESModule.cc.

Referenced by CSCGeometryESModule().

bool CSCGeometryESModule::useRealWireGeometry_
private

Definition at line 80 of file CSCGeometryESModule.cc.

Referenced by CSCGeometryESModule().