Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:34:45

0001 #!/bin/sh
0002 
0003 #py=`mktemp --tmpdir=. make_db_XXXXXXXXXX.py`
0004 
0005 #trap "rm -f \"$py\"" 1 2 3 15
0006 
0007 o="./output.db"
0008 v="00"
0009 
0010 #eval `scramv1 runtime -sh`
0011 rm -f "$o"
0012 for f in ue_calibrations_pf_mc.txt ue_calibrations_calo_mc.txt ue_calibrations_pf_data.txt ue_calibrations_calo_data.txt; do
0013     py=`mktemp --tmpdir=. make_db_XXXXXXXXXX.py`
0014     trap "rm -f \"$py\"" 1 2 3 15
0015     e="unknown"
0016     d="unknown"
0017     case "$f" in
0018         *pf*) e="PF";;
0019         *calo*) e="Calo";;
0020     esac
0021     case "$f" in
0022         *data*) d="offline";;
0023         *mc*) d="mc";;
0024     esac
0025     cat <<EOF > "$py"
0026 import FWCore.ParameterSet.VarParsing as VarParsing
0027 
0028 ivars = VarParsing.VarParsing('standard')
0029 
0030 ivars.register ('outputTag',
0031                 mult=ivars.multiplicity.singleton,
0032                 mytype=ivars.varType.string,
0033                 info="for testing")
0034 ivars.outputTag="UETable_${e}_v${v}_${d}"
0035 
0036 ivars.register ('inputFile',
0037                 mult=ivars.multiplicity.singleton,
0038                 mytype=ivars.varType.string,
0039                 info="for testing")
0040 
0041 ivars.register ('outputFile',
0042                 mult=ivars.multiplicity.singleton,
0043                 mytype=ivars.varType.string,
0044                 info="for testing")
0045 
0046 ivars.inputFile="$f"
0047 ivars.outputFile="$o"
0048 
0049 ivars.parseArguments()
0050 
0051 import FWCore.ParameterSet.Config as cms
0052 
0053 process = cms.Process('DUMMY')
0054 
0055 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1))
0056 process.source = cms.Source("EmptyIOVSource",
0057                             timetype = cms.string("runnumber"),
0058                             firstValue = cms.uint64(1),
0059                             lastValue = cms.uint64(1),
0060                             interval = cms.uint64(1)
0061                             )
0062 
0063 process.load("CondCore.DBCommon.CondDBCommon_cfi")
0064 process.CondDBCommon.connect = "sqlite_file:" + ivars.outputFile
0065 
0066 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
0067                                           process.CondDBCommon,
0068                                           timetype = cms.untracked.string("runnumber"),
0069                                           toPut = cms.VPSet(cms.PSet(record = cms.string('HeavyIonUERcd'),
0070                                                                      tag = cms.string(ivars.outputTag)
0071                                                                      )
0072                                                             )
0073                                           )
0074 
0075 process.makeUETableDB = cms.EDAnalyzer('UETableProducer',
0076                                        txtFile = cms.string(ivars.inputFile),
0077                                        jetCorrectorFormat = cms.untracked.bool(True)
0078                                        )
0079 
0080 process.step  = cms.Path(process.makeUETableDB)
0081 EOF
0082     cmsRun "$py"
0083 done
0084 
0085 #rm -f "$py"