Skip to content

Commit

Permalink
Merge pull request #33431 from thomreis/ecal_tp_esconsumes_migration
Browse files Browse the repository at this point in the history
Migrate EcalTPCondAnalyzer to use esConsumes
  • Loading branch information
cmsbuild authored Apr 16, 2021
2 parents 7c00be1 + 2c6c4f4 commit 8b8cfcd
Show file tree
Hide file tree
Showing 6 changed files with 264 additions and 346 deletions.
486 changes: 160 additions & 326 deletions SimCalorimetry/EcalTrigPrimProducers/plugins/EcalTPCondAnalyzer.cc

Large diffs are not rendered by default.

49 changes: 34 additions & 15 deletions SimCalorimetry/EcalTrigPrimProducers/plugins/EcalTPCondAnalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,15 @@
//
//

// system include files
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Utilities/interface/InputTag.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/MakerMacros.h"

#include "DataFormats/Common/interface/Handle.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"

#include "CondFormats/EcalObjects/interface/EcalTPGCrystalStatus.h"
#include "CondFormats/EcalObjects/interface/EcalTPGFineGrainEBGroup.h"
#include "CondFormats/EcalObjects/interface/EcalTPGFineGrainEBIdMap.h"
#include "CondFormats/EcalObjects/interface/EcalTPGFineGrainStripEE.h"
Expand All @@ -37,34 +34,60 @@
#include "CondFormats/EcalObjects/interface/EcalTPGPhysicsConst.h"
#include "CondFormats/EcalObjects/interface/EcalTPGSlidingWindow.h"
#include "CondFormats/EcalObjects/interface/EcalTPGSpike.h"
#include "CondFormats/EcalObjects/interface/EcalTPGStripStatus.h"
#include "CondFormats/EcalObjects/interface/EcalTPGTowerStatus.h"
#include "CondFormats/EcalObjects/interface/EcalTPGWeightGroup.h"
#include "CondFormats/EcalObjects/interface/EcalTPGWeightIdMap.h"

class CaloSubdetectorGeometry;

#include <string>
#include <vector>
#include "CondFormats/DataRecord/interface/EcalTPGFineGrainEBGroupRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGFineGrainEBIdMapRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGFineGrainStripEERcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGFineGrainTowerEERcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGLinearizationConstRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGLutGroupRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGLutIdMapRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGPedestalsRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGPhysicsConstRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGSlidingWindowRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGSpikeRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGWeightGroupRcd.h"
#include "CondFormats/DataRecord/interface/EcalTPGWeightIdMapRcd.h"
#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
#include "Geometry/Records/interface/CaloGeometryRecord.h"

//
// class declaration
//

class EcalTPCondAnalyzer : public edm::one::EDAnalyzer<> {
class EcalTPCondAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
public:
explicit EcalTPCondAnalyzer(const edm::ParameterSet &);
~EcalTPCondAnalyzer() override;

void analyze(const edm::Event &, const edm::EventSetup &) override;
void beginJob() override;
void beginRun(const edm::Run &run, const edm::EventSetup &es);
void beginRun(const edm::Run &run, const edm::EventSetup &evtSetup) override;
void endJob() override;
void endRun(edm::Run const &, edm::EventSetup const &) override;

private:
unsigned long long getRecords(edm::EventSetup const &setup);
unsigned long long cacheID_;

edm::ESGetToken<CaloSubdetectorGeometry, EcalEndcapGeometryRecord> tokenEndcapGeom_;
edm::ESGetToken<CaloSubdetectorGeometry, EcalBarrelGeometryRecord> tokenBarrelGeom_;
edm::ESGetToken<EcalTPGPhysicsConst, EcalTPGPhysicsConstRcd> tokenEcalTPGPhysics_;
edm::ESGetToken<EcalTPGLinearizationConst, EcalTPGLinearizationConstRcd> tokenEcalTPGLinearization_;
edm::ESGetToken<EcalTPGPedestals, EcalTPGPedestalsRcd> tokenEcalTPGPedestals_;
edm::ESGetToken<EcalTPGWeightIdMap, EcalTPGWeightIdMapRcd> tokenEcalTPGWeightIdMap_;
edm::ESGetToken<EcalTPGFineGrainEBIdMap, EcalTPGFineGrainEBIdMapRcd> tokenEcalTPGFineGrainEBIdMap_;
edm::ESGetToken<EcalTPGLutIdMap, EcalTPGLutIdMapRcd> tokenEcalTPGLutIdMap_;
edm::ESGetToken<EcalTPGSlidingWindow, EcalTPGSlidingWindowRcd> tokenEcalTPGSlidingWindow_;
edm::ESGetToken<EcalTPGFineGrainStripEE, EcalTPGFineGrainStripEERcd> tokenEcalTPGFineGrainStripEE_;
edm::ESGetToken<EcalTPGWeightGroup, EcalTPGWeightGroupRcd> tokenEcalTPGWeightGroup_;
edm::ESGetToken<EcalTPGLutGroup, EcalTPGLutGroupRcd> tokenEcalTPGLutGroup_;
edm::ESGetToken<EcalTPGFineGrainEBGroup, EcalTPGFineGrainEBGroupRcd> tokenEcalTPGFineGrainEBGroup_;
edm::ESGetToken<EcalTPGSpike, EcalTPGSpikeRcd> tokenEcalTPGSpike_;
edm::ESGetToken<EcalTPGFineGrainTowerEE, EcalTPGFineGrainTowerEERcd> tokenEcalTPGFineGrainTowerEE_;

const CaloSubdetectorGeometry *theEndcapGeometry_;
const CaloSubdetectorGeometry *theBarrelGeometry_;

Expand All @@ -82,8 +105,4 @@ class EcalTPCondAnalyzer : public edm::one::EDAnalyzer<> {
void printEcalTPGFineGrainEBIdMap(const EcalTPGFineGrainEBIdMap *ecaltpgFineGrainEB) const;
void printTOWEREE(const EcalTPGFineGrainTowerEE *ecaltpgFineGrainTowerEE,
const EcalTPGLutGroup *ecaltpgLutGroup) const;
void printBadX(const EcalTPGCrystalStatus *ecaltpgBadX) const;
void printBadTT(const EcalTPGTowerStatus *ecaltpgBadTT) const;
void printBadStrip(const EcalTPGStripStatus *ecaltpgBadStrip) const;
void printSpikeTh(const EcalTPGSpike *ecaltpgSpike) const;
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FWCore.ParameterSet.Config as cms

process = cms.Process("TPDBAn")
process.load("CondCore.DBCommon.CondDBSetup_cfi")
process.load("CondCore.CondDB.CondDB_cfi")

process.load("Geometry.CaloEventSetup.CaloGeometry_cfi")

Expand All @@ -17,13 +17,28 @@
# firstRun = cms.untracked.uint32(135175)
)

process.load("CondCore.DBCommon.CondDBCommon_cfi")
process.CondDBCommon.DBParameters.authenticationPath = '/afs/cern.ch/cms/DB/conddb'
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
process.prefer("GlobalTag")
process.GlobalTag.globaltag = 'GR10_P_V5::All'
process.GlobalTag.globaltag = '112X_dataRun3_HLT_v3'


process.tpDBAnalyzer = cms.EDAnalyzer("EcalTPCondAnalyzer")

process.MessageLogger = cms.Service("MessageLogger",
cerr = cms.untracked.PSet(
enable = cms.untracked.bool(False)
),
cout = cms.untracked.PSet(
INFO = cms.untracked.PSet(
limit = cms.untracked.int32(0)
),
EcalTPCondAnalyzer = cms.untracked.PSet(
limit = cms.untracked.int32(100000000)
),
enable = cms.untracked.bool(True),
threshold = cms.untracked.string('DEBUG')
),
debugModules = cms.untracked.vstring('tpDBAnalyzer')
)

process.p = cms.Path(process.tpDBAnalyzer)
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,21 @@

process.tpDBAnalyzer = cms.EDAnalyzer("EcalTPCondAnalyzer")

process.MessageLogger = cms.Service("MessageLogger",
cerr = cms.untracked.PSet(
enable = cms.untracked.bool(False)
),
cout = cms.untracked.PSet(
INFO = cms.untracked.PSet(
limit = cms.untracked.int32(0)
),
EcalTPCondAnalyzer = cms.untracked.PSet(
limit = cms.untracked.int32(100000000)
),
enable = cms.untracked.bool(True),
threshold = cms.untracked.string('DEBUG')
),
debugModules = cms.untracked.vstring('tpDBAnalyzer')
)

process.p = cms.Path(process.tpDBAnalyzer)
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,21 @@

process.tpDBAnalyzer = cms.EDAnalyzer("EcalTPCondAnalyzer")

process.MessageLogger = cms.Service("MessageLogger",
cerr = cms.untracked.PSet(
enable = cms.untracked.bool(False)
),
cout = cms.untracked.PSet(
INFO = cms.untracked.PSet(
limit = cms.untracked.int32(0)
),
EcalTPCondAnalyzer = cms.untracked.PSet(
limit = cms.untracked.int32(100000000)
),
enable = cms.untracked.bool(True),
threshold = cms.untracked.string('DEBUG')
),
debugModules = cms.untracked.vstring('tpDBAnalyzer')
)

process.p = cms.Path(process.tpDBAnalyzer)
18 changes: 17 additions & 1 deletion SimCalorimetry/EcalTrigPrimProducers/test/readDBTPConds_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,22 @@

process.tpDBAnalyzer = cms.EDAnalyzer("EcalTPCondAnalyzer")

process.p = cms.Path(process.tpDBAnalyzer)
process.MessageLogger = cms.Service("MessageLogger",
cerr = cms.untracked.PSet(
enable = cms.untracked.bool(False)
),
cout = cms.untracked.PSet(
INFO = cms.untracked.PSet(
limit = cms.untracked.int32(0)
),
EcalTPCondAnalyzer = cms.untracked.PSet(
limit = cms.untracked.int32(100000000)
),
enable = cms.untracked.bool(True),
threshold = cms.untracked.string('DEBUG')
),
debugModules = cms.untracked.vstring('tpDBAnalyzer')
)

process.p = cms.Path(process.tpDBAnalyzer)

0 comments on commit 8b8cfcd

Please sign in to comment.