forked from MatiXOfficial/pps-alignment-data
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_distributions_reference_cfg.py
More file actions
114 lines (96 loc) · 3.62 KB
/
Copy pathrun_distributions_reference_cfg.py
File metadata and controls
114 lines (96 loc) · 3.62 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
########## Configuration ##########
# if set to True, a file with logs will be produced.
produce_logs = False
# Source max processed events
max_events = 10000000
# Specifies a method used to load conditions. Can be set to:
# - "ESSource" - configs loaded directly via ESSource
# - "local_sqlite" - configs retrieved from an SQLite file (input_conditions)
# - "db" - configs retrieved from the Conditions DB.
conditions_input = "ESSource"
# Input SQLite file. Used only if conditions_input is set to "local_sqlite".
input_sqlite = 'sqlite_file:alignment_config.db'
# Database tag. Used only if conditions_input_from_db is set to True.
db_tag = 'PPSAlignmentConfiguration_reference_test_v1_express'
###################################
import FWCore.ParameterSet.Config as cms
from input_files import input_files
process = cms.Process('referenceDistributions')
process.load('FWCore.MessageService.MessageLogger_cfi')
process.load("CalibPPS.AlignmentGlobal.ppsAlignmentWorker_cfi")
process.load("DQMServices.Core.DQMStore_cfi")
# Update the product labels for the worker inputs
process.ppsAlignmentWorker.tracksTags = cms.VInputTag(
cms.InputTag("ctppsLocalTrackLiteProducer"),
cms.InputTag("ctppsLocalTrackLiteProducerAlCaRecoProducer")
)
# Message Logger
if produce_logs:
process.MessageLogger = cms.Service("MessageLogger",
destinations = cms.untracked.vstring('run_distributions',
'cout'
),
run_distributions = cms.untracked.PSet(
threshold = cms.untracked.string("INFO")
),
cout = cms.untracked.PSet(
threshold = cms.untracked.string('WARNING')
)
)
else:
process.MessageLogger = cms.Service("MessageLogger",
destinations = cms.untracked.vstring('cout'),
cout = cms.untracked.PSet(
threshold = cms.untracked.string('WARNING')
)
)
# Source
process.source = cms.Source("PoolSource",
fileNames = input_files
)
process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(max_events))
# Event Setup
if conditions_input == 'ESSource':
from config_reference import ppsAlignmentConfigESSource
process.ppsAlignmentConfigESSource = ppsAlignmentConfigESSource
elif conditions_input == 'local_sqlite':
process.load("CondCore.CondDB.CondDB_cfi")
process.CondDB.connect = input_sqlite
process.PoolDBESSource = cms.ESSource("PoolDBESSource",
process.CondDB,
DumbStat = cms.untracked.bool(True),
toGet = cms.VPSet(cms.PSet(
record = cms.string('PPSAlignmentConfigurationRcd'),
tag = cms.string(db_tag)
))
)
elif conditions_input == 'db':
process.load("CondCore.CondDB.CondDB_cfi")
process.CondDB.connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS')
process.PoolDBESSource = cms.ESSource("PoolDBESSource",
process.CondDB,
toGet = cms.VPSet(cms.PSet(
record = cms.string('PPSAlignmentConfigurationRcd'),
tag = cms.string(db_tag)
))
)
else:
raise ValueError(conditions_input + ' is wrong conditions_input')
# load DQM framework
process.load("DQM.Integration.config.environment_cfi")
process.dqmEnv.subSystemFolder = "CalibPPS"
process.dqmSaver.path = ""
process.dqmSaver.tag = "CalibPPS"
# Worker config label (for ES product label)
process.ppsAlignmentWorker.label = cms.string("reference")
process.options.numberOfThreads = cms.untracked.uint32(8)
process.path = cms.Path(
process.ppsAlignmentWorker
)
process.end_path = cms.EndPath(
process.dqmSaver
)
process.schedule = cms.Schedule(
process.path,
process.end_path
)