Public Member Functions | |
MisalignedMuonESProducer (const edm::ParameterSet &p) | |
Constructor. | |
edm::ESProducts < boost::shared_ptr < DTGeometry > , boost::shared_ptr < CSCGeometry > > | produce (const MuonGeometryRecord &) |
Produce the misaligned Muon geometry and store it. | |
void | saveToDB () |
Save alignemnts and error to database. | |
virtual | ~MisalignedMuonESProducer () |
Destructor. | |
Private Attributes | |
AlignmentErrors * | csc_AlignmentErrors |
Alignments * | csc_Alignments |
AlignmentErrors * | dt_AlignmentErrors |
Alignments * | dt_Alignments |
std::string | theCSCAlignRecordName |
std::string | theCSCErrorRecordName |
boost::shared_ptr< CSCGeometry > | theCSCGeometry |
std::string | theDTAlignRecordName |
misalignment scenario | |
std::string | theDTErrorRecordName |
boost::shared_ptr< DTGeometry > | theDTGeometry |
const bool | theSaveToDB |
const edm::ParameterSet | theScenario |
whether or not writing to DB |
Definition at line 42 of file MisalignedMuonESProducer.cc.
MisalignedMuonESProducer::MisalignedMuonESProducer | ( | const edm::ParameterSet & | p | ) |
Constructor.
Definition at line 82 of file MisalignedMuonESProducer.cc.
References edm::ESProducer::setWhatProduced().
: theSaveToDB(p.getUntrackedParameter<bool>("saveToDbase")), theScenario(p.getParameter<edm::ParameterSet>("scenario")), theDTAlignRecordName( "DTAlignmentRcd" ), theDTErrorRecordName( "DTAlignmentErrorRcd" ), theCSCAlignRecordName( "CSCAlignmentRcd" ), theCSCErrorRecordName( "CSCAlignmentErrorRcd" ) { setWhatProduced(this); }
MisalignedMuonESProducer::~MisalignedMuonESProducer | ( | ) | [virtual] |
edm::ESProducts< boost::shared_ptr< DTGeometry >, boost::shared_ptr< CSCGeometry > > MisalignedMuonESProducer::produce | ( | const MuonGeometryRecord & | iRecord | ) |
Produce the misaligned Muon geometry and store it.
Definition at line 102 of file MisalignedMuonESProducer.cc.
References align::AlignableMuon, GeometryAligner::applyAlignments(), MuonScenarioBuilder::applyScenario(), DTGeometryBuilderFromDDD::build(), CSCGeometryBuilderFromDDD::build(), csc_AlignmentErrors, csc_Alignments, AlignableMuon::cscAlignmentErrors(), AlignableMuon::cscAlignments(), dt_AlignmentErrors, dt_Alignments, AlignableMuon::dtAlignmentErrors(), AlignableMuon::dtAlignments(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), edm::es::products(), saveToDB(), theCSCGeometry, theDTGeometry, theSaveToDB, and theScenario.
{ edm::LogInfo("MisalignedMuon") << "Producer called"; // Create the Muon geometry from ideal geometry edm::ESTransientHandle<DDCompactView> cpv; iRecord.getRecord<IdealGeometryRecord>().get( cpv ); edm::ESHandle<MuonDDDConstants> mdc; iRecord.getRecord<MuonNumberingRecord>().get(mdc); DTGeometryBuilderFromDDD DTGeometryBuilder; CSCGeometryBuilderFromDDD CSCGeometryBuilder; theDTGeometry = boost::shared_ptr<DTGeometry>(new DTGeometry ); DTGeometryBuilder.build(theDTGeometry, &(*cpv), *mdc ); theCSCGeometry = boost::shared_ptr<CSCGeometry>( new CSCGeometry ); CSCGeometryBuilder.build( theCSCGeometry, &(*cpv), *mdc ); // Create the alignable hierarchy AlignableMuon* theAlignableMuon = new AlignableMuon( &(*theDTGeometry) , &(*theCSCGeometry) ); // Create misalignment scenario MuonScenarioBuilder scenarioBuilder( theAlignableMuon ); scenarioBuilder.applyScenario( theScenario ); // Get alignments and errors dt_Alignments = theAlignableMuon->dtAlignments() ; dt_AlignmentErrors = theAlignableMuon->dtAlignmentErrors(); csc_Alignments = theAlignableMuon->cscAlignments(); csc_AlignmentErrors = theAlignableMuon->cscAlignmentErrors(); // Misalign the EventSetup geometry GeometryAligner aligner; aligner.applyAlignments<DTGeometry>( &(*theDTGeometry), dt_Alignments, dt_AlignmentErrors, AlignTransform() ); aligner.applyAlignments<CSCGeometry>( &(*theCSCGeometry ), csc_Alignments, csc_AlignmentErrors, AlignTransform() ); // Write alignments to DB if (theSaveToDB) this->saveToDB(); edm::LogInfo("MisalignedMuon") << "Producer done"; return edm::es::products( theDTGeometry, theCSCGeometry ); }
void MisalignedMuonESProducer::saveToDB | ( | void | ) |
Save alignemnts and error to database.
Definition at line 161 of file MisalignedMuonESProducer.cc.
References edm::Service< T >::isAvailable(), theCSCAlignRecordName, theCSCErrorRecordName, theDTAlignRecordName, and theDTErrorRecordName.
Referenced by produce().
{ // Call service edm::Service<cond::service::PoolDBOutputService> poolDbService; if( !poolDbService.isAvailable() ) // Die if not available throw cms::Exception("NotAvailable") << "PoolDBOutputService not available"; // Store DT alignments and errors poolDbService->writeOne<Alignments>( &(*dt_Alignments), poolDbService->beginOfTime(), theDTAlignRecordName); poolDbService->writeOne<AlignmentErrors>( &(*dt_AlignmentErrors), poolDbService->beginOfTime(), theDTErrorRecordName); // Store CSC alignments and errors poolDbService->writeOne<Alignments>( &(*csc_Alignments), poolDbService->beginOfTime(), theCSCAlignRecordName); poolDbService->writeOne<AlignmentErrors>( &(*csc_AlignmentErrors), poolDbService->beginOfTime(), theCSCErrorRecordName); }
Definition at line 72 of file MisalignedMuonESProducer.cc.
Referenced by produce().
Definition at line 71 of file MisalignedMuonESProducer.cc.
Referenced by produce().
Definition at line 70 of file MisalignedMuonESProducer.cc.
Referenced by produce().
Definition at line 69 of file MisalignedMuonESProducer.cc.
Referenced by produce().
std::string MisalignedMuonESProducer::theCSCAlignRecordName [private] |
Definition at line 64 of file MisalignedMuonESProducer.cc.
Referenced by saveToDB().
std::string MisalignedMuonESProducer::theCSCErrorRecordName [private] |
Definition at line 64 of file MisalignedMuonESProducer.cc.
Referenced by saveToDB().
boost::shared_ptr<CSCGeometry> MisalignedMuonESProducer::theCSCGeometry [private] |
Definition at line 67 of file MisalignedMuonESProducer.cc.
Referenced by produce().
std::string MisalignedMuonESProducer::theDTAlignRecordName [private] |
misalignment scenario
Definition at line 63 of file MisalignedMuonESProducer.cc.
Referenced by saveToDB().
std::string MisalignedMuonESProducer::theDTErrorRecordName [private] |
Definition at line 63 of file MisalignedMuonESProducer.cc.
Referenced by saveToDB().
boost::shared_ptr<DTGeometry> MisalignedMuonESProducer::theDTGeometry [private] |
Definition at line 66 of file MisalignedMuonESProducer.cc.
Referenced by produce().
const bool MisalignedMuonESProducer::theSaveToDB [private] |
Definition at line 60 of file MisalignedMuonESProducer.cc.
Referenced by produce().
const edm::ParameterSet MisalignedMuonESProducer::theScenario [private] |
whether or not writing to DB
Definition at line 61 of file MisalignedMuonESProducer.cc.
Referenced by produce().