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

Date:
2011/12/10 03:13:18
Revision:
1.6
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_, dbGeometryCallback_(), edm::eventsetup::dependsOn(), fromDDD_, 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 
43  if(fromDDD_) {
45  } else {
47  }
48 
49  edm::LogInfo("Geometry") << "@SUB=DTGeometryESModule"
50  << "Label '" << myLabel_ << "' "
51  << (applyAlignment_ ? "looking for" : "IGNORING")
52  << " alignment labels '" << alignmentsLabel_ << "'.";
53 }
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 55 of file DTGeometryESModule.cc.

55 {}

Member Function Documentation

void DTGeometryESModule::dbGeometryCallback_ ( const DTRecoGeometryRcd record)
private

Definition at line 107 of file DTGeometryESModule.cc.

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

Referenced by DTGeometryESModule().

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

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

Referenced by DTGeometryESModule().

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

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

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

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

const std::string DTGeometryESModule::alignmentsLabel_
private

Definition at line 38 of file DTGeometryESModule.h.

Referenced by DTGeometryESModule(), and produce().

bool DTGeometryESModule::applyAlignment_
private

Definition at line 37 of file DTGeometryESModule.h.

Referenced by DTGeometryESModule(), and produce().

bool DTGeometryESModule::fromDDD_
private

Definition at line 40 of file DTGeometryESModule.h.

Referenced by DTGeometryESModule().

const std::string DTGeometryESModule::myLabel_
private

Definition at line 39 of file DTGeometryESModule.h.

Referenced by DTGeometryESModule(), and produce().