diff --git a/Alignment/MuonAlignment/interface/MuonAlignmentInputDB.h b/Alignment/MuonAlignment/interface/MuonAlignmentInputDB.h index 19db1d959c756..728b160491714 100644 --- a/Alignment/MuonAlignment/interface/MuonAlignmentInputDB.h +++ b/Alignment/MuonAlignment/interface/MuonAlignmentInputDB.h @@ -41,10 +41,10 @@ class MuonAlignmentInputDB : public MuonAlignmentInputMethod { const Alignments* dtAlignments, const Alignments* cscAlignments, const Alignments* gemAlignments, - const Alignments* globalPositionRcd, const AlignmentErrorsExtended* dtAlignmentErrorsExtended, const AlignmentErrorsExtended* cscAlignmentErrorsExtended, - const AlignmentErrorsExtended* gemAlignmentErrorsExtended); + const AlignmentErrorsExtended* gemAlignmentErrorsExtended, + const Alignments* globalPositionRcd); ~MuonAlignmentInputDB() override; // ---------- const member functions --------------------- @@ -67,10 +67,10 @@ class MuonAlignmentInputDB : public MuonAlignmentInputMethod { const Alignments* dtAlignments_; const Alignments* cscAlignments_; const Alignments* gemAlignments_; - const Alignments* globalPositionRcd_; const AlignmentErrorsExtended* dtAlignmentErrorsExtended_; const AlignmentErrorsExtended* cscAlignmentErrorsExtended_; const AlignmentErrorsExtended* gemAlignmentErrorsExtended_; + const Alignments* globalPositionRcd_; const bool m_getAPEs; }; diff --git a/Alignment/MuonAlignment/plugins/MuonGeometryDBConverter.cc b/Alignment/MuonAlignment/plugins/MuonGeometryDBConverter.cc index 580b99e1e4774..b0ed1e6e198a3 100644 --- a/Alignment/MuonAlignment/plugins/MuonGeometryDBConverter.cc +++ b/Alignment/MuonAlignment/plugins/MuonGeometryDBConverter.cc @@ -56,7 +56,7 @@ class MuonGeometryDBConverter : public edm::one::EDAnalyzer<> { bool m_done; std::string m_input, m_output; - std::string m_dtLabel, m_cscLabel, m_gemLabel; + std::string m_dtLabel, m_cscLabel, m_gemLabel, m_dtAPELabel, m_cscAPELabel, m_gemAPELabel; double m_shiftErr, m_angleErr; std::string m_fileName; bool m_getAPEs; @@ -76,6 +76,11 @@ class MuonGeometryDBConverter : public edm::one::EDAnalyzer<> { edm::ESGetToken dtAliToken_; edm::ESGetToken cscAliToken_; edm::ESGetToken gemAliToken_; + + edm::ESGetToken dtAPEToken_; + edm::ESGetToken cscAPEToken_; + edm::ESGetToken gemAPEToken_; + const edm::ESGetToken gprToken_; }; @@ -116,6 +121,9 @@ MuonGeometryDBConverter::MuonGeometryDBConverter(const edm::ParameterSet &iConfi m_dtLabel = iConfig.getParameter("dtLabel"); m_cscLabel = iConfig.getParameter("cscLabel"); m_gemLabel = iConfig.getParameter("gemLabel"); + m_dtAPELabel = iConfig.getParameter("dtAPELabel"); + m_cscAPELabel = iConfig.getParameter("cscAPELabel"); + m_gemAPELabel = iConfig.getParameter("gemAPELabel"); m_shiftErr = iConfig.getParameter("shiftErr"); m_angleErr = iConfig.getParameter("angleErr"); m_getAPEs = iConfig.getParameter("getAPEs"); @@ -125,6 +133,10 @@ MuonGeometryDBConverter::MuonGeometryDBConverter(const edm::ParameterSet &iConfi cscAliToken_ = esConsumes(edm::ESInputTag("", m_cscLabel)); gemAliToken_ = esConsumes(edm::ESInputTag("", m_gemLabel)); + dtAPEToken_ = esConsumes(edm::ESInputTag("", m_dtAPELabel)); + cscAPEToken_ = esConsumes(edm::ESInputTag("", m_cscAPELabel)); + gemAPEToken_ = esConsumes(edm::ESInputTag("", m_gemAPELabel)); + dtGeomToken_ = esConsumes(edm::ESInputTag("", idealGeometryLabelForInputXML)); cscGeomToken_ = esConsumes(edm::ESInputTag("", idealGeometryLabelForInputXML)); gemGeomToken_ = esConsumes(edm::ESInputTag("", idealGeometryLabelForInputXML)); @@ -173,6 +185,9 @@ void MuonGeometryDBConverter::analyze(const edm::Event &iEvent, const edm::Event &iSetup.getData(dtAliToken_), &iSetup.getData(cscAliToken_), &iSetup.getData(gemAliToken_), + &iSetup.getData(dtAPEToken_), + &iSetup.getData(cscAPEToken_), + &iSetup.getData(gemAPEToken_), &iSetup.getData(gprToken_)); MuonAlignment *muonAlignment = new MuonAlignment(iSetup, inputMethod); if (m_getAPEs) { @@ -216,6 +231,9 @@ void MuonGeometryDBConverter::fillDescriptions(edm::ConfigurationDescriptions &d desc.add("dtLabel", ""); desc.add("cscLabel", ""); desc.add("gemLabel", ""); + desc.add("dtAPELabel", ""); + desc.add("cscAPELabel", ""); + desc.add("gemAPELabel", ""); desc.add("shiftErr", 1000.0); desc.add("angleErr", 6.28); desc.add("getAPEs", true); diff --git a/Alignment/MuonAlignment/plugins/MuonGeometrySVGTemplate.cc b/Alignment/MuonAlignment/plugins/MuonGeometrySVGTemplate.cc index b447c59441aec..933c30755006a 100644 --- a/Alignment/MuonAlignment/plugins/MuonGeometrySVGTemplate.cc +++ b/Alignment/MuonAlignment/plugins/MuonGeometrySVGTemplate.cc @@ -20,7 +20,7 @@ #include #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/Event.h" @@ -43,7 +43,7 @@ // class decleration // -class MuonGeometrySVGTemplate : public edm::EDAnalyzer { +class MuonGeometrySVGTemplate : public edm::one::EDAnalyzer<> { public: explicit MuonGeometrySVGTemplate(const edm::ParameterSet &iConfig); ~MuonGeometrySVGTemplate() override; diff --git a/Alignment/MuonAlignment/plugins/MuonMisalignedProducer.cc b/Alignment/MuonAlignment/plugins/MuonMisalignedProducer.cc index ac3df3da5db19..5035e8ab8824a 100644 --- a/Alignment/MuonAlignment/plugins/MuonMisalignedProducer.cc +++ b/Alignment/MuonAlignment/plugins/MuonMisalignedProducer.cc @@ -61,12 +61,12 @@ class MuonMisalignedProducer : public edm::one::EDAnalyzer<> { edm::ESGetToken esTokenCSC_; edm::ESGetToken esTokenGEM_; - Alignments dt_Alignments; - AlignmentErrorsExtended dt_AlignmentErrorsExtended; - Alignments csc_Alignments; - AlignmentErrorsExtended csc_AlignmentErrorsExtended; - Alignments gem_Alignments; - AlignmentErrorsExtended gem_AlignmentErrorsExtended; + Alignments* dt_Alignments; + AlignmentErrorsExtended* dt_AlignmentErrorsExtended; + Alignments* csc_Alignments; + AlignmentErrorsExtended* csc_AlignmentErrorsExtended; + Alignments* gem_Alignments; + AlignmentErrorsExtended* gem_AlignmentErrorsExtended; }; //__________________________________________________________________________________________________ @@ -84,7 +84,7 @@ MuonMisalignedProducer::MuonMisalignedProducer(const edm::ParameterSet& p) esTokenGEM_(esConsumes(edm::ESInputTag("", "idealForMuonMisalignedProducer"))) {} //__________________________________________________________________________________________________ -MuonMisalignedProducer::~MuonMisalignedProducer() = default; +MuonMisalignedProducer::~MuonMisalignedProducer() {} //__________________________________________________________________________________________________ void MuonMisalignedProducer::analyze(const edm::Event& event, const edm::EventSetup& eventSetup) { @@ -102,12 +102,12 @@ void MuonMisalignedProducer::analyze(const edm::Event& event, const edm::EventSe scenarioBuilder.applyScenario(theScenario); // Get alignments and errors - dt_Alignments = *(theAlignableMuon->dtAlignments()); - dt_AlignmentErrorsExtended = *(theAlignableMuon->dtAlignmentErrorsExtended()); - csc_Alignments = *(theAlignableMuon->cscAlignments()); - csc_AlignmentErrorsExtended = *(theAlignableMuon->cscAlignmentErrorsExtended()); - gem_Alignments = *(theAlignableMuon->gemAlignments()); - gem_AlignmentErrorsExtended = *(theAlignableMuon->gemAlignmentErrorsExtended()); + dt_Alignments = theAlignableMuon->dtAlignments(); + dt_AlignmentErrorsExtended = theAlignableMuon->dtAlignmentErrorsExtended(); + csc_Alignments = theAlignableMuon->cscAlignments(); + csc_AlignmentErrorsExtended = theAlignableMuon->cscAlignmentErrorsExtended(); + gem_Alignments = theAlignableMuon->gemAlignments(); + gem_AlignmentErrorsExtended = theAlignableMuon->gemAlignmentErrorsExtended(); // Misalign the EventSetup geometry /* GeometryAligner aligner; @@ -132,17 +132,17 @@ void MuonMisalignedProducer::saveToDB(void) { throw cms::Exception("NotAvailable") << "PoolDBOutputService not available"; // Store DT alignments and errors - poolDbService->writeOneIOV(dt_Alignments, poolDbService->beginOfTime(), theDTAlignRecordName); + poolDbService->writeOneIOV(*dt_Alignments, poolDbService->beginOfTime(), theDTAlignRecordName); poolDbService->writeOneIOV( - dt_AlignmentErrorsExtended, poolDbService->beginOfTime(), theDTErrorRecordName); + *dt_AlignmentErrorsExtended, poolDbService->beginOfTime(), theDTErrorRecordName); // Store CSC alignments and errors - poolDbService->writeOneIOV(csc_Alignments, poolDbService->beginOfTime(), theCSCAlignRecordName); + poolDbService->writeOneIOV(*csc_Alignments, poolDbService->beginOfTime(), theCSCAlignRecordName); poolDbService->writeOneIOV( - csc_AlignmentErrorsExtended, poolDbService->beginOfTime(), theCSCErrorRecordName); - poolDbService->writeOneIOV(gem_Alignments, poolDbService->beginOfTime(), theGEMAlignRecordName); + *csc_AlignmentErrorsExtended, poolDbService->beginOfTime(), theCSCErrorRecordName); + poolDbService->writeOneIOV(*gem_Alignments, poolDbService->beginOfTime(), theGEMAlignRecordName); poolDbService->writeOneIOV( - gem_AlignmentErrorsExtended, poolDbService->beginOfTime(), theGEMErrorRecordName); + *gem_AlignmentErrorsExtended, poolDbService->beginOfTime(), theGEMErrorRecordName); } //____________________________________________________________________________________________ DEFINE_FWK_MODULE(MuonMisalignedProducer); diff --git a/Alignment/MuonAlignment/src/MuonAlignment.cc b/Alignment/MuonAlignment/src/MuonAlignment.cc index b922a4f1ca529..e8715a6952ec5 100644 --- a/Alignment/MuonAlignment/src/MuonAlignment.cc +++ b/Alignment/MuonAlignment/src/MuonAlignment.cc @@ -251,8 +251,8 @@ void MuonAlignment::saveDTSurveyToDB(void) { throw cms::Exception("NotAvailable") << "PoolDBOutputService not available"; // Get alignments and errors - Alignments dtAlignments{}; - SurveyErrors dtSurveyErrors{}; + Alignments* dtAlignments = new Alignments(); + SurveyErrors* dtSurveyErrors = new SurveyErrors(); align::Alignables alignableList; recursiveList(theAlignableMuon->DTBarrel(), alignableList); @@ -268,13 +268,13 @@ void MuonAlignment::saveDTSurveyToDB(void) { (*alignable)->id()); SurveyError error((*alignable)->alignableObjectId(), (*alignable)->id(), (*alignable)->survey()->errors()); - dtAlignments.m_align.push_back(value); - dtSurveyErrors.m_surveyErrors.push_back(error); + dtAlignments->m_align.push_back(value); + dtSurveyErrors->m_surveyErrors.push_back(error); } // Store DT alignments and errors - poolDbService->writeOneIOV(dtAlignments, poolDbService->currentTime(), theDTSurveyRecordName); - poolDbService->writeOneIOV(dtSurveyErrors, poolDbService->currentTime(), theDTSurveyErrorRecordName); + poolDbService->writeOneIOV(*dtAlignments, poolDbService->currentTime(), theDTSurveyRecordName); + poolDbService->writeOneIOV(*dtSurveyErrors, poolDbService->currentTime(), theDTSurveyErrorRecordName); } void MuonAlignment::saveCSCSurveyToDB(void) { @@ -284,8 +284,8 @@ void MuonAlignment::saveCSCSurveyToDB(void) { throw cms::Exception("NotAvailable") << "PoolDBOutputService not available"; // Get alignments and errors - Alignments cscAlignments{}; - SurveyErrors cscSurveyErrors{}; + Alignments* cscAlignments = new Alignments(); + SurveyErrors* cscSurveyErrors = new SurveyErrors(); align::Alignables alignableList; recursiveList(theAlignableMuon->CSCEndcaps(), alignableList); @@ -301,13 +301,13 @@ void MuonAlignment::saveCSCSurveyToDB(void) { (*alignable)->id()); SurveyError error((*alignable)->alignableObjectId(), (*alignable)->id(), (*alignable)->survey()->errors()); - cscAlignments.m_align.push_back(value); - cscSurveyErrors.m_surveyErrors.push_back(error); + cscAlignments->m_align.push_back(value); + cscSurveyErrors->m_surveyErrors.push_back(error); } // Store CSC alignments and errors - poolDbService->writeOneIOV(cscAlignments, poolDbService->currentTime(), theCSCSurveyRecordName); - poolDbService->writeOneIOV(cscSurveyErrors, poolDbService->currentTime(), theCSCSurveyErrorRecordName); + poolDbService->writeOneIOV(*cscAlignments, poolDbService->currentTime(), theCSCSurveyRecordName); + poolDbService->writeOneIOV(*cscSurveyErrors, poolDbService->currentTime(), theCSCSurveyErrorRecordName); } void MuonAlignment::saveSurveyToDB(void) { @@ -322,13 +322,13 @@ void MuonAlignment::saveDTtoDB(void) { throw cms::Exception("NotAvailable") << "PoolDBOutputService not available"; // Get alignments and errors - Alignments dt_Alignments = *(theAlignableMuon->dtAlignments()); - AlignmentErrorsExtended dt_AlignmentErrorsExtended = *(theAlignableMuon->dtAlignmentErrorsExtended()); + const Alignments* dt_Alignments = theAlignableMuon->dtAlignments(); + const AlignmentErrorsExtended* dt_AlignmentErrorsExtended = theAlignableMuon->dtAlignmentErrorsExtended(); // Store DT alignments and errors - poolDbService->writeOneIOV(dt_Alignments, poolDbService->currentTime(), theDTAlignRecordName); + poolDbService->writeOneIOV(*dt_Alignments, poolDbService->currentTime(), theDTAlignRecordName); poolDbService->writeOneIOV( - dt_AlignmentErrorsExtended, poolDbService->currentTime(), theDTErrorRecordName); + *dt_AlignmentErrorsExtended, poolDbService->currentTime(), theDTErrorRecordName); } void MuonAlignment::saveCSCtoDB(void) { @@ -338,13 +338,13 @@ void MuonAlignment::saveCSCtoDB(void) { throw cms::Exception("NotAvailable") << "PoolDBOutputService not available"; // Get alignments and errors - Alignments csc_Alignments = *(theAlignableMuon->cscAlignments()); - AlignmentErrorsExtended csc_AlignmentErrorsExtended = *(theAlignableMuon->cscAlignmentErrorsExtended()); + const Alignments* csc_Alignments = theAlignableMuon->cscAlignments(); + const AlignmentErrorsExtended* csc_AlignmentErrorsExtended = theAlignableMuon->cscAlignmentErrorsExtended(); // Store CSC alignments and errors - poolDbService->writeOneIOV(csc_Alignments, poolDbService->currentTime(), theCSCAlignRecordName); + poolDbService->writeOneIOV(*csc_Alignments, poolDbService->currentTime(), theCSCAlignRecordName); poolDbService->writeOneIOV( - csc_AlignmentErrorsExtended, poolDbService->currentTime(), theCSCErrorRecordName); + *csc_AlignmentErrorsExtended, poolDbService->currentTime(), theCSCErrorRecordName); } void MuonAlignment::saveGEMtoDB(void) { @@ -354,13 +354,13 @@ void MuonAlignment::saveGEMtoDB(void) { throw cms::Exception("NotAvailable") << "PoolDBOutputService not available"; // Get alignments and errors - Alignments gem_Alignments = *(theAlignableMuon->gemAlignments()); - AlignmentErrorsExtended gem_AlignmentErrorsExtended = *(theAlignableMuon->gemAlignmentErrorsExtended()); + const Alignments* gem_Alignments = theAlignableMuon->gemAlignments(); + const AlignmentErrorsExtended* gem_AlignmentErrorsExtended = theAlignableMuon->gemAlignmentErrorsExtended(); // Store CSC alignments and errors - poolDbService->writeOneIOV(gem_Alignments, poolDbService->currentTime(), theGEMAlignRecordName); + poolDbService->writeOneIOV(*gem_Alignments, poolDbService->currentTime(), theGEMAlignRecordName); poolDbService->writeOneIOV( - gem_AlignmentErrorsExtended, poolDbService->currentTime(), theGEMErrorRecordName); + *gem_AlignmentErrorsExtended, poolDbService->currentTime(), theGEMErrorRecordName); } void MuonAlignment::saveToDB(void) { diff --git a/Alignment/MuonAlignment/src/MuonAlignmentInputDB.cc b/Alignment/MuonAlignment/src/MuonAlignmentInputDB.cc index 1986b68bbf6a3..cc403072d5b7d 100644 --- a/Alignment/MuonAlignment/src/MuonAlignmentInputDB.cc +++ b/Alignment/MuonAlignment/src/MuonAlignmentInputDB.cc @@ -58,20 +58,20 @@ MuonAlignmentInputDB::MuonAlignmentInputDB(const DTGeometry* dtGeometry, const Alignments* dtAlignments, const Alignments* cscAlignments, const Alignments* gemAlignments, - const Alignments* globalPositionRcd, const AlignmentErrorsExtended* dtAlignmentErrorsExtended, const AlignmentErrorsExtended* cscAlignmentErrorsExtended, - const AlignmentErrorsExtended* gemAlignmentErrorsExtended) + const AlignmentErrorsExtended* gemAlignmentErrorsExtended, + const Alignments* globalPositionRcd) : dtGeometry_(dtGeometry), cscGeometry_(cscGeometry), gemGeometry_(gemGeometry), dtAlignments_(dtAlignments), cscAlignments_(cscAlignments), gemAlignments_(gemAlignments), - globalPositionRcd_(globalPositionRcd), dtAlignmentErrorsExtended_(dtAlignmentErrorsExtended), cscAlignmentErrorsExtended_(cscAlignmentErrorsExtended), gemAlignmentErrorsExtended_(gemAlignmentErrorsExtended), + globalPositionRcd_(globalPositionRcd), m_getAPEs(true) {} // MuonAlignmentInputDB::MuonAlignmentInputDB(const MuonAlignmentInputDB& rhs) diff --git a/Alignment/MuonAlignmentAlgorithms/plugins/CSCOverlapsBeamSplashCut.cc b/Alignment/MuonAlignmentAlgorithms/plugins/CSCOverlapsBeamSplashCut.cc index 8764616e85ffe..107d7783da28d 100644 --- a/Alignment/MuonAlignmentAlgorithms/plugins/CSCOverlapsBeamSplashCut.cc +++ b/Alignment/MuonAlignmentAlgorithms/plugins/CSCOverlapsBeamSplashCut.cc @@ -20,7 +20,7 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/one/EDFilter.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/ESHandle.h" @@ -37,7 +37,7 @@ // class decleration // -class CSCOverlapsBeamSplashCut : public edm::EDFilter { +class CSCOverlapsBeamSplashCut : public edm::one::EDFilter<> { public: explicit CSCOverlapsBeamSplashCut(const edm::ParameterSet&); ~CSCOverlapsBeamSplashCut() override;