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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
import socket
import FWCore.ParameterSet.Config as cms
import FWCore.ParameterSet.VarParsing as VarParsing
from CondCore.CondDB.CondDB_cfi import *
options = VarParsing.VarParsing()
options.register( 'runNumber'
, 1 #default value
, VarParsing.VarParsing.multiplicity.singleton
, VarParsing.VarParsing.varType.int
, "Run number to be uploaded."
)
options.register( 'destinationConnection'
, 'sqlite_file:EBAlignment_PopCon_test.db' #default value
, VarParsing.VarParsing.multiplicity.singleton
, VarParsing.VarParsing.varType.string
, "Connection string to the DB where payloads will be possibly written."
)
options.register( 'targetConnection'
, '' #default value
, VarParsing.VarParsing.multiplicity.singleton
, VarParsing.VarParsing.varType.string
, """Connection string to the target DB:
if not empty (default), this provides the latest IOV and payloads to compare;
it is the DB where payloads should be finally uploaded."""
)
options.register( 'sourceConnection'
, '' #default value
, VarParsing.VarParsing.multiplicity.singleton
, VarParsing.VarParsing.varType.string
, """Connection string to the DB hosting tags for RunInfo and EBAlignment.
It defaults to the same as the target connection, i.e. empty.
If target connection is also empty, it is set to be the same as destination connection."""
)
options.register( 'tag'
, 'EBAlignment_PopCon_test_express'
, VarParsing.VarParsing.multiplicity.singleton
, VarParsing.VarParsing.varType.string
, "Tag written in destinationConnection and finally appended in targetConnection."
)
options.register( 'tagForRunInfo'
, 'runInfo_31X_hlt'
, VarParsing.VarParsing.multiplicity.singleton
, VarParsing.VarParsing.varType.string
, "Tag used to retrieve the RunInfo payload and the magnet current therein."
)
options.register( 'tagForBOff'
, 'EBAlignment_express_0T'
, VarParsing.VarParsing.multiplicity.singleton
, VarParsing.VarParsing.varType.string
, "Tag used to retrieve the EBAlignment payload for magnet off."
)
options.register( 'tagForBOn'
, 'EBAlignment_express_3.8T'
, VarParsing.VarParsing.multiplicity.singleton
, VarParsing.VarParsing.varType.string
, "Tag used to retrieve the EBAlignment payload for magnet on."
)
options.register( 'currentThreshold'
, 7000.
, VarParsing.VarParsing.multiplicity.singleton
, VarParsing.VarParsing.varType.float
, "The threshold on the magnet current for considering a switch of the magnetic field."
)
options.register( 'messageLevel'
, 0 #default value
, VarParsing.VarParsing.multiplicity.singleton
, VarParsing.VarParsing.varType.int
, "Message level; default to 0"
)
options.parseArguments()
if not options.sourceConnection:
if options.targetConnection:
options.sourceConnection = options.targetConnection
else:
options.sourceConnection = options.destinationConnection
CondDBConnection = CondDB.clone( connect = cms.string( options.destinationConnection ) )
CondDBConnection.DBParameters.messageLevel = cms.untracked.int32( options.messageLevel )
PopConConnection = CondDB.clone( connect = cms.string( options.sourceConnection ) )
PopConConnection.DBParameters.messageLevel = cms.untracked.int32( options.messageLevel )
process = cms.Process( "EBAlignmentPopulator" )
process.MessageLogger = cms.Service( "MessageLogger"
, destinations = cms.untracked.vstring( 'cout' )
, cout = cms.untracked.PSet( threshold = cms.untracked.string( 'INFO' ) )
)
if options.messageLevel == 3:
#enable LogDebug output: remember the USER_CXXFLAGS="-DEDM_ML_DEBUG" compilation flag!
process.MessageLogger.cout = cms.untracked.PSet( threshold = cms.untracked.string( 'DEBUG' ) )
process.MessageLogger.debugModules = cms.untracked.vstring( '*' )
process.source = cms.Source( "EmptyIOVSource"
, lastValue = cms.uint64( options.runNumber )
, timetype = cms.string( 'runnumber' )
, firstValue = cms.uint64( options.runNumber )
, interval = cms.uint64( 1 )
)
process.PoolDBOutputService = cms.Service( "PoolDBOutputService"
, CondDBConnection
, timetype = cms.untracked.string( 'runnumber' )
, toPut = cms.VPSet( cms.PSet( record = cms.string( 'EBAlignmentRcd' )
, tag = cms.string( options.tag )
)
)
)
process.popConEBAlignment = cms.EDAnalyzer( "EcalAlignmentPopConBTransitionAnalyzer"
, SinceAppendMode = cms.bool( True )
, record = cms.string( 'EBAlignmentRcd' )
, Source = cms.PSet( BTransition = cms.PSet( PopConConnection
, runNumber = cms.uint64( options.runNumber )
, tagForRunInfo = cms.string( options.tagForRunInfo )
, tagForBOff = cms.string( options.tagForBOff )
, tagForBOn = cms.string( options.tagForBOn )
, currentThreshold = cms.untracked.double( options.currentThreshold )
)
)
, loggingOn = cms.untracked.bool( True )
, targetDBConnectionString = cms.untracked.string( options.targetConnection )
)
process.p = cms.Path( process.popConEBAlignment )
|