#include <DTGeometryESModule.h>
Public Member Functions | |
DTGeometryESModule (const edm::ParameterSet &p) | |
Constructor. | |
boost::shared_ptr< DTGeometry > | produce (const MuonGeometryRecord &record) |
Produce DTGeometry. | |
virtual | ~DTGeometryESModule () |
Destructor. | |
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_ |
ESProducer for DTGeometry in MuonGeometryRecord
Definition at line 21 of file DTGeometryESModule.h.
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().
: alignmentsLabel_(p.getParameter<std::string>("alignmentsLabel")), myLabel_(p.getParameter<std::string>("appendToDataLabel")), fromDDD_(p.getParameter<bool>("fromDDD")) { applyAlignment_ = p.getParameter<bool>("applyAlignment"); setWhatProduced(this, dependsOn(&DTGeometryESModule::geometryCallback_) ); edm::LogInfo("Geometry") << "@SUB=DTGeometryESModule" << "Label '" << myLabel_ << "' " << (applyAlignment_ ? "looking for" : "IGNORING") << " alignment labels '" << alignmentsLabel_ << "'."; }
DTGeometryESModule::~DTGeometryESModule | ( | ) | [virtual] |
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().
{ // // Called whenever the muon numbering (or ideal geometry) changes // _dtGeometry = boost::shared_ptr<DTGeometry>(new DTGeometry ); if ( fromDDD_ ) { edm::ESHandle<MuonDDDConstants> mdc; record.get( mdc ); edm::ESTransientHandle<DDCompactView> cpv; record.getRecord<IdealGeometryRecord>().get(cpv); DTGeometryBuilderFromDDD builder; builder.build(_dtGeometry, &(*cpv), *mdc); } else { edm::ESHandle<RecoIdealGeometry> rig; record.getRecord<DTRecoGeometryRcd>().get(rig); DTGeometryBuilderFromCondDB builder; builder.build(_dtGeometry, *rig); } }
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_.
{ // // Called whenever the alignments or alignment errors change // if ( applyAlignment_ ) { // applyAlignment_ is scheduled for removal. // Ideal geometry obtained by using 'fake alignment' (with applyAlignment_ = true) edm::ESHandle<Alignments> globalPosition; record.getRecord<GlobalPositionRcd>().get(alignmentsLabel_, globalPosition); edm::ESHandle<Alignments> alignments; record.getRecord<DTAlignmentRcd>().get(alignmentsLabel_, alignments); edm::ESHandle<AlignmentErrors> alignmentErrors; record.getRecord<DTAlignmentErrorRcd>().get(alignmentsLabel_, alignmentErrors); // Only apply alignment if values exist if (alignments->empty() && alignmentErrors->empty() && globalPosition->empty()) { edm::LogInfo("Config") << "@SUB=DTGeometryRecord::produce" << "Alignment(Error)s and global position (label '" << alignmentsLabel_ << "') empty: Geometry producer (label " << "'" << myLabel_ << "') assumes fake and does not apply."; } else { GeometryAligner aligner; aligner.applyAlignments<DTGeometry>( &(*_dtGeometry), &(*alignments), &(*alignmentErrors), align::DetectorGlobalPosition(*globalPosition, DetId(DetId::Muon))); } } return _dtGeometry; }
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().