CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
bTagCalibrationDbCreation.py
Go to the documentation of this file.
1 import os
2 import sys
3 import FWCore.ParameterSet.Config as cms
4 
5 if len(sys.argv) < 3:
6  raise RuntimeError('\nERROR: Need csv-filename as first argument.\n')
7 csv_file = sys.argv[2]
8 db_file = csv_file.replace('.csv', '.db')
9 tagger = os.path.basename(csv_file).split('.')[0]
10 print "Using file:", csv_file
11 print "DBout into:", db_file
12 print "taggername:", tagger
13 
14 process = cms.Process("BTagCalibCreator")
15 process.load("CondCore.DBCommon.CondDBCommon_cfi")
16 process.CondDBCommon.connect = 'sqlite_file:' + db_file
17 
18 process.maxEvents = cms.untracked.PSet(
19  input=cms.untracked.int32(1),
20 )
21 
22 process.source = cms.Source("EmptySource")
23 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
24  process.CondDBCommon,
25  toPut = cms.VPSet(
26  cms.PSet(
27  record = cms.string(tagger),
28  tag = cms.string(tagger),
29  label = cms.string(tagger),
30  ),
31  )
32 )
33 
34 process.dbCreator = cms.EDAnalyzer("BTagCalibrationDbCreator",
35  csvFile=cms.untracked.string(csv_file),
36  tagger=cms.untracked.string(tagger),
37 )
38 
39 process.p = cms.Path(
40  process.dbCreator
41 )
42 
43 
double split
Definition: MVATrainer.cc:139