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

Date:
2009/01/16 11:11:46
Revision:
1.4
Author
N. Amapane - CERN

Definition at line 21 of file DTGeometryESModule.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 35 of file DTGeometryESModule.cc.

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

36  : alignmentsLabel_(p.getParameter<std::string>("alignmentsLabel")),
37  myLabel_(p.getParameter<std::string>("appendToDataLabel")),
38  fromDDD_(p.getParameter<bool>("fromDDD"))
39 {
40 
41  applyAlignment_ = p.getParameter<bool>("applyAlignment");
42 
44 
45  edm::LogInfo("Geometry") << "@SUB=DTGeometryESModule"
46  << "Label '" << myLabel_ << "' "
47  << (applyAlignment_ ? "looking for" : "IGNORING")
48  << " alignment labels '" << alignmentsLabel_ << "'.";
49 }
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_
DTGeometryESModule::~DTGeometryESModule ( )
virtual

Destructor.

Definition at line 51 of file DTGeometryESModule.cc.

51 {}

Member Function Documentation

void DTGeometryESModule::geometryCallback_ ( const MuonNumberingRecord record)
private

Definition at line 86 of file DTGeometryESModule.cc.

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

Referenced by DTGeometryESModule().

86  {
87  //
88  // Called whenever the muon numbering (or ideal geometry) changes
89  //
90 
91  _dtGeometry = boost::shared_ptr<DTGeometry>(new DTGeometry );
92  if ( fromDDD_ ) {
94  record.get( mdc );
95 
97  record.getRecord<IdealGeometryRecord>().get(cpv);
98 
100  builder.build(_dtGeometry, &(*cpv), *mdc);
101  } else {
103  record.getRecord<DTRecoGeometryRcd>().get(rig);
104 
106  builder.build(_dtGeometry, *rig);
107  }
108 
109 }
boost::shared_ptr< DTGeometry > _dtGeometry
void build(boost::shared_ptr< DTGeometry > theGeometry, const RecoIdealGeometry &rig)
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 54 of file DTGeometryESModule.cc.

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

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

Member Data Documentation

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

Definition at line 34 of file DTGeometryESModule.h.

Referenced by 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 geometryCallback_().

const std::string DTGeometryESModule::myLabel_
private

Definition at line 38 of file DTGeometryESModule.h.

Referenced by DTGeometryESModule(), and produce().