1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
import FWCore.ParameterSet.Config as cms
import FWCore.ParameterSet.VarParsing as VarParsing
options = VarParsing.VarParsing()
options.register('runN',
1,
VarParsing.VarParsing.multiplicity.singleton,
VarParsing.VarParsing.varType.int,
"runN in the IOV.")
options.register('tag',
'SiStripApvGain_GR10_v1_hlt',
VarParsing.VarParsing.multiplicity.singleton,
VarParsing.VarParsing.varType.string,
"input tag")
options.register('inputFiles',
'frontier://FrontierProd/CMS_CONDITIONS',
VarParsing.VarParsing.multiplicity.singleton,
VarParsing.VarParsing.varType.string,
"input files")
options.parseArguments()
if (not options.tag or not options.inputFiles):
raise ValueError('usage: cmsRun SiStripApvGainReader_cfg.py inputFiles=my_input_file tag=my_tag')
process = cms.Process("SiStripApvGainReader")
process.MessageLogger = cms.Service(
"MessageLogger",
debugModules = cms.untracked.vstring(''),
threshold = cms.untracked.string('INFO'),
destinations = cms.untracked.vstring('SiStripApvGainReader.log')
)
##
## Empty events source
## (specify the run number to pick correct IOV)
##
process.source = cms.Source("EmptySource",
numberEventsInRun = cms.untracked.uint32(1),
firstRun = cms.untracked.uint32(options.runN)
)
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1)
)
##
## To Correctly build the SiStripGainRcd in the ES
## we need all the dependent records => specify a Global Tag
##
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_data', '')
##
## Prefer the SiStripApvGainRcd or SiStripApvGain2Rcd
## under test
##
process.poolDBESSource = cms.ESSource("PoolDBESSource",
connect = cms.string(options.inputFiles),
toGet = cms.VPSet(cms.PSet(record = cms.string('SiStripApvGainRcd'),
tag = cms.string(options.tag)
)
)
)
process.prefer_poolDBESSource = cms.ESPrefer("PoolDBESSource","poolDBESSource")
##
## Dump the Gain payload. It will be in the format
## DetId APV1 APV2 APV3 APV4 (APV5) (APV6)
##
process.gainreader = cms.EDAnalyzer("SiStripApvGainReader",
printDebug = cms.untracked.bool(True),
outputFile = cms.untracked.string("SiStripApvGains_dump.txt"),
gainType = cms.untracked.uint32(0) #0 for G1, 1 for G2
)
process.TFileService = cms.Service("TFileService",
fileName = cms.string("gain.root"),
closeFileFast = cms.untracked.bool(True)
)
process.p1 = cms.Path(process.gainreader)
|