New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[90X] AlCaRecoTriggerBits updates #17568
Merged
davidlange6
merged 7 commits into
cms-sw:CMSSW_9_0_X
from
mmusich:90X_AlCaRecoTriggerBitsUpdator
Feb 21, 2017
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c9a9cb6
Add key replacement feature in AlCaRecoTriggerBitsUpdate
mmusich b891eaa
add script to automatize multi-IOVed operations
mmusich 177b730
Update DB I/O configuration
mmusich bea37ab
Allow reading from condDB and use conddblib utility
mmusich e5c063f
Introduce instructions
mmusich 84f4840
reserve size of keyPairs
mmusich 6f27b90
fix instructions
mmusich File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
CondTools/HLT/test/AlCaRecoTriggerBitsRcdRead_TEMPL_cfg.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
import FWCore.ParameterSet.VarParsing as VarParsing | ||
|
||
process = cms.Process("READ") | ||
|
||
options = VarParsing.VarParsing() | ||
options.register( "inputDB", | ||
"frontier://FrontierProd/CMS_CONDITIONS", #default value | ||
VarParsing.VarParsing.multiplicity.singleton, | ||
VarParsing.VarParsing.varType.string, | ||
"the input DB" | ||
) | ||
|
||
options.register( "inputTag", | ||
"AlCaRecoHLTpaths8e29_1e31_v7_hlt", #default value | ||
VarParsing.VarParsing.multiplicity.singleton, | ||
VarParsing.VarParsing.varType.string, | ||
"the input tag" | ||
) | ||
|
||
options.parseArguments() | ||
|
||
|
||
process.load("FWCore.MessageLogger.MessageLogger_cfi") | ||
process.MessageLogger.cerr = cms.untracked.PSet(placeholder = cms.untracked.bool(True)) | ||
process.MessageLogger.cout = cms.untracked.PSet(INFO = cms.untracked.PSet( | ||
reportEvery = cms.untracked.int32(1000) | ||
)) | ||
|
||
# the module writing to DB | ||
process.load("CondTools.HLT.AlCaRecoTriggerBitsRcdRead_cfi") | ||
# 'twiki' is default - others are text, python (future: html?) | ||
#process.AlCaRecoTriggerBitsRcdRead.outputType = 'twiki' | ||
# If rawFileName stays empty (default), use the message logger for output. | ||
# Otherwise use the file name specified, adding a suffix according to outputType: | ||
process.AlCaRecoTriggerBitsRcdRead.rawFileName = 'triggerBits'+options.inputTag | ||
|
||
# No data, but might want to specify the 'firstRun' to check (default is 1): | ||
process.source = cms.Source("EmptySource", | ||
numberEventsInRun = cms.untracked.uint32(1), # do not change! | ||
firstRun = cms.untracked.uint32(1) | ||
) | ||
# With 'numberEventsInRun = 1' above, | ||
# this will check IOVs until run (!) number specified as 'input' here, | ||
# so take care to choose a one that is not too small...: | ||
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(500000) ) | ||
|
||
# Input for AlCaRecoTriggerBitsRcd, | ||
# either via GlobalTag | ||
# (loading of Configuration.StandardSequences.CondDBESSource_cff equivalent to CondCore.ESSources.CondDBESSource_cfi | ||
# as entry point for condition records in the EventSetup, | ||
# but sufficient and faster than Configuration.StandardSequences.FrontierConditions_GlobalTag_cff): | ||
#from Configuration.AlCa.autoCond import autoCond | ||
#process.load("Configuration.StandardSequences.CondDBESSource_cff") | ||
#process.GlobalTag.globaltag = autoCond['run2_data'] #choose your tag | ||
|
||
# ...or specify database and tag: | ||
from CondCore.CondDB.CondDB_cfi import * | ||
#CondDBTriggerBits = CondDB.clone(connect = cms.string('frontier://FrontierProd/CMS_COND_31X_HLT')) | ||
CondDBTriggerBits = CondDB.clone(connect = cms.string(options.inputDB)) | ||
process.dbInput = cms.ESSource("PoolDBESSource", | ||
CondDBTriggerBits, | ||
toGet = cms.VPSet(cms.PSet(record = cms.string('AlCaRecoTriggerBitsRcd'), | ||
tag = cms.string(options.inputTag) # choose tag you want | ||
) | ||
) | ||
) | ||
|
||
# Put module in path: | ||
process.p = cms.Path(process.AlCaRecoTriggerBitsRcdRead) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
136 changes: 136 additions & 0 deletions
136
CondTools/HLT/test/AlCaRecoTriggerBitsRcdUpdate_TEMPL_cfg.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
# Config file template to write new/update AlCaRecoTriggerBits stored | ||
# in AlCaRecoTriggerBitsRcd that is used to get selected HLT paths for | ||
# the HLTHighLevel filter for AlCaReco production. | ||
# | ||
# Please understand that there are two IOVs involved: | ||
# 1) One for the output tag. Here the usually used default is 1->inf, | ||
# changed by process.AlCaRecoTriggerBitsRcdUpdate.firstRunIOV | ||
# and process.AlCaRecoTriggerBitsRcdUpdate.lastRunIOV. | ||
# 2) The IOV of the tag of the input AlCaRecoTriggerBitsRcd. | ||
# That is chosen by process.source.firstRun (but irrelevant if | ||
# process.AlCaRecoTriggerBitsRcdUpdate.startEmpty = True) | ||
# | ||
# See also further comments below, especially the WARNING. | ||
# | ||
# Author : Marco Musich | ||
# Date : Feb 2016 | ||
|
||
import FWCore.ParameterSet.Config as cms | ||
import FWCore.ParameterSet.VarParsing as VarParsing | ||
|
||
process = cms.Process("UPDATEDB") | ||
|
||
options = VarParsing.VarParsing() | ||
options.register( "inputDB", | ||
"frontier://FrontierProd/CMS_CONDITIONS", #default value | ||
VarParsing.VarParsing.multiplicity.singleton, | ||
VarParsing.VarParsing.varType.string, | ||
"the input DB" | ||
) | ||
|
||
options.register( "inputTag", | ||
"AlCaRecoHLTpaths8e29_1e31_v7_hlt", #default value | ||
VarParsing.VarParsing.multiplicity.singleton, | ||
VarParsing.VarParsing.varType.string, | ||
"the input tag" | ||
) | ||
|
||
options.register( "outputDB", | ||
"sqlite_file:AlCaRecoTriggerBits.db", #default value | ||
VarParsing.VarParsing.multiplicity.singleton, | ||
VarParsing.VarParsing.varType.string, | ||
"the output DB" | ||
) | ||
|
||
options.register( "outputTag", | ||
"testTag", #default value | ||
VarParsing.VarParsing.multiplicity.singleton, | ||
VarParsing.VarParsing.varType.string, | ||
"the input DB" | ||
) | ||
|
||
options.register( "firstRun", | ||
1, #default value | ||
VarParsing.VarParsing.multiplicity.singleton, | ||
VarParsing.VarParsing.varType.int, | ||
"the first run" | ||
) | ||
|
||
options.parseArguments() | ||
|
||
process.load("FWCore.MessageLogger.MessageLogger_cfi") | ||
process.MessageLogger.cerr = cms.untracked.PSet(placeholder = cms.untracked.bool(True)) | ||
process.MessageLogger.cout = cms.untracked.PSet(INFO = cms.untracked.PSet( | ||
reportEvery = cms.untracked.int32(1) | ||
)) | ||
|
||
# the module writing to DB | ||
process.load("CondTools.HLT.AlCaRecoTriggerBitsRcdUpdate_cfi") | ||
# The IOV that you want to write out, defaut is 1 to -1/inf. | ||
process.AlCaRecoTriggerBitsRcdUpdate.firstRunIOV = options.firstRun # docu see... | ||
#process.AlCaRecoTriggerBitsRcdUpdate.lastRunIOV = -1 # ...cfi | ||
# If you want to start from scratch, comment the next line: | ||
process.AlCaRecoTriggerBitsRcdUpdate.startEmpty = False | ||
# In case you want to remove 'keys', use this possibly comma separated list. | ||
# Also if you want to replace settings for one 'key', you have to remove it first. | ||
#process.AlCaRecoTriggerBitsRcdUpdate.listNamesRemove = ["SiStripCalZeroBias"] | ||
# Here specifiy 'key' and corresponding paths for new entries or updated ones: | ||
# process.AlCaRecoTriggerBitsRcdUpdate.triggerListsAdd = [ | ||
# cms.PSet(listName = cms.string('AlCaEcalTrg'), # to be updated | ||
# hltPaths = cms.vstring('AlCa_EcalPhiSym*') | ||
# ) | ||
# ] | ||
|
||
process.AlCaRecoTriggerBitsRcdUpdate.triggerListsAdd = [] | ||
process.AlCaRecoTriggerBitsRcdUpdate.alcarecoToReplace = [ | ||
cms.PSet(oldKey = cms.string('SiStripCalMinBiasAfterAbortGap'), | ||
newKey = cms.string('SiStripCalMinBiasAAG') | ||
) | ||
] | ||
|
||
# No data, but have to specify run number if you do not want 1, see below: | ||
process.source = cms.Source("EmptySource", | ||
#numberEventsInRun = cms.untracked.uint32(1), | ||
firstRun = cms.untracked.uint32(options.firstRun) # 1 is default | ||
) | ||
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) ) | ||
|
||
# DB input - needed only for AlCaRecoTriggerBitsRcdUpdate.startEmpty = False | ||
# WARNING: | ||
# Take care in case the input tag has several IOVs: The run number that will be | ||
# used to define which payload you get is defined by the run number in the | ||
# EmptySource above! | ||
# Either a global tag... | ||
# from Configuration.AlCa.autoCond import autoCond | ||
# process.load("Configuration.StandardSequences.CondDBESSource_cff") | ||
# process.GlobalTag.globaltag = autoCond['run2_data'] #choose your tag | ||
|
||
# ...or (recommended since simpler) directly from DB/sqlite | ||
|
||
process.load("CondCore.CondDB.CondDB_cfi") | ||
|
||
# DB input service: | ||
process.CondDB.connect = options.inputDB | ||
process.dbInput = cms.ESSource("PoolDBESSource", | ||
process.CondDB, | ||
toGet = cms.VPSet(cms.PSet(record = cms.string('AlCaRecoTriggerBitsRcd'), | ||
tag = cms.string(options.inputTag) | ||
) | ||
) | ||
) | ||
|
||
# DB output service: | ||
process.CondDB.connect = options.outputDB | ||
process.PoolDBOutputService = cms.Service("PoolDBOutputService", | ||
process.CondDB, | ||
timetype = cms.untracked.string('runnumber'), | ||
toPut = cms.VPSet(cms.PSet(record = cms.string('AlCaRecoTriggerBitsRcd'), | ||
tag = cms.string(options.outputTag) # choose output tag you want | ||
) | ||
) | ||
) | ||
|
||
# Put module in path: | ||
process.p = cms.Path(process.AlCaRecoTriggerBitsRcdUpdate) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Commands to run the workflow multi-IOV: | ||
|
||
## TO UPDATE | ||
``` | ||
python run_wf.py -f frontier://PromptProd/CMS_CONDITIONS -i AlCaRecoHLTpaths8e29_1e31_v24_offline -d AlCaRecoHLTpaths_TEST | ||
``` | ||
|
||
will create an update sqlite file called `AlCaRecoHLTpaths_TEST.db` with an updated tag ` AlCaRecoHLTpaths_TEST` (the same IOV structure will be preserved) | ||
|
||
Options available: | ||
* `-f` specifies connection (allows both condDB and sqlite files) | ||
* `-i` specifies input tag | ||
* `-d` specifies the output tag | ||
* `[-C]` (optional) if set to false leaves transient files IOV-by-IOV | ||
|
||
|
||
## TO READ BACK | ||
``` | ||
cmsRun AlCaRecoTriggerBitsRcdRead_TEMPL_cfg.py inputDB=AlCaRecoHLTpaths_TEST.db inputTag=AlCaRecoHLTpaths_TEST | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mmusich - please reserve the size of keyPairs. It is known in this case.