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, boost::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 33 of file DTGeometryESModule.cc.

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

34  : alignmentsLabel_(p.getParameter<std::string>("alignmentsLabel")),
35  myLabel_(p.getParameter<std::string>("appendToDataLabel")),
36  fromDDD_(p.getParameter<bool>("fromDDD"))
37 {
38 
39  applyAlignment_ = p.getParameter<bool>("applyAlignment");
40 
41  if(fromDDD_) {
43  } else {
45  }
46 
47  edm::LogInfo("Geometry") << "@SUB=DTGeometryESModule"
48  << "Label '" << myLabel_ << "' "
49  << (applyAlignment_ ? "looking for" : "IGNORING")
50  << " alignment labels '" << alignmentsLabel_ << "'.";
51 }
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 53 of file DTGeometryESModule.cc.

53 {}

Member Function Documentation

void DTGeometryESModule::dbGeometryCallback_ ( const DTRecoGeometryRcd record)
private

Definition at line 105 of file DTGeometryESModule.cc.

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

Referenced by DTGeometryESModule().

105  {
106  //
107  // Called whenever the muon numbering (or ideal geometry) changes
108  //
109 
110  _dtGeometry = boost::shared_ptr<DTGeometry>(new DTGeometry );
112  record.get(rig);
113 
115  builder.build(_dtGeometry, *rig);
116 
117 }
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 88 of file DTGeometryESModule.cc.

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

Referenced by DTGeometryESModule().

88  {
89  //
90  // Called whenever the muon numbering (or ideal geometry) changes
91  //
92 
93  _dtGeometry = boost::shared_ptr<DTGeometry>(new DTGeometry );
95  record.get( mdc );
96 
98  record.getRecord<IdealGeometryRecord>().get(cpv);
99 
100  DTGeometryBuilderFromDDD builder;
101  builder.build(_dtGeometry, &(*cpv), *mdc);
102 
103 }
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 56 of file DTGeometryESModule.cc.

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

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