Skip to content

Commit

Permalink
Merge pull request #40793 from mmusich/useResources_in_ConditionDBWriter
Browse files Browse the repository at this point in the history
`usesResource` in `ConditionDBWriter`
  • Loading branch information
cmsbuild authored Feb 20, 2023
2 parents 3cc5a4e + cfd3f1b commit 67b6191
Show file tree
Hide file tree
Showing 16 changed files with 56 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ void SiStripGainFromCalibTree::merge(TH2* A, TH2* B) {

SiStripGainFromCalibTree::SiStripGainFromCalibTree(const edm::ParameterSet& iConfig)
: ConditionDBWriter<SiStripApvGain>(iConfig) {
usesResource(TFileService::kSharedResource);
OutputGains = iConfig.getParameter<std::string>("OutputGains");

AlgoMode = iConfig.getUntrackedParameter<std::string>("AlgoMode", "CalibTree");
MagFieldCurrentTh = iConfig.getUntrackedParameter<double>("MagFieldCurrentTh", 2000.);
MinNrEntries = iConfig.getUntrackedParameter<double>("minNrEntries", 20);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/ParameterSet/interface/FileInPath.h"
#include "Geometry/Records/interface/TrackerTopologyRcd.h"
#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h"
#include "FWCore/ParameterSet/interface/FileInPath.h"
#include "Geometry/Records/interface/TrackerTopologyRcd.h"
#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ class ConditionDBWriter
Time_(0),
setSinceTime_(false),
firstRun_(true) {
usesResource(cond::service::PoolDBOutputService::kSharedResource);
edm::LogInfo("ConditionDBWriter::ConditionDBWriter()") << std::endl;
SinceAppendMode_ = iConfig.getParameter<bool>("SinceAppendMode");
std::string IOVMode = iConfig.getParameter<std::string>("IOVMode");
Expand Down
2 changes: 2 additions & 0 deletions CondCore/DBOutputService/interface/PoolDBOutputService.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ namespace cond {
public:
PoolDBOutputService(const edm::ParameterSet& iConfig, edm::ActivityRegistry& iAR);

static const std::string kSharedResource;

virtual ~PoolDBOutputService();

//use these to control connections
Expand Down
2 changes: 2 additions & 0 deletions CondCore/DBOutputService/src/PoolDBOutputService.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#include <memory>
#include <cassert>

const std::string cond::service::PoolDBOutputService::kSharedResource = "PoolDBOutputService";

//In order to make PoolDBOutputService::currentTime() to work we have to keep track
// of which stream is presently being processed on a given thread during the call of
// a module which calls that method.
Expand Down
12 changes: 7 additions & 5 deletions CondFormats/PhysicsToolsObjects/test/SiStripDeDx2DBuilder.cc
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#ifndef SiStripDeDx2DBuilder_H
#define SiStripDeDx2DBuilder_H

#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "CondFormats/PhysicsToolsObjects/interface/Histogram2D.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/Exception.h"
//#include "FWCore/Utilities/interface/FileInPath.h"

#include "CondFormats/PhysicsToolsObjects/interface/Histogram2D.h"

#include <iostream>
#include <fstream>
//#include "CLHEP/Random/RandFlat.h"
Expand Down
12 changes: 7 additions & 5 deletions CondFormats/PhysicsToolsObjects/test/SiStripDeDx3DBuilder.cc
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#ifndef SiStripDeDx3DBuilder_H
#define SiStripDeDx3DBuilder_H

#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "CondFormats/PhysicsToolsObjects/interface/Histogram3D.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/Exception.h"
//#include "FWCore/Utilities/interface/FileInPath.h"

#include "CondFormats/PhysicsToolsObjects/interface/Histogram3D.h"

#include <iostream>
#include <fstream>
//#include "CLHEP/Random/RandFlat.h"
Expand Down
2 changes: 2 additions & 0 deletions CondFormats/PhysicsToolsObjects/test/SiStripDeDxMipBuilder.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "CondFormats/PhysicsToolsObjects/test/SiStripDeDxMipBuilder.h"
#include "CondFormats/PhysicsToolsObjects/interface/Histogram2D.h"
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
//#include "CalibTracker/SiStripCommon/interface/SiStripDetInfoFileReader.h"

#include <iostream>
Expand Down
3 changes: 2 additions & 1 deletion CondFormats/PhysicsToolsObjects/test/SiStripDeDxMipBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
//#include "FWCore/Utilities/interface/FileInPath.h"

#include "CondFormats/PhysicsToolsObjects/interface/Histogram2D.h"
Expand Down
6 changes: 4 additions & 2 deletions CondTools/SiStrip/plugins/SiStripApvGainBuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

// user include files
#include "CalibTracker/SiStripCommon/interface/SiStripDetInfoFileReader.h"
#include "CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h"
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "CondFormats/SiStripObjects/interface/SiStripApvGain.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/FileInPath.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/Exception.h"

#include "CLHEP/Random/RandFlat.h"
#include "CLHEP/Random/RandGauss.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h"
#include "CondFormats/SiStripObjects/interface/SiStripApvSimulationParameters.h"
#include "CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h"

class SiStripApvSimulationParametersBuilder : public edm::one::EDAnalyzer<> {
public:
Expand Down
5 changes: 4 additions & 1 deletion CondTools/SiStrip/plugins/SiStripNoisesBuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@

// user includes
#include "CalibTracker/SiStripCommon/interface/SiStripDetInfoFileReader.h"
#include "CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h"
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "CondFormats/SiStripObjects/interface/SiStripNoises.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/FileInPath.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/Exception.h"

#include "CLHEP/Random/RandFlat.h"
Expand Down
15 changes: 9 additions & 6 deletions CondTools/SiStrip/plugins/SiStripPedestalsBuilder.cc
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ParameterSet/interface/FileInPath.h"
#include "CalibTracker/SiStripCommon/interface/SiStripDetInfoFileReader.h"
#include "CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h"
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "CondFormats/SiStripObjects/interface/SiStripPedestals.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/FileInPath.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/Exception.h"

#include "CLHEP/Random/RandFlat.h"
#include "CLHEP/Random/RandGauss.h"
Expand Down
13 changes: 8 additions & 5 deletions CondTools/SiStrip/plugins/SiStripSummaryBuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
#include <fstream>

// user include files
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "CondFormats/SiStripObjects/interface/SiStripSummary.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/FileInPath.h"
#include "CondFormats/SiStripObjects/interface/SiStripSummary.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/Exception.h"

#include "CLHEP/Random/RandFlat.h"
#include "CLHEP/Random/RandGauss.h"
Expand Down
5 changes: 4 additions & 1 deletion CondTools/SiStrip/plugins/SiStripThresholdBuilder.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "CalibTracker/SiStripCommon/interface/SiStripDetInfoFileReader.h"
#include "CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h"
#include "CondFormats/SiStripObjects/interface/SiStripThreshold.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/FileInPath.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/Exception.h"

#include "CLHEP/Random/RandFlat.h"
Expand Down

0 comments on commit 67b6191

Please sign in to comment.