Skip to content

Commit

Permalink
Fixes and additions for DB payload creation
Browse files Browse the repository at this point in the history
  • Loading branch information
cvuosalo committed Feb 4, 2022
1 parent 400549b commit 69e2db8
Show file tree
Hide file tree
Showing 6 changed files with 145 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
process.load('Configuration.Geometry.GeometryExtended2021_cff')
process.load('Geometry.MuonNumbering.muonNumberingInitialization_cfi')
process.load("Geometry.MuonNumbering.muonGeometryConstants_cff")
process.load('Configuration.StandardSequences.DD4hep_GeometrySim_cff')
process.load('Geometry.CaloEventSetup.CaloGeometryDBWriter_cfi')
process.load('CondTools.Geometry.HcalParametersWriter_cff')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ OutputDDToDDL::OutputDDToDDL(const edm::ParameterSet& iConfig) : m_fname() {
<< std::endl;
(*m_xos) << std::fixed << std::setprecision(18);

ddToken_ = esConsumes<DDCompactView, IdealGeometryRecord>();
ddToken_ = esConsumes<DDCompactView, IdealGeometryRecord, edm::Transition::BeginRun>();
}

OutputDDToDDL::~OutputDDToDDL() {
Expand Down
8 changes: 5 additions & 3 deletions Geometry/CSCGeometry/test/stubs/CSCGeometryAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ class CSCGeometryAnalyzer : public edm::one::EDAnalyzer<> {
const int dashedLineWidth_;
const std::string dashedLine_;
const std::string myName_;
edm::ESGetToken<CSCGeometry, MuonGeometryRecord> ddToken_;
};

CSCGeometryAnalyzer::CSCGeometryAnalyzer(const edm::ParameterSet& iConfig)
: dashedLineWidth_(194), dashedLine_(std::string(dashedLineWidth_, '-')), myName_("CSCGeometryAnalyzer") {}
: dashedLineWidth_(194), dashedLine_(std::string(dashedLineWidth_, '-')), myName_("CSCGeometryAnalyzer") {
ddToken_ = esConsumes<CSCGeometry, MuonGeometryRecord>();
}

CSCGeometryAnalyzer::~CSCGeometryAnalyzer() {}

Expand All @@ -42,8 +45,7 @@ void CSCGeometryAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetu
std::cout << "start " << dashedLine_ << std::endl;
std::cout << "pi = " << dPi << ", radToDeg = " << radToDeg << std::endl;

edm::ESHandle<CSCGeometry> pDD;
iSetup.get<MuonGeometryRecord>().get(pDD);
edm::ESTransientHandle<CSCGeometry> pDD = iSetup.getTransientHandle(ddToken_);
std::cout << " Geometry node for CSCGeom is " << &(*pDD) << std::endl;
std::cout << " I have " << pDD->detTypes().size() << " detTypes" << std::endl;
std::cout << " I have " << pDD->detUnits().size() << " detUnits" << std::endl;
Expand Down
52 changes: 52 additions & 0 deletions Geometry/GEMGeometry/test/testGEMGeometryFromDB_cfg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import FWCore.ParameterSet.Config as cms

from Configuration.StandardSequences.Eras import eras

process = cms.Process("Demo",eras.run3_GEM)



process.load('Configuration.StandardSequences.GeometryDB_cff')
process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
process.XMLFromDBSource.label = cms.string('Extended')
from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgrade2021', '')

from Configuration.AlCa.autoCond import autoCond
process.load('Geometry.MuonNumbering.muonNumberingInitialization_cfi')

process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1)
)

process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi")
process.preferFakeAlign = cms.ESPrefer("FakeAlignmentSource")

process.source = cms.Source("EmptySource")

process.test = cms.EDAnalyzer("GEMGeometryAnalyzer")

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

### TO ACTIVATE LogTrace NEED TO COMPILE IT WITH:
### -----------------------------------------------------------
### --> scram b -j8 USER_CXXFLAGS="-DEDM_ML_DEBUG"
### Make sure that you first cleaned your CMSSW version:
### --> scram b clean
### before issuing the scram command above
###############################################################
process.load("FWCore.MessageLogger.MessageLogger_cfi")
#
#
process.MessageLogger.debugModules = cms.untracked.vstring("*")
process.MessageLogger.cerr.enable = False
process.MessageLogger.files.junk = dict()
process.MessageLogger.cout = cms.untracked.PSet(
enable = cms.untracked.bool(True),
threshold = cms.untracked.string("DEBUG"),
default = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
FwkReport = cms.untracked.PSet( limit = cms.untracked.int32(-1) ),
# GEMGeometryBuilderFromDDD = cms.untracked.PSet( limit = cms.untracked.int32(-1) ),
# GEMNumberingScheme = cms.untracked.PSet( limit = cms.untracked.int32(-1) ),
)
82 changes: 82 additions & 0 deletions Geometry/GEMGeometry/test/testGEMGeometryFromLocalDB_cfg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import FWCore.ParameterSet.Config as cms

from Configuration.StandardSequences.Eras import eras

process = cms.Process("Demo",eras.run3_GEM)



process.load('Configuration.StandardSequences.GeometryDB_cff')
process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
process.load('CondCore.CondDB.CondDB_cfi')
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
process.XMLFromDBSource.label = cms.string('Extended')
from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgrade2021', '')

from Configuration.AlCa.autoCond import autoCond
process.load('Geometry.MuonNumbering.muonNumberingInitialization_cfi')

process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1)
)

process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi")
process.preferFakeAlign = cms.ESPrefer("FakeAlignmentSource")

process.source = cms.Source("EmptySource")



process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1)
)

process.CondDB.timetype = cms.untracked.string('runnumber')
process.CondDB.connect = cms.string('sqlite_file:myfile.db')
process.PoolDBESSourceGeometry = cms.ESSource("PoolDBESSource",
process.CondDB,
toGet = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'),tag = cms.string('XMLFILE_Geometry_TagXX_Extended2021_mc')),
cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('PEcalEndcapRcd'), tag = cms.string('EERECO_Geometry_TagXX')),
cms.PSet(record = cms.string('PEcalPreshowerRcd'),tag = cms.string('EPRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('PHcalRcd'), tag = cms.string('HCALRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('PCaloTowerRcd'), tag = cms.string('CTRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('PZdcRcd'), tag = cms.string('ZDCRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('PCastorRcd'), tag = cms.string('CASTORRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('CSCRecoGeometryRcd'),tag = cms.string('CSCRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('CSCRecoDigiParametersRcd'),tag = cms.string('CSCRECODIGI_Geometry_TagXX')),
cms.PSet(record = cms.string('DTRecoGeometryRcd'),tag = cms.string('DTRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('RPCRecoGeometryRcd'),tag = cms.string('RPCRECO_Geometry_TagXX')),
cms.PSet(record = cms.string('GEMRecoGeometryRcd'),tag = cms.string('GEMRECO_Geometry_TagXX'))
)
)
process.es_prefer_geometry = cms.ESPrefer( "PoolDBESSource", "PoolDBESSourceGeometry" )


process.test = cms.EDAnalyzer("GEMGeometryAnalyzer")

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

### TO ACTIVATE LogTrace NEED TO COMPILE IT WITH:
### -----------------------------------------------------------
### --> scram b -j8 USER_CXXFLAGS="-DEDM_ML_DEBUG"
### Make sure that you first cleaned your CMSSW version:
### --> scram b clean
### before issuing the scram command above
###############################################################
process.load("FWCore.MessageLogger.MessageLogger_cfi")
#
#
process.MessageLogger.debugModules = cms.untracked.vstring("*")
process.MessageLogger.cerr.enable = False
process.MessageLogger.files.junk = dict()
process.MessageLogger.cout = cms.untracked.PSet(
enable = cms.untracked.bool(True),
threshold = cms.untracked.string("DEBUG"),
default = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
FwkReport = cms.untracked.PSet( limit = cms.untracked.int32(-1) ),
# GEMGeometryBuilderFromDDD = cms.untracked.PSet( limit = cms.untracked.int32(-1) ),
# GEMNumberingScheme = cms.untracked.PSet( limit = cms.untracked.int32(-1) ),
)
11 changes: 5 additions & 6 deletions Geometry/GEMGeometry/test/testGEMGeometry_cfg.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import FWCore.ParameterSet.Config as cms

process = cms.Process("Demo")
from Configuration.StandardSequences.Eras import eras

process.load('Configuration.Geometry.GeometryExtended2023D21Reco_cff')
process.load('Configuration.Geometry.GeometryExtended2023D21_cff')
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc', '')
process = cms.Process("Demo",eras.run3_GEM)

process.load('Configuration.Geometry.GeometryExtended2021_cff')
process.load('Configuration.Geometry.GeometryExtended2021Reco_cff')

process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1)
Expand Down

0 comments on commit 69e2db8

Please sign in to comment.