Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:43

0001 from __future__ import print_function
0002 import os
0003 import sys
0004 import FWCore.ParameterSet.Config as cms
0005 
0006 if len(sys.argv) < 3:
0007     raise RuntimeError('\nERROR: Need csv-filename as first argument.\n')
0008 csv_file = sys.argv[2]
0009 db_file = csv_file.replace('.csv', '.db')
0010 tagger = os.path.basename(csv_file).split('.')[0]
0011 print("Using file:", csv_file)
0012 print("DBout into:", db_file)
0013 print("taggername:", tagger)
0014 
0015 process = cms.Process("BTagCalibCreator")
0016 process.load("CondCore.DBCommon.CondDBCommon_cfi")
0017 process.CondDBCommon.connect = 'sqlite_file:' + db_file
0018 
0019 process.maxEvents = cms.untracked.PSet(
0020     input=cms.untracked.int32(1),
0021 )
0022 
0023 process.source = cms.Source("EmptySource")
0024 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
0025     process.CondDBCommon,
0026     toPut = cms.VPSet(
0027         cms.PSet(
0028             record = cms.string(tagger),
0029             tag = cms.string(tagger),
0030             label = cms.string(tagger),
0031         ),
0032     )
0033 )
0034 
0035 process.dbCreator = cms.EDAnalyzer("BTagCalibrationDbCreator",
0036     csvFile=cms.untracked.string(csv_file),
0037     tagger=cms.untracked.string(tagger),
0038 )
0039 
0040 process.p = cms.Path(
0041     process.dbCreator
0042 )
0043 
0044