CMS 3D CMS Logo

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

#include <DTGeometryESModule.h>

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

Public Member Functions

 DTGeometryESModule (const edm::ParameterSet &p)
 Constructor. More...
 
std::shared_ptr< DTGeometryproduce (const MuonGeometryRecord &record)
 Produce DTGeometry. More...
 
 ~DTGeometryESModule () 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 Member Functions

void dbGeometryCallback_ (const DTRecoGeometryRcd &record)
 
void geometryCallback_ (const MuonNumberingRecord &record)
 

Private Attributes

std::shared_ptr< DTGeometry_dtGeometry
 
const std::string alignmentsLabel_
 
bool applyAlignment_
 
bool fromDDD_
 
const std::string myLabel_
 

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())
 
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 DTGeometry in MuonGeometryRecord

Author
N. Amapane - CERN

Definition at line 20 of file DTGeometryESModule.h.

Constructor & Destructor Documentation

DTGeometryESModule::DTGeometryESModule ( const edm::ParameterSet p)

Constructor.

Definition at line 34 of file DTGeometryESModule.cc.

References alignmentsLabel_, applyAlignment_, dbGeometryCallback_(), edm::eventsetup::dependsOn(), fromDDD_, geometryCallback_(), edm::ParameterSet::getParameter(), myLabel_, and edm::ESProducer::setWhatProduced().

35  : alignmentsLabel_(p.getParameter<std::string>("alignmentsLabel")),
36  myLabel_(p.getParameter<std::string>("appendToDataLabel")),
37  fromDDD_(p.getParameter<bool>("fromDDD"))
38 {
39 
40  applyAlignment_ = p.getParameter<bool>("applyAlignment");
41 
42  if(fromDDD_) {
44  } else {
46  }
47 
48  edm::LogInfo("Geometry") << "@SUB=DTGeometryESModule"
49  << "Label '" << myLabel_ << "' "
50  << (applyAlignment_ ? "looking for" : "IGNORING")
51  << " alignment labels '" << alignmentsLabel_ << "'.";
52 }
T getParameter(std::string const &) const
depends_on::OneHolder< T, TDependsOnRecord > dependsOn(void(T::*iT)(const TDependsOnRecord &))
void geometryCallback_(const MuonNumberingRecord &record)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
const std::string myLabel_
const std::string alignmentsLabel_
void dbGeometryCallback_(const DTRecoGeometryRcd &record)
DTGeometryESModule::~DTGeometryESModule ( )
override

Destructor.

Definition at line 54 of file DTGeometryESModule.cc.

54 {}

Member Function Documentation

void DTGeometryESModule::dbGeometryCallback_ ( const DTRecoGeometryRcd record)
private

Definition at line 106 of file DTGeometryESModule.cc.

References _dtGeometry, DTGeometryBuilderFromCondDB::build(), DEFINE_FWK_EVENTSETUP_MODULE, and edm::eventsetup::EventSetupRecord::get().

Referenced by DTGeometryESModule().

106  {
107  //
108  // Called whenever the muon numbering (or ideal geometry) changes
109  //
110 
111  _dtGeometry = std::make_shared<DTGeometry>();
113  record.get(rig);
114 
116  builder.build(_dtGeometry, *rig);
117 
118 }
void get(HolderT &iHolder) const
std::shared_ptr< DTGeometry > _dtGeometry
void build(const std::shared_ptr< DTGeometry > &theGeometry, const RecoIdealGeometry &rig)
void DTGeometryESModule::geometryCallback_ ( const MuonNumberingRecord record)
private

Definition at line 89 of file DTGeometryESModule.cc.

References _dtGeometry, DTGeometryBuilderFromDDD::build(), edm::eventsetup::EventSetupRecord::get(), and edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord().

Referenced by DTGeometryESModule().

89  {
90  //
91  // Called whenever the muon numbering (or ideal geometry) changes
92  //
93 
94  _dtGeometry = std::make_shared<DTGeometry>();
96  record.get( mdc );
97 
99  record.getRecord<IdealGeometryRecord>().get(cpv);
100 
101  DTGeometryBuilderFromDDD builder;
102  builder.build(_dtGeometry, &(*cpv), *mdc);
103 
104 }
void get(HolderT &iHolder) const
void build(std::shared_ptr< DTGeometry > theGeometry, const DDCompactView *cview, const MuonDDDConstants &muonConstants)
std::shared_ptr< DTGeometry > _dtGeometry
std::shared_ptr< DTGeometry > DTGeometryESModule::produce ( const MuonGeometryRecord record)

Produce DTGeometry.

Definition at line 57 of file DTGeometryESModule.cc.

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

57  {
58 
59  //
60  // Called whenever the alignments or alignment errors change
61  //
62  if ( applyAlignment_ ) {
63  // applyAlignment_ is scheduled for removal.
64  // Ideal geometry obtained by using 'fake alignment' (with applyAlignment_ = true)
65  edm::ESHandle<Alignments> globalPosition;
66  record.getRecord<GlobalPositionRcd>().get(alignmentsLabel_, globalPosition);
67  edm::ESHandle<Alignments> alignments;
68  record.getRecord<DTAlignmentRcd>().get(alignmentsLabel_, alignments);
70  record.getRecord<DTAlignmentErrorExtendedRcd>().get(alignmentsLabel_, alignmentErrors);
71  // Only apply alignment if values exist
72  if (alignments->empty() && alignmentErrors->empty() && globalPosition->empty()) {
73  edm::LogInfo("Config") << "@SUB=DTGeometryRecord::produce"
74  << "Alignment(Error)s and global position (label '"
75  << alignmentsLabel_ << "') empty: Geometry producer (label "
76  << "'" << myLabel_ << "') assumes fake and does not apply.";
77  } else {
78  GeometryAligner aligner;
79  aligner.applyAlignments<DTGeometry>( &(*_dtGeometry),
80  &(*alignments), &(*alignmentErrors),
82  }
83  }
84 
85  return _dtGeometry;
86 
87 }
bool empty() const
Test of empty vector without having to look into internals:
Definition: Alignments.h:15
Class to update a given geometry with a set of alignments.
const std::string myLabel_
const std::string alignmentsLabel_
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:
std::shared_ptr< DTGeometry > _dtGeometry
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)

Member Data Documentation

std::shared_ptr<DTGeometry> DTGeometryESModule::_dtGeometry
private

Definition at line 34 of file DTGeometryESModule.h.

Referenced by dbGeometryCallback_(), geometryCallback_(), and produce().

const std::string DTGeometryESModule::alignmentsLabel_
private

Definition at line 37 of file DTGeometryESModule.h.

Referenced by DTGeometryESModule(), and produce().

bool DTGeometryESModule::applyAlignment_
private

Definition at line 36 of file DTGeometryESModule.h.

Referenced by DTGeometryESModule(), and produce().

bool DTGeometryESModule::fromDDD_
private

Definition at line 39 of file DTGeometryESModule.h.

Referenced by DTGeometryESModule().

const std::string DTGeometryESModule::myLabel_
private

Definition at line 38 of file DTGeometryESModule.h.

Referenced by DTGeometryESModule(), and produce().