#include <CSCGeometryESModule.h>
Public Member Functions | |
CSCGeometryESModule (const edm::ParameterSet &p) | |
Constructor. | |
boost::shared_ptr< CSCGeometry > | produce (const MuonGeometryRecord &record) |
Produce CSCGeometry. | |
virtual | ~CSCGeometryESModule () |
Destructor. | |
Private Member Functions | |
void | geometryCallback_ (const MuonNumberingRecord &) |
Called when geometry description changes. | |
Private Attributes | |
const std::string | alignmentsLabel_ |
bool | applyAlignment_ |
boost::shared_ptr< CSCGeometry > | cscGeometry |
bool | debugV |
const std::string | myLabel_ |
bool | useCentreTIOffsets |
bool | useDDD_ |
bool | useGangedStripsInME1a |
bool | useOnlyWiresInME1a |
bool | useRealWireGeometry |
ESProducer for CSCGeometry in MuonGeometryRecord
Definition at line 19 of file CSCGeometryESModule.h.
CSCGeometryESModule::CSCGeometryESModule | ( | const edm::ParameterSet & | p | ) |
Constructor.
Definition at line 35 of file CSCGeometryESModule.cc.
References alignmentsLabel_, applyAlignment_, debugV, edm::eventsetup::dependsOn(), geometryCallback_(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), myLabel_, edm::ESProducer::setWhatProduced(), useCentreTIOffsets, useDDD_, useGangedStripsInME1a, useOnlyWiresInME1a, and useRealWireGeometry.
: alignmentsLabel_(p.getParameter<std::string>("alignmentsLabel")), myLabel_(p.getParameter<std::string>("appendToDataLabel")) { setWhatProduced(this, dependsOn(&CSCGeometryESModule::geometryCallback_) ); // Choose wire geometry modelling // We now _require_ some wire geometry specification in the CSCOrcaSpec.xml file // in the DDD Geometry. // Default as of transition to CMSSW is to use real values. // Alternative is to use pseudo-values which match reasonably closely // the calculated geometry values used up to and including ORCA_8_8_1. // (This was the default in ORCA.) useRealWireGeometry = p.getParameter<bool>("useRealWireGeometry"); // Suppress strips altogether in ME1a region of ME11? useOnlyWiresInME1a = p.getParameter<bool>("useOnlyWiresInME1a"); // Allow strips in ME1a region of ME11 but gang them? // Default is now to treat ME1a with ganged strips (e.g. in clusterizer) useGangedStripsInME1a = p.getParameter<bool>("useGangedStripsInME1a"); if ( useGangedStripsInME1a ) useOnlyWiresInME1a = false; // override possible inconsistentcy // Use the backed-out offsets that correct the CTI useCentreTIOffsets = p.getParameter<bool>("useCentreTIOffsets"); // Debug printout etc. in CSCGeometry etc. debugV = p.getUntrackedParameter<bool>("debugV", false); // Find out if using the DDD or CondDB Geometry source. useDDD_ = p.getParameter<bool>("useDDD"); // Feed these value to where I need them applyAlignment_ = p.getParameter<bool>("applyAlignment"); edm::LogInfo("Geometry") << "@SUB=CSCGeometryESModule" << "Label '" << myLabel_ << "' " << (applyAlignment_ ? "looking for" : "IGNORING") << " alignment labels '" << alignmentsLabel_ << "'."; }
CSCGeometryESModule::~CSCGeometryESModule | ( | ) | [virtual] |
void CSCGeometryESModule::geometryCallback_ | ( | const MuonNumberingRecord & | record | ) | [private] |
Called when geometry description changes.
Definition at line 125 of file CSCGeometryESModule.cc.
References CSCGeometryBuilderFromDDD::build(), CSCGeometryBuilder::build(), cscGeometry, debugV, edm::eventsetup::EventSetupRecord::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), useCentreTIOffsets, useDDD_, useGangedStripsInME1a, useOnlyWiresInME1a, and useRealWireGeometry.
Referenced by CSCGeometryESModule().
{ // Called whenever the muon numbering (or ideal geometry) changes cscGeometry = boost::shared_ptr<CSCGeometry>( new CSCGeometry ); cscGeometry->setUseRealWireGeometry( useRealWireGeometry ); cscGeometry->setOnlyWiresInME1a( useOnlyWiresInME1a ); cscGeometry->setGangedStripsInME1a( useGangedStripsInME1a ); cscGeometry->setUseCentreTIOffsets( useCentreTIOffsets ); cscGeometry->setDebugV( debugV ); if ( debugV ) cscGeometry->queryModelling(); // Called whenever the muon numbering (or ideal geometry) changes // if ( useDDD_ ) { edm::ESTransientHandle<DDCompactView> cpv; edm::ESHandle<MuonDDDConstants> mdc; record.getRecord<IdealGeometryRecord>().get(cpv); record.get( mdc ); CSCGeometryBuilderFromDDD builder; // _cscGeometry = boost::shared_ptr<CSCGeometry>(builder.build(_cscGeometry, &(*cpv), *mdc)); builder.build(cscGeometry, &(*cpv), *mdc); } else { edm::ESHandle<RecoIdealGeometry> rig; edm::ESHandle<CSCRecoDigiParameters> rdp; record.getRecord<CSCRecoGeometryRcd>().get(rig); record.getRecord<CSCRecoDigiParametersRcd>().get(rdp); CSCGeometryBuilder cscgb; // _cscGeometry = boost::shared_ptr<CSCGeometry>(cscgb.build(_cscGeometry, *rig, *rdp)); cscgb.build(cscGeometry, *rig, *rdp); } }
boost::shared_ptr< CSCGeometry > CSCGeometryESModule::produce | ( | const MuonGeometryRecord & | record | ) |
Produce CSCGeometry.
Definition at line 87 of file CSCGeometryESModule.cc.
References alignmentsLabel_, applyAlignment_, GeometryAligner::applyAlignments(), cscGeometry, 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<CSCAlignmentRcd>().get(alignmentsLabel_, alignments); edm::ESHandle<AlignmentErrors> alignmentErrors; // <<<<<<< CSCGeometryESModule.cc // record.getRecord<CSCAlignmentErrorRcd>().get( alignmentErrors ); // GeometryAligner aligner; // aligner.applyAlignments<CSCGeometry>( &(*_cscGeometry), // &(*alignments), &(*alignmentErrors), // align::DetectorGlobalPosition(*globalPositionRcd, DetId(DetId::Muon))); // ======= record.getRecord<CSCAlignmentErrorRcd>().get(alignmentsLabel_, alignmentErrors); // Only apply alignment if values exist if (alignments->empty() && alignmentErrors->empty() && globalPosition->empty()) { edm::LogInfo("Config") << "@SUB=CSCGeometryRecord::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<CSCGeometry>( &(*cscGeometry), &(*alignments), &(*alignmentErrors), align::DetectorGlobalPosition(*globalPosition, DetId(DetId::Muon)) ); } // >>>>>>> 1.8 } return cscGeometry; }
const std::string CSCGeometryESModule::alignmentsLabel_ [private] |
Definition at line 44 of file CSCGeometryESModule.h.
Referenced by CSCGeometryESModule(), and produce().
bool CSCGeometryESModule::applyAlignment_ [private] |
Definition at line 42 of file CSCGeometryESModule.h.
Referenced by CSCGeometryESModule(), and produce().
boost::shared_ptr<CSCGeometry> CSCGeometryESModule::cscGeometry [private] |
Definition at line 34 of file CSCGeometryESModule.h.
Referenced by geometryCallback_(), and produce().
bool CSCGeometryESModule::debugV [private] |
Definition at line 41 of file CSCGeometryESModule.h.
Referenced by CSCGeometryESModule(), and geometryCallback_().
const std::string CSCGeometryESModule::myLabel_ [private] |
Definition at line 45 of file CSCGeometryESModule.h.
Referenced by CSCGeometryESModule(), and produce().
bool CSCGeometryESModule::useCentreTIOffsets [private] |
Definition at line 40 of file CSCGeometryESModule.h.
Referenced by CSCGeometryESModule(), and geometryCallback_().
bool CSCGeometryESModule::useDDD_ [private] |
Definition at line 43 of file CSCGeometryESModule.h.
Referenced by CSCGeometryESModule(), and geometryCallback_().
bool CSCGeometryESModule::useGangedStripsInME1a [private] |
Definition at line 39 of file CSCGeometryESModule.h.
Referenced by CSCGeometryESModule(), and geometryCallback_().
bool CSCGeometryESModule::useOnlyWiresInME1a [private] |
Definition at line 38 of file CSCGeometryESModule.h.
Referenced by CSCGeometryESModule(), and geometryCallback_().
bool CSCGeometryESModule::useRealWireGeometry [private] |
Definition at line 37 of file CSCGeometryESModule.h.
Referenced by CSCGeometryESModule(), and geometryCallback_().