-
Notifications
You must be signed in to change notification settings - Fork 1
/
retrieve_CTPPSRPAlignmentCorrectionsData.py
56 lines (47 loc) · 1.8 KB
/
retrieve_CTPPSRPAlignmentCorrectionsData.py
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
import sys
####### arguments #######
run_number = int(sys.argv[2]) if len(sys.argv) >= 3 else 0 # used to select the IOV
#########################
##### configuration #####
input = 'sqlite_file:alignment_results.db' # input database
db_tag = 'PPSAlignmentConfig_v1_prompt' # database tag
#########################
import FWCore.ParameterSet.Config as cms
process = cms.Process("retrieveCTPPSRPAlignmentCorrectionsData")
# Message Logger
process.MessageLogger = cms.Service("MessageLogger",
destinations = cms.untracked.vstring('retrieve_CTPPSRPAlignmentCorrectionsData'
),
retrieve_CTPPSRPAlignmentCorrectionsData = cms.untracked.PSet(
threshold = cms.untracked.string('INFO')
)
)
# Load CondDB service
process.load("CondCore.CondDB.CondDB_cfi")
# input database (in this case the local sqlite file)
process.CondDB.connect = input
# A data source must always be defined. We don't need it, so here's a dummy one.
process.source = cms.Source("EmptyIOVSource",
timetype = cms.string('runnumber'),
firstValue = cms.uint64(run_number),
lastValue = cms.uint64(run_number),
interval = cms.uint64(1)
)
# We define the input service.
process.PoolDBESSource = cms.ESSource("PoolDBESSource",
process.CondDB,
DumbStat = cms.untracked.bool(True),
toGet = cms.VPSet(cms.PSet(
record = cms.string('CTPPSRPAlignmentCorrectionsDataRcd'),
tag = cms.string(db_tag)
))
)
# DB object retrieve module
process.retrieve_config = cms.EDAnalyzer("RetrieveCTPPSRPAlignmentCorrectionsData",
toGet = cms.VPSet(cms.PSet(
record = cms.string('CTPPSRPAlignmentCorrectionsDataRcd'),
data = cms.vstring('CTPPSRPAlignmentCorrectionsData')
)),
verbose = cms.untracked.bool(True)
)
process.path = cms.Path(process.retrieve_config)