File indexing completed on 2024-04-06 12:02:43
0001 import FWCore.ParameterSet.Config as cms
0002 import FWCore.ParameterSet.VarParsing as VarParsing
0003
0004 process = cms.Process("READ")
0005
0006 options = VarParsing.VarParsing()
0007 options.register('inputTag',
0008 "myTagName",
0009 VarParsing.VarParsing.multiplicity.singleton,
0010 VarParsing.VarParsing.varType.string,
0011 "output tag name")
0012 options.register('inputRecord',
0013 "BeamSpotOnlineLegacyObjectsRcd",
0014 VarParsing.VarParsing.multiplicity.singleton,
0015 VarParsing.VarParsing.varType.string,
0016 "type of record")
0017 options.register('startRun',
0018 306171,
0019 VarParsing.VarParsing.multiplicity.singleton,
0020 VarParsing.VarParsing.varType.int,
0021 "location of the input data")
0022 options.register('startLumi',
0023 497,
0024 VarParsing.VarParsing.multiplicity.singleton,
0025 VarParsing.VarParsing.varType.int,
0026 "IOV Start Lumi")
0027 options.register('maxLSToRead',
0028 10,
0029 VarParsing.VarParsing.multiplicity.singleton,
0030 VarParsing.VarParsing.varType.int,
0031 "total number of LumiSections to read in input")
0032 options.parseArguments()
0033
0034 process.load("FWCore.MessageService.MessageLogger_cfi")
0035 process.MessageLogger.cerr.FwkReport.reportEvery = 100000
0036
0037 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.maxLSToRead))
0038
0039
0040
0041
0042 process.source = cms.Source("EmptySource",
0043 firstRun = cms.untracked.uint32(options.startRun),
0044 firstLuminosityBlock = cms.untracked.uint32(options.startLumi),
0045 numberEventsInLuminosityBlock = cms.untracked.uint32(1),
0046 numberEventsInRun = cms.untracked.uint32(5000),
0047 )
0048
0049
0050
0051
0052 process.load("Configuration.StandardSequences.GeometryDB_cff")
0053 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0054 from Configuration.AlCa.GlobalTag import GlobalTag
0055 process.GlobalTag = GlobalTag(process.GlobalTag, "132X_dataRun3_HLT_v2")
0056 process.GlobalTag.toGet = cms.VPSet(cms.PSet(record = cms.string("TrackerAlignmentRcd"),
0057 tag = cms.string("TrackerAlignment_PCL_byRun_v0_hlt"),
0058 label = cms.untracked.string("reference")),
0059 cms.PSet(record = cms.string("TrackerAlignmentRcd"),
0060 tag = cms.string("TrackerAlignment_collisions23_forHLT_v9"),
0061 label = cms.untracked.string("target")))
0062
0063
0064
0065 myTagName = options.inputTag
0066
0067 print("isForHLT: ",(options.inputRecord == "BeamSpotOnlineHLTObjectsRcd"))
0068 print("max LS to Read: ",options.maxLSToRead)
0069
0070
0071
0072
0073 from CondCore.CondDB.CondDB_cfi import *
0074 CondDBBeamSpotObjects = CondDB.clone(connect = cms.string('sqlite_file:test_%s.db' % myTagName))
0075 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
0076 CondDBBeamSpotObjects,
0077 timetype = cms.untracked.string('lumiid'),
0078 toPut = cms.VPSet(cms.PSet(record = cms.string(options.inputRecord),
0079 tag = cms.string(myTagName))),
0080 loadBlobStreamer = cms.untracked.bool(False)
0081 )
0082
0083
0084
0085
0086 process.beamspotonlineshifter = cms.EDAnalyzer("BeamSpotOnlineShifter",
0087 isHLT = cms.bool((options.inputRecord == "BeamSpotOnlineHLTObjectsRcd")),
0088 xShift = cms.double(+0.000141),
0089 yShift = cms.double(+0.000826),
0090 zShift = cms.double(+0.000277))
0091
0092
0093 process.p = cms.Path(process.beamspotonlineshifter)