Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-11-22 06:26:53

0001 # Config file template to write new/update AlCaRecoTriggerBits stored
0002 # in AlCaRecoTriggerBitsRcd that is used to get selected HLT paths for
0003 # the HLTHighLevel filter for AlCaReco production.
0004 #
0005 # Please understand that there are two IOVs involved:
0006 # 1) One for the output tag. Here the usually used default is 1->inf,
0007 #    changed by process.AlCaRecoTriggerBitsRcdUpdate.firstRunIOV
0008 #    and process.AlCaRecoTriggerBitsRcdUpdate.lastRunIOV.
0009 # 2) The IOV of the tag of the input AlCaRecoTriggerBitsRcd.
0010 #    That is chosen by process.source.firstRun (but irrelevant if 
0011 #    process.AlCaRecoTriggerBitsRcdUpdate.startEmpty = True)
0012 #
0013 # See also further comments below, especially the WARNING.
0014 #
0015 #  Author    : Marco Musich
0016 #  Date      : Feb 2016
0017 
0018 import FWCore.ParameterSet.Config as cms
0019 import FWCore.ParameterSet.VarParsing as VarParsing 
0020 
0021 process = cms.Process("UPDATEDB")
0022 
0023 options = VarParsing.VarParsing()
0024 options.register( "inputDB", 
0025                   "frontier://FrontierProd/CMS_CONDITIONS",  #default value
0026                   VarParsing.VarParsing.multiplicity.singleton, 
0027                   VarParsing.VarParsing.varType.string,
0028                   "the input DB"
0029                   )
0030 
0031 options.register( "inputTag", 
0032                   "AlCaRecoHLTpaths8e29_1e31_v7_hlt",  #default value
0033                   VarParsing.VarParsing.multiplicity.singleton, 
0034                   VarParsing.VarParsing.varType.string,
0035                   "the input tag"
0036                   )
0037 
0038 options.register( "outputDB", 
0039                   "sqlite_file:AlCaRecoTriggerBits.db",  #default value
0040                   VarParsing.VarParsing.multiplicity.singleton, 
0041                   VarParsing.VarParsing.varType.string,
0042                   "the output DB"
0043                   )
0044 
0045 options.register( "outputTag", 
0046                   "testTag",  #default value
0047                   VarParsing.VarParsing.multiplicity.singleton, 
0048                   VarParsing.VarParsing.varType.string,
0049                   "the input DB"
0050                   )
0051 
0052 options.register( "firstRun", 
0053                   1,  #default value
0054                   VarParsing.VarParsing.multiplicity.singleton, 
0055                   VarParsing.VarParsing.varType.int,
0056                   "the first run"
0057                   )
0058 
0059 options.parseArguments()
0060 
0061 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0062 process.MessageLogger.cerr = cms.untracked.PSet(enable = cms.untracked.bool(False))
0063 process.MessageLogger.cout = cms.untracked.PSet(INFO = cms.untracked.PSet(
0064     reportEvery = cms.untracked.int32(1)
0065 ))
0066 
0067 # the module writing to DB
0068 from CondTools.HLT.alCaRecoTriggerBitsRcdUpdate_cfi import alCaRecoTriggerBitsRcdUpdate as _alCaRecoTriggerBitsRcdUpdate
0069 process.AlCaRecoTriggerBitsRcdUpdate = _alCaRecoTriggerBitsRcdUpdate.clone()
0070 # The IOV that you want to write out, defaut is 1 to -1/inf. 
0071 process.AlCaRecoTriggerBitsRcdUpdate.firstRunIOV = options.firstRun # docu see...
0072 #process.AlCaRecoTriggerBitsRcdUpdate.lastRunIOV = -1 # ...cfi
0073 # If you want to start from scratch, comment the next line:
0074 process.AlCaRecoTriggerBitsRcdUpdate.startEmpty = False
0075 # In case you want to remove 'keys', use this possibly comma separated list.
0076 # Also if you want to replace settings for one 'key', you have to remove it first.
0077 #process.AlCaRecoTriggerBitsRcdUpdate.listNamesRemove = ["SiStripCalZeroBias"]
0078 # Here specifiy 'key' and corresponding paths for new entries or updated ones:
0079 # process.AlCaRecoTriggerBitsRcdUpdate.triggerListsAdd = [
0080 #     cms.PSet(listName = cms.string('AlCaEcalTrg'), # to be updated
0081 #              hltPaths = cms.vstring('AlCa_EcalPhiSym*')
0082 #              )
0083 #     ]
0084 
0085 process.AlCaRecoTriggerBitsRcdUpdate.triggerListsAdd = []
0086 process.AlCaRecoTriggerBitsRcdUpdate.alcarecoToReplace = [
0087     cms.PSet(oldKey = cms.string('SiStripCalMinBiasAfterAbortGap'),
0088              newKey = cms.string('SiStripCalMinBiasAAG')
0089              )
0090     ]
0091 
0092 # No data, but have to specify run number if you do not want 1, see below:
0093 process.source = cms.Source("EmptySource",
0094                             #numberEventsInRun = cms.untracked.uint32(1),
0095                             firstRun = cms.untracked.uint32(options.firstRun) # 1 is default
0096                             )
0097 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) )
0098 
0099 # DB input - needed only for AlCaRecoTriggerBitsRcdUpdate.startEmpty = False
0100 # WARNING:
0101 # Take care in case the input tag has several IOVs: The run number that will be 
0102 # used to define which payload you get is defined by the run number in the
0103 # EmptySource above!
0104 # Either a global tag...
0105 # from Configuration.AlCa.autoCond import autoCond
0106 # process.load("Configuration.StandardSequences.CondDBESSource_cff")
0107 # process.GlobalTag.globaltag = autoCond['run2_data'] #choose your tag
0108 
0109 # ...or (recommended since simpler) directly from DB/sqlite
0110 
0111 process.load("CondCore.CondDB.CondDB_cfi")
0112 
0113 # DB input service: 
0114 process.CondDB.connect = options.inputDB
0115 process.dbInput = cms.ESSource("PoolDBESSource",
0116                                process.CondDB,
0117                                toGet = cms.VPSet(cms.PSet(record = cms.string('AlCaRecoTriggerBitsRcd'),
0118                                                           tag = cms.string(options.inputTag)
0119                                                           )
0120                                                  )
0121                                )
0122 
0123 # DB output service:
0124 process.CondDB.connect = options.outputDB
0125 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
0126                                           process.CondDB,
0127                                           timetype = cms.untracked.string('runnumber'),
0128                                           toPut = cms.VPSet(cms.PSet(record = cms.string('AlCaRecoTriggerBitsRcd'),
0129                                                                      tag = cms.string(options.outputTag) # choose output tag you want
0130                                                                      )
0131                                                             )
0132                                           )
0133 
0134 # Put module in path:
0135 process.p = cms.Path(process.AlCaRecoTriggerBitsRcdUpdate)
0136 
0137