diff --git a/Alignment/MuonAlignment/test/BuildFile.xml b/Alignment/MuonAlignment/test/BuildFile.xml
deleted file mode 100644
index 49ff1177511b4..0000000000000
--- a/Alignment/MuonAlignment/test/BuildFile.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Alignment/MuonAlignment/test/ComputeTransformation.cpp b/Alignment/MuonAlignment/test/ComputeTransformation.cpp
deleted file mode 100644
index 06a11fe27f594..0000000000000
--- a/Alignment/MuonAlignment/test/ComputeTransformation.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-#include
-
-#include "FWCore/Framework/interface/EDAnalyzer.h"
-#include "FWCore/Framework/interface/EventSetup.h"
-#include "FWCore/Framework/interface/ESHandle.h"
-#include "FWCore/Framework/interface/MakerMacros.h"
-
-#include "Geometry/DTGeometry/interface/DTGeometry.h"
-#include "Geometry/CSCGeometry/interface/CSCGeometry.h"
-#include "Geometry/Records/interface/MuonGeometryRecord.h"
-#include "DataFormats/MuonDetId/interface/DTChamberId.h"
-#include "DataFormats/MuonDetId/interface/CSCDetId.h"
-
-//
-//
-// class declaration
-//
-
-class ComputeTransformation : public edm::EDAnalyzer {
-public:
- explicit ComputeTransformation(const edm::ParameterSet&);
- ~ComputeTransformation();
-
- virtual void analyze(const edm::Event&, const edm::EventSetup&);
-
-private:
- // ----------member data ---------------------------
- std::string m_fileName;
-};
-
-//
-// constructors and destructor
-//
-ComputeTransformation::ComputeTransformation(const edm::ParameterSet& iConfig)
- : m_fileName(iConfig.getParameter("fileName")) {}
-
-ComputeTransformation::~ComputeTransformation() {}
-
-void ComputeTransformation::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
- edm::ESHandle dtGeometry;
- iSetup.get().get(dtGeometry);
-
- edm::ESHandle cscGeometry;
- iSetup.get().get(cscGeometry);
-
- std::ofstream output;
- output.open(m_fileName.c_str());
- output << "rotation = {}" << std::endl;
-
- for (int wheel = -2; wheel <= 2; wheel++) {
- for (int station = 1; station <= 4; station++) {
- for (int sector = 1; sector <= 14; sector++) {
- if (station != 4 and sector > 12)
- continue;
- DTChamberId id(wheel, station, sector);
- // globalcoords = rot * localcoords
- Surface::RotationType rot = dtGeometry->idToDet(id)->surface().rotation();
- output << "rotation[\"DT\", " << wheel << ", " << station << ", 0, " << sector << "] = [[" << rot.xx() << ", "
- << rot.xy() << ", " << rot.xz() << "], [" << rot.yx() << ", " << rot.yy() << ", " << rot.yz() << "], ["
- << rot.zx() << ", " << rot.zy() << ", " << rot.zz() << "]]" << std::endl;
- }
- }
- }
-
- for (int endcap = 1; endcap <= 2; endcap++) {
- for (int station = 1; station <= 4; station++) {
- for (int ring = 1; ring <= 3; ring++) {
- if (station > 1 and ring == 3)
- continue;
- for (int sector = 1; sector <= 36; sector++) {
- if (station > 1 && ring == 1 && sector > 18)
- continue;
- CSCDetId id(endcap, station, ring, sector);
- // globalcoords = rot * localcoords
- Surface::RotationType rot = cscGeometry->idToDet(id)->surface().rotation();
- output << "rotation[\"CSC\", " << endcap << ", " << station << ", " << ring << ", " << sector << "] = [["
- << rot.xx() << ", " << rot.xy() << ", " << rot.xz() << "], [" << rot.yx() << ", " << rot.yy() << ", "
- << rot.yz() << "], [" << rot.zx() << ", " << rot.zy() << ", " << rot.zz() << "]]" << std::endl;
- }
- }
- }
- }
-}
-
-//define this as a plug-in
-DEFINE_FWK_MODULE(ComputeTransformation);
diff --git a/Alignment/MuonAlignment/test/MuonGeometryArrange.py b/Alignment/MuonAlignment/test/MuonGeometryArrange.py
deleted file mode 100644
index c2395db06fede..0000000000000
--- a/Alignment/MuonAlignment/test/MuonGeometryArrange.py
+++ /dev/null
@@ -1,106 +0,0 @@
-import FWCore.ParameterSet.Config as cms
-process =cms.Process("TEST")
-
-#Ideal geometry
-process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi")
-process.load('Configuration.Geometry.GeometryExtended2021_cff')
-process.load("Geometry.MuonNumbering.muonNumberingInitialization_cfi")
-process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
-
-from Configuration.AlCa.GlobalTag import GlobalTag
-process.GlobalTag = GlobalTag(process.GlobalTag, "auto:phase1_2021_design")
-
-import Geometry.DTGeometryBuilder.dtGeometryDB_cfi
-import Geometry.CSCGeometryBuilder.cscGeometryDB_cfi
-import Geometry.GEMGeometryBuilder.gemGeometryDB_cfi
-
-process.DTGeometryIdeal = Geometry.DTGeometryBuilder.dtGeometryDB_cfi.DTGeometryESModule.clone()
-process.DTGeometryIdeal.appendToDataLabel = 'MuonGeometryArrangeGeomIdeal'
-process.DTGeometryIdeal.applyAlignment = cms.bool(False)
-process.CSCGeometryIdeal = Geometry.CSCGeometryBuilder.cscGeometryDB_cfi.CSCGeometryESModule.clone()
-process.CSCGeometryIdeal.appendToDataLabel = 'MuonGeometryArrangeGeomIdeal'
-process.CSCGeometryIdeal.applyAlignment = cms.bool(False)
-process.GEMGeometryIdeal = Geometry.GEMGeometryBuilder.gemGeometryDB_cfi.GEMGeometryESModule.clone()
-process.GEMGeometryIdeal.appendToDataLabel = 'MuonGeometryArrangeGeomIdeal'
-process.GEMGeometryIdeal.applyAlignment = cms.bool(False)
-
-process.DTGeometryMuonGeometryArrange1 = Geometry.DTGeometryBuilder.dtGeometryDB_cfi.DTGeometryESModule.clone()
-process.DTGeometryMuonGeometryArrange1.appendToDataLabel = 'MuonGeometryArrangeLabel1'
-process.DTGeometryMuonGeometryArrange1.applyAlignment = cms.bool(False)
-process.CSCGeometryMuonGeometryArrange1 = Geometry.CSCGeometryBuilder.cscGeometryDB_cfi.CSCGeometryESModule.clone()
-process.CSCGeometryMuonGeometryArrange1.appendToDataLabel = 'MuonGeometryArrangeLabel1'
-process.CSCGeometryMuonGeometryArrange1.applyAlignment = cms.bool(False)
-process.GEMGeometryMuonGeometryArrange1 = Geometry.GEMGeometryBuilder.gemGeometryDB_cfi.GEMGeometryESModule.clone()
-process.GEMGeometryMuonGeometryArrange1.appendToDataLabel = 'MuonGeometryArrangeLabel1'
-process.GEMGeometryMuonGeometryArrange1.applyAlignment = cms.bool(False)
-
-process.DTGeometryMuonGeometryArrange2 = Geometry.DTGeometryBuilder.dtGeometryDB_cfi.DTGeometryESModule.clone()
-process.DTGeometryMuonGeometryArrange2.appendToDataLabel = 'MuonGeometryArrangeLabel2'
-process.DTGeometryMuonGeometryArrange2.applyAlignment = cms.bool(False)
-process.CSCGeometryMuonGeometryArrange2 = Geometry.CSCGeometryBuilder.cscGeometryDB_cfi.CSCGeometryESModule.clone()
-process.CSCGeometryMuonGeometryArrange2.appendToDataLabel = 'MuonGeometryArrangeLabel2'
-process.CSCGeometryMuonGeometryArrange2.applyAlignment = cms.bool(False)
-process.GEMGeometryMuonGeometryArrange2 = Geometry.GEMGeometryBuilder.gemGeometryDB_cfi.GEMGeometryESModule.clone()
-process.GEMGeometryMuonGeometryArrange2.appendToDataLabel = 'MuonGeometryArrangeLabel2'
-process.GEMGeometryMuonGeometryArrange2.applyAlignment = cms.bool(False)
-
-process.DTGeometryMuonGeometryArrange2a = Geometry.DTGeometryBuilder.dtGeometryDB_cfi.DTGeometryESModule.clone()
-process.DTGeometryMuonGeometryArrange2a.appendToDataLabel = 'MuonGeometryArrangeLabel2a'
-process.DTGeometryMuonGeometryArrange2a.applyAlignment = cms.bool(False)
-process.CSCGeometryMuonGeometryArrange2a = Geometry.CSCGeometryBuilder.cscGeometryDB_cfi.CSCGeometryESModule.clone()
-process.CSCGeometryMuonGeometryArrange2a.appendToDataLabel = 'MuonGeometryArrangeLabel2a'
-process.CSCGeometryMuonGeometryArrange2a.applyAlignment = cms.bool(False)
-process.GEMGeometryMuonGeometryArrange2a = Geometry.GEMGeometryBuilder.gemGeometryDB_cfi.GEMGeometryESModule.clone()
-process.GEMGeometryMuonGeometryArrange2a.appendToDataLabel = 'MuonGeometryArrangeLabel2a'
-process.GEMGeometryMuonGeometryArrange2a.applyAlignment = cms.bool(False)
-
-process.MessageLogger = cms.Service("MessageLogger",
- cerr = cms.untracked.PSet(
- threshold = cms.untracked.string('INFO')
- ),
- files = cms.untracked.PSet(
- info_txt = cms.untracked.PSet(
- threshold = cms.untracked.string('INFO')
- )
- )
-)
-
-
-process.source = cms.Source("EmptySource")
-process.maxEvents = cms.untracked.PSet(
- input = cms.untracked.int32(1)
- )
-
-
-# Full configuration for Muon Geometry Comparison Tool
-#process.MuonGeometryCompare = cms.EDFilter("MuonGeometryArrange",
-process.MuonGeometryCompare = cms.EDAnalyzer("MuonGeometryArrange",
- outputFile = cms.untracked.string('output.root'),
-
- detIdFlag = cms.untracked.bool(False),
- detIdFlagFile = cms.untracked.string('blah.txt'),
- weightById = cms.untracked.bool(False),
- levels = cms.untracked.vstring('Det'),
- weightBy = cms.untracked.string('SELF'),
- weightByIdFile = cms.untracked.string('blah2.txt'),
- treeName = cms.untracked.string('alignTree'),
-# Root input files are not used yet.
- inputROOTFile1 = cms.untracked.string('IDEAL'),
- inputROOTFile2 = cms.untracked.string('idealmuon2.root'),
-# Geometries are read from xml files
-# inputXMLCurrent = cms.untracked.string('B.xml'),
-# inputXMLCurrent = cms.untracked.string('A.xml'),
-# inputXMLCurrent = cms.untracked.string('moveRing.xml'),
-# inputXMLCurrent = cms.untracked.string('movedRing.xml'),
-# inputXMLCurrent = cms.untracked.string('fiddleMuon.xml'),
-# inputXMLCurrent = cms.untracked.string('fiddle2Muon.xml'),
- inputXMLCurrent = cms.untracked.string('fiddle3Muon.xml'),
- inputXMLReference = cms.untracked.string('idealMuon.xml'),
-# A few defaults. You pick.
- endcapNumber = cms.untracked.int32(2),
- stationNumber = cms.untracked.int32(3),
- ringNumber = cms.untracked.int32(2)
-)
-
-process.p = cms.Path( process.MuonGeometryCompare )
-
diff --git a/Alignment/MuonAlignment/test/TestMisalign.cpp b/Alignment/MuonAlignment/test/TestMisalign.cpp
deleted file mode 100644
index 8b96e0605940b..0000000000000
--- a/Alignment/MuonAlignment/test/TestMisalign.cpp
+++ /dev/null
@@ -1,130 +0,0 @@
-// -*- C++ -*-
-//
-// Package: TestMisalign
-// Class: TestMisalign
-//
-//
-// Description: Module to test the Alignment software
-//
-//
-
-// system include files
-#include
-#include
-#include
-#include
-
-// user include files
-#include "FWCore/MessageLogger/interface/MessageLogger.h"
-#include "FWCore/Framework/interface/EDAnalyzer.h"
-
-#include "FWCore/Framework/interface/EventSetup.h"
-#include "FWCore/Framework/interface/ESHandle.h"
-#include "FWCore/Framework/interface/MakerMacros.h"
-
-#include "FWCore/ParameterSet/interface/ParameterSet.h"
-
-#include
-
-#include "Geometry/DTGeometry/interface/DTGeometry.h"
-#include "Geometry/CSCGeometry/interface/CSCGeometry.h"
-
-//
-//
-// class declaration
-//
-
-class TestMisalign : public edm::EDAnalyzer {
-public:
- explicit TestMisalign(const edm::ParameterSet&);
- ~TestMisalign();
-
- virtual void analyze(const edm::Event&, const edm::EventSetup&);
-
-private:
- void fillTree(const GeomDet* geomDet);
-
- // ----------member data ---------------------------
- TTree* theTree;
- TFile* theFile;
- float x, y, z, phi, theta, length, thick, width;
- int Id_;
- TRotMatrix* rot;
-};
-
-//
-// constructors and destructor
-//
-TestMisalign::TestMisalign(const edm::ParameterSet& iConfig) {
- // Open root file and define tree
- std::string fileName = iConfig.getUntrackedParameter("fileName", "test.root");
- theFile = new TFile(fileName.c_str(), "RECREATE");
- theTree = new TTree("theTree", "Detector units positions");
-
- theTree->Branch("Id", &Id_, "Id/I");
- theTree->Branch("x", &x, "x/F");
- theTree->Branch("y", &y, "y/F");
- theTree->Branch("z", &z, "z/F");
- theTree->Branch("phi", &phi, "phi/F");
- theTree->Branch("theta", &theta, "theta/F");
- theTree->Branch("length", &length, "length/F");
- theTree->Branch("width", &width, "width/F");
- theTree->Branch("thick", &thick, "thick/F");
- rot = 0;
- theTree->Branch("rot", "TRotMatrix", &rot);
-}
-
-TestMisalign::~TestMisalign() {
- theTree->Write();
- theFile->Close();
-}
-
-void TestMisalign::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
- edm::LogInfo("MuonAlignment") << "Starting!";
-
- //
- // Retrieve muon geometry from event setup
- //
- edm::ESHandle pDT;
- edm::ESHandle pCSC;
-
- iSetup.get().get(pDT);
- iSetup.get().get(pCSC);
-
- // Now loop on detector units, and store position and orientation
- for (auto iGeomDet = pDT->dets().begin(); iGeomDet != pDT->dets().end(); iGeomDet++)
- this->fillTree(*iGeomDet);
- for (auto iGeomDet = pCSC->dets().begin(); iGeomDet != pCSC->dets().end(); iGeomDet++)
- this->fillTree(*iGeomDet);
-
- edm::LogInfo("MuonAlignment") << "Done!";
-}
-
-//__________________________________________________________________________________________________
-void TestMisalign::fillTree(const GeomDet* geomDet) {
- Id_ = geomDet->geographicalId().rawId();
- x = geomDet->position().x();
- y = geomDet->position().y();
- z = geomDet->position().z();
- phi = geomDet->surface().normalVector().phi();
- theta = geomDet->surface().normalVector().theta();
- length = geomDet->surface().bounds().length();
- width = geomDet->surface().bounds().width();
- thick = geomDet->surface().bounds().thickness();
-
- double matrix[9] = {geomDet->rotation().xx(),
- geomDet->rotation().xy(),
- geomDet->rotation().xz(),
- geomDet->rotation().yx(),
- geomDet->rotation().yy(),
- geomDet->rotation().yz(),
- geomDet->rotation().zx(),
- geomDet->rotation().zy(),
- geomDet->rotation().zz()};
- rot = new TRotMatrix("rot", "rot", matrix);
-
- theTree->Fill();
-}
-
-//define this as a plug-in
-DEFINE_FWK_MODULE(TestMisalign);
diff --git a/Alignment/MuonAlignment/test/TestMuonAnalyzer.cpp b/Alignment/MuonAlignment/test/TestMuonAnalyzer.cpp
deleted file mode 100644
index 674fbe1cc5cbf..0000000000000
--- a/Alignment/MuonAlignment/test/TestMuonAnalyzer.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-// -*- C++ -*-
-//
-// Package: TestMuonAnalyzer
-// Class: TestMuonAnalyzer
-//
-//
-// Description: Module to test the Alignment software
-//
-//
-
-// system include files
-#include
-#include
-#include
-#include
-
-// user include files
-#include "FWCore/Framework/interface/Frameworkfwd.h"
-#include "FWCore/MessageLogger/interface/MessageLogger.h"
-#include "FWCore/Framework/interface/EDAnalyzer.h"
-
-#include "FWCore/Framework/interface/Event.h"
-#include "FWCore/Framework/interface/EventSetup.h"
-#include "FWCore/Framework/interface/ESHandle.h"
-#include "FWCore/Framework/interface/MakerMacros.h"
-
-#include "FWCore/ParameterSet/interface/ParameterSet.h"
-
-#include "Alignment/MuonAlignment/interface/AlignableMuon.h"
-#include "Alignment/MuonAlignment/interface/AlignableDTChamber.h"
-#include "Alignment/MuonAlignment/interface/AlignableCSCChamber.h"
-
-#include "Geometry/DTGeometry/interface/DTGeometry.h"
-#include "Geometry/DTGeometry/interface/DTChamber.h"
-#include "Geometry/CSCGeometry/interface/CSCGeometry.h"
-#include "Geometry/CSCGeometry/interface/CSCChamber.h"
-#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
-#include "Geometry/Records/interface/MuonGeometryRecord.h"
-//
-//
-// class declaration
-//
-
-class TestMuonAnalyzer : public edm::EDAnalyzer {
-public:
- explicit TestMuonAnalyzer(const edm::ParameterSet&);
- ~TestMuonAnalyzer();
-
- virtual void analyze(const edm::Event&, const edm::EventSetup&);
-
-private:
- void fillTree(const GeomDet* geomDet);
-
- // ----------member data ---------------------------
- TTree* theTree;
- TFile* theFile;
- float x, y, z, phi, theta, length, thick, width;
- int Id_;
- TRotMatrix* rot;
-};
-
-//
-// constructors and destructor
-//
-TestMuonAnalyzer::TestMuonAnalyzer(const edm::ParameterSet& iConfig) {
- // Open root file and define tree
- std::string fileName = iConfig.getUntrackedParameter("fileName", "test.root");
- theFile = new TFile(fileName.c_str(), "RECREATE");
- theTree = new TTree("theTree", "Detector units positions");
-
- theTree->Branch("Id", &Id_, "Id/I");
- theTree->Branch("x", &x, "x/F");
- theTree->Branch("y", &y, "y/F");
- theTree->Branch("z", &z, "z/F");
- theTree->Branch("phi", &phi, "phi/F");
- theTree->Branch("theta", &theta, "theta/F");
- theTree->Branch("length", &length, "length/F");
- theTree->Branch("width", &width, "width/F");
- theTree->Branch("thick", &thick, "thick/F");
- rot = 0;
- theTree->Branch("rot", "TRotMatrix", &rot);
-}
-
-TestMuonAnalyzer::~TestMuonAnalyzer() {
- theTree->Write();
- theFile->Close();
-}
-
-void TestMuonAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
- edm::LogInfo("MuonAlignment") << "Starting!";
-
- //
- // Retrieve muon geometry from event setup
- //
- edm::ESHandle pDT;
- edm::ESHandle pCSC;
-
- iSetup.get().get(pDT);
- iSetup.get().get(pCSC);
-
- // Now loop on detector units, and store position and orientation
- for (auto iGeomDet = pDT->dets().begin(); iGeomDet != pDT->dets().end(); iGeomDet++)
- this->fillTree(*iGeomDet);
- for (auto iGeomDet = pCSC->dets().begin(); iGeomDet != pCSC->dets().end(); iGeomDet++)
- this->fillTree(*iGeomDet);
-
- edm::LogInfo("MuonAlignment") << "Done!";
-}
-
-//__________________________________________________________________________________________________
-void TestMuonAnalyzer::fillTree(const GeomDet* geomDet) {
- Id_ = geomDet->geographicalId().rawId();
- x = geomDet->position().x();
- y = geomDet->position().y();
- z = geomDet->position().z();
- phi = geomDet->surface().normalVector().phi();
- theta = geomDet->surface().normalVector().theta();
- length = geomDet->surface().bounds().length();
- width = geomDet->surface().bounds().width();
- thick = geomDet->surface().bounds().thickness();
-
- double matrix[9] = {geomDet->rotation().xx(),
- geomDet->rotation().xy(),
- geomDet->rotation().xz(),
- geomDet->rotation().yx(),
- geomDet->rotation().yy(),
- geomDet->rotation().yz(),
- geomDet->rotation().zx(),
- geomDet->rotation().zy(),
- geomDet->rotation().zz()};
- rot = new TRotMatrix("rot", "rot", matrix); // mem. leak?
-
- theTree->Fill();
-}
-
-//define this as a plug-in
-DEFINE_FWK_MODULE(TestMuonAnalyzer);
diff --git a/Alignment/MuonAlignment/test/TestMuonHierarchy.cpp b/Alignment/MuonAlignment/test/TestMuonHierarchy.cpp
deleted file mode 100644
index 6e2360a419706..0000000000000
--- a/Alignment/MuonAlignment/test/TestMuonHierarchy.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-// -*- C++ -*-
-//
-// Package: TestMuonHierarchy
-// Class: TestMuonHierarchy
-//
-//
-// Description: Module to test the Alignment software
-//
-//
-// Original Author: Frederic Ronga
-// Created: March 16, 2006
-//
-
-// system include files
-#include
-#include
-#include
-
-// user include files
-#include "FWCore/Framework/interface/EDAnalyzer.h"
-#include "FWCore/Framework/interface/MakerMacros.h"
-#include "FWCore/Framework/interface/EventSetup.h"
-#include "FWCore/Framework/interface/ESHandle.h"
-#include "FWCore/MessageLogger/interface/MessageLogger.h"
-
-#include "Geometry/Records/interface/MuonGeometryRecord.h"
-
-#include "Alignment/MuonAlignment/interface/AlignableMuon.h"
-#include "Alignment/CommonAlignment/interface/AlignableObjectId.h"
-
-static const int kLEAD_WIDTH = 40; // First field width
-
-//
-// class declaration
-//
-class TestMuonHierarchy : public edm::EDAnalyzer {
-public:
- explicit TestMuonHierarchy(const edm::ParameterSet&) {}
-
- virtual void analyze(const edm::Event&, const edm::EventSetup&);
-
-private:
- // ----------member data ---------------------------
- void dumpAlignable(const Alignable*, unsigned int, unsigned int);
- void printInfo(const Alignable*, unsigned int);
-
- std::unique_ptr alignableMuon_;
- std::string leaders_, blank_, filled_;
-
- edm::ESGetToken esTokenDT_;
- edm::ESGetToken esTokenCSC_;
- edm::ESGetToken esTokenGEM_;
-};
-
-void TestMuonHierarchy::analyze(const edm::Event&, const edm::EventSetup& setup) {
- edm::LogInfo("MuonHierarchy") << "Starting!";
- edm::ESHandle dtGeometry = setup.getHandle(esTokenDT_);
- edm::ESHandle cscGeometry = setup.getHandle(esTokenCSC_);
- edm::ESHandle gemGeometry = setup.getHandle(esTokenGEM_);
-
- alignableMuon_ = std::make_unique(&(*dtGeometry), &(*cscGeometry), &(*gemGeometry));
-
- leaders_ = "";
- blank_ = " "; // These two...
- filled_ = "| "; // ... must have the same length
-
- // Now dump mother of each alignable
- //const Alignable* alignable = (&(*theAlignableMuon))->pixelHalfBarrels()[0];
- dumpAlignable(alignableMuon_.get(), 1, 1);
-
- edm::LogInfo("MuonAlignment") << "Done!";
-}
-
-//__________________________________________________________________________________________________
-// Recursive loop on alignable hierarchy
-void TestMuonHierarchy::dumpAlignable(const Alignable* alignable, unsigned int idau, unsigned int ndau) {
- printInfo(alignable, idau);
-
- if (ndau != idau)
- leaders_ += filled_;
- else
- leaders_ += blank_;
-
- const align::Alignables& comps = alignable->components();
- if (unsigned int ndau_ = comps.size()) {
- unsigned int idau_ = 0;
- for (align::Alignables::const_iterator iter = comps.begin(); iter != comps.end(); ++iter)
- dumpAlignable(*iter, ++idau_, ndau_);
- }
-
- leaders_ = leaders_.substr(0, leaders_.length() - blank_.length());
-}
-
-//__________________________________________________________________________________________________
-// Do the actual printout
-void TestMuonHierarchy::printInfo(const Alignable* alignable, unsigned int idau) {
- int width = kLEAD_WIDTH - leaders_.length();
-
- std::ostringstream name, pos, rot;
-
- name << alignableMuon_->objectIdProvider().idToString(alignable->alignableObjectId()) << idau;
-
- // Position
- pos.setf(std::ios::fixed);
- pos << "(" << std::right << std::setw(8) << std::setprecision(4) << alignable->globalPosition().x() << ","
- << std::setw(8) << std::setprecision(4) << alignable->globalPosition().y() << "," << std::setw(8)
- << std::setprecision(4) << alignable->globalPosition().z() << ")";
-
- edm::LogVerbatim("DumpAlignable") << leaders_ << "+-> " << std::setw(width) << std::left << name.str() << " | "
- << std::setw(3) << std::left << alignable->components().size() << " | "
- << std::setw(11) << std::left << alignable->id() << " | " << pos.str();
-}
-//define this as a plug-in
-DEFINE_FWK_MODULE(TestMuonHierarchy);
diff --git a/Alignment/MuonAlignment/test/TestReader.cpp b/Alignment/MuonAlignment/test/TestReader.cpp
deleted file mode 100644
index ba4b9a43633c2..0000000000000
--- a/Alignment/MuonAlignment/test/TestReader.cpp
+++ /dev/null
@@ -1,263 +0,0 @@
-// -*- C++ -*-
-//
-//
-// Description: Module to test the Alignment software
-//
-//
-
-// system include files
-#include
-#include
-#include
-#include
-
-// user include files
-#include "FWCore/MessageLogger/interface/MessageLogger.h"
-#include "FWCore/Framework/interface/EDAnalyzer.h"
-
-#include "FWCore/Framework/interface/EventSetup.h"
-#include "FWCore/Framework/interface/ESHandle.h"
-#include "FWCore/Framework/interface/ESTransientHandle.h"
-#include "FWCore/Framework/interface/MakerMacros.h"
-
-#include "CondFormats/Alignment/interface/Alignments.h"
-#include "CondFormats/Alignment/interface/AlignTransform.h"
-#include "CondFormats/AlignmentRecord/interface/DTAlignmentRcd.h"
-#include "CondFormats/AlignmentRecord/interface/CSCAlignmentRcd.h"
-#include "CondFormats/Alignment/interface/AlignmentErrorsExtended.h"
-#include "CondFormats/Alignment/interface/AlignTransformErrorExtended.h"
-#include "CondFormats/AlignmentRecord/interface/DTAlignmentErrorExtendedRcd.h"
-#include "CondFormats/AlignmentRecord/interface/CSCAlignmentErrorExtendedRcd.h"
-
-#include "Geometry/DTGeometry/interface/DTGeometry.h"
-#include "Geometry/CSCGeometry/interface/CSCGeometry.h"
-#include "Geometry/Records/interface/MuonGeometryRecord.h"
-
-#include "Alignment/MuonAlignment/interface/AlignableMuon.h"
-#include "Alignment/CommonAlignment/interface/Utilities.h"
-#include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentParameterBuilder.h"
-
-#include "DataFormats/MuonDetId/interface/CSCDetId.h"
-
-//
-//
-// class declaration
-//
-
-class TestMuonReader : public edm::EDAnalyzer {
-public:
- explicit TestMuonReader(const edm::ParameterSet&);
- ~TestMuonReader();
-
- void recursiveGetMuChambers(const align::Alignables& composite, align::Alignables& chambers, int kind);
- align::EulerAngles toPhiXYZ(const align::RotationType&);
- virtual void analyze(const edm::Event&, const edm::EventSetup&);
-
-private:
- // ----------member data ---------------------------
- TTree* theTree;
- TFile* theFile;
- float x, y, z, phi, theta, length, thick, width;
- TRotMatrix* rot;
-
- edm::ESGetToken esTokenDT_;
- edm::ESGetToken esTokenCSC_;
- edm::ESGetToken esTokenGEM_;
-};
-
-//
-// constructors and destructor
-//
-TestMuonReader::TestMuonReader(const edm::ParameterSet& iConfig)
- : theTree(0),
- theFile(0),
- x(0.),
- y(0.),
- z(0.),
- phi(0.),
- theta(0.),
- length(0.),
- thick(0.),
- width(0.),
- rot(0),
- esTokenDT_(esConsumes(edm::ESInputTag("", "idealForTestReader"))),
- esTokenCSC_(esConsumes(edm::ESInputTag("", "idealForTestReader"))),
- esTokenGEM_(esConsumes(edm::ESInputTag("", "idealForTestReader"))) {}
-
-TestMuonReader::~TestMuonReader() {}
-
-void TestMuonReader::recursiveGetMuChambers(const align::Alignables& composites,
- align::Alignables& chambers,
- int kind) {
- for (const auto& cit : composites) {
- if (cit->alignableObjectId() == kind) {
- chambers.push_back(cit);
- continue;
- } else {
- const auto& components = cit->components();
- recursiveGetMuChambers(components, chambers, kind);
- }
- }
-}
-
-align::EulerAngles TestMuonReader::toPhiXYZ(const align::RotationType& rot) {
- align::EulerAngles angles(3);
- angles(1) = std::atan2(rot.yz(), rot.zz());
- angles(2) = std::asin(-rot.xz());
- angles(3) = std::atan2(rot.xy(), rot.xx());
- return angles;
-}
-
-void TestMuonReader::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
- // first, get chamber alignables from ideal geometry:
- edm::ESHandle dtGeometry = iSetup.getHandle(esTokenDT_);
- edm::ESHandle cscGeometry = iSetup.getHandle(esTokenCSC_);
- edm::ESHandle gemGeometry = iSetup.getHandle(esTokenGEM_);
-
- AlignableMuon ideal_alignableMuon(&(*dtGeometry), &(*cscGeometry), &(*gemGeometry));
-
- const auto& ideal_barrels = ideal_alignableMuon.DTBarrel();
- const auto& ideal_endcaps = ideal_alignableMuon.CSCEndcaps();
-
- align::Alignables ideal_mb_chambers, ideal_me_chambers;
- recursiveGetMuChambers(ideal_barrels, ideal_mb_chambers, align::AlignableDTChamber);
- recursiveGetMuChambers(ideal_endcaps, ideal_me_chambers, align::AlignableCSCChamber);
- //std::cout<<" #ideals dts="< dtAlignments;
- iSetup.get().get( dtAlignments );
- edm::ESHandle dtAlignmentErrorsExtended;
- iSetup.get().get( dtAlignmentErrorsExtended );
-
- for ( std::vector::const_iterator it = dtAlignments->m_align.begin();
- it != dtAlignments->m_align.end(); it++ )
- {
- CLHEP::HepRotation rot( (*it).rotation() );
- align::RotationType rotation( rot.xx(), rot.xy(), rot.xz(),
- rot.yx(), rot.yy(), rot.yz(),
- rot.zx(), rot.zy(), rot.zz() );
-
- std::cout << (*it).rawId()
- << " " << (*it).translation().x()
- << " " << (*it).translation().y()
- << " " << (*it).translation().z()
- << " " << rotation.xx() << " " << rotation.xy() << " " << rotation.xz()
- << " " << rotation.yx() << " " << rotation.yy() << " " << rotation.yz()
- << " " << rotation.zx() << " " << rotation.zy() << " " << rotation.zz()
- << std::endl;
-
- }
- std::cout << std::endl << "----------------------" << std::endl;
-
- for ( std::vector::const_iterator it = dtAlignmentErrorsExtended->m_alignError.begin();
- it != dtAlignmentErrorsExtended->m_alignError.end(); it++ )
- {
- CLHEP::HepSymMatrix error = (*it).matrix();
- std::cout << (*it).rawId() << " ";
- for ( int i=0; i cscAlignments;
- iSetup.get().get(cscAlignments);
- //edm::ESHandle cscAlignmentErrorsExtended;
- //iSetup.get().get( cscAlignmentErrorsExtended );
-
- //align::Alignables::const_iterator csc_ideal = ideal_endcaps.begin();
- std::cout << std::setprecision(3) << std::fixed;
- //std::cout<<" lens : "<m_align.size()<::const_iterator it = cscAlignments->m_align.begin();
- it != cscAlignments->m_align.end();
- it++) {
- CSCDetId id((*it).rawId());
- if (id.layer() > 0)
- continue; // look at chambers only, skip layers
-
- if (id.station() == 1 && id.ring() == 4)
- continue; // not interested in duplicated ME1/4
-
- char nme[100];
- sprintf(nme, "%d/%d/%02d", id.station(), id.ring(), id.chamber());
- std::string me = "ME+";
- if (id.endcap() == 2)
- me = "ME-";
- me += nme;
-
- // find this chamber in ideal geometry
- const Alignable* ideal{nullptr};
- for (const auto& cideal : ideal_me_chambers)
- if (cideal->geomDetId().rawId() == (*it).rawId()) {
- ideal = cideal;
- break;
- }
- if (ideal == nullptr) {
- std::cout << " no ideal chamber for " << id << std::endl;
- continue;
- }
-
- //if (ideal->geomDetId().rawId() != (*it).rawId()) std::cout<<" badid : "<<(*csc_ideal)->geomDetId().rawId()<<" "<<(*it).rawId()<globalPosition();
- align::RotationType idealRotation = ideal->globalRotation();
- //align::EulerAngles abg = align::toAngles(idealRotation);
- //std::cout << me <<" "<< (*it).rawId()<<" "<0.00001 || fabs(rabg[1]-rxyz[1])>0.00001 ||fabs(rabg[1]-rxyz[1])>0.00001)
- // std::cout << me <<" large angle diff = "<::const_iterator it = cscAlignmentErrorsExtended->m_alignError.begin();
- it != cscAlignmentErrorsExtended->m_alignError.end(); it++ )
- {
- CLHEP::HepSymMatrix error = (*it).matrix();
- std::cout << (*it).rawId() << " ";
- for ( int i=0; i
-#include
-#include
-#include
-
-// user include files
-#include "FWCore/MessageLogger/interface/MessageLogger.h"
-#include "FWCore/Framework/interface/EDAnalyzer.h"
-
-#include "FWCore/Framework/interface/EventSetup.h"
-#include "FWCore/Framework/interface/ESTransientHandle.h"
-#include "FWCore/Framework/interface/ESHandle.h"
-#include "FWCore/Framework/interface/MakerMacros.h"
-
-#include "FWCore/ParameterSet/interface/ParameterSet.h"
-
-#include "Alignment/MuonAlignment/interface/AlignableMuon.h"
-#include
-
-#include "Geometry/DTGeometry/interface/DTGeometry.h"
-
-#include "DataFormats/GeometrySurface/interface/Surface.h"
-
-#include
-
-//
-//
-// class declaration
-//
-
-class TestRotation : public edm::EDAnalyzer {
-public:
- explicit TestRotation(const edm::ParameterSet&);
- ~TestRotation();
-
- virtual void analyze(const edm::Event&, const edm::EventSetup&);
-
-private:
- // ----------member data ---------------------------
- TTree* theTree;
- TFile* theFile;
- float x, y, z, phi, theta, length, thick, width;
- TRotMatrix* dir;
-
- edm::ESGetToken esTokenDT_;
- edm::ESGetToken esTokenCSC_;
- edm::ESGetToken esTokenGEM_;
-};
-
-//
-// constructors and destructor
-//
-TestRotation::TestRotation(const edm::ParameterSet& iConfig) {
- // Open root file and define tree
- std::string fileName = iConfig.getUntrackedParameter("fileName", "test.root");
- theFile = new TFile(fileName.c_str(), "RECREATE");
- theTree = new TTree("theTree", "Detector units positions");
-
- theTree->Branch("x", &x, "x/F");
- theTree->Branch("y", &y, "y/F");
- theTree->Branch("z", &z, "z/F");
- theTree->Branch("phi", &phi, "phi/F");
- theTree->Branch("theta", &theta, "theta/F");
- theTree->Branch("length", &length, "length/F");
- theTree->Branch("width", &width, "width/F");
- theTree->Branch("thick", &thick, "thick/F");
- dir = 0;
- theTree->Branch("dir", "TRotMatrix", &dir);
-}
-
-TestRotation::~TestRotation() {
- theTree->Write();
- theFile->Close();
-}
-
-void TestRotation::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
- edm::LogInfo("MuonAlignment") << "Starting!";
-
- /*
- //
- // Build alignable muon geometry from event setup
- //
-
- edm::ESTransientHandle cpv;
- iRecord.getRecord().get( cpv );
-
- DTGeometryBuilderFromDDD DTGeometryBuilder;
- CSCGeometryBuilderFromDDD CSCGeometryBuilder;
-
- theDTGeometry = std::shared_ptr( DTGeometryBuilder.build( &(*cpv) ) );
- theCSCGeometry = std::shared_ptr( CSCGeometryBuilder.build( &(*cpv) ) );
-
- AlignableMuon* theAlignableMuon = new AlignableMuon( &(*theDTGeometry) , &(*theCSCGeometry) );
-*/
-
- //
- // Retrieve ideal geometry from event setup
- //
- edm::ESHandle dtGeometry = iSetup.getHandle(esTokenDT_);
- edm::ESHandle cscGeometry = iSetup.getHandle(esTokenCSC_);
- edm::ESHandle gemGeometry = iSetup.getHandle(esTokenGEM_);
-
- AlignableMuon* theAlignableMuon = new AlignableMuon(&(*dtGeometry), &(*cscGeometry), &(*gemGeometry));
-
- // Apply alignment
-
- const auto& theDTWheels = theAlignableMuon->DTWheels();
- std::cout << "Number of wheels=" << theDTWheels.size() << std::endl;
-
- for (const auto& iter : theDTWheels) {
- std::cout << "------------------------" << std::endl << " BEFORE ROTATION " << std::endl;
-
- align::GlobalPoint pos_i = iter->globalPosition();
- align::RotationType dir_i = iter->globalRotation();
-
- std::cout << "x=" << pos_i.x() << ", y=" << pos_i.y() << ", z=" << pos_i.z() << std::endl;
- std::cout << "xx=" << dir_i.xx() << ", yx=" << dir_i.yx() << ", zx=" << dir_i.zx() << std::endl;
- std::cout << "xy=" << dir_i.xy() << ", yy=" << dir_i.yy() << ", zy=" << dir_i.zy() << std::endl;
- std::cout << "xz=" << dir_i.xz() << ", yz=" << dir_i.yz() << ", zz=" << dir_i.zz() << std::endl;
-
- // x = iter->surface().position().x();
- // y = iter->surface().position().y();
- // z = iter->surface().position().z();
- // std::cout << "X=" << x << ", Y= " << y << ", Z=" << z << std::endl ;
-
- double deltaPhi = 3.1415926 / 180 * 45;
-
- iter->rotateAroundGlobalZ(deltaPhi);
-
- std::cout << "------------------------" << std::endl << " AFTER ROTATION " << std::endl;
-
- align::GlobalPoint pos_f = iter->globalPosition();
- align::RotationType dir_f = iter->globalRotation();
-
- std::cout << "x=" << pos_f.x() << ", y=" << pos_f.y() << ", z=" << pos_f.z() << std::endl;
- std::cout << "xx=" << dir_f.xx() << ", yx=" << dir_f.yx() << ", zx=" << dir_f.zx() << std::endl;
- std::cout << "xy=" << dir_f.xy() << ", yy=" << dir_f.yy() << ", zy=" << dir_f.zy() << std::endl;
- std::cout << "xz=" << dir_f.xz() << ", yz=" << dir_f.yz() << ", zz=" << dir_f.zz() << std::endl;
- std::cout << "------------------------" << std::endl;
- }
-
- // delete theAlignableMuon ;
-
- edm::LogInfo("MuonAlignment") << "Done!";
-}
-
-//define this as a plug-in
-DEFINE_FWK_MODULE(TestRotation);
diff --git a/Alignment/MuonAlignment/test/TestTranslation.cpp b/Alignment/MuonAlignment/test/TestTranslation.cpp
deleted file mode 100644
index 758d445308924..0000000000000
--- a/Alignment/MuonAlignment/test/TestTranslation.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-// -*- C++ -*-
-//
-// Package: TestTranslation
-// Class: TestTranslation
-//
-//
-// Description: Module to test the Alignment software
-//
-//
-
-// system include files
-#include
-#include
-#include
-#include
-
-// user include files
-#include "FWCore/MessageLogger/interface/MessageLogger.h"
-#include "FWCore/Framework/interface/EDAnalyzer.h"
-
-#include "FWCore/Framework/interface/EventSetup.h"
-#include "FWCore/Framework/interface/ESTransientHandle.h"
-#include "FWCore/Framework/interface/ESHandle.h"
-#include "FWCore/Framework/interface/MakerMacros.h"
-
-#include "FWCore/ParameterSet/interface/ParameterSet.h"
-
-#include "Alignment/MuonAlignment/interface/AlignableMuon.h"
-#include
-
-#include "Geometry/DTGeometry/interface/DTGeometry.h"
-
-#include "DataFormats/GeometrySurface/interface/Surface.h"
-
-#include
-
-//
-//
-// class declaration
-//
-
-class TestTranslation : public edm::EDAnalyzer {
-public:
- explicit TestTranslation(const edm::ParameterSet&);
- ~TestTranslation();
-
- virtual void analyze(const edm::Event&, const edm::EventSetup&);
-
-private:
- // ----------member data ---------------------------
- TTree* theTree;
- TFile* theFile;
- float x, y, z, phi, theta, length, thick, width;
- TRotMatrix* dir;
-
- typedef Surface::RotationType RotationType;
- typedef Surface::PositionType PositionType;
-
- void apply(Alignable*);
-};
-
-//
-// constructors and destructor
-//
-TestTranslation::TestTranslation(const edm::ParameterSet& iConfig) {
- // Open root file and define tree
- std::string fileName = iConfig.getUntrackedParameter("fileName", "test.root");
- theFile = new TFile(fileName.c_str(), "RECREATE");
- theTree = new TTree("theTree", "Detector units positions");
-
- theTree->Branch("x", &x, "x/F");
- theTree->Branch("y", &y, "y/F");
- theTree->Branch("z", &z, "z/F");
- theTree->Branch("phi", &phi, "phi/F");
- theTree->Branch("theta", &theta, "theta/F");
- theTree->Branch("length", &length, "length/F");
- theTree->Branch("width", &width, "width/F");
- theTree->Branch("thick", &thick, "thick/F");
- dir = 0;
- theTree->Branch("dir", "TRotMatrix", &dir);
-}
-
-TestTranslation::~TestTranslation() {
- theTree->Write();
- theFile->Close();
-}
-
-void TestTranslation::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
- edm::LogInfo("MuonAlignment") << "Starting!";
-
- /*
- //
- // Build alignable muon geometry from event setup
- //
- edm::ESTransientHandle cpv;
- iRecord.getRecord().get( cpv );
-
- DTGeometryBuilderFromDDD DTGeometryBuilder;
- CSCGeometryBuilderFromDDD CSCGeometryBuilder;
-
- theDTGeometry = std::shared_ptr( DTGeometryBuilder.build( &(*cpv) ) );
- theCSCGeometry = std::shared_ptr( CSCGeometryBuilder.build( &(*cpv) ) );
-
- AlignableMuon* theAlignableMuon = new AlignableMuon( &(*theDTGeometry) , &(*theCSCGeometry) );
-*/
-
- //
- // Retrieve ideal geometry from event setup
- //
- edm::ESHandle dtGeometry;
- edm::ESHandle cscGeometry;
- edm::ESHandle gemGeometry;
- iSetup.get().get(dtGeometry);
- iSetup.get().get(cscGeometry);
- iSetup.get().get(gemGeometry);
-
- AlignableMuon* theAlignableMuon = new AlignableMuon(&(*dtGeometry), &(*cscGeometry), &(*gemGeometry));
-
- // Apply alignment
- for (const auto& iter : theAlignableMuon->DTChambers())
- apply(iter);
- for (const auto& iter : theAlignableMuon->CSCEndcaps())
- apply(iter);
-
- edm::LogInfo("MuonAlignment") << "Done!";
-}
-
-void TestTranslation::apply(Alignable* it) {
- std::cout << "------------------------" << std::endl << " BEFORE TRANSLATION " << std::endl;
-
- align::GlobalPoint pos_i = (it)->globalPosition();
- // RotationType dir_i = (it)->globalRotation();
-
- std::cout << "x=" << pos_i.x() << ", y=" << pos_i.y() << ", z=" << pos_i.z() << std::endl;
-
- double dx = 1.0;
- double dy = 2.0;
- double dz = 3.0;
- align::GlobalVector dr(dx, dy, dz);
- it->move(dr);
-
- std::cout << "------------------------" << std::endl << " AFTER TRANSLATION " << std::endl;
-
- align::GlobalPoint pos_f = (it)->globalPosition();
- // RotationType dir_f = (it)->globalRotation();
-
- std::cout << "x=" << pos_f.x() << ", y=" << pos_f.y() << ", z=" << pos_f.z() << std::endl;
-
- std::cout << "------------------------" << std::endl;
-}
-
-// delete theAlignableMuon ;
-
-//define this as a plug-in
-DEFINE_FWK_MODULE(TestTranslation);
diff --git a/Alignment/MuonAlignment/test/computeIdealTransformation_cfg.py b/Alignment/MuonAlignment/test/computeIdealTransformation_cfg.py
deleted file mode 100644
index ea4f76282d831..0000000000000
--- a/Alignment/MuonAlignment/test/computeIdealTransformation_cfg.py
+++ /dev/null
@@ -1,35 +0,0 @@
-import FWCore.ParameterSet.Config as cms
-
-process = cms.Process("COMPUTEIDEAL")
-process.source = cms.Source("EmptySource")
-process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1))
-
-process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi")
-process.load("Geometry.MuonNumbering.muonNumberingInitialization_cfi")
-process.load("Geometry.DTGeometry.dtGeometry_cfi")
-process.load("Geometry.CSCGeometry.cscGeometry_cfi")
-
-# Ideal records
-# frontier://FrontierProd/CMS_COND_31X_FROM21X DTAlignmentRcd DTIdealGeometry200_mc
-# frontier://FrontierProd/CMS_COND_31X_FROM21X DTAlignmentErrorExtendedRcd DTIdealGeometryErrors200_mc
-# frontier://FrontierProd/CMS_COND_31X_ALIGNMENT CSCAlignmentRcd CSCIdealGeometry310me42_mc
-# frontier://FrontierProd/CMS_COND_31X_ALIGNMENT CSCAlignmentErrorExtendedRcd CSCIdealGeometryErrors310me42_mc
-# frontier://FrontierProd/CMS_COND_31X_FROM21X GlobalPositionRcd IdealGeometry
-# frontier://FrontierProd/CMS_COND_31X_FROM21X TrackerAlignmentRcd TrackerIdealGeometry210_mc
-# frontier://FrontierProd/CMS_COND_31X_FROM21X TrackerAlignmentErrorExtendedRcd TrackerIdealGeometryErrors210_mc
-
-process.load("CondCore.DBCommon.CondDBSetup_cfi")
-process.ideal31Xfrom21X = cms.ESSource("PoolDBESSource",
- process.CondDBSetup,
- connect = cms.string("frontier://FrontierProd/CMS_COND_31X_FROM21X"),
- toGet = cms.VPSet(cms.PSet(record = cms.string("DTAlignmentRcd"), tag = cms.string("DTIdealGeometry200_mc")),
- cms.PSet(record = cms.string("DTAlignmentErrorExtendedRcd"), tag = cms.string("DTIdealGeometryErrors200_mc")),
- cms.PSet(record = cms.string("GlobalPositionRcd"), tag = cms.string("IdealGeometry"))))
-process.ideal31X = cms.ESSource("PoolDBESSource",
- process.CondDBSetup,
- connect = cms.string("frontier://FrontierProd/CMS_COND_31X_ALIGNMENT"),
- toGet = cms.VPSet(cms.PSet(record = cms.string("CSCAlignmentRcd"), tag = cms.string("CSCIdealGeometry310me42_mc")),
- cms.PSet(record = cms.string("CSCAlignmentErrorExtendedRcd"), tag = cms.string("CSCIdealGeometryErrors310me42_mc"))))
-
-process.ComputeTransformation = cms.EDAnalyzer("ComputeTransformation", fileName = cms.string("Alignment/MuonAlignment/data/idealTransformation.py"))
-process.Path = cms.Path(process.ComputeTransformation)
diff --git a/Alignment/MuonAlignment/test/test-db-read_cfg.py b/Alignment/MuonAlignment/test/test-db-read_cfg.py
deleted file mode 100644
index 48981077b91fe..0000000000000
--- a/Alignment/MuonAlignment/test/test-db-read_cfg.py
+++ /dev/null
@@ -1,67 +0,0 @@
-import FWCore.ParameterSet.Config as cms
-
-process = cms.Process("TEST")
-# Message logger service
-process.load("FWCore.MessageService.MessageLogger_cfi")
-
-# DT and CSC geometry
-process.load("Geometry.MuonCommonData.muonIdealGeometryXML_cfi")
-process.load("Geometry.MuonNumbering.muonNumberingInitialization_cfi")
-
-# Reading misalignments from DB
-process.load("CondCore.DBCommon.CondDBSetup_cfi")
-
-process.maxEvents = cms.untracked.PSet(
- input = cms.untracked.int32(1)
-)
-process.source = cms.Source("EmptySource")
-
-
-process.DTGeometryMisalignedMuonProducer = cms.ESProducer("DTGeometryESModule",
- appendToDataLabel = cms.string('idealForTestReader'),
- applyAlignment = cms.bool(False),
- alignmentsLabel = cms.string(''),
- fromDDD = cms.bool(True)
-)
-
-process.CSCGeometryMisalignedMuonProducer = cms.ESProducer("CSCGeometryESModule",
- appendToDataLabel = cms.string('idealForTestReader'),
- debugV = cms.untracked.bool(False),
- useGangedStripsInME1a = cms.bool(False),
- alignmentsLabel = cms.string(''),
- useOnlyWiresInME1a = cms.bool(False),
- useRealWireGeometry = cms.bool(True),
- useCentreTIOffsets = cms.bool(False),
- applyAlignment = cms.bool(False),
- fromDDD = cms.bool(True),
- fromDD4hep = cms.bool(False)
-)
-
-
-from CondCore.DBCommon.CondDBSetup_cfi import CondDBSetup
-process.PoolDBESSource = cms.ESSource("PoolDBESSource",
- process.CondDBSetup,
- toGet = cms.VPSet(cms.PSet(
- record = cms.string('DTAlignmentRcd'),
- tag = cms.string('DT100InversepbScenario')
- ),
- cms.PSet(
- record = cms.string('DTAlignmentErrorExtendedRcd'),
- tag = cms.string('DT100InversepbScenarioErrors')
- ),
- cms.PSet(
- record = cms.string('CSCAlignmentRcd'),
- tag = cms.string('CSC100InversepbScenario')
- ),
- cms.PSet(
- record = cms.string('CSCAlignmentErrorExtendedRcd'),
- tag = cms.string('CSC100InversepbScenarioErrors')
- )),
- connect = cms.string('sqlite_file:Alignments.db')
-)
-
-process.prod = cms.EDAnalyzer("TestMuonReader")
-
-process.p1 = cms.Path(process.prod)
-
-
diff --git a/Alignment/MuonAlignment/test/test-hierarchy_cfg.py b/Alignment/MuonAlignment/test/test-hierarchy_cfg.py
deleted file mode 100644
index bac775160ae86..0000000000000
--- a/Alignment/MuonAlignment/test/test-hierarchy_cfg.py
+++ /dev/null
@@ -1,64 +0,0 @@
-import FWCore.ParameterSet.Config as cms
-
-process = cms.Process("TEST")
-# Message logger service
-process.load("FWCore.MessageService.MessageLogger_cfi")
-
-# Ideal geometry producer
-process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi")
-process.load("Geometry.MuonNumbering.muonNumberingInitialization_cfi")
-
-# testing ideal geometry from Fake...
-#process.load("Geometry.DTGeometry.dtGeometry_cfi")
-#process.load("Geometry.CSCGeometry.cscGeometry_cfi")
-#process.load("CalibMuon.Configuration.Muon_FakeAlignment_cff")
-
-## ...or testing geometry from DB/sqlite...
-#process.load("Geometry.DTGeometry.dtGeometry_cfi")
-#process.load("Geometry.CSCGeometry.cscGeometry_cfi")
-#process.load("Alignment.CommonAlignmentProducer.GlobalPosition_Frontier_cff")
-#
-#from CondCore.DBCommon.CondDBSetup_cfi import *
-#process.PoolDBESSource = cms.ESSource(
-# "PoolDBESSource",
-# CondDBSetup,
-# #connect = cms.string('frontier://FrontierProd/CMS_COND_31X_ALIGNMENT'),
-# connect = cms.string('sqlite_file:Alignments.db'),
-# toGet = cms.VPSet(cms.PSet(record = cms.string('DTAlignmentRcd'),
-# tag = cms.string('DT100InversepbScenario')
-# ),
-# cms.PSet(record = cms.string('DTAlignmentErrorExtendedRcd'),
-# tag = cms.string('DT100InversepbScenarioErrors')
-# ),
-# cms.PSet(record = cms.string('CSCAlignmentRcd'),
-# tag = cms.string('CSC100InversepbScenario')
-# ),
-# cms.PSet(record = cms.string('CSCAlignmentErrorExtendedRcd'),
-# tag = cms.string('CSC100InversepbScenarioErrors')
-# )
-# )
-# )
-
-## ... or testing any of the scenarios from cff
-process.load("Alignment.MuonAlignment.MisalignedMuon_cfi")
-import Alignment.MuonAlignment.Scenarios_cff as _Scenarios
-#process.MisalignedMuon.scenario = _Scenarios.MuonNoMovementsScenario
-#process.MisalignedMuon.scenario = _Scenarios.Muon10InversepbScenario
-process.MisalignedMuon.scenario = _Scenarios.Muon10inversePbScenario2008
-
-process.maxEvents = cms.untracked.PSet(
- input = cms.untracked.int32(1)
-)
-process.source = cms.Source("EmptySource")
-
-process.prod = cms.EDAnalyzer("TestMuonHierarchy")
-
-process.p1 = cms.Path(process.prod)
-process.MessageLogger.cout = cms.untracked.PSet(
- threshold = cms.untracked.string('INFO'),
- default = cms.untracked.PSet(
- limit = cms.untracked.int32(10000000)
- )
-)
-
-
diff --git a/Alignment/MuonAlignment/test/test-rotation_cfg.py b/Alignment/MuonAlignment/test/test-rotation_cfg.py
deleted file mode 100644
index d258cc38b7fc3..0000000000000
--- a/Alignment/MuonAlignment/test/test-rotation_cfg.py
+++ /dev/null
@@ -1,41 +0,0 @@
-import FWCore.ParameterSet.Config as cms
-
-process = cms.Process("TEST")
-process.load("Geometry.MuonCommonData.muonIdealGeometryXML_cfi")
-
-process.load("Geometry.MuonNumbering.muonNumberingInitialization_cfi")
-
-# DT geometry
-# include "Geometry/DTGeometry/data/dtGeometry.cfi"
-# CSC geometry
-# include "Geometry/CSCGeometry/data/cscGeometry.cfi"
-# Misalignment example scenario producer
-process.load("Alignment.MuonAlignment.MisalignedMuon_cfi")
-
-process.MessageLogger = cms.Service("MessageLogger",
- info_txt = cms.untracked.PSet(
- threshold = cms.untracked.string('INFO')
- ),
- cerr = cms.untracked.PSet(
- threshold = cms.untracked.string('ERROR')
- ),
- destinations = cms.untracked.vstring('info_txt',
- 'cerr')
-)
-
-process.maxEvents = cms.untracked.PSet(
- input = cms.untracked.int32(1)
-)
-process.source = cms.Source("EmptySource")
-
-process.MisalignedTracker = cms.ESProducer("MisalignedTrackerESProducer",
- process.MuonNoMovementsScenario
-)
-
-process.prod = cms.EDAnalyzer("TestRotation",
- fileName = cms.untracked.string('misaligned-2.root')
-)
-
-process.p1 = cms.Path(process.prod)
-
-
diff --git a/Alignment/MuonAlignment/test/test-translation_cfg.py b/Alignment/MuonAlignment/test/test-translation_cfg.py
deleted file mode 100644
index 78cf7b7ae491e..0000000000000
--- a/Alignment/MuonAlignment/test/test-translation_cfg.py
+++ /dev/null
@@ -1,41 +0,0 @@
-import FWCore.ParameterSet.Config as cms
-
-process = cms.Process("TEST")
-process.load("Geometry.MuonCommonData.muonIdealGeometryXML_cfi")
-
-process.load("Geometry.MuonNumbering.muonNumberingInitialization_cfi")
-
-# DT geometry
-# include "Geometry/DTGeometry/data/dtGeometry.cfi"
-#
-# CSC geometry
-# include "Geometry/CSCGeometry/data/cscGeometry.cfi"
-process.load("Alignment.MuonAlignment.MisalignedMuon_cfi")
-
-process.MessageLogger = cms.Service("MessageLogger",
- info_txt = cms.untracked.PSet(
- threshold = cms.untracked.string('INFO')
- ),
- cerr = cms.untracked.PSet(
- threshold = cms.untracked.string('ERROR')
- ),
- destinations = cms.untracked.vstring('info_txt',
- 'cerr')
-)
-
-process.maxEvents = cms.untracked.PSet(
- input = cms.untracked.int32(1)
-)
-process.source = cms.Source("EmptySource")
-
-process.MisalignedTracker = cms.ESProducer("MisalignedTrackerESProducer",
- process.MuonNoMovementsScenario
-)
-
-process.prod = cms.EDAnalyzer("TestTranslation",
- fileName = cms.untracked.string('misaligned-2.root')
-)
-
-process.p1 = cms.Path(process.prod)
-
-
diff --git a/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGDBCopy.cc b/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGDBCopy.cc
index 7a9acc35ed156..b71c487f8190f 100644
--- a/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGDBCopy.cc
+++ b/CalibCalorimetry/EcalTPGTools/plugins/EcalTPGDBCopy.cc
@@ -148,119 +148,80 @@ void EcalTPGDBCopy::copyToDB(const edm::EventSetup& evtSetup, const std::string&
std::string recordName = m_records[container];
if (container == "EcalTPGPedestals") {
- const auto handle = evtSetup.getHandle(pedestalsToken_);
- const EcalTPGPedestals* obj = handle.product();
- dbOutput->createNewIOV(
- new EcalTPGPedestals(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
+ const auto& obj = evtSetup.getData(pedestalsToken_);
+ dbOutput->createOneIOV(obj, dbOutput->beginOfTime(), recordName);
} else if (container == "EcalTPGLinearizationConst") {
- const auto handle = evtSetup.getHandle(linearizationConstToken_);
- const EcalTPGLinearizationConst* obj = handle.product();
- dbOutput->createNewIOV(
- new EcalTPGLinearizationConst(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
+ const auto& obj = evtSetup.getData(linearizationConstToken_);
+ dbOutput->createOneIOV(obj, dbOutput->beginOfTime(), recordName);
} else if (container == "EcalTPGSlidingWindow") {
- const auto handle = evtSetup.getHandle(slidingWindowToken_);
- const EcalTPGSlidingWindow* obj = handle.product();
- dbOutput->createNewIOV(
- new EcalTPGSlidingWindow(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
+ const auto& obj = evtSetup.getData(slidingWindowToken_);
+ dbOutput->createOneIOV(obj, dbOutput->beginOfTime(), recordName);
} else if (container == "EcalTPGFineGrainEBIdMap") {
- const auto handle = evtSetup.getHandle(fineGrainEBIdMapToken_);
- const EcalTPGFineGrainEBIdMap* obj = handle.product();
- dbOutput->createNewIOV(
- new EcalTPGFineGrainEBIdMap(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
+ const auto& obj = evtSetup.getData(fineGrainEBIdMapToken_);
+ dbOutput->createOneIOV(obj, dbOutput->beginOfTime(), recordName);
} else if (container == "EcalTPGFineGrainStripEE") {
- const auto handle = evtSetup.getHandle(fineGrainStripEEToken_);
- const EcalTPGFineGrainStripEE* obj = handle.product();
- dbOutput->createNewIOV(
- new EcalTPGFineGrainStripEE(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
+ const auto& obj = evtSetup.getData(fineGrainStripEEToken_);
+ dbOutput->createOneIOV(obj, dbOutput->beginOfTime(), recordName);
} else if (container == "EcalTPGFineGrainTowerEE") {
- const auto handle = evtSetup.getHandle(fineGrainTowerEEToken_);
- const EcalTPGFineGrainTowerEE* obj = handle.product();
- dbOutput->createNewIOV(
- new EcalTPGFineGrainTowerEE(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
+ const auto& obj = evtSetup.getData(fineGrainTowerEEToken_);
+ dbOutput->createOneIOV(obj, dbOutput->beginOfTime(), recordName);
} else if (container == "EcalTPGLutIdMap") {
- const auto handle = evtSetup.getHandle(lutIdMapToken_);
- const EcalTPGLutIdMap* obj = handle.product();
- dbOutput->createNewIOV(
- new EcalTPGLutIdMap(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
+ const auto& obj = evtSetup.getData(lutIdMapToken_);
+ dbOutput->createOneIOV(obj, dbOutput->beginOfTime(), recordName);
} else if (container == "EcalTPGWeightIdMap") {
- const auto handle = evtSetup.getHandle(weightIdMapToken_);
- const EcalTPGWeightIdMap* obj = handle.product();
- dbOutput->createNewIOV(
- new EcalTPGWeightIdMap(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
+ const auto& obj = evtSetup.getData(weightIdMapToken_);
+ dbOutput->createOneIOV(obj, dbOutput->beginOfTime(), recordName);
} else if (container == "EcalTPGWeightGroup") {
- const auto handle = evtSetup.getHandle(weightGroupToken_);
- const EcalTPGWeightGroup* obj = handle.product();
- dbOutput->createNewIOV(
- new EcalTPGWeightGroup(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
+ const auto& obj = evtSetup.getData(weightGroupToken_);
+ dbOutput->createOneIOV(obj, dbOutput->beginOfTime(), recordName);
} else if (container == "EcalTPGOddWeightIdMap") {
- const auto handle = evtSetup.getHandle(oddWeightIdMapToken_);
- const EcalTPGOddWeightIdMap* obj = handle.product();
- dbOutput->createNewIOV(
- new EcalTPGOddWeightIdMap(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
+ const auto& obj = evtSetup.getData(oddWeightIdMapToken_);
+ dbOutput->createOneIOV(obj, dbOutput->beginOfTime(), recordName);
} else if (container == "EcalTPGOddWeightGroup") {
- const auto handle = evtSetup.getHandle(oddWeightGroupToken_);
- const EcalTPGOddWeightGroup* obj = handle.product();
- dbOutput->createNewIOV(
- new EcalTPGOddWeightGroup(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
+ const auto& obj = evtSetup.getData(oddWeightGroupToken_);
+ dbOutput->createOneIOV(obj, dbOutput->beginOfTime(), recordName);
} else if (container == "EcalTPGTPMode") {
- const auto handle = evtSetup.getHandle(tpModeToken_);
- const EcalTPGTPMode* obj = handle.product();
- dbOutput->createNewIOV(
- new EcalTPGTPMode(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
+ const auto& obj = evtSetup.getData(tpModeToken_);
+ dbOutput->createOneIOV(obj, dbOutput->beginOfTime(), recordName);
} else if (container == "EcalTPGLutGroup") {
- const auto handle = evtSetup.getHandle(lutGroupToken_);
- const EcalTPGLutGroup* obj = handle.product();
- dbOutput->createNewIOV(
- new EcalTPGLutGroup(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
+ const auto& obj = evtSetup.getData(lutGroupToken_);
+ dbOutput->createOneIOV(obj, dbOutput->beginOfTime(), recordName);
} else if (container == "EcalTPGFineGrainEBGroup") {
- const auto handle = evtSetup.getHandle(fineGrainEBGroupToken_);
- const EcalTPGFineGrainEBGroup* obj = handle.product();
- dbOutput->createNewIOV(
- new EcalTPGFineGrainEBGroup(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
+ const auto& obj = evtSetup.getData(fineGrainEBGroupToken_);
+ dbOutput->createOneIOV(obj, dbOutput->beginOfTime(), recordName);
} else if (container == "EcalTPGPhysicsConst") {
- const auto handle = evtSetup.getHandle(physicsConstToken_);
- const EcalTPGPhysicsConst* obj = handle.product();
- dbOutput->createNewIOV(
- new EcalTPGPhysicsConst(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
+ const auto& obj = evtSetup.getData(physicsConstToken_);
+ dbOutput->createOneIOV(obj, dbOutput->beginOfTime(), recordName);
} else if (container == "EcalTPGCrystalStatus") {
- const auto handle = evtSetup.getHandle(crystalStatusToken_);
- const EcalTPGCrystalStatus* obj = handle.product();
- dbOutput->createNewIOV(
- new EcalTPGCrystalStatus(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
+ const auto& obj = evtSetup.getData(crystalStatusToken_);
+ dbOutput->createOneIOV(obj, dbOutput->beginOfTime(), recordName);
} else if (container == "EcalTPGTowerStatus") {
- const auto handle = evtSetup.getHandle(towerStatusToken_);
- const EcalTPGTowerStatus* obj = handle.product();
- dbOutput->createNewIOV(
- new EcalTPGTowerStatus(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
+ const auto& obj = evtSetup.getData(towerStatusToken_);
+ dbOutput->createOneIOV(obj, dbOutput->beginOfTime(), recordName);
} else if (container == "EcalTPGSpike") {
- const auto handle = evtSetup.getHandle(spikeToken_);
- const EcalTPGSpike* obj = handle.product();
-
- dbOutput->createNewIOV(
- new EcalTPGSpike(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
+ const auto& obj = evtSetup.getData(spikeToken_);
+ dbOutput->createOneIOV(obj, dbOutput->beginOfTime(), recordName);
} else if (container == "EcalTPGStripStatus") {
- const auto handle = evtSetup.getHandle(stripStatusToken_);
- const EcalTPGStripStatus* obj = handle.product();
- dbOutput->createNewIOV(
- new EcalTPGStripStatus(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
+ const auto& obj = evtSetup.getData(stripStatusToken_);
+ dbOutput->createOneIOV(obj, dbOutput->beginOfTime(), recordName);
} else {
throw cms::Exception("Unknown container");
diff --git a/CalibPPS/TimingCalibration/python/ALCARECOPPSDiamondSampicTimingCalibHarvester_cff.py b/CalibPPS/TimingCalibration/python/ALCARECOPPSDiamondSampicTimingCalibHarvester_cff.py
index 1c6ecf70c86a7..c4d3106a70710 100644
--- a/CalibPPS/TimingCalibration/python/ALCARECOPPSDiamondSampicTimingCalibHarvester_cff.py
+++ b/CalibPPS/TimingCalibration/python/ALCARECOPPSDiamondSampicTimingCalibHarvester_cff.py
@@ -1,5 +1,5 @@
import FWCore.ParameterSet.Config as cms
-
+from DQMServices.Components.EDMtoMEConverter_cfi import EDMtoMEConverter
from Geometry.VeryForwardGeometry.geometryRPFromDB_cfi import *
from CalibPPS.TimingCalibration.PPSDiamondSampicTimingCalibrationPCLHarvester_cfi import *
@@ -9,5 +9,11 @@
from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
dqmEnv = DQMEDHarvester('DQMHarvestingMetadata',
subSystemFolder=cms.untracked.string('AlCaReco/PPSDiamondSampicTimingCalibrationPCL/AlignedChannels'))
-
-ALCAHARVESTPPSDiamondSampicTimingCalibration = cms.Sequence(PPSDiamondSampicTimingCalibrationPCLHarvester + dqmEnv)
+
+EDMtoMEConvertPPSTimingSampicCalibration = EDMtoMEConverter.clone()
+EDMtoMEConvertPPSTimingSampicCalibration.lumiInputTag = cms.InputTag("EDMtoMEConvertPPSTimingSampicCalibration", "MEtoEDMConverterLumi")
+EDMtoMEConvertPPSTimingSampicCalibration.runInputTag = cms.InputTag("EDMtoMEConvertPPSTimingSampicCalibration", "MEtoEDMConverterRun")
+
+ALCAHARVESTPPSDiamondSampicTimingCalibration = cms.Sequence(EDMtoMEConvertPPSTimingSampicCalibration +
+ PPSDiamondSampicTimingCalibrationPCLHarvester +
+ dqmEnv)
diff --git a/CalibPPS/TimingCalibration/python/PPSTimingCalibrationHarvester_cff.py b/CalibPPS/TimingCalibration/python/PPSTimingCalibrationHarvester_cff.py
index 5fcabfa63217e..d9ac61918802f 100644
--- a/CalibPPS/TimingCalibration/python/PPSTimingCalibrationHarvester_cff.py
+++ b/CalibPPS/TimingCalibration/python/PPSTimingCalibrationHarvester_cff.py
@@ -2,3 +2,14 @@
from Geometry.VeryForwardGeometry.geometryRPFromDB_cfi import *
from CalibPPS.TimingCalibration.ppsTimingCalibrationPCLHarvester_cfi import *
+from DQMServices.Components.EDMtoMEConverter_cfi import EDMtoMEConverter
+
+EDMtoMEConvertPPSTimingCalibration = EDMtoMEConverter.clone()
+EDMtoMEConvertPPSTimingCalibration.lumiInputTag = cms.InputTag("EDMtoMEConvertPPSTimingCalibration", "MEtoEDMConverterLumi")
+EDMtoMEConvertPPSTimingCalibration.runInputTag = cms.InputTag("EDMtoMEConvertPPSTimingCalibration", "MEtoEDMConverterRun")
+
+
+ALCAHARVESTPPSTimingCalibration = cms.Task(
+ EDMtoMEConvertPPSTimingCalibration,
+ ppsTimingCalibrationPCLHarvester
+)
diff --git a/CalibTracker/SiPixelConnectivity/test/SiPixelFedCablingMapWriter.cc b/CalibTracker/SiPixelConnectivity/test/SiPixelFedCablingMapWriter.cc
index 2211cf59282cb..ea608d10459b6 100644
--- a/CalibTracker/SiPixelConnectivity/test/SiPixelFedCablingMapWriter.cc
+++ b/CalibTracker/SiPixelConnectivity/test/SiPixelFedCablingMapWriter.cc
@@ -70,7 +70,7 @@ void SiPixelFedCablingMapWriter::analyze(const edm::Event& iEvent, const edm::Ev
void SiPixelFedCablingMapWriter::beginJob() {}
void SiPixelFedCablingMapWriter::endJob() {
- SiPixelFedCablingMap* result = new SiPixelFedCablingMap(cabling);
+ SiPixelFedCablingMap result(cabling);
LogInfo("Now NEW writing to DB");
edm::Service mydbservice;
if (!mydbservice.isAvailable()) {
@@ -84,10 +84,9 @@ void SiPixelFedCablingMapWriter::endJob() {
try {
if (mydbservice->isNewTagRequest(record_)) {
- mydbservice->createNewIOV(
- result, mydbservice->beginOfTime(), mydbservice->endOfTime(), record_);
+ mydbservice->createOneIOV(result, mydbservice->beginOfTime(), record_);
} else {
- mydbservice->appendSinceTime(result, mydbservice->currentTime(), record_);
+ mydbservice->appendOneIOV(result, mydbservice->currentTime(), record_);
}
} catch (std::exception& e) {
LogError("std::exception: ") << e.what();
diff --git a/CalibTracker/SiPixelGainCalibration/plugins/SiPixelGainCalibrationAnalysis.cc b/CalibTracker/SiPixelGainCalibration/plugins/SiPixelGainCalibrationAnalysis.cc
index 3072ffa6a0f45..ac1d63c186b09 100644
--- a/CalibTracker/SiPixelGainCalibration/plugins/SiPixelGainCalibrationAnalysis.cc
+++ b/CalibTracker/SiPixelGainCalibration/plugins/SiPixelGainCalibrationAnalysis.cc
@@ -17,8 +17,6 @@ Description:
//
// user include files
-#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
-
#include "SiPixelGainCalibrationAnalysis.h"
#include
#include
diff --git a/CalibTracker/SiPixelLorentzAngle/src/SiPixelLorentzAnglePCLHarvester.cc b/CalibTracker/SiPixelLorentzAngle/src/SiPixelLorentzAnglePCLHarvester.cc
index a4ee5adcf7cfc..97adca6e609d1 100644
--- a/CalibTracker/SiPixelLorentzAngle/src/SiPixelLorentzAnglePCLHarvester.cc
+++ b/CalibTracker/SiPixelLorentzAngle/src/SiPixelLorentzAnglePCLHarvester.cc
@@ -412,7 +412,7 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS
edm::Service mydbservice;
if (mydbservice.isAvailable()) {
try {
- mydbservice->writeOneIOV(LorentzAngle.get(), mydbservice->currentTime(), recordName_);
+ mydbservice->writeOneIOV(*LorentzAngle, mydbservice->currentTime(), recordName_);
} catch (const cond::Exception& er) {
edm::LogError("SiPixelLorentzAngleDB") << er.what() << std::endl;
} catch (const std::exception& er) {
diff --git a/CalibTracker/SiPixelQuality/plugins/SiPixelStatusHarvester.cc b/CalibTracker/SiPixelQuality/plugins/SiPixelStatusHarvester.cc
index b4dc6f87d6684..0dc7621c6b37f 100644
--- a/CalibTracker/SiPixelQuality/plugins/SiPixelStatusHarvester.cc
+++ b/CalibTracker/SiPixelQuality/plugins/SiPixelStatusHarvester.cc
@@ -174,10 +174,10 @@ void SiPixelStatusHarvester::dqmEndRun(const edm::Run& iRun, const edm::EventSet
if (poolDbService.isAvailable()) { // if(poolDbService.isAvailable() )
// start producing tag for permanent component removed
- SiPixelQuality* siPixelQualityPermBad = new SiPixelQuality();
+ SiPixelQuality siPixelQualityPermBad;
const std::vector badComponentList = badPixelInfo_->getBadComponentList();
for (unsigned int i = 0; i < badComponentList.size(); i++) {
- siPixelQualityPermBad->addDisabledModule(badComponentList[i]);
+ siPixelQualityPermBad.addDisabledModule(badComponentList[i]);
uint32_t detId = badComponentList[i].DetID;
int detid = int(detId);
@@ -194,7 +194,7 @@ void SiPixelStatusHarvester::dqmEndRun(const edm::Run& iRun, const edm::EventSet
}
if (debug_ == true) { // only produced for debugging reason
cond::Time_t thisIOV = (cond::Time_t)iRun.id().run();
- poolDbService->writeOneIOV(*siPixelQualityPermBad, thisIOV, recordName_ + "_permanentBad");
+ poolDbService->writeOneIOV(siPixelQualityPermBad, thisIOV, recordName_ + "_permanentBad");
}
// IOV for final payloads. FEDerror25 and pcl
@@ -203,7 +203,7 @@ void SiPixelStatusHarvester::dqmEndRun(const edm::Run& iRun, const edm::EventSet
std::map pclIOV;
// container for SiPixelQuality for the whole run
- std::map siPixelQualityStuckTBM_Tag;
+ std::map siPixelQualityStuckTBM_Tag;
// stuckTBM tag from FED error 25 with permanent component removed
for (SiPixelStatusManager::FEDerror25Map_iterator it = FEDerror25Map.begin(); it != FEDerror25Map.end(); it++) {
@@ -219,8 +219,8 @@ void SiPixelStatusHarvester::dqmEndRun(const edm::Run& iRun, const edm::EventSet
else
interval = int(endLumiBlock_ - it->first + 1); // +1 because need to include the last lumi section
- SiPixelQuality* siPixelQuality_stuckTBM = new SiPixelQuality();
- SiPixelQuality* siPixelQuality_FEDerror25 = new SiPixelQuality();
+ SiPixelQuality siPixelQuality_stuckTBM;
+ SiPixelQuality siPixelQuality_FEDerror25;
std::map> tmpFEDerror25 = it->second;
for (std::map>::iterator ilist = tmpFEDerror25.begin(); ilist != tmpFEDerror25.end();
@@ -272,7 +272,7 @@ void SiPixelStatusHarvester::dqmEndRun(const edm::Run& iRun, const edm::EventSet
// fill the badmodule only if there is(are) bad ROC(s) in it
if (badrocs_stuckTBM != 0) {
BadModule_stuckTBM.BadRocs = badrocs_stuckTBM;
- siPixelQuality_stuckTBM->addDisabledModule(BadModule_stuckTBM);
+ siPixelQuality_stuckTBM.addDisabledModule(BadModule_stuckTBM);
}
// change module error type if all ROCs are bad
@@ -287,7 +287,7 @@ void SiPixelStatusHarvester::dqmEndRun(const edm::Run& iRun, const edm::EventSet
// fill the badmodule only if there is(are) bad ROC(s) in it
if (badrocs_FEDerror25 != 0) {
BadModule_FEDerror25.BadRocs = badrocs_FEDerror25;
- siPixelQuality_FEDerror25->addDisabledModule(BadModule_FEDerror25);
+ siPixelQuality_FEDerror25.addDisabledModule(BadModule_FEDerror25);
}
} // loop over modules
@@ -298,9 +298,7 @@ void SiPixelStatusHarvester::dqmEndRun(const edm::Run& iRun, const edm::EventSet
fedError25IOV[it->first] = it->first;
if (debug_ == true) // only produced for debugging reason
- poolDbService->writeOneIOV(*siPixelQuality_FEDerror25, thisIOV, recordName_ + "_FEDerror25");
-
- delete siPixelQuality_FEDerror25;
+ poolDbService->writeOneIOV(siPixelQuality_FEDerror25, thisIOV, recordName_ + "_FEDerror25");
}
// IOV for PCL output tags that "combines" permanent bad/stuckTBM/other
@@ -314,9 +312,9 @@ void SiPixelStatusHarvester::dqmEndRun(const edm::Run& iRun, const edm::EventSet
std::map::iterator itIOV;
// container for SiPixelQuality for the whole run
- std::map siPixelQualityPCL_Tag;
- std::map siPixelQualityPrompt_Tag;
- std::map siPixelQualityOther_Tag;
+ std::map siPixelQualityPCL_Tag;
+ std::map siPixelQualityPrompt_Tag;
+ std::map siPixelQualityOther_Tag;
for (itIOV = finalIOV.begin(); itIOV != finalIOV.end(); itIOV++) {
int interval = 0;
@@ -371,17 +369,17 @@ void SiPixelStatusHarvester::dqmEndRun(const edm::Run& iRun, const edm::EventSet
// add empty bad components to "other" tag
edm::LogInfo("SiPixelStatusHarvester")
<< "Tag requested for other in low statistics IOV in the " << outputBase_ << " harvester" << std::endl;
- siPixelQualityOther_Tag[itIOV->first] = new SiPixelQuality();
+ siPixelQualityOther_Tag[itIOV->first] = SiPixelQuality();
continue;
}
// create the DB object
// payload including all : PCL = permanent bad (low DIGI ROC) + other + stuckTBM
- SiPixelQuality* siPixelQualityPCL = new SiPixelQuality();
- SiPixelQuality* siPixelQualityOther = new SiPixelQuality();
+ SiPixelQuality siPixelQualityPCL;
+ SiPixelQuality siPixelQualityOther;
// Prompt = permanent bad(low DIGI + low eff/damaged ROCs + other)
- SiPixelQuality* siPixelQualityPrompt = new SiPixelQuality();
+ SiPixelQuality siPixelQualityPrompt;
// loop over modules
std::map detectorStatus = tmpSiPixelStatus.getDetectorStatus();
@@ -472,7 +470,7 @@ void SiPixelStatusHarvester::dqmEndRun(const edm::Run& iRun, const edm::EventSet
}
if (badrocsPCL != 0) {
BadModulePCL.BadRocs = badrocsPCL;
- siPixelQualityPCL->addDisabledModule(BadModulePCL);
+ siPixelQualityPCL.addDisabledModule(BadModulePCL);
}
// Other
@@ -483,7 +481,7 @@ void SiPixelStatusHarvester::dqmEndRun(const edm::Run& iRun, const edm::EventSet
}
if (badrocsOther != 0) {
BadModuleOther.BadRocs = badrocsOther;
- siPixelQualityOther->addDisabledModule(BadModuleOther);
+ siPixelQualityOther.addDisabledModule(BadModuleOther);
}
// start constructing bad components for prompt = "other" + permanent
@@ -519,7 +517,7 @@ void SiPixelStatusHarvester::dqmEndRun(const edm::Run& iRun, const edm::EventSet
}
if (badrocsPrompt != 0) {
BadModulePrompt.BadRocs = badrocsPrompt;
- siPixelQualityPrompt->addDisabledModule(BadModulePrompt);
+ siPixelQualityPrompt.addDisabledModule(BadModulePrompt);
}
} // end module loop
@@ -549,25 +547,20 @@ void SiPixelStatusHarvester::dqmEndRun(const edm::Run& iRun, const edm::EventSet
// Add a dummy IOV starting from last lumisection+1 to close the tag for the run
if ((outputBase_ == "nLumibased" || outputBase_ == "dynamicLumibased") && !finalIOV.empty()) {
itIOV = std::prev(finalIOV.end()); // go to last element in the pixel quality tag
- SiPixelQuality* lastPrompt = siPixelQualityPrompt_Tag[itIOV->first];
- SiPixelQuality* lastOther = siPixelQualityOther_Tag[itIOV->first];
+ SiPixelQuality lastPrompt = siPixelQualityPrompt_Tag[itIOV->first];
+ SiPixelQuality lastOther = siPixelQualityOther_Tag[itIOV->first];
// add permanent bad components to last lumi+1 IF AND ONLY IF the last payload of prompt is not equal to permanent bad components
edm::LuminosityBlockID lu(iRun.id().run(), endLumiBlock_ + 1);
cond::Time_t thisIOV = (cond::Time_t)(lu.value());
if (!SiPixelStatusHarvester::equal(lastPrompt, siPixelQualityPermBad))
- poolDbService->writeOneIOV(*siPixelQualityPermBad, thisIOV, recordName_ + "_prompt");
+ poolDbService->writeOneIOV(siPixelQualityPermBad, thisIOV, recordName_ + "_prompt");
// add empty bad components to last lumi+1 IF AND ONLY IF the last payload of other is not equal to empty
- SiPixelQuality* siPixelQualityDummy = new SiPixelQuality();
+ SiPixelQuality siPixelQualityDummy;
if (!SiPixelStatusHarvester::equal(lastOther, siPixelQualityDummy))
- poolDbService->writeOneIOV(*siPixelQualityDummy, thisIOV, recordName_ + "_other");
-
- delete siPixelQualityDummy;
+ poolDbService->writeOneIOV(siPixelQualityDummy, thisIOV, recordName_ + "_other");
}
-
- delete siPixelQualityPermBad;
-
} // end of if(poolDbService.isAvailable() )
}
@@ -609,15 +602,15 @@ edm::LuminosityBlockNumber_t SiPixelStatusHarvester::stepIOV(
}
//--------------------------------------------------------------------------------------------------
-bool SiPixelStatusHarvester::equal(SiPixelQuality* a, SiPixelQuality* b) {
+bool SiPixelStatusHarvester::equal(SiPixelQuality a, SiPixelQuality b) {
std::vector badRocListA;
std::vector badRocListB;
- for (unsigned int ia = 0; ia < (a->getBadComponentList()).size(); ia++) {
- badRocListA.push_back((a->getBadComponentList())[ia]);
+ for (unsigned int ia = 0; ia < (a.getBadComponentList()).size(); ia++) {
+ badRocListA.push_back((a.getBadComponentList())[ia]);
}
- for (unsigned int ib = 0; ib < (b->getBadComponentList()).size(); ib++) {
- badRocListB.push_back((b->getBadComponentList())[ib]);
+ for (unsigned int ib = 0; ib < (b.getBadComponentList()).size(); ib++) {
+ badRocListB.push_back((b.getBadComponentList())[ib]);
}
if (badRocListA.size() != badRocListB.size())
@@ -646,23 +639,22 @@ bool SiPixelStatusHarvester::equal(SiPixelQuality* a, SiPixelQuality* b) {
}
//--------------------------------------------------------------------------------------------------
-void SiPixelStatusHarvester::constructTag(std::map siPixelQualityTag,
+void SiPixelStatusHarvester::constructTag(std::map siPixelQualityTag,
edm::Service& poolDbService,
std::string tagName,
edm::Run const& iRun) {
- for (std::map::iterator qIt = siPixelQualityTag.begin(); qIt != siPixelQualityTag.end();
- ++qIt) {
+ for (std::map::iterator qIt = siPixelQualityTag.begin(); qIt != siPixelQualityTag.end(); ++qIt) {
edm::LuminosityBlockID lu(iRun.id().run(), qIt->first);
cond::Time_t thisIOV = (cond::Time_t)(lu.value());
- SiPixelQuality* thisPayload = qIt->second;
+ SiPixelQuality thisPayload = qIt->second;
if (qIt == siPixelQualityTag.begin())
- poolDbService->writeOneIOV(*thisPayload, thisIOV, recordName_ + "_" + tagName);
+ poolDbService->writeOneIOV(thisPayload, thisIOV, recordName_ + "_" + tagName);
else {
- SiPixelQuality* prevPayload = (std::prev(qIt))->second;
+ SiPixelQuality prevPayload = (std::prev(qIt))->second;
if (!SiPixelStatusHarvester::equal(thisPayload,
prevPayload)) // only append newIOV if this payload differs wrt last
- poolDbService->writeOneIOV(*thisPayload, thisIOV, recordName_ + "_" + tagName);
+ poolDbService->writeOneIOV(thisPayload, thisIOV, recordName_ + "_" + tagName);
}
}
}
diff --git a/CalibTracker/SiPixelQuality/plugins/SiPixelStatusHarvester.h b/CalibTracker/SiPixelQuality/plugins/SiPixelStatusHarvester.h
index c2fb7a437125f..c669bc29c4aca 100644
--- a/CalibTracker/SiPixelQuality/plugins/SiPixelStatusHarvester.h
+++ b/CalibTracker/SiPixelQuality/plugins/SiPixelStatusHarvester.h
@@ -97,10 +97,10 @@ class SiPixelStatusHarvester : public DQMOneEDAnalyzer IOV);
// boolean function to check whether two SiPixelQualitys (pyloads) are identical
- bool equal(SiPixelQuality* a, SiPixelQuality* b);
+ bool equal(SiPixelQuality a, SiPixelQuality b);
// Tag constructor
- void constructTag(std::map siPixelQualityTag,
+ void constructTag(std::map siPixelQualityTag,
edm::Service& poolDbService,
std::string tagName,
edm::Run const& iRun);
diff --git a/Calibration/LumiAlCaRecoProducers/plugins/RawPCCProducer.cc b/Calibration/LumiAlCaRecoProducers/plugins/RawPCCProducer.cc
index 0f19a9a862d41..e73ff7fa0c9a7 100644
--- a/Calibration/LumiAlCaRecoProducers/plugins/RawPCCProducer.cc
+++ b/Calibration/LumiAlCaRecoProducers/plugins/RawPCCProducer.cc
@@ -41,6 +41,7 @@ class RawPCCProducer : public edm::global::EDProducer pccToken_;
+ const edm::ESGetToken lumiCorrectionsToken_;
const edm::EDPutTokenT putToken_;
const std::string takeAverageValue_; //Output average values
@@ -55,7 +56,8 @@ class RawPCCProducer : public edm::global::EDProducer(
+ : lumiCorrectionsToken_(esConsumes()),
+ putToken_{produces(
iConfig.getParameter("RawPCCProducerParameters")
.getUntrackedParameter("outputProductName", "alcaLumi"))},
takeAverageValue_{iConfig.getParameter("RawPCCProducerParameters")
@@ -123,9 +125,8 @@ void RawPCCProducer::globalEndLuminosityBlockProduce(edm::LuminosityBlock& lumiS
std::vector correctionScaleFactors;
if (applyCorr_) {
- edm::ESHandle corrHandle;
- iSetup.get().get(corrHandle);
- const LumiCorrections* pccCorrections = corrHandle.product();
+ //Get PCC corrections from the event setup through a token
+ const auto pccCorrections = &iSetup.getData(lumiCorrectionsToken_);
correctionScaleFactors = pccCorrections->getCorrectionsBX();
} else {
correctionScaleFactors.resize(LumiConstants::numBX, 1.0);
diff --git a/Calibration/TkAlCaRecoProducers/plugins/AlcaBeamSpotHarvester.cc b/Calibration/TkAlCaRecoProducers/plugins/AlcaBeamSpotHarvester.cc
index d1a1408c72f07..bacf8be8fccf0 100644
--- a/Calibration/TkAlCaRecoProducers/plugins/AlcaBeamSpotHarvester.cc
+++ b/Calibration/TkAlCaRecoProducers/plugins/AlcaBeamSpotHarvester.cc
@@ -75,30 +75,30 @@ void AlcaBeamSpotHarvester::endRun(const edm::Run &iRun, const edm::EventSetup &
if (poolDbService.isAvailable()) {
for (AlcaBeamSpotManager::bsMap_iterator it = beamSpotMap.begin(); it != beamSpotMap.end(); it++) {
- BeamSpotObjects *aBeamSpot = new BeamSpotObjects();
- aBeamSpot->SetType(it->second.second.type());
- aBeamSpot->SetPosition(it->second.second.x0(), it->second.second.y0(), it->second.second.z0());
+ BeamSpotObjects aBeamSpot;
+ aBeamSpot.SetType(it->second.second.type());
+ aBeamSpot.SetPosition(it->second.second.x0(), it->second.second.y0(), it->second.second.z0());
if (sigmaZValue_ == -1) {
- aBeamSpot->SetSigmaZ(it->second.second.sigmaZ());
+ aBeamSpot.SetSigmaZ(it->second.second.sigmaZ());
} else {
- aBeamSpot->SetSigmaZ(sigmaZValue_);
+ aBeamSpot.SetSigmaZ(sigmaZValue_);
}
- aBeamSpot->Setdxdz(it->second.second.dxdz());
- aBeamSpot->Setdydz(it->second.second.dydz());
- aBeamSpot->SetBeamWidthX(it->second.second.BeamWidthX());
- aBeamSpot->SetBeamWidthY(it->second.second.BeamWidthY());
- aBeamSpot->SetEmittanceX(it->second.second.emittanceX());
- aBeamSpot->SetEmittanceY(it->second.second.emittanceY());
- aBeamSpot->SetBetaStar(it->second.second.betaStar());
+ aBeamSpot.Setdxdz(it->second.second.dxdz());
+ aBeamSpot.Setdydz(it->second.second.dydz());
+ aBeamSpot.SetBeamWidthX(it->second.second.BeamWidthX());
+ aBeamSpot.SetBeamWidthY(it->second.second.BeamWidthY());
+ aBeamSpot.SetEmittanceX(it->second.second.emittanceX());
+ aBeamSpot.SetEmittanceY(it->second.second.emittanceY());
+ aBeamSpot.SetBetaStar(it->second.second.betaStar());
for (int i = 0; i < 7; ++i) {
for (int j = 0; j < 7; ++j) {
- aBeamSpot->SetCovariance(i, j, it->second.second.covariance(i, j));
+ aBeamSpot.SetCovariance(i, j, it->second.second.covariance(i, j));
}
}
if (sigmaZValue_ > 0) {
- aBeamSpot->SetCovariance(3, 3, 0.000025);
+ aBeamSpot.SetCovariance(3, 3, 0.000025);
}
cond::Time_t thisIOV = 1;
@@ -130,12 +130,7 @@ void AlcaBeamSpotHarvester::endRun(const edm::Run &iRun, const edm::EventSetup &
}
if (poolDbService->isNewTagRequest(outputrecordName_)) {
edm::LogInfo("AlcaBeamSpotHarvester") << "new tag requested" << std::endl;
- // poolDbService->createNewIOV(aBeamSpot,
- // poolDbService->beginOfTime(),poolDbService->endOfTime(),"BeamSpotObjectsRcd");
- // poolDbService->createNewIOV(aBeamSpot,
- // poolDbService->currentTime(),
- // poolDbService->endOfTime(),"BeamSpotObjectsRcd");
- poolDbService->writeOne(aBeamSpot, thisIOV, outputrecordName_);
+ poolDbService->writeOneIOV(aBeamSpot, thisIOV, outputrecordName_);
if (dumpTxt_ && beamSpotOutputBase_ == "lumibased") {
beamspot::dumpBeamSpotTxt(outFile, currentBS);
@@ -149,9 +144,7 @@ void AlcaBeamSpotHarvester::endRun(const edm::Run &iRun, const edm::EventSetup &
}
} else {
edm::LogInfo("AlcaBeamSpotHarvester") << "no new tag requested, appending IOV" << std::endl;
- // poolDbService->appendSinceTime(aBeamSpot,
- // poolDbService->currentTime(),"BeamSpotObjectsRcd");
- poolDbService->writeOne(aBeamSpot, thisIOV, outputrecordName_);
+ poolDbService->writeOneIOV(aBeamSpot, thisIOV, outputrecordName_);
if (dumpTxt_ && beamSpotOutputBase_ == "lumibased") {
beamspot::dumpBeamSpotTxt(outFile, currentBS);
}
diff --git a/CondFormats/Common/test/BeamSpotObjectsRcdByLumi_prep.json b/CondFormats/Common/data/BeamSpotObjectsRcdByLumi_prep.json
similarity index 100%
rename from CondFormats/Common/test/BeamSpotObjectsRcdByLumi_prep.json
rename to CondFormats/Common/data/BeamSpotObjectsRcdByLumi_prep.json
diff --git a/CondFormats/Common/test/BeamSpotObjectsRcdByLumi_prod.json b/CondFormats/Common/data/BeamSpotObjectsRcdByLumi_prod.json
similarity index 100%
rename from CondFormats/Common/test/BeamSpotObjectsRcdByLumi_prod.json
rename to CondFormats/Common/data/BeamSpotObjectsRcdByLumi_prod.json
diff --git a/CondFormats/Common/test/BeamSpotObjectsRcdByRun_prep.json b/CondFormats/Common/data/BeamSpotObjectsRcdByRun_prep.json
similarity index 100%
rename from CondFormats/Common/test/BeamSpotObjectsRcdByRun_prep.json
rename to CondFormats/Common/data/BeamSpotObjectsRcdByRun_prep.json
diff --git a/CondFormats/Common/test/BeamSpotObjectsRcdByRun_prod.json b/CondFormats/Common/data/BeamSpotObjectsRcdByRun_prod.json
similarity index 100%
rename from CondFormats/Common/test/BeamSpotObjectsRcdByRun_prod.json
rename to CondFormats/Common/data/BeamSpotObjectsRcdByRun_prod.json
diff --git a/CondFormats/Common/test/BeamSpotObjectsRcdHPbyLumi_prep.json b/CondFormats/Common/data/BeamSpotObjectsRcdHPbyLumi_prep.json
similarity index 100%
rename from CondFormats/Common/test/BeamSpotObjectsRcdHPbyLumi_prep.json
rename to CondFormats/Common/data/BeamSpotObjectsRcdHPbyLumi_prep.json
diff --git a/CondFormats/Common/test/BeamSpotObjectsRcdHPbyLumi_prod.json b/CondFormats/Common/data/BeamSpotObjectsRcdHPbyLumi_prod.json
similarity index 100%
rename from CondFormats/Common/test/BeamSpotObjectsRcdHPbyLumi_prod.json
rename to CondFormats/Common/data/BeamSpotObjectsRcdHPbyLumi_prod.json
diff --git a/CondFormats/Common/test/BeamSpotObjectsRcdHPbyRun_prep.json b/CondFormats/Common/data/BeamSpotObjectsRcdHPbyRun_prep.json
similarity index 100%
rename from CondFormats/Common/test/BeamSpotObjectsRcdHPbyRun_prep.json
rename to CondFormats/Common/data/BeamSpotObjectsRcdHPbyRun_prep.json
diff --git a/CondFormats/Common/test/BeamSpotObjectsRcdHPbyRun_prod.json b/CondFormats/Common/data/BeamSpotObjectsRcdHPbyRun_prod.json
similarity index 100%
rename from CondFormats/Common/test/BeamSpotObjectsRcdHPbyRun_prod.json
rename to CondFormats/Common/data/BeamSpotObjectsRcdHPbyRun_prod.json
diff --git a/CondFormats/Common/test/CTPPSRPAlignmentCorrectionsDataRcd_prep.json b/CondFormats/Common/data/CTPPSRPAlignmentCorrectionsDataRcd_prep.json
similarity index 100%
rename from CondFormats/Common/test/CTPPSRPAlignmentCorrectionsDataRcd_prep.json
rename to CondFormats/Common/data/CTPPSRPAlignmentCorrectionsDataRcd_prep.json
diff --git a/CondFormats/Common/test/CTPPSRPAlignmentCorrectionsDataRcd_prod.json b/CondFormats/Common/data/CTPPSRPAlignmentCorrectionsDataRcd_prod.json
similarity index 100%
rename from CondFormats/Common/test/CTPPSRPAlignmentCorrectionsDataRcd_prod.json
rename to CondFormats/Common/data/CTPPSRPAlignmentCorrectionsDataRcd_prod.json
diff --git a/CondFormats/Common/test/DropBoxMetadata_example.txt b/CondFormats/Common/data/DropBoxMetadata_example.txt
similarity index 100%
rename from CondFormats/Common/test/DropBoxMetadata_example.txt
rename to CondFormats/Common/data/DropBoxMetadata_example.txt
diff --git a/CondFormats/Common/test/EcalPedestal_prep.json b/CondFormats/Common/data/EcalPedestal_prep.json
similarity index 100%
rename from CondFormats/Common/test/EcalPedestal_prep.json
rename to CondFormats/Common/data/EcalPedestal_prep.json
diff --git a/CondFormats/Common/test/EcalPedestal_prod.json b/CondFormats/Common/data/EcalPedestal_prod.json
similarity index 100%
rename from CondFormats/Common/test/EcalPedestal_prod.json
rename to CondFormats/Common/data/EcalPedestal_prod.json
diff --git a/CondFormats/Common/test/LumiCorrections_prep.json b/CondFormats/Common/data/LumiCorrections_prep.json
similarity index 100%
rename from CondFormats/Common/test/LumiCorrections_prep.json
rename to CondFormats/Common/data/LumiCorrections_prep.json
diff --git a/CondFormats/Common/test/LumiCorrections_prod.json b/CondFormats/Common/data/LumiCorrections_prod.json
similarity index 100%
rename from CondFormats/Common/test/LumiCorrections_prod.json
rename to CondFormats/Common/data/LumiCorrections_prod.json
diff --git a/CondFormats/Common/test/PPSTimingCalibrationRcd_Sampic_prep.json b/CondFormats/Common/data/PPSTimingCalibrationRcd_Sampic_prep.json
similarity index 100%
rename from CondFormats/Common/test/PPSTimingCalibrationRcd_Sampic_prep.json
rename to CondFormats/Common/data/PPSTimingCalibrationRcd_Sampic_prep.json
diff --git a/CondFormats/Common/test/PPSTimingCalibrationRcd_Sampic_prod.json b/CondFormats/Common/data/PPSTimingCalibrationRcd_Sampic_prod.json
similarity index 100%
rename from CondFormats/Common/test/PPSTimingCalibrationRcd_Sampic_prod.json
rename to CondFormats/Common/data/PPSTimingCalibrationRcd_Sampic_prod.json
diff --git a/CondFormats/Common/test/PPSTimingCalibrationRcd_prep.json b/CondFormats/Common/data/PPSTimingCalibrationRcd_prep.json
similarity index 100%
rename from CondFormats/Common/test/PPSTimingCalibrationRcd_prep.json
rename to CondFormats/Common/data/PPSTimingCalibrationRcd_prep.json
diff --git a/CondFormats/Common/test/PPSTimingCalibrationRcd_prod.json b/CondFormats/Common/data/PPSTimingCalibrationRcd_prod.json
similarity index 100%
rename from CondFormats/Common/test/PPSTimingCalibrationRcd_prod.json
rename to CondFormats/Common/data/PPSTimingCalibrationRcd_prod.json
diff --git a/CondFormats/Common/test/SiPixelAliRcd_prep.json b/CondFormats/Common/data/SiPixelAliRcd_prep.json
similarity index 100%
rename from CondFormats/Common/test/SiPixelAliRcd_prep.json
rename to CondFormats/Common/data/SiPixelAliRcd_prep.json
diff --git a/CondFormats/Common/test/SiPixelAliRcd_prod.json b/CondFormats/Common/data/SiPixelAliRcd_prod.json
similarity index 100%
rename from CondFormats/Common/test/SiPixelAliRcd_prod.json
rename to CondFormats/Common/data/SiPixelAliRcd_prod.json
diff --git a/CondFormats/Common/test/SiPixelLorentzAngleRcd_multirun_prep.json b/CondFormats/Common/data/SiPixelLorentzAngleRcd_multirun_prep.json
similarity index 100%
rename from CondFormats/Common/test/SiPixelLorentzAngleRcd_multirun_prep.json
rename to CondFormats/Common/data/SiPixelLorentzAngleRcd_multirun_prep.json
diff --git a/CondFormats/Common/test/SiPixelLorentzAngleRcd_multirun_prod.json b/CondFormats/Common/data/SiPixelLorentzAngleRcd_multirun_prod.json
similarity index 100%
rename from CondFormats/Common/test/SiPixelLorentzAngleRcd_multirun_prod.json
rename to CondFormats/Common/data/SiPixelLorentzAngleRcd_multirun_prod.json
diff --git a/CondFormats/Common/test/SiPixelLorentzAngleRcd_prep.json b/CondFormats/Common/data/SiPixelLorentzAngleRcd_prep.json
similarity index 100%
rename from CondFormats/Common/test/SiPixelLorentzAngleRcd_prep.json
rename to CondFormats/Common/data/SiPixelLorentzAngleRcd_prep.json
diff --git a/CondFormats/Common/test/SiPixelLorentzAngleRcd_prod.json b/CondFormats/Common/data/SiPixelLorentzAngleRcd_prod.json
similarity index 100%
rename from CondFormats/Common/test/SiPixelLorentzAngleRcd_prod.json
rename to CondFormats/Common/data/SiPixelLorentzAngleRcd_prod.json
diff --git a/CondFormats/Common/test/SiPixelQualityFromDbRcd_other_prep.json b/CondFormats/Common/data/SiPixelQualityFromDbRcd_other_prep.json
similarity index 100%
rename from CondFormats/Common/test/SiPixelQualityFromDbRcd_other_prep.json
rename to CondFormats/Common/data/SiPixelQualityFromDbRcd_other_prep.json
diff --git a/CondFormats/Common/test/SiPixelQualityFromDbRcd_other_prod.json b/CondFormats/Common/data/SiPixelQualityFromDbRcd_other_prod.json
similarity index 100%
rename from CondFormats/Common/test/SiPixelQualityFromDbRcd_other_prod.json
rename to CondFormats/Common/data/SiPixelQualityFromDbRcd_other_prod.json
diff --git a/CondFormats/Common/test/SiPixelQualityFromDbRcd_prompt_prep.json b/CondFormats/Common/data/SiPixelQualityFromDbRcd_prompt_prep.json
similarity index 100%
rename from CondFormats/Common/test/SiPixelQualityFromDbRcd_prompt_prep.json
rename to CondFormats/Common/data/SiPixelQualityFromDbRcd_prompt_prep.json
diff --git a/CondFormats/Common/test/SiPixelQualityFromDbRcd_prompt_prod.json b/CondFormats/Common/data/SiPixelQualityFromDbRcd_prompt_prod.json
similarity index 100%
rename from CondFormats/Common/test/SiPixelQualityFromDbRcd_prompt_prod.json
rename to CondFormats/Common/data/SiPixelQualityFromDbRcd_prompt_prod.json
diff --git a/CondFormats/Common/test/SiPixelQualityFromDbRcd_stuckTBM_prep.json b/CondFormats/Common/data/SiPixelQualityFromDbRcd_stuckTBM_prep.json
similarity index 100%
rename from CondFormats/Common/test/SiPixelQualityFromDbRcd_stuckTBM_prep.json
rename to CondFormats/Common/data/SiPixelQualityFromDbRcd_stuckTBM_prep.json
diff --git a/CondFormats/Common/test/SiPixelQualityFromDbRcd_stuckTBM_prod.json b/CondFormats/Common/data/SiPixelQualityFromDbRcd_stuckTBM_prod.json
similarity index 100%
rename from CondFormats/Common/test/SiPixelQualityFromDbRcd_stuckTBM_prod.json
rename to CondFormats/Common/data/SiPixelQualityFromDbRcd_stuckTBM_prod.json
diff --git a/CondFormats/Common/test/SiStripApvGainRcdAAG_multirun_prep.json b/CondFormats/Common/data/SiStripApvGainRcdAAG_multirun_prep.json
similarity index 100%
rename from CondFormats/Common/test/SiStripApvGainRcdAAG_multirun_prep.json
rename to CondFormats/Common/data/SiStripApvGainRcdAAG_multirun_prep.json
diff --git a/CondFormats/Common/test/SiStripApvGainRcdAAG_multirun_prod.json b/CondFormats/Common/data/SiStripApvGainRcdAAG_multirun_prod.json
similarity index 100%
rename from CondFormats/Common/test/SiStripApvGainRcdAAG_multirun_prod.json
rename to CondFormats/Common/data/SiStripApvGainRcdAAG_multirun_prod.json
diff --git a/CondFormats/Common/test/SiStripApvGainRcdAAG_prep.json b/CondFormats/Common/data/SiStripApvGainRcdAAG_prep.json
similarity index 100%
rename from CondFormats/Common/test/SiStripApvGainRcdAAG_prep.json
rename to CondFormats/Common/data/SiStripApvGainRcdAAG_prep.json
diff --git a/CondFormats/Common/test/SiStripApvGainRcdAAG_prod.json b/CondFormats/Common/data/SiStripApvGainRcdAAG_prod.json
similarity index 100%
rename from CondFormats/Common/test/SiStripApvGainRcdAAG_prod.json
rename to CondFormats/Common/data/SiStripApvGainRcdAAG_prod.json
diff --git a/CondFormats/Common/test/SiStripApvGainRcdAfterAbortGap_prep.json b/CondFormats/Common/data/SiStripApvGainRcdAfterAbortGap_prep.json
similarity index 100%
rename from CondFormats/Common/test/SiStripApvGainRcdAfterAbortGap_prep.json
rename to CondFormats/Common/data/SiStripApvGainRcdAfterAbortGap_prep.json
diff --git a/CondFormats/Common/test/SiStripApvGainRcdAfterAbortGap_prod.json b/CondFormats/Common/data/SiStripApvGainRcdAfterAbortGap_prod.json
similarity index 100%
rename from CondFormats/Common/test/SiStripApvGainRcdAfterAbortGap_prod.json
rename to CondFormats/Common/data/SiStripApvGainRcdAfterAbortGap_prod.json
diff --git a/CondFormats/Common/test/SiStripApvGainRcd_multirun_prep.json b/CondFormats/Common/data/SiStripApvGainRcd_multirun_prep.json
similarity index 100%
rename from CondFormats/Common/test/SiStripApvGainRcd_multirun_prep.json
rename to CondFormats/Common/data/SiStripApvGainRcd_multirun_prep.json
diff --git a/CondFormats/Common/test/SiStripApvGainRcd_multirun_prod.json b/CondFormats/Common/data/SiStripApvGainRcd_multirun_prod.json
similarity index 100%
rename from CondFormats/Common/test/SiStripApvGainRcd_multirun_prod.json
rename to CondFormats/Common/data/SiStripApvGainRcd_multirun_prod.json
diff --git a/CondFormats/Common/test/SiStripApvGainRcd_prep.json b/CondFormats/Common/data/SiStripApvGainRcd_prep.json
similarity index 100%
rename from CondFormats/Common/test/SiStripApvGainRcd_prep.json
rename to CondFormats/Common/data/SiStripApvGainRcd_prep.json
diff --git a/CondFormats/Common/test/SiStripApvGainRcd_prod.json b/CondFormats/Common/data/SiStripApvGainRcd_prod.json
similarity index 100%
rename from CondFormats/Common/test/SiStripApvGainRcd_prod.json
rename to CondFormats/Common/data/SiStripApvGainRcd_prod.json
diff --git a/CondFormats/Common/test/SiStripBadStripRcd_prep.json b/CondFormats/Common/data/SiStripBadStripRcd_prep.json
similarity index 100%
rename from CondFormats/Common/test/SiStripBadStripRcd_prep.json
rename to CondFormats/Common/data/SiStripBadStripRcd_prep.json
diff --git a/CondFormats/Common/test/SiStripBadStripRcd_prod.json b/CondFormats/Common/data/SiStripBadStripRcd_prod.json
similarity index 100%
rename from CondFormats/Common/test/SiStripBadStripRcd_prod.json
rename to CondFormats/Common/data/SiStripBadStripRcd_prod.json
diff --git a/CondFormats/Common/plugins/BuildFile.xml b/CondFormats/Common/plugins/BuildFile.xml
new file mode 100644
index 0000000000000..8ae323b027886
--- /dev/null
+++ b/CondFormats/Common/plugins/BuildFile.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/CondFormats/Common/test/ProduceDropBoxMetadata.cc b/CondFormats/Common/plugins/ProduceDropBoxMetadata.cc
similarity index 52%
rename from CondFormats/Common/test/ProduceDropBoxMetadata.cc
rename to CondFormats/Common/plugins/ProduceDropBoxMetadata.cc
index e1d2744e2afeb..0b42cc343bb54 100644
--- a/CondFormats/Common/test/ProduceDropBoxMetadata.cc
+++ b/CondFormats/Common/plugins/ProduceDropBoxMetadata.cc
@@ -1,33 +1,58 @@
-/*
- * See header file for a description of this class.
+/** \class ProduceDropBoxMetadata
+ * Create an sqlite file containing the
+ * DropBoxMetadata needed for the PCL uploads
*
- * $Date: 2012/02/15 14:07:10 $
- * $Revision: 1.3 $
+ * $Date: 2011/02/22 11:05:16 $
+ * $Revision: 1.4 $
* \author G. Cerminara - CERN
+ * Modifications T. Vami - JHU
*/
-#include "ProduceDropBoxMetadata.h"
-
#include
#include
+#include
+
+#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
+#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "CondFormats/DataRecord/interface/DropBoxMetadataRcd.h"
#include "CondFormats/Common/interface/DropBoxMetadata.h"
-
#include "CondFormats/Common/src/headers.h"
-#include
+#include "FWCore/PluginManager/interface/ModuleDef.h"
+#include "FWCore/Framework/interface/MakerMacros.h"
+
+class ProduceDropBoxMetadata : public edm::one::EDAnalyzer<> {
+public:
+ /// Constructor
+ explicit ProduceDropBoxMetadata(const edm::ParameterSet&);
+
+ /// Destructor
+ ~ProduceDropBoxMetadata() override;
+
+private:
+ // Operations
+ void analyze(const edm::Event&, const edm::EventSetup&) override;
+
+ bool read;
+ bool write;
+
+ std::vector fToWrite;
+ std::vector fToRead;
+
+ const edm::ESGetToken dropBoxMetadataToken_;
+};
using namespace std;
using namespace edm;
-ProduceDropBoxMetadata::ProduceDropBoxMetadata(const edm::ParameterSet& pSet) {
+ProduceDropBoxMetadata::ProduceDropBoxMetadata(const edm::ParameterSet& pSet) : dropBoxMetadataToken_(esConsumes()) {
read = pSet.getUntrackedParameter("read");
write = pSet.getUntrackedParameter("write");
@@ -35,67 +60,56 @@ ProduceDropBoxMetadata::ProduceDropBoxMetadata(const edm::ParameterSet& pSet) {
fToRead = pSet.getUntrackedParameter >("toRead");
}
-ProduceDropBoxMetadata::~ProduceDropBoxMetadata() {}
+ProduceDropBoxMetadata::~ProduceDropBoxMetadata() = default;
-// void ProduceDropBoxMetadata::beginJob() {
-void ProduceDropBoxMetadata::beginRun(const edm::Run& run, const edm::EventSetup& eSetup) {
- cout << "[ProduceDropBoxMetadata] beginJob" << endl;
-
- string plRecord = "DropBoxMetadataRcd";
+void ProduceDropBoxMetadata::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
// ---------------------------------------------------------------------------------
// Write the payload
-
if (write) {
- cout << "\n\n[ProduceDropBoxMetadata] entering write, to loop over toWrite\n" << endl;
- DropBoxMetadata* metadata = new DropBoxMetadata;
+ DropBoxMetadata metadata;
+ edm::LogPrint("ProduceDropBoxMetadata") << "Entering write, to loop over toWrite";
// loop over all the pSets for the TF1 that we want to write to DB
for (vector::const_iterator fSetup = fToWrite.begin(); fSetup != fToWrite.end(); ++fSetup) {
string record = (*fSetup).getUntrackedParameter("record");
- cout << "\n--- record: " << record << endl;
+ edm::LogPrint("ProduceDropBoxMetadata") << "\n--- record: " << record;
DropBoxMetadata::Parameters params;
vector paramKeys = (*fSetup).getParameterNames();
for (vector::const_iterator key = paramKeys.begin(); key != paramKeys.end(); ++key) {
if (*key != "record") {
string value = (*fSetup).getUntrackedParameter(*key);
params.addParameter(*key, value);
- cout << " key: " << *key << " value: " << value << endl;
+ edm::LogPrint("ProduceDropBoxMetadata") << " key: " << *key << " value: " << value;
}
}
- metadata->addRecordParameters(record, params);
+ metadata.addRecordParameters(record, params);
}
// actually write to DB
edm::Service dbOut;
if (dbOut.isAvailable()) {
- dbOut->writeOne(metadata, 1, plRecord);
+ dbOut->writeOneIOV(metadata, 1, "DropBoxMetadataRcd");
}
}
if (read) {
// Read the objects
- cout << "\n\n[ProduceDropBoxMetadata] entering read, to loop over toRead\n" << endl;
- edm::ESHandle mdPayload;
- eSetup.get().get(mdPayload);
-
- const DropBoxMetadata* metadata = mdPayload.product();
+ edm::LogPrint("ProduceDropBoxMetadata") << "Entering read, to loop over toRead";
+ const auto& mdPayload = iSetup.getData(dropBoxMetadataToken_);
// loop
for (vector::const_iterator name = fToRead.begin(); name != fToRead.end(); ++name) {
- cout << "\n--- record: " << *name << endl;
- if (metadata->knowsRecord(*name)) {
- const map& params = metadata->getRecordParameters(*name).getParameterMap();
+ edm::LogPrint("ProduceDropBoxMetadata") << "\n--- record: " << *name;
+ if (mdPayload.knowsRecord(*name)) {
+ const map& params = mdPayload.getRecordParameters(*name).getParameterMap();
for (map::const_iterator par = params.begin(); par != params.end(); ++par) {
- cout << " key: " << par->first << " value: " << par->second << endl;
+ edm::LogPrint("ProduceDropBoxMetadata") << " key: " << par->first << " value: " << par->second;
}
} else {
- cout << " not in the payload!" << endl;
+ edm::LogPrint("ProduceDropBoxMetadata") << " not in the payload!";
}
}
}
}
-#include "FWCore/PluginManager/interface/ModuleDef.h"
-#include "FWCore/Framework/interface/MakerMacros.h"
-
DEFINE_FWK_MODULE(ProduceDropBoxMetadata);
diff --git a/CondFormats/Common/test/BuildFile.xml b/CondFormats/Common/test/BuildFile.xml
index 515a88c443e45..29524c55620a1 100644
--- a/CondFormats/Common/test/BuildFile.xml
+++ b/CondFormats/Common/test/BuildFile.xml
@@ -15,9 +15,13 @@
-
-
-
+
+
+
+
+
+
+
diff --git a/CondFormats/Common/test/DropBoxMetadataReader.py b/CondFormats/Common/test/DropBoxMetadataReader.py
new file mode 100644
index 0000000000000..b619ea989eb07
--- /dev/null
+++ b/CondFormats/Common/test/DropBoxMetadataReader.py
@@ -0,0 +1,67 @@
+# documentation: https://twiki.cern.ch/twiki/bin/view/CMS/AlCaDBPCL#Drop_box_metadata_management
+
+import FWCore.ParameterSet.Config as cms
+
+process = cms.Process("myprocess")
+
+process.load("CondCore.CondDB.CondDB_cfi")
+process.load("FWCore.MessageService.MessageLogger_cfi")
+
+process.CondDB.connect = 'sqlite_file:DropBoxMetadata.db'
+
+process.maxEvents = cms.untracked.PSet(
+ input = cms.untracked.int32(1)
+)
+process.source = cms.Source("EmptySource",
+ firstRun = cms.untracked.uint32(300000)
+ )
+
+
+# given a set of .json files in the current dir, ProduceDropBoxMetadata produces a sqlite containign the payload with the prod/and/prep metadata
+process.myReader = cms.EDAnalyzer("ProduceDropBoxMetadata",
+ # set to True if you want to write out a sqlite.db translating the json's into a payload
+ write = cms.untracked.bool(False),
+ toWrite = cms.VPSet(),
+
+ # this boolean will read the content of whichever payload is available and print its content to stoutput
+ # set this to false if you write out a sqlite.db translating the json's into a payload
+ read = cms.untracked.bool(True),
+ # toRead lists of record names to be sought inside the DropBoxMetadataRcd payload avaialble to the ProduceDropBoxMetadata;
+ # for instance, if write is True, you're reading back the metadata you've just entered in the payload from the .json files
+ toRead = cms.untracked.vstring(
+ 'BeamSpotObjectsRcdByRun',
+ 'BeamSpotObjectsRcdByLumi',
+ 'BeamSpotObjectsRcdHPByLumi',
+ 'BeamSpotObjectsRcdHPByRun',
+ 'SiStripBadStripRcd',
+ 'SiStripApvGainRcd',
+ 'TrackerAlignmentRcd',
+ 'SiStripApvGainRcdAfterAbortGap',
+ 'SiStripApvGainRcdAAG',
+ 'EcalPedestalsRcd',
+ "LumiCorrectionsRcd",
+ "SiPixelQualityFromDbRcd_prompt",
+ "SiPixelQualityFromDbRcd_stuckTBM",
+ "SiPixelQualityFromDbRcd_other",
+ "SiPixelLorentzAngleRcd",
+ "CTPPSRPAlignmentCorrectionsDataRcd",
+ "PPSTimingCalibrationRcd",
+ "PPSTimingCalibrationRcd_Sampic"
+ ) # same strings as fType
+ )
+
+process.p = cms.Path(process.myReader)
+
+process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
+process.GlobalTag.globaltag = '121X_dataRun3_Express_Queue'
+
+# Set to True if you want to read a DropBoxMetadata payload from a local sqlite
+# specify the name of the sqlitefile.db and the tag name; the payload loaded will be for run 300000
+readsqlite = True
+if readsqlite:
+ process.GlobalTag.toGet = cms.VPSet(
+ cms.PSet(record = cms.string("DropBoxMetadataRcd"),
+ tag = cms.string("DropBoxMetadata"),
+ connect = cms.string("sqlite_file:DropBoxMetadata.db")
+ )
+ )
diff --git a/CondFormats/Common/test/ProduceDropBoxMetadata.h b/CondFormats/Common/test/ProduceDropBoxMetadata.h
deleted file mode 100644
index d97cf71a162c7..0000000000000
--- a/CondFormats/Common/test/ProduceDropBoxMetadata.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef ProduceDropBoxMetadata_H
-#define ProduceDropBoxMetadata_H
-
-/** \class ProduceDropBoxMetadata
- * No description available.
- *
- * $Date: 2011/02/22 11:05:16 $
- * $Revision: 1.1 $
- * \author G. Cerminara - CERN
- */
-#include "FWCore/Framework/interface/EDAnalyzer.h"
-#include "FWCore/ParameterSet/interface/ParameterSet.h"
-
-#include
-#include
-
-class ProduceDropBoxMetadata : public edm::EDAnalyzer {
-public:
- /// Constructor
- ProduceDropBoxMetadata(const edm::ParameterSet&);
-
- /// Destructor
- virtual ~ProduceDropBoxMetadata();
-
- // Operations
- // virtual void beginJob();
- virtual void beginRun(const edm::Run& run, const edm::EventSetup& eSetup);
-
- virtual void analyze(const edm::Event&, const edm::EventSetup&) {}
- virtual void endJob() {}
-
-protected:
-private:
- bool read;
- bool write;
-
- std::vector fToWrite;
- std::vector fToRead;
-};
-#endif
diff --git a/CondFormats/Common/test/ProduceDropBoxMetadata.py b/CondFormats/Common/test/ProduceDropBoxMetadata.py
index 98e22e0705e06..e33956c14acff 100644
--- a/CondFormats/Common/test/ProduceDropBoxMetadata.py
+++ b/CondFormats/Common/test/ProduceDropBoxMetadata.py
@@ -5,6 +5,7 @@
process = cms.Process("myprocess")
process.load("CondCore.CondDB.CondDB_cfi")
+process.load("FWCore.MessageService.MessageLogger_cfi")
process.CondDB.connect = 'sqlite_file:DropBoxMetadata.db'
@@ -20,7 +21,7 @@
def encodeJsonInString(filename):
"""This function open the json file and encodes it in a string replacing probelamtic characters"""
- thefile = open(filename)
+ thefile = open("../data/"+filename)
thejson = json.load(thefile)
thefile.close()
return json.JSONEncoder().encode(thejson).replace('"',""")
@@ -98,7 +99,8 @@ def encodeJsonInString(filename):
# set to True if you want to write out a sqlite.db translating the json's into a payload
write = cms.untracked.bool(True),
- # toWrite holds a list of Pset's, one for each workflow you want to produce DropBoxMetadata for; you need to have 2 .json files for each PSet
+ # toWrite holds a list of Pset's, one for each workflow you want to produce DropBoxMetadata for;
+ # you need to have 2 .json files for each PSet
toWrite = cms.VPSet(cms.PSet(record = cms.untracked.string("BeamSpotObjectsRcdByRun"),
Source = cms.untracked.string("AlcaHarvesting"),
FileClass = cms.untracked.string("ALCA"),
@@ -217,9 +219,7 @@ def encodeJsonInString(filename):
# this boolean will read the content of whichever payload is available and print its content to stoutput
# set this to false if you write out a sqlite.db translating the json's into a payload
read = cms.untracked.bool(False),
-
- # toRead lists of record names to be sought inside the DropBoxMetadataRcd payload avaialble to the ProduceDropBoxMetadata; for instance, if write is True, you're reading back the metadata you've just entered in the payload from the .json files
- toRead = cms.untracked.vstring('BeamSpotObjectsRcdByRun','BeamSpotObjectsRcdByLumi','BeamSpotObjectsRcdHPByLumi','BeamSpotObjectsRcdHPByRun','SiStripBadStripRcd','SiStripApvGainRcd','TrackerAlignmentRcd','SiStripApvGainRcdAfterAbortGap','SiStripApvGainRcdAAG','EcalPedestalsRcd',"LumiCorrectionsRcd","SiPixelQualityFromDbRcd_prompt","SiPixelQualityFromDbRcd_stuckTBM","SiPixelQualityFromDbRcd_other","SiPixelLorentzAngleRcd","CTPPSRPAlignmentCorrectionsDataRcd","PPSTimingCalibrationRcd","PPSTimingCalibrationRcd_Sampic") # same strings as fType
+ toRead = cms.untracked.vstring()
)
process.p = cms.Path(process.mywriter)
@@ -244,13 +244,3 @@ def encodeJsonInString(filename):
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
process.GlobalTag.globaltag = '121X_dataRun3_Express_Queue'
-# Set to True if you want to read a DropBoxMetadata payload from a local sqlite
-# specify the name of the sqlitefile.db and the tag name; the payload loaded will be for run 300000
-readsqlite = False
-if readsqlite:
- process.GlobalTag.toGet = cms.VPSet(
- cms.PSet(record = cms.string("DropBoxMetadataRcd"),
- tag = cms.string("DropBoxMetadata"),
- connect = cms.string("sqlite_file:DropBoxMetadata_addHPbyRun.db")
- )
- )
diff --git a/CondFormats/Common/test/createTestDBObjects.sh b/CondFormats/Common/test/createTestDBObjects.sh
new file mode 100755
index 0000000000000..55945c9e8034d
--- /dev/null
+++ b/CondFormats/Common/test/createTestDBObjects.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+function die { echo $1: status $2 ; exit $2; }
+
+echo -e "TESTING Dropbox Metadata DB codes ...\n\n"
+cd ${LOCAL_TEST_DIR}/
+cmsRun ProduceDropBoxMetadata.py || die "Failure running ProduceDropBoxMetadata.py" $?
+
+echo -e "TESTING Dropbox Metadata DB Reader code ...\n Reading local sqlite DropBoxMetadata.db \n\n "
+cmsRun DropBoxMetadataReader.py || die "Failure running DropBoxMetadataReader.py" $?
+
diff --git a/CondFormats/Common/test/testDropboxMetadataDB.cpp b/CondFormats/Common/test/testDropboxMetadataDB.cpp
new file mode 100644
index 0000000000000..2f0e0c40064da
--- /dev/null
+++ b/CondFormats/Common/test/testDropboxMetadataDB.cpp
@@ -0,0 +1,2 @@
+#include "FWCore/Utilities/interface/TestHelper.h"
+RUNTEST()
diff --git a/CondFormats/DTObjects/test/stubs/DTConfigPrint.cc b/CondFormats/DTObjects/test/stubs/DTConfigPrint.cc
index 09787b45ea574..7dbb7933a6c42 100644
--- a/CondFormats/DTObjects/test/stubs/DTConfigPrint.cc
+++ b/CondFormats/DTObjects/test/stubs/DTConfigPrint.cc
@@ -12,8 +12,6 @@ Toy EDAnalyzer for testing purposes only.
#include "FWCore/Framework/interface/MakerMacros.h"
#include "CondFormats/DTObjects/test/stubs/DTConfigPrint.h"
-#include "CondFormats/DTObjects/interface/DTCCBConfig.h"
-#include "CondFormats/DataRecord/interface/DTCCBConfigRcd.h"
namespace edmtest {
@@ -27,6 +25,7 @@ namespace edmtest {
catalog = "";
else
catalog = p.getParameter("catalog");
+ es_token = esConsumes();
}
DTConfigPrint::DTConfigPrint(int i) {}
@@ -40,13 +39,12 @@ namespace edmtest {
std::cout << " ---EVENT NUMBER " << e.id().event() << std::endl;
// get configuration for current run
- edm::ESHandle conf;
- context.get().get(conf);
- std::cout << conf->version() << std::endl;
- std::cout << std::distance(conf->begin(), conf->end()) << " data in the container" << std::endl;
+ const auto& conf = context.getData(es_token);
+ std::cout << conf.version() << std::endl;
+ std::cout << std::distance(conf.begin(), conf.end()) << " data in the container" << std::endl;
// loop over chambers
- DTCCBConfig::ccb_config_map configKeys(conf->configKeyMap());
+ DTCCBConfig::ccb_config_map configKeys(conf.configKeyMap());
DTCCBConfig::ccb_config_iterator iter = configKeys.begin();
DTCCBConfig::ccb_config_iterator iend = configKeys.end();
while (iter != iend) {
diff --git a/CondFormats/DTObjects/test/stubs/DTConfigPrint.h b/CondFormats/DTObjects/test/stubs/DTConfigPrint.h
index 4b83b5df199f7..bbd9d83b7ae45 100644
--- a/CondFormats/DTObjects/test/stubs/DTConfigPrint.h
+++ b/CondFormats/DTObjects/test/stubs/DTConfigPrint.h
@@ -11,6 +11,9 @@ Toy EDAnalyzer for testing purposes only.
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
+#include "CondFormats/DTObjects/interface/DTCCBConfig.h"
+#include "CondFormats/DataRecord/interface/DTCCBConfigRcd.h"
+
//#include "CondFormats/DTObjects/interface/DTConfigList.h"
//#include "CondTools/DT/interface/DTConfigHandler.h"
//#include "CondTools/DT/interface/DTDBSession.h"
@@ -31,6 +34,7 @@ namespace edmtest {
std::string catalog;
std::string token;
bool local;
+ edm::ESGetToken es_token;
// DTDBSession* session;
// const DTConfigList* rs;
// DTConfigHandler* ri;
diff --git a/CondFormats/DTObjects/test/stubs/DTDeadPrint.cc b/CondFormats/DTObjects/test/stubs/DTDeadPrint.cc
index 19a480c7c710d..75dde732e8a6d 100644
--- a/CondFormats/DTObjects/test/stubs/DTDeadPrint.cc
+++ b/CondFormats/DTObjects/test/stubs/DTDeadPrint.cc
@@ -13,12 +13,10 @@ Toy EDAnalyzer for testing purposes only.
#include "FWCore/Framework/interface/MakerMacros.h"
#include "CondFormats/DTObjects/test/stubs/DTDeadPrint.h"
-#include "CondFormats/DTObjects/interface/DTDeadFlag.h"
-#include "CondFormats/DataRecord/interface/DTDeadFlagRcd.h"
namespace edmtest {
- DTDeadPrint::DTDeadPrint(edm::ParameterSet const& p) {}
+ DTDeadPrint::DTDeadPrint(edm::ParameterSet const& p) : es_token(esConsumes()) {}
DTDeadPrint::DTDeadPrint(int i) {}
@@ -29,12 +27,11 @@ namespace edmtest {
// Context is not used.
std::cout << " I AM IN RUN NUMBER " << e.id().run() << std::endl;
std::cout << " ---EVENT NUMBER " << e.id().event() << std::endl;
- edm::ESHandle dList;
- context.get().get(dList);
- std::cout << dList->version() << std::endl;
- std::cout << std::distance(dList->begin(), dList->end()) << " data in the container" << std::endl;
- DTDeadFlag::const_iterator iter = dList->begin();
- DTDeadFlag::const_iterator iend = dList->end();
+ const auto& dList = context.getData(es_token);
+ std::cout << dList.version() << std::endl;
+ std::cout << std::distance(dList.begin(), dList.end()) << " data in the container" << std::endl;
+ DTDeadFlag::const_iterator iter = dList.begin();
+ DTDeadFlag::const_iterator iend = dList.end();
while (iter != iend) {
const std::pair& data = *iter++;
const DTDeadFlagId& id = data.first;
diff --git a/CondFormats/DTObjects/test/stubs/DTDeadPrint.h b/CondFormats/DTObjects/test/stubs/DTDeadPrint.h
index ae68ae42d980e..e12fd4df5b379 100644
--- a/CondFormats/DTObjects/test/stubs/DTDeadPrint.h
+++ b/CondFormats/DTObjects/test/stubs/DTDeadPrint.h
@@ -11,6 +11,9 @@ Toy EDAnalyzer for testing purposes only.
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
+#include "CondFormats/DTObjects/interface/DTDeadFlag.h"
+#include "CondFormats/DataRecord/interface/DTDeadFlagRcd.h"
+
namespace edmtest {
class DTDeadPrint : public edm::EDAnalyzer {
public:
@@ -20,5 +23,6 @@ namespace edmtest {
virtual void analyze(const edm::Event& e, const edm::EventSetup& c);
private:
+ edm::ESGetToken es_token;
};
} // namespace edmtest
diff --git a/CondFormats/DTObjects/test/stubs/DTDeadUpdate.cc b/CondFormats/DTObjects/test/stubs/DTDeadUpdate.cc
index 53f3b97ec314b..576e35d3e6a0d 100644
--- a/CondFormats/DTObjects/test/stubs/DTDeadUpdate.cc
+++ b/CondFormats/DTObjects/test/stubs/DTDeadUpdate.cc
@@ -17,12 +17,10 @@ Toy EDAnalyzer for testing purposes only.
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "CondFormats/DTObjects/test/stubs/DTDeadUpdate.h"
-#include "CondFormats/DTObjects/interface/DTDeadFlag.h"
-#include "CondFormats/DataRecord/interface/DTDeadFlagRcd.h"
namespace edmtest {
- DTDeadUpdate::DTDeadUpdate(edm::ParameterSet const& p) : dSum(0) {}
+ DTDeadUpdate::DTDeadUpdate(edm::ParameterSet const& p) : dSum(0), es_token(esConsumes()) {}
DTDeadUpdate::DTDeadUpdate(int i) : dSum(0) {}
@@ -35,12 +33,11 @@ namespace edmtest {
// Context is not used.
std::cout << " I AM IN RUN NUMBER " << e.id().run() << std::endl;
std::cout << " ---EVENT NUMBER " << e.id().event() << std::endl;
- edm::ESHandle dList;
- context.get().get(dList);
- std::cout << dList->version() << std::endl;
- std::cout << std::distance(dList->begin(), dList->end()) << " data in the container" << std::endl;
- DTDeadFlag::const_iterator iter = dList->begin();
- DTDeadFlag::const_iterator iend = dList->end();
+ const auto& dList = context.getData(es_token);
+ std::cout << dList.version() << std::endl;
+ std::cout << std::distance(dList.begin(), dList.end()) << " data in the container" << std::endl;
+ DTDeadFlag::const_iterator iter = dList.begin();
+ DTDeadFlag::const_iterator iend = dList.end();
while (iter != iend) {
const std::pair& data = *iter++;
const DTDeadFlagId& id = data.first;
diff --git a/CondFormats/DTObjects/test/stubs/DTDeadUpdate.h b/CondFormats/DTObjects/test/stubs/DTDeadUpdate.h
index d26665941f0ef..34dd43dd5ea35 100644
--- a/CondFormats/DTObjects/test/stubs/DTDeadUpdate.h
+++ b/CondFormats/DTObjects/test/stubs/DTDeadUpdate.h
@@ -11,7 +11,8 @@ Toy EDAnalyzer for testing purposes only.
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
-class DTDeadFlag;
+#include "CondFormats/DTObjects/interface/DTDeadFlag.h"
+#include "CondFormats/DataRecord/interface/DTDeadFlagRcd.h"
namespace edmtest {
class DTDeadUpdate : public edm::EDAnalyzer {
@@ -28,5 +29,6 @@ namespace edmtest {
void fill_dead_RO(const char* file, DTDeadFlag* deadList);
void fill_discCat(const char* file, DTDeadFlag* deadList);
DTDeadFlag* dSum;
+ edm::ESGetToken es_token;
};
} // namespace edmtest
diff --git a/CondFormats/DTObjects/test/stubs/DTFullMapPrint.cc b/CondFormats/DTObjects/test/stubs/DTFullMapPrint.cc
index 0f171d122b0d3..ef710430d1d20 100644
--- a/CondFormats/DTObjects/test/stubs/DTFullMapPrint.cc
+++ b/CondFormats/DTObjects/test/stubs/DTFullMapPrint.cc
@@ -14,12 +14,10 @@ It gets a compact map from the EventSetup and dumps it as a full map.
#include "FWCore/Framework/interface/MakerMacros.h"
#include "CondFormats/DTObjects/test/stubs/DTFullMapPrint.h"
-#include "CondFormats/DTObjects/interface/DTReadOutMapping.h"
-#include "CondFormats/DataRecord/interface/DTReadOutMappingRcd.h"
namespace edmtest {
- DTFullMapPrint::DTFullMapPrint(edm::ParameterSet const& p) {}
+ DTFullMapPrint::DTFullMapPrint(edm::ParameterSet const& p) : es_token(esConsumes()) {}
DTFullMapPrint::DTFullMapPrint(int i) {}
@@ -30,9 +28,8 @@ namespace edmtest {
// Context is not used.
std::cout << " I AM IN RUN NUMBER " << e.id().run() << std::endl;
std::cout << " ---EVENT NUMBER " << e.id().event() << std::endl;
- edm::ESHandle dbMap;
- context.get().get(dbMap);
- const DTReadOutMapping* ro_map = dbMap->fullMap();
+ const auto& dbMap = context.getData(es_token);
+ const DTReadOutMapping* ro_map = dbMap.fullMap();
std::cout << ro_map->mapCellTdc() << " - " << ro_map->mapRobRos() << std::endl;
std::cout << std::distance(ro_map->begin(), ro_map->end()) << " connections in the map" << std::endl;
DTReadOutMapping::const_iterator iter = ro_map->begin();
diff --git a/CondFormats/DTObjects/test/stubs/DTFullMapPrint.h b/CondFormats/DTObjects/test/stubs/DTFullMapPrint.h
index 014c43400af13..1b2b77927440f 100644
--- a/CondFormats/DTObjects/test/stubs/DTFullMapPrint.h
+++ b/CondFormats/DTObjects/test/stubs/DTFullMapPrint.h
@@ -11,6 +11,9 @@ Toy EDAnalyzer for testing purposes only.
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
+#include "CondFormats/DTObjects/interface/DTReadOutMapping.h"
+#include "CondFormats/DataRecord/interface/DTReadOutMappingRcd.h"
+
namespace edmtest {
class DTFullMapPrint : public edm::EDAnalyzer {
public:
@@ -20,5 +23,6 @@ namespace edmtest {
virtual void analyze(const edm::Event& e, const edm::EventSetup& c);
private:
+ edm::ESGetToken es_token;
};
} // namespace edmtest
diff --git a/CondFormats/DTObjects/test/stubs/DTMapPrint.cc b/CondFormats/DTObjects/test/stubs/DTMapPrint.cc
index 1c5c47f10b247..6dbe147ca6ba0 100644
--- a/CondFormats/DTObjects/test/stubs/DTMapPrint.cc
+++ b/CondFormats/DTObjects/test/stubs/DTMapPrint.cc
@@ -13,12 +13,10 @@ Toy EDAnalyzer for testing purposes only.
#include "FWCore/Framework/interface/MakerMacros.h"
#include "CondFormats/DTObjects/test/stubs/DTMapPrint.h"
-#include "CondFormats/DTObjects/interface/DTReadOutMapping.h"
-#include "CondFormats/DataRecord/interface/DTReadOutMappingRcd.h"
namespace edmtest {
- DTMapPrint::DTMapPrint(edm::ParameterSet const& p) {}
+ DTMapPrint::DTMapPrint(edm::ParameterSet const& p) : es_token(esConsumes()) {}
DTMapPrint::DTMapPrint(int i) {}
@@ -29,12 +27,11 @@ namespace edmtest {
// Context is not used.
std::cout << " I AM IN RUN NUMBER " << e.id().run() << std::endl;
std::cout << " ---EVENT NUMBER " << e.id().event() << std::endl;
- edm::ESHandle ro_map;
- context.get().get(ro_map);
- std::cout << ro_map->mapCellTdc() << " - " << ro_map->mapRobRos() << std::endl;
- std::cout << std::distance(ro_map->begin(), ro_map->end()) << " connections in the map" << std::endl;
- DTReadOutMapping::const_iterator iter = ro_map->begin();
- DTReadOutMapping::const_iterator iend = ro_map->end();
+ const auto& ro_map = context.getData(es_token);
+ std::cout << ro_map.mapCellTdc() << " - " << ro_map.mapRobRos() << std::endl;
+ std::cout << std::distance(ro_map.begin(), ro_map.end()) << " connections in the map" << std::endl;
+ DTReadOutMapping::const_iterator iter = ro_map.begin();
+ DTReadOutMapping::const_iterator iend = ro_map.end();
while (iter != iend) {
const DTReadOutGeometryLink& link = *iter++;
std::cout << link.dduId << " " << link.rosId << " " << link.robId << " " << link.tdcId << " " << link.channelId
diff --git a/CondFormats/DTObjects/test/stubs/DTMapPrint.h b/CondFormats/DTObjects/test/stubs/DTMapPrint.h
index 992c4ff2363ef..23429a7900f47 100644
--- a/CondFormats/DTObjects/test/stubs/DTMapPrint.h
+++ b/CondFormats/DTObjects/test/stubs/DTMapPrint.h
@@ -11,6 +11,9 @@ Toy EDAnalyzer for testing purposes only.
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
+#include "CondFormats/DTObjects/interface/DTReadOutMapping.h"
+#include "CondFormats/DataRecord/interface/DTReadOutMappingRcd.h"
+
namespace edmtest {
class DTMapPrint : public edm::EDAnalyzer {
public:
@@ -20,5 +23,6 @@ namespace edmtest {
virtual void analyze(const edm::Event& e, const edm::EventSetup& c);
private:
+ edm::ESGetToken es_token;
};
} // namespace edmtest
diff --git a/CondFormats/DTObjects/test/stubs/DTRangeT0Print.cc b/CondFormats/DTObjects/test/stubs/DTRangeT0Print.cc
index d10f845d59618..ca7ef0b3abf45 100644
--- a/CondFormats/DTObjects/test/stubs/DTRangeT0Print.cc
+++ b/CondFormats/DTObjects/test/stubs/DTRangeT0Print.cc
@@ -13,12 +13,10 @@ Toy EDAnalyzer for testing purposes only.
#include "FWCore/Framework/interface/MakerMacros.h"
#include "CondFormats/DTObjects/test/stubs/DTRangeT0Print.h"
-#include "CondFormats/DTObjects/interface/DTRangeT0.h"
-#include "CondFormats/DataRecord/interface/DTRangeT0Rcd.h"
namespace edmtest {
- DTRangeT0Print::DTRangeT0Print(edm::ParameterSet const& p) {}
+ DTRangeT0Print::DTRangeT0Print(edm::ParameterSet const& p) : es_token(esConsumes()) {}
DTRangeT0Print::DTRangeT0Print(int i) {}
@@ -29,10 +27,9 @@ namespace edmtest {
// Context is not used.
std::cout << " I AM IN RUN NUMBER " << e.id().run() << std::endl;
std::cout << " ---EVENT NUMBER " << e.id().event() << std::endl;
- edm::ESHandle t0;
- context.get().get(t0);
- std::cout << t0->version() << std::endl;
- std::cout << std::distance(t0->begin(), t0->end()) << " data in the container" << std::endl;
+ const auto& t0 = context.getData(es_token);
+ std::cout << t0.version() << std::endl;
+ std::cout << std::distance(t0.begin(), t0.end()) << " data in the container" << std::endl;
}
DEFINE_FWK_MODULE(DTRangeT0Print);
} // namespace edmtest
diff --git a/CondFormats/DTObjects/test/stubs/DTRangeT0Print.h b/CondFormats/DTObjects/test/stubs/DTRangeT0Print.h
index cb906e0120fff..a157c2b4dea5c 100644
--- a/CondFormats/DTObjects/test/stubs/DTRangeT0Print.h
+++ b/CondFormats/DTObjects/test/stubs/DTRangeT0Print.h
@@ -11,6 +11,9 @@ Toy EDAnalyzer for testing purposes only.
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
+#include "CondFormats/DTObjects/interface/DTRangeT0.h"
+#include "CondFormats/DataRecord/interface/DTRangeT0Rcd.h"
+
namespace edmtest {
class DTRangeT0Print : public edm::EDAnalyzer {
public:
@@ -20,5 +23,6 @@ namespace edmtest {
virtual void analyze(const edm::Event& e, const edm::EventSetup& c);
private:
+ edm::ESGetToken es_token;
};
} // namespace edmtest
diff --git a/CondFormats/DTObjects/test/stubs/DTT0Print.cc b/CondFormats/DTObjects/test/stubs/DTT0Print.cc
index 585ad57a023cc..3cc4dd2cee7ef 100644
--- a/CondFormats/DTObjects/test/stubs/DTT0Print.cc
+++ b/CondFormats/DTObjects/test/stubs/DTT0Print.cc
@@ -13,12 +13,10 @@ Toy EDAnalyzer for testing purposes only.
#include "FWCore/Framework/interface/MakerMacros.h"
#include "CondFormats/DTObjects/test/stubs/DTT0Print.h"
-#include "CondFormats/DTObjects/interface/DTT0.h"
-#include "CondFormats/DataRecord/interface/DTT0Rcd.h"
namespace edmtest {
- DTT0Print::DTT0Print(edm::ParameterSet const& p) {}
+ DTT0Print::DTT0Print(edm::ParameterSet const& p) : es_token(esConsumes()) {}
DTT0Print::DTT0Print(int i) {}
@@ -29,14 +27,13 @@ namespace edmtest {
// Context is not used.
std::cout << " I AM IN RUN NUMBER " << e.id().run() << std::endl;
std::cout << " ---EVENT NUMBER " << e.id().event() << std::endl;
- edm::ESHandle t0;
- context.get().get(t0);
- std::cout << t0->version() << std::endl;
- std::cout << std::distance(t0->begin(), t0->end()) << " data in the container" << std::endl;
+ const auto& t0 = context.getData(es_token);
+ std::cout << t0.version() << std::endl;
+ std::cout << std::distance(t0.begin(), t0.end()) << " data in the container" << std::endl;
float t0mean;
float t0rms;
- DTT0::const_iterator iter = t0->begin();
- DTT0::const_iterator iend = t0->end();
+ DTT0::const_iterator iter = t0.begin();
+ DTT0::const_iterator iend = t0.end();
while (iter != iend) {
const DTT0Data& t0Data = *iter++;
int channelId = t0Data.channelId;
@@ -48,7 +45,7 @@ namespace edmtest {
DTChamberId cc(id.chamberId());
std::cout << channelId << " " << id.rawId() << " " << cp->rawId() << " " << ch.rawId() << " " << cc.rawId()
<< std::endl;
- t0->get(id, t0mean, t0rms, DTTimeUnits::counts);
+ t0.get(id, t0mean, t0rms, DTTimeUnits::counts);
std::cout << id.wheel() << " " << id.station() << " " << id.sector() << " " << id.superlayer() << " "
<< id.layer() << " " << id.wire() << " -> " << t0Data.t0mean << " " << t0Data.t0rms << " -> " << t0mean
<< " " << t0rms << std::endl;
diff --git a/CondFormats/DTObjects/test/stubs/DTT0Print.h b/CondFormats/DTObjects/test/stubs/DTT0Print.h
index 05e3baf666f78..0b57eae258819 100644
--- a/CondFormats/DTObjects/test/stubs/DTT0Print.h
+++ b/CondFormats/DTObjects/test/stubs/DTT0Print.h
@@ -11,6 +11,9 @@ Toy EDAnalyzer for testing purposes only.
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
+#include "CondFormats/DTObjects/interface/DTT0.h"
+#include "CondFormats/DataRecord/interface/DTT0Rcd.h"
+
namespace edmtest {
class DTT0Print : public edm::EDAnalyzer {
public:
@@ -20,5 +23,6 @@ namespace edmtest {
virtual void analyze(const edm::Event& e, const edm::EventSetup& c);
private:
+ edm::ESGetToken es_token;
};
} // namespace edmtest
diff --git a/CondFormats/DTObjects/test/stubs/DTTtrigPrint.cc b/CondFormats/DTObjects/test/stubs/DTTtrigPrint.cc
index e7851e62f40b2..797d6ba0e435f 100644
--- a/CondFormats/DTObjects/test/stubs/DTTtrigPrint.cc
+++ b/CondFormats/DTObjects/test/stubs/DTTtrigPrint.cc
@@ -13,12 +13,10 @@ Toy EDAnalyzer for testing purposes only.
#include "FWCore/Framework/interface/MakerMacros.h"
#include "CondFormats/DTObjects/test/stubs/DTTtrigPrint.h"
-#include "CondFormats/DTObjects/interface/DTTtrig.h"
-#include "CondFormats/DataRecord/interface/DTTtrigRcd.h"
namespace edmtest {
- DTTtrigPrint::DTTtrigPrint(edm::ParameterSet const& p) {}
+ DTTtrigPrint::DTTtrigPrint(edm::ParameterSet const& p) : es_token(esConsumes()) {}
DTTtrigPrint::DTTtrigPrint(int i) {}
@@ -29,12 +27,11 @@ namespace edmtest {
// Context is not used.
std::cout << " I AM IN RUN NUMBER " << e.id().run() << std::endl;
std::cout << " ---EVENT NUMBER " << e.id().event() << std::endl;
- edm::ESHandle tTrig;
- context.get().get(tTrig);
- std::cout << tTrig->version() << std::endl;
- std::cout << std::distance(tTrig->begin(), tTrig->end()) << " data in the container" << std::endl;
- DTTtrig::const_iterator iter = tTrig->begin();
- DTTtrig::const_iterator iend = tTrig->end();
+ const auto& tTrig = context.getData(es_token);
+ std::cout << tTrig.version() << std::endl;
+ std::cout << std::distance(tTrig.begin(), tTrig.end()) << " data in the container" << std::endl;
+ DTTtrig::const_iterator iter = tTrig.begin();
+ DTTtrig::const_iterator iend = tTrig.end();
while (iter != iend) {
const DTTtrigId& trigId = iter->first;
const DTTtrigData& trigData = iter->second;
@@ -42,24 +39,24 @@ namespace edmtest {
float trigTrms;
float trigKfac;
float trigComp;
- tTrig->get(trigId.wheelId,
- trigId.stationId,
- trigId.sectorId,
- trigId.slId,
- trigId.layerId,
- trigId.cellId,
- trigTime,
- trigTrms,
- trigKfac,
- DTTimeUnits::counts);
- tTrig->get(trigId.wheelId,
- trigId.stationId,
- trigId.sectorId,
- trigId.slId,
- trigId.layerId,
- trigId.cellId,
- trigComp,
- DTTimeUnits::counts);
+ tTrig.get(trigId.wheelId,
+ trigId.stationId,
+ trigId.sectorId,
+ trigId.slId,
+ trigId.layerId,
+ trigId.cellId,
+ trigTime,
+ trigTrms,
+ trigKfac,
+ DTTimeUnits::counts);
+ tTrig.get(trigId.wheelId,
+ trigId.stationId,
+ trigId.sectorId,
+ trigId.slId,
+ trigId.layerId,
+ trigId.cellId,
+ trigComp,
+ DTTimeUnits::counts);
std::cout << trigId.wheelId << " " << trigId.stationId << " " << trigId.sectorId << " " << trigId.slId << " "
<< trigId.layerId << " " << trigId.cellId << " -> " << trigData.tTrig << " " << trigData.tTrms << " "
<< trigData.kFact << " -> " << trigTime << " " << trigTrms << " " << trigKfac << " -> " << trigComp
diff --git a/CondFormats/DTObjects/test/stubs/DTTtrigPrint.h b/CondFormats/DTObjects/test/stubs/DTTtrigPrint.h
index 55706d9629177..4cd38dd570e62 100644
--- a/CondFormats/DTObjects/test/stubs/DTTtrigPrint.h
+++ b/CondFormats/DTObjects/test/stubs/DTTtrigPrint.h
@@ -11,6 +11,9 @@ Toy EDAnalyzer for testing purposes only.
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
+#include "CondFormats/DTObjects/interface/DTTtrig.h"
+#include "CondFormats/DataRecord/interface/DTTtrigRcd.h"
+
namespace edmtest {
class DTTtrigPrint : public edm::EDAnalyzer {
public:
@@ -20,5 +23,6 @@ namespace edmtest {
virtual void analyze(const edm::Event& e, const edm::EventSetup& c);
private:
+ edm::ESGetToken es_token;
};
} // namespace edmtest
diff --git a/CondFormats/EcalObjects/test/stubs/EcalTimeBiasCorrectionsFillInitial.cc b/CondFormats/EcalObjects/test/stubs/EcalTimeBiasCorrectionsFillInitial.cc
index a7d9a8d1d59b5..83ea7f800e87d 100644
--- a/CondFormats/EcalObjects/test/stubs/EcalTimeBiasCorrectionsFillInitial.cc
+++ b/CondFormats/EcalObjects/test/stubs/EcalTimeBiasCorrectionsFillInitial.cc
@@ -12,7 +12,7 @@
#include "FWCore/Framework/interface/ModuleFactory.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
-#include "FWCore/Framework/interface/EDAnalyzer.h"
+#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/ESProducts.h"
#include "CondFormats/EcalObjects/interface/EcalTimeBiasCorrections.h"
@@ -27,7 +27,7 @@
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
-class EcalTimeBiasCorrectionsFillInitial : public edm::EDAnalyzer {
+class EcalTimeBiasCorrectionsFillInitial : public edm::one::EDAnalyzer<> {
public:
explicit EcalTimeBiasCorrectionsFillInitial(const edm::ParameterSet &);
~EcalTimeBiasCorrectionsFillInitial();
@@ -41,7 +41,7 @@ class EcalTimeBiasCorrectionsFillInitial : public edm::EDAnalyzer {
std::vector EEtimeCorrAmplitudeBins_;
std::vector EEtimeCorrShiftBins_;
- EcalTimeBiasCorrections *bias_;
+ EcalTimeBiasCorrections bias_;
};
EcalTimeBiasCorrectionsFillInitial::EcalTimeBiasCorrectionsFillInitial(const edm::ParameterSet &ps) {
@@ -60,15 +60,13 @@ EcalTimeBiasCorrectionsFillInitial::EcalTimeBiasCorrectionsFillInitial(const edm
"different from EEtimeCorrShiftBins.";
}
- bias_ = new EcalTimeBiasCorrections();
+ copy(EBtimeCorrAmplitudeBins_.begin(), EBtimeCorrAmplitudeBins_.end(), back_inserter(bias_.EBTimeCorrAmplitudeBins));
- copy(EBtimeCorrAmplitudeBins_.begin(), EBtimeCorrAmplitudeBins_.end(), back_inserter(bias_->EBTimeCorrAmplitudeBins));
+ copy(EBtimeCorrShiftBins_.begin(), EBtimeCorrShiftBins_.end(), back_inserter(bias_.EBTimeCorrShiftBins));
- copy(EBtimeCorrShiftBins_.begin(), EBtimeCorrShiftBins_.end(), back_inserter(bias_->EBTimeCorrShiftBins));
+ copy(EEtimeCorrAmplitudeBins_.begin(), EEtimeCorrAmplitudeBins_.end(), back_inserter(bias_.EETimeCorrAmplitudeBins));
- copy(EEtimeCorrAmplitudeBins_.begin(), EEtimeCorrAmplitudeBins_.end(), back_inserter(bias_->EETimeCorrAmplitudeBins));
-
- copy(EEtimeCorrShiftBins_.begin(), EEtimeCorrShiftBins_.end(), back_inserter(bias_->EETimeCorrShiftBins));
+ copy(EEtimeCorrShiftBins_.begin(), EEtimeCorrShiftBins_.end(), back_inserter(bias_.EETimeCorrShiftBins));
}
EcalTimeBiasCorrectionsFillInitial::~EcalTimeBiasCorrectionsFillInitial() {}
@@ -77,7 +75,7 @@ void EcalTimeBiasCorrectionsFillInitial::analyze(const edm::Event &iEvent, const
void EcalTimeBiasCorrectionsFillInitial::endJob() {
edm::Service