test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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...
 
boost::shared_ptr< DTGeometryproduce (const MuonGeometryRecord &record)
 Produce DTGeometry. More...
 
virtual ~DTGeometryESModule ()
 Destructor. More...
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- 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 ()
 

Private Member Functions

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

Private Attributes

boost::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
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 
- 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::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_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 DTGeometry in MuonGeometryRecord

Author
N. Amapane - CERN

Definition at line 19 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 ( )
virtual

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(), and edm::eventsetup::EventSetupRecord::get().

Referenced by DTGeometryESModule().

106  {
107  //
108  // Called whenever the muon numbering (or ideal geometry) changes
109  //
110 
111  _dtGeometry = boost::shared_ptr<DTGeometry>(new DTGeometry );
113  record.get(rig);
114 
116  builder.build(_dtGeometry, *rig);
117 
118 }
boost::shared_ptr< DTGeometry > _dtGeometry
void build(boost::shared_ptr< DTGeometry > theGeometry, const RecoIdealGeometry &rig)
void get(HolderT &iHolder) const
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 = boost::shared_ptr<DTGeometry>(new DTGeometry );
96  record.get( mdc );
97 
99  record.getRecord<IdealGeometryRecord>().get(cpv);
100 
101  DTGeometryBuilderFromDDD builder;
102  builder.build(_dtGeometry, &(*cpv), *mdc);
103 
104 }
boost::shared_ptr< DTGeometry > _dtGeometry
void get(HolderT &iHolder) const
void build(boost::shared_ptr< DTGeometry > theGeometry, const DDCompactView *cview, const MuonDDDConstants &muonConstants)
boost::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(), 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 }
Class to update a given geometry with a set of alignments.
boost::shared_ptr< DTGeometry > _dtGeometry
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)
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)

Member Data Documentation

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

Definition at line 33 of file DTGeometryESModule.h.

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

const std::string DTGeometryESModule::alignmentsLabel_
private

Definition at line 36 of file DTGeometryESModule.h.

Referenced by DTGeometryESModule(), and produce().

bool DTGeometryESModule::applyAlignment_
private

Definition at line 35 of file DTGeometryESModule.h.

Referenced by DTGeometryESModule(), and produce().

bool DTGeometryESModule::fromDDD_
private

Definition at line 38 of file DTGeometryESModule.h.

Referenced by DTGeometryESModule().

const std::string DTGeometryESModule::myLabel_
private

Definition at line 37 of file DTGeometryESModule.h.

Referenced by DTGeometryESModule(), and produce().