#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 | 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_ |
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_, dbGeometryCallback_(), edm::eventsetup::dependsOn(), fromDDD_, 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"); if(fromDDD_) { setWhatProduced(this, dependsOn(&DTGeometryESModule::geometryCallback_) ); } else { setWhatProduced(this, dependsOn(&DTGeometryESModule::dbGeometryCallback_) ); } edm::LogInfo("Geometry") << "@SUB=DTGeometryESModule" << "Label '" << myLabel_ << "' " << (applyAlignment_ ? "looking for" : "IGNORING") << " alignment labels '" << alignmentsLabel_ << "'."; }
DTGeometryESModule::~DTGeometryESModule | ( | ) | [virtual] |
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().
{ // // Called whenever the muon numbering (or ideal geometry) changes // _dtGeometry = boost::shared_ptr<DTGeometry>(new DTGeometry ); edm::ESHandle<RecoIdealGeometry> rig; record.get(rig); DTGeometryBuilderFromCondDB builder; builder.build(_dtGeometry, *rig); }
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().
{ // // Called whenever the muon numbering (or ideal geometry) changes // _dtGeometry = boost::shared_ptr<DTGeometry>(new DTGeometry ); edm::ESHandle<MuonDDDConstants> mdc; record.get( mdc ); edm::ESTransientHandle<DDCompactView> cpv; record.getRecord<IdealGeometryRecord>().get(cpv); DTGeometryBuilderFromDDD builder; builder.build(_dtGeometry, &(*cpv), *mdc); }
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_.
{ // // 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 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().