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 ()(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

const std::string alignmentsLabel_
 
bool applyAlignment_
 
bool debugV
 
edm::ReusableObjectHolder< HostTypeholder_
 
const std::string myLabel_
 
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 >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- 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 21 of file CSCGeometryESModule.h.

Member Typedef Documentation

Definition at line 38 of file CSCGeometryESModule.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 32 of file CSCGeometryESModule.cc.

References alignmentsLabel_, applyAlignment_, debugV, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), myLabel_, edm::ESProducer::setWhatProduced(), useCentreTIOffsets, useDDD_, useGangedStripsInME1a, useOnlyWiresInME1a, and useRealWireGeometry.

33  : alignmentsLabel_(p.getParameter<std::string>("alignmentsLabel")),
34  myLabel_(p.getParameter<std::string>("appendToDataLabel"))
35 {
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 
56  if ( useGangedStripsInME1a ) useOnlyWiresInME1a = false; // override possible inconsistentcy
57 
58  // Use the backed-out offsets that correct the CTI
59  useCentreTIOffsets = p.getParameter<bool>("useCentreTIOffsets");
60 
61  // Debug printout etc. in CSCGeometry etc.
62 
63  debugV = p.getUntrackedParameter<bool>("debugV", false);
64 
65  // Find out if using the DDD or CondDB Geometry source.
66  useDDD_ = p.getParameter<bool>("useDDD");
67 
68  // Feed these value to where I need them
69  applyAlignment_ = p.getParameter<bool>("applyAlignment");
70 
71 
72  edm::LogInfo("Geometry") << "@SUB=CSCGeometryESModule"
73  << "Label '" << myLabel_ << "' "
74  << (applyAlignment_ ? "looking for" : "IGNORING")
75  << " alignment labels '" << alignmentsLabel_ << "'.";
76  setWhatProduced(this);
77 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const std::string alignmentsLabel_
const std::string myLabel_
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
CSCGeometryESModule::~CSCGeometryESModule ( )
override

Destructor.

Definition at line 80 of file CSCGeometryESModule.cc.

80 {}

Member Function Documentation

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

Definition at line 122 of file CSCGeometryESModule.cc.

References CSCGeometryBuilderFromDDD::build(), CSCGeometryBuilder::build(), DEFINE_FWK_EVENTSETUP_MODULE, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), query::host, record, and useDDD_.

Referenced by produce().

123 {
124  if ( useDDD_ ) {
125 
126  host->ifRecordChanges<MuonNumberingRecord>(record,
127  [this, &host, &record](auto const& rec) {
128  host->clear();
131  record.getRecord<IdealGeometryRecord>().get(cpv);
132  rec.get(mdc);
134  builder.build(host, &(*cpv), *mdc);
135  });
136  } else {
137  bool recreateGeometry = false;
138 
139  host->ifRecordChanges<CSCRecoGeometryRcd>(record,
140  [&recreateGeometry](auto const& rec) {
141  recreateGeometry = true;
142  });
143 
144  host->ifRecordChanges<CSCRecoDigiParametersRcd>(record,
145  [&recreateGeometry](auto const& rec) {
146  recreateGeometry = true;
147  });
148 
149  if (recreateGeometry) {
150  host->clear();
153  record.getRecord<CSCRecoGeometryRcd>().get(rig);
154  record.getRecord<CSCRecoDigiParametersRcd>().get(rdp);
155  CSCGeometryBuilder cscgb;
156  cscgb.build(host, *rig, *rdp);
157  }
158  }
159 }
host
Definition: query.py:115
JetCorrectorParameters::Record record
Definition: classes.h:7
void build(const std::shared_ptr< CSCGeometry > &theGeometry, const RecoIdealGeometry &rig, const CSCRecoDigiParameters &cscpars)
Build the geometry.
void build(std::shared_ptr< CSCGeometry > geom, const DDCompactView *fv, const MuonDDDConstants &muonConstants)
Build the geometry.
std::shared_ptr< CSCGeometry > CSCGeometryESModule::produce ( const MuonGeometryRecord record)

Produce CSCGeometry.

Definition at line 83 of file CSCGeometryESModule.cc.

References alignmentsLabel_, applyAlignment_, GeometryAligner::applyAlignments(), debugV, align::DetectorGlobalPosition(), AlignmentErrorsExtended::empty(), Alignments::empty(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), holder_, query::host, initCSCGeometry_(), DetId::Muon, myLabel_, useCentreTIOffsets, useGangedStripsInME1a, useOnlyWiresInME1a, and useRealWireGeometry.

83  {
84 
85  auto host = holder_.makeOrGet([this]() {
86  return new HostType(debugV,
91  });
92 
93  initCSCGeometry_(record, host);
94 
95  // Called whenever the alignments or alignment errors change
96 
97  if ( applyAlignment_ ) {
98  // applyAlignment_ is scheduled for removal.
99  // Ideal geometry obtained by using 'fake alignment' (with applyAlignment_ = true)
100  edm::ESHandle<Alignments> globalPosition;
101  record.getRecord<GlobalPositionRcd>().get(alignmentsLabel_, globalPosition);
102  edm::ESHandle<Alignments> alignments;
103  record.getRecord<CSCAlignmentRcd>().get(alignmentsLabel_, alignments);
105  record.getRecord<CSCAlignmentErrorExtendedRcd>().get(alignmentsLabel_, alignmentErrors);
106  // Only apply alignment if values exist
107  if (alignments->empty() && alignmentErrors->empty() && globalPosition->empty()) {
108  edm::LogInfo("Config") << "@SUB=CSCGeometryRecord::produce"
109  << "Alignment(Error)s and global position (label '"
110  << alignmentsLabel_ << "') empty: Geometry producer (label "
111  << "'" << myLabel_ << "') assumes fake and does not apply.";
112  } else {
113  GeometryAligner aligner;
114  aligner.applyAlignments<CSCGeometry>( &(*host), &(*alignments), &(*alignmentErrors),
115  align::DetectorGlobalPosition(*globalPosition, DetId(DetId::Muon)) );
116  }
117  }
118  return host; // automatically converts to std::shared_ptr<CSCGeometry>
119 }
host
Definition: query.py:115
edm::ESProductHost< CSCGeometry, MuonNumberingRecord, CSCRecoGeometryRcd, CSCRecoDigiParametersRcd > HostType
bool empty() const
Test of empty vector without having to look into internals:
Definition: Alignments.h:15
const std::string alignmentsLabel_
Class to update a given geometry with a set of alignments.
const std::string myLabel_
void initCSCGeometry_(const MuonGeometryRecord &, std::shared_ptr< HostType > &host)
Definition: DetId.h:18
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
bool empty() const
Test of empty vector without having to look into internals:
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
edm::ReusableObjectHolder< HostType > holder_

Member Data Documentation

const std::string CSCGeometryESModule::alignmentsLabel_
private

Definition at line 52 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().

bool CSCGeometryESModule::applyAlignment_
private

Definition at line 50 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().

bool CSCGeometryESModule::debugV
private

Definition at line 49 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().

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

Definition at line 42 of file CSCGeometryESModule.h.

Referenced by produce().

const std::string CSCGeometryESModule::myLabel_
private

Definition at line 53 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().

bool CSCGeometryESModule::useCentreTIOffsets
private

Definition at line 48 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().

bool CSCGeometryESModule::useDDD_
private

Definition at line 51 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and initCSCGeometry_().

bool CSCGeometryESModule::useGangedStripsInME1a
private

Definition at line 47 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().

bool CSCGeometryESModule::useOnlyWiresInME1a
private

Definition at line 46 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().

bool CSCGeometryESModule::useRealWireGeometry
private

Definition at line 45 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().