CMS 3D CMS Logo

List of all members | Public Member Functions | 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 ()
 
virtual ~ESProducer ()(false)
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer () noexcept(false)
 
- 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 Member Functions

void cscRecoDigiParametersChanged_ (const CSCRecoDigiParametersRcd &)
 
void cscRecoGeometryChanged_ (const CSCRecoGeometryRcd &)
 
void initCSCGeometry_ (const MuonGeometryRecord &)
 
void muonNumberingChanged_ (const MuonNumberingRecord &)
 Called when geometry description changes. More...
 

Private Attributes

const std::string alignmentsLabel_
 
bool applyAlignment_
 
std::shared_ptr< CSCGeometrycscGeometry
 
bool debugV
 
const std::string myLabel_
 
bool recreateGeometry_
 
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
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())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 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 19 of file CSCGeometryESModule.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 35 of file CSCGeometryESModule.cc.

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

36  : recreateGeometry_(true),
37  alignmentsLabel_(p.getParameter<std::string>("alignmentsLabel")),
38  myLabel_(p.getParameter<std::string>("appendToDataLabel"))
39 {
40 
41  // Choose wire geometry modelling
42  // We now _require_ some wire geometry specification in the CSCOrcaSpec.xml file
43  // in the DDD Geometry.
44  // Default as of transition to CMSSW is to use real values.
45  // Alternative is to use pseudo-values which match reasonably closely
46  // the calculated geometry values used up to and including ORCA_8_8_1.
47  // (This was the default in ORCA.)
48 
49  useRealWireGeometry = p.getParameter<bool>("useRealWireGeometry");
50 
51  // Suppress strips altogether in ME1a region of ME11?
52 
53  useOnlyWiresInME1a = p.getParameter<bool>("useOnlyWiresInME1a");
54 
55  // Allow strips in ME1a region of ME11 but gang them?
56  // Default is now to treat ME1a with ganged strips (e.g. in clusterizer)
57 
58  useGangedStripsInME1a = p.getParameter<bool>("useGangedStripsInME1a");
59 
60  if ( useGangedStripsInME1a ) useOnlyWiresInME1a = false; // override possible inconsistentcy
61 
62  // Use the backed-out offsets that correct the CTI
63  useCentreTIOffsets = p.getParameter<bool>("useCentreTIOffsets");
64 
65  // Debug printout etc. in CSCGeometry etc.
66 
67  debugV = p.getUntrackedParameter<bool>("debugV", false);
68 
69  // Find out if using the DDD or CondDB Geometry source.
70  useDDD_ = p.getParameter<bool>("useDDD");
71 
72  // Feed these value to where I need them
73  applyAlignment_ = p.getParameter<bool>("applyAlignment");
74 
75 
76  edm::LogInfo("Geometry") << "@SUB=CSCGeometryESModule"
77  << "Label '" << myLabel_ << "' "
78  << (applyAlignment_ ? "looking for" : "IGNORING")
79  << " alignment labels '" << alignmentsLabel_ << "'.";
80  if(useDDD_) {
82  } else {
84  }
85 }
T getParameter(std::string const &) const
void cscRecoDigiParametersChanged_(const CSCRecoDigiParametersRcd &)
T getUntrackedParameter(std::string const &, T const &) const
depends_on::OneHolder< T, TDependsOnRecord > dependsOn(void(T::*iT)(const TDependsOnRecord &))
const std::string alignmentsLabel_
void muonNumberingChanged_(const MuonNumberingRecord &)
Called when geometry description changes.
const std::string myLabel_
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
void cscRecoGeometryChanged_(const CSCRecoGeometryRcd &)
CSCGeometryESModule::~CSCGeometryESModule ( )
override

Destructor.

Definition at line 88 of file CSCGeometryESModule.cc.

88 {}

Member Function Documentation

void CSCGeometryESModule::cscRecoDigiParametersChanged_ ( const CSCRecoDigiParametersRcd )
private

Definition at line 176 of file CSCGeometryESModule.cc.

References DEFINE_FWK_EVENTSETUP_MODULE, and recreateGeometry_.

Referenced by CSCGeometryESModule().

176  {
177  recreateGeometry_=true;
178 }
void CSCGeometryESModule::cscRecoGeometryChanged_ ( const CSCRecoGeometryRcd )
private

Definition at line 173 of file CSCGeometryESModule.cc.

References recreateGeometry_.

Referenced by CSCGeometryESModule().

173  {
174  recreateGeometry_=true;
175 }
void CSCGeometryESModule::initCSCGeometry_ ( const MuonGeometryRecord record)
private

Definition at line 131 of file CSCGeometryESModule.cc.

References CSCGeometryBuilderFromDDD::build(), CSCGeometryBuilder::build(), cscGeometry, debugV, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), recreateGeometry_, useCentreTIOffsets, useDDD_, useGangedStripsInME1a, useOnlyWiresInME1a, and useRealWireGeometry.

Referenced by produce().

132 {
133  if(not recreateGeometry_) return;
134 
135  // Updates whenever a dependent Record was changed
136 
139 
140  // cscGeometry->setUseRealWireGeometry( useRealWireGeometry );
141  // cscGeometry->setOnlyWiresInME1a( useOnlyWiresInME1a );
142  // cscGeometry->setGangedStripsInME1a( useGangedStripsInME1a );
143  // cscGeometry->setUseCentreTIOffsets( useCentreTIOffsets );
144  // cscGeometry->setDebugV( debugV );
145 
146  // if ( debugV ) cscGeometry->queryModelling();
147 
148  // Called whenever the muon numbering (or ideal geometry) changes
149  //
150  if ( useDDD_ ) {
153  record.getRecord<IdealGeometryRecord>().get(cpv);
154  record.getRecord<MuonNumberingRecord>().get( mdc );
156  // _cscGeometry = std::shared_ptr<CSCGeometry>(builder.build(_cscGeometry, &(*cpv), *mdc));
157  builder.build(cscGeometry, &(*cpv), *mdc);
158  } else {
161  record.getRecord<CSCRecoGeometryRcd>().get(rig);
162  record.getRecord<CSCRecoDigiParametersRcd>().get(rdp);
163  CSCGeometryBuilder cscgb;
164  // _cscGeometry = std::shared_ptr<CSCGeometry>(cscgb.build(_cscGeometry, *rig, *rdp));
165  cscgb.build(cscGeometry, *rig, *rdp);
166  }
167  recreateGeometry_=false;
168 }
void build(const std::shared_ptr< CSCGeometry > &theGeometry, const RecoIdealGeometry &rig, const CSCRecoDigiParameters &cscpars)
Build the geometry.
std::shared_ptr< CSCGeometry > cscGeometry
void build(std::shared_ptr< CSCGeometry > geom, const DDCompactView *fv, const MuonDDDConstants &muonConstants)
Build the geometry.
void CSCGeometryESModule::muonNumberingChanged_ ( const MuonNumberingRecord )
private

Called when geometry description changes.

Definition at line 170 of file CSCGeometryESModule.cc.

References recreateGeometry_.

Referenced by CSCGeometryESModule().

170  {
171  recreateGeometry_=true;
172 }
std::shared_ptr< CSCGeometry > CSCGeometryESModule::produce ( const MuonGeometryRecord record)

Produce CSCGeometry.

Definition at line 91 of file CSCGeometryESModule.cc.

References alignmentsLabel_, applyAlignment_, GeometryAligner::applyAlignments(), cscGeometry, align::DetectorGlobalPosition(), Alignments::empty(), AlignmentErrorsExtended::empty(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), initCSCGeometry_(), DetId::Muon, and myLabel_.

91  {
92 
93  initCSCGeometry_(record);
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 // <<<<<<< CSCGeometryESModule.cc
106 // record.getRecord<CSCAlignmentErrorExtendedRcd>().get( alignmentErrors );
107 // GeometryAligner aligner;
108 // aligner.applyAlignments<CSCGeometry>( &(*_cscGeometry),
109 // &(*alignments), &(*alignmentErrors),
110 // align::DetectorGlobalPosition(*globalPositionRcd, DetId(DetId::Muon)));
111 // =======
112  record.getRecord<CSCAlignmentErrorExtendedRcd>().get(alignmentsLabel_, alignmentErrors);
113  // Only apply alignment if values exist
114  if (alignments->empty() && alignmentErrors->empty() && globalPosition->empty()) {
115  edm::LogInfo("Config") << "@SUB=CSCGeometryRecord::produce"
116  << "Alignment(Error)s and global position (label '"
117  << alignmentsLabel_ << "') empty: Geometry producer (label "
118  << "'" << myLabel_ << "') assumes fake and does not apply.";
119  } else {
120  GeometryAligner aligner;
121  aligner.applyAlignments<CSCGeometry>( &(*cscGeometry), &(*alignments), &(*alignmentErrors),
122  align::DetectorGlobalPosition(*globalPosition, DetId(DetId::Muon)) );
123  }
124 // >>>>>>> 1.8
125  }
126 
127  return cscGeometry;
128 }
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 &)
Definition: DetId.h:18
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
std::shared_ptr< CSCGeometry > cscGeometry
bool empty() const
Test of empty vector without having to look into internals:
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)

Member Data Documentation

const std::string CSCGeometryESModule::alignmentsLabel_
private

Definition at line 49 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().

bool CSCGeometryESModule::applyAlignment_
private

Definition at line 47 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().

std::shared_ptr<CSCGeometry> CSCGeometryESModule::cscGeometry
private

Definition at line 38 of file CSCGeometryESModule.h.

Referenced by initCSCGeometry_(), and produce().

bool CSCGeometryESModule::debugV
private

Definition at line 46 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and initCSCGeometry_().

const std::string CSCGeometryESModule::myLabel_
private

Definition at line 50 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().

bool CSCGeometryESModule::recreateGeometry_
private
bool CSCGeometryESModule::useCentreTIOffsets
private

Definition at line 45 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and initCSCGeometry_().

bool CSCGeometryESModule::useDDD_
private

Definition at line 48 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and initCSCGeometry_().

bool CSCGeometryESModule::useGangedStripsInME1a
private

Definition at line 44 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and initCSCGeometry_().

bool CSCGeometryESModule::useOnlyWiresInME1a
private

Definition at line 43 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and initCSCGeometry_().

bool CSCGeometryESModule::useRealWireGeometry
private

Definition at line 42 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and initCSCGeometry_().