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 ()
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
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_
 
bool debugV
 
edm::ESGetToken< Alignments, GlobalPositionRcdglobalPositionToken_
 
edm::ReusableObjectHolder< HostTypeholder_
 
edm::ESGetToken< MuonDDDConstants, MuonNumberingRecordmdcToken_
 
const std::string myLabel_
 
edm::ESGetToken< CSCRecoDigiParameters, CSCRecoDigiParametersRcdrdpToken_
 
edm::ESGetToken< RecoIdealGeometry, CSCRecoGeometryRcdrigToken_
 
bool useCentreTIOffsets
 
bool useDDD_
 
bool useGangedStripsInME1a
 
bool useOnlyWiresInME1a
 
bool useRealWireGeometry
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ESProducer
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
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 eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 

Detailed Description

ESProducer for CSCGeometry in MuonGeometryRecord

Author
Tim Cox

Definition at line 40 of file CSCGeometryESModule.h.

Member Typedef Documentation

Definition at line 57 of file CSCGeometryESModule.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 16 of file CSCGeometryESModule.cc.

References alignmentErrorsToken_, alignmentsLabel_, alignmentsToken_, applyAlignment_, cpvToken_, debugV, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), globalPositionToken_, mdcToken_, myLabel_, rdpToken_, rigToken_, edm::ESProducer::setWhatProduced(), useCentreTIOffsets, useDDD_, useGangedStripsInME1a, useOnlyWiresInME1a, and useRealWireGeometry.

17  : alignmentsLabel_(p.getParameter<std::string>("alignmentsLabel")),
18  myLabel_(p.getParameter<std::string>("appendToDataLabel"))
19 {
20  auto cc = setWhatProduced(this);
21 
22  // Choose wire geometry modelling
23  // We now _require_ some wire geometry specification in the CSCOrcaSpec.xml file
24  // in the DDD Geometry.
25  // Default as of transition to CMSSW is to use real values.
26  // Alternative is to use pseudo-values which match reasonably closely
27  // the calculated geometry values used up to and including ORCA_8_8_1.
28  // (This was the default in ORCA.)
29 
30  useRealWireGeometry = p.getParameter<bool>("useRealWireGeometry");
31 
32  // Suppress strips altogether in ME1a region of ME11?
33 
34  useOnlyWiresInME1a = p.getParameter<bool>("useOnlyWiresInME1a");
35 
36  // Allow strips in ME1a region of ME11 but gang them?
37  // Default is now to treat ME1a with ganged strips (e.g. in clusterizer)
38 
39  useGangedStripsInME1a = p.getParameter<bool>("useGangedStripsInME1a");
40 
41  if ( useGangedStripsInME1a ) useOnlyWiresInME1a = false; // override possible inconsistentcy
42 
43  // Use the backed-out offsets that correct the CTI
44  useCentreTIOffsets = p.getParameter<bool>("useCentreTIOffsets");
45 
46  // Debug printout etc. in CSCGeometry etc.
47 
48  debugV = p.getUntrackedParameter<bool>("debugV", false);
49 
50  // Find out if using the DDD or CondDB Geometry source.
51  useDDD_ = p.getParameter<bool>("useDDD");
52  if(useDDD_) {
55  }
56  else {
59  }
60 
61  // Feed these value to where I need them
62  applyAlignment_ = p.getParameter<bool>("applyAlignment");
63  if(applyAlignment_) {
67  }
68 
69 
70  edm::LogInfo("Geometry") << "@SUB=CSCGeometryESModule"
71  << "Label '" << myLabel_ << "' "
72  << (applyAlignment_ ? "looking for" : "IGNORING")
73  << " alignment labels '" << alignmentsLabel_ << "'.";
74 }
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< Alignments, CSCAlignmentRcd > alignmentsToken_
const std::string alignmentsLabel_
const std::string myLabel_
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
edm::ESGetToken< CSCRecoDigiParameters, CSCRecoDigiParametersRcd > rdpToken_
edm::ESGetToken< Alignments, GlobalPositionRcd > globalPositionToken_
edm::ESGetToken< AlignmentErrorsExtended, CSCAlignmentErrorExtendedRcd > alignmentErrorsToken_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvToken_
edm::ESGetToken< MuonDDDConstants, MuonNumberingRecord > mdcToken_
edm::ESGetToken< RecoIdealGeometry, CSCRecoGeometryRcd > rigToken_
CSCGeometryESModule::~CSCGeometryESModule ( )
override

Destructor.

Definition at line 77 of file CSCGeometryESModule.cc.

77 {}

Member Function Documentation

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

Definition at line 116 of file CSCGeometryESModule.cc.

References CSCGeometryBuilderFromDDD::build(), CSCGeometryBuilder::build(), cpvToken_, DEFINE_FWK_EVENTSETUP_MODULE, edm::eventsetup::EventSetupRecordImplementation< T >::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getTransientHandle(), query::host, mdcToken_, edm::ESTransientHandle< T >::product(), rdpToken_, record, rigToken_, and useDDD_.

Referenced by produce().

117 {
118  if ( useDDD_ ) {
119 
120  host->ifRecordChanges<MuonNumberingRecord>(record,
121  [&host, &record, this](auto const& rec) {
122  host->clear();
124  const auto& mdc = rec.get(mdcToken_);
126  builder.build(*host, cpv.product(), mdc);
127  });
128  } else {
129  bool recreateGeometry = false;
130 
131  host->ifRecordChanges<CSCRecoGeometryRcd>(record,
132  [&recreateGeometry](auto const& rec) {
133  recreateGeometry = true;
134  });
135 
136  host->ifRecordChanges<CSCRecoDigiParametersRcd>(record,
137  [&recreateGeometry](auto const& rec) {
138  recreateGeometry = true;
139  });
140 
141  if (recreateGeometry) {
142  host->clear();
143  const auto& rig = record.get(rigToken_);
144  const auto& rdp = record.get(rdpToken_);
145  CSCGeometryBuilder cscgb;
146  cscgb.build(*host, rig, rdp);
147  }
148  }
149 }
host
Definition: query.py:115
JetCorrectorParameters::Record record
Definition: classes.h:7
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_
void build(CSCGeometry &geom, const DDCompactView *fv, const MuonDDDConstants &muonConstants)
Build the geometry.
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvToken_
T const * product() const
edm::ESGetToken< MuonDDDConstants, MuonNumberingRecord > mdcToken_
edm::ESGetToken< RecoIdealGeometry, CSCRecoGeometryRcd > rigToken_
std::shared_ptr< CSCGeometry > CSCGeometryESModule::produce ( const MuonGeometryRecord record)

Produce CSCGeometry.

Definition at line 80 of file CSCGeometryESModule.cc.

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

80  {
81 
82  auto host = holder_.makeOrGet([this]() {
83  return new HostType(debugV,
88  });
89 
90  initCSCGeometry_(record, host);
91 
92  // Called whenever the alignments or alignment errors change
93 
94  if ( applyAlignment_ ) {
95  // applyAlignment_ is scheduled for removal.
96  // Ideal geometry obtained by using 'fake alignment' (with applyAlignment_ = true)
97  const auto& globalPosition = record.get(globalPositionToken_);
98  const auto& alignments = record.get(alignmentsToken_);
99  const auto& alignmentErrors = record.get(alignmentErrorsToken_);
100  // Only apply alignment if values exist
101  if (alignments.empty() && alignmentErrors.empty() && globalPosition.empty()) {
102  edm::LogInfo("Config") << "@SUB=CSCGeometryRecord::produce"
103  << "Alignment(Error)s and global position (label '"
104  << alignmentsLabel_ << "') empty: Geometry producer (label "
105  << "'" << myLabel_ << "') assumes fake and does not apply.";
106  } else {
107  GeometryAligner aligner;
108  aligner.applyAlignments<CSCGeometry>( &(*host), &alignments, &alignmentErrors,
109  align::DetectorGlobalPosition(globalPosition, DetId(DetId::Muon)) );
110  }
111  }
112  return host; // automatically converts to std::shared_ptr<CSCGeometry>
113 }
host
Definition: query.py:115
edm::ESGetToken< Alignments, CSCAlignmentRcd > alignmentsToken_
edm::ESProductHost< CSCGeometry, MuonNumberingRecord, CSCRecoGeometryRcd, CSCRecoDigiParametersRcd > HostType
const std::string alignmentsLabel_
Class to update a given geometry with a set of alignments.
const std::string myLabel_
std::shared_ptr< T > makeOrGet(F iFunc)
If there isn&#39;t an object already available, creates a new one using iFunc.
void initCSCGeometry_(const MuonGeometryRecord &, std::shared_ptr< HostType > &host)
edm::ESGetToken< Alignments, GlobalPositionRcd > globalPositionToken_
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESGetToken< AlignmentErrorsExtended, CSCAlignmentErrorExtendedRcd > alignmentErrorsToken_
Definition: DetId.h:18
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
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 71 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().

const std::string CSCGeometryESModule::alignmentsLabel_
private

Definition at line 81 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().

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

Definition at line 70 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().

bool CSCGeometryESModule::applyAlignment_
private

Definition at line 79 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().

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

Definition at line 63 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and initCSCGeometry_().

bool CSCGeometryESModule::debugV
private

Definition at line 78 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().

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

Definition at line 69 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().

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

Definition at line 61 of file CSCGeometryESModule.h.

Referenced by produce().

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

Definition at line 64 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and initCSCGeometry_().

const std::string CSCGeometryESModule::myLabel_
private

Definition at line 82 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().

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

Definition at line 67 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and initCSCGeometry_().

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

Definition at line 66 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and initCSCGeometry_().

bool CSCGeometryESModule::useCentreTIOffsets
private

Definition at line 77 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().

bool CSCGeometryESModule::useDDD_
private

Definition at line 80 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and initCSCGeometry_().

bool CSCGeometryESModule::useGangedStripsInME1a
private

Definition at line 76 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().

bool CSCGeometryESModule::useOnlyWiresInME1a
private

Definition at line 75 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().

bool CSCGeometryESModule::useRealWireGeometry
private

Definition at line 74 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().