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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
|
import FWCore.ParameterSet.Config as cms
process = cms.Process("Alignment")
process.load("Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi")
process.load("RecoTracker.FinalTrackSelectors.TrackerTrackHitFilter_cff")
process.load("RecoTracker.TrackProducer.TrackRefitters_cff")
process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff")
process.load('Configuration.Geometry.GeometryRecoDB_cff')
#Tracker
from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import *
#Muon
from Geometry.MuonNumbering.muonNumberingInitialization_cfi import *
from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import *
# Alignment
from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import *
from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import *
from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import *
process.load("Configuration.StandardSequences.MagneticField_cff")
# loading the alignment producer
process.load("Alignment.CommonAlignmentProducer.AlignmentProducer_cff")
# loading DB constants
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
process.GlobalTag.globaltag = "{FILL GT HERE}"
process.load("FWCore.MessageService.MessageLogger_cfi")
process.MessageLogger.cerr.FwkReport.reportEvery = 10000
# configure the database file - use survey one for default
from CondCore.CondDB.CondDB_cfi import *
process.GlobalTag.toGet = cms.VPSet(
# cms.PSet(record = cms.string('TrackerAlignmentRcd'),
# tag = cms.string('Alignments'),
# connect = cms.string('sqlite_file:/afs/cern.ch/work/u/usarica/scratch-dimuon3/CMSSW_8_0_20/src/Alignment/HIPAlignmentAlgorithm/hp30112016_all_v2/alignments_iter2.db')
# ),
#
# cms.PSet(record = cms.string('TrackerSurfaceDeformationRcd'),
# tag = cms.string('TrackerSurfaceDeformations_2015-EOY_v1_RunD'),
# connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS')
# ),
#
# cms.PSet(record = cms.string('TrackerAlignmentErrorExtendedRcd'),
# tag = cms.string('TrackerIdealGeometryErrorsExtended210_mc'),
# connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS')
# ),
#
# cms.PSet(record = cms.string('SiPixelTemplateDBObjectRcd'),
# tag = cms.string('SiPixelTemplateDBObject_phase1_38T_2018_v2'),
# connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS'),
# ),
)
process.AlignmentProducer.applyDbAlignment = True
process.AlignmentProducer.checkDbAlignmentValidity=False
process.AlignmentProducer.algoConfig.multiIOV=True
process.AlignmentProducer.algoConfig.IOVrange=cms.vuint32(<iovs>)
# TEC disk 1-9 in +z half : 470311204,470327588,470343972,470360388,470376772,470393156,470409572,470425956,470442372
# TEC disk 1-9 in -z half : 470049060,470065444,470081828,470098244,470114628,470131012,470147428,470163812,470180228
# angle cut : degrees-65,70,75,80 ; rads-1.134,1.222,1.309,1.396 ; sin-0.9,0.95,0.97,0.99
# angle cut : rad 1.33 1.35, 1.37
#process.AlignmentProducer.algoConfig.setScanDet = cms.vdouble(1,0,20) #detector ID (1=all det), start,step
process.AlignmentProducer.algoConfig.monitorConfig.fillTrackMonitoring = cms.bool(False)
process.AlignmentProducer.algoConfig.monitorConfig.fillTrackHitMonitoring = cms.bool(False)
# Apply reweighting
process.AlignmentProducer.algoConfig.UseReweighting=cms.bool(True) # Turned on for collectors to behave properly
process.AlignmentProducer.algoConfig.ReweightPerAlignable=cms.bool(True) # One needs to specify the DataType; otherwise everything will be multiplied by 1
process.AlignmentProducer.algoConfig.UniformEta=cms.bool(False) # Turned off, not needed in collection jobs
process.AlignmentProducer.algoConfig.Weight=cms.double(1)
# Apply surface deformations, determined through batchHippy
SurfDefFlag = <SURFDEFOPT>
# See Alignment/CommonAlignmentParametrization/src/AlignmentParametersFactory.cc::parametersType for the second string
process.AlignmentProducer.ParameterBuilder.parameterTypes = cms.vstring(
'SelectorRigid,RigidBody',
'SelectorBowed,BowedSurface',
'SelectorTwoBowed,TwoBowedSurfaces',
)
SelectorRigidAlignables = []
SelectorBowedAlignables = []
SelectorTwoBowedAlignables = []
### Set parameters to align (all modules in this example)
if SurfDefFlag:
SelectorBowedAlignables.extend([
# "TrackerP1PXBModule,111111 111",
# "TrackerP1PXECModule,110111 111",
# "TrackerTIBModuleUnit,111111 111",
# "TrackerTIDModuleUnit,100111 111",
# "TrackerTECModuleUnit,100111 111,tecSingleSens",
])
SelectorTwoBowedAlignables.extend([
# "TrackerTOBModuleUnit,100111 111 100111 111",
# "TrackerTECModuleUnit,100111 111 100111 111,tecDoubleSens",
])
SelectorRigidAlignables.extend([
# "TrackerP1PXBModule,111111",
# "TrackerP1PXBLadder,111111",
# "TrackerP1PXBLayer,111111",
# "TrackerP1PXBHalfBarrel,111111",
# "TrackerP1PXBBarrel,111111",
# "TrackerP1PXECModule,110111",
# "TrackerP1PXECPanel,111111",
# "TrackerP1PXECBlade,111111",
# "TrackerP1PXECHalfDisk,111111",
# "TrackerP1PXECHalfCylinder,111111",
# "TrackerP1PXECEndcap,111111",
# "TrackerTIBModuleUnit,101111",
# "TrackerTIBModule,111111",
# "TrackerTIBString,111111",
# "TrackerTIBSurface,111111",
# "TrackerTIBHalfShell,111111",
# "TrackerTIBLayer,111111",
# "TrackerTIBHalfBarrel,111111",
# "TrackerTIBBarrel,111111",
# "TrackerTIDModuleUnit,100111",
# "TrackerTIDModule,100111",
# "TrackerTIDSide,111111",
# "TrackerTIDRing,111111",
# "TrackerTIDDisk,111111",
# "TrackerTIDEndcap,111111",
# "TrackerTOBModuleUnit,100111",
# "TrackerTOBModule,100111",
# "TrackerTOBRod,111111",
# "TrackerTOBLayer,111111",
# "TrackerTOBHalfBarrel,111111",
# "TrackerTOBBarrel,111111",
# "TrackerTECModuleUnit,100111",
# "TrackerTECModule,100111",
# "TrackerTECRing,111111",
# "TrackerTECPetal,111111",
# "TrackerTECSide,111111",
# "TrackerTECDisk,110111",
# "TrackerTECEndcap,001000",
# "TIDDets,001000,endCapDS",
# "TIDDets,001000,endCapSS",
# "TECDets,111111,endCapDS",
# "TECDets,111111,endCapSS",
# "TECDets,111111,TECRing1",
# "TECDets,111111,TECRing2",
# "TECDets,111111,TECRing3",
# "TECDets,111111,TECRing4",
# "TECDets,111111,TECRing5",
# "TECDets,111111,TECRing6",
# "TECDets,111111,TECRing7",
])
# Filter SelectorRigidAlignables
SelectorNonRigidAlignables = SelectorBowedAlignables+SelectorTwoBowedAlignables
tmprigidalignables=[]
for sra in SelectorRigidAlignables:
tmpstrsra = sra.split(',')[0]
tmpstrsrafound=False
for snra in SelectorNonRigidAlignables:
tmpstrsnra = snra.split(',')[0]
tmpstrsrafound = (tmpstrsra == tmpstrsnra)
if tmpstrsrafound:
break
if not tmpstrsrafound:
tmprigidalignables.append(sra)
else:
print("{} is already in the non-rigid alignables list. Omitting it in the rigid structures to align.".format(tmpstrsra))
SelectorRigidAlignables = tmprigidalignables
process.AlignmentProducer.ParameterBuilder.SelectorBowed = cms.PSet(
alignParams = cms.vstring(SelectorBowedAlignables),
tecSingleSens = cms.PSet(
tecDetId = cms.PSet(
ringRanges = cms.vint32(1,4)
)
),
)
process.AlignmentProducer.ParameterBuilder.SelectorTwoBowed = cms.PSet(
alignParams = cms.vstring(SelectorTwoBowedAlignables),
tecDoubleSens = cms.PSet(
tecDetId = cms.PSet(
ringRanges = cms.vint32(5,7)
)
),
)
process.AlignmentProducer.ParameterBuilder.SelectorRigid = cms.PSet(
alignParams = cms.vstring(SelectorRigidAlignables),
endCapSS = cms.PSet(
phiRanges = cms.vdouble(),
rRanges = cms.vdouble(40.0, 60.0, 75.0, 999.0),
etaRanges = cms.vdouble(),
yRanges = cms.vdouble(),
xRanges = cms.vdouble(),
zRanges = cms.vdouble()
),
endCapDS = cms.PSet(
phiRanges = cms.vdouble(),
rRanges = cms.vdouble(0.0, 40.0, 60.0, 75.0),
etaRanges = cms.vdouble(),
yRanges = cms.vdouble(),
xRanges = cms.vdouble(),
zRanges = cms.vdouble()
),
TECRing1 = cms.PSet(
phiRanges = cms.vdouble(),
rRanges = cms.vdouble(20,30),
etaRanges = cms.vdouble(),
yRanges = cms.vdouble(),
xRanges = cms.vdouble(),
zRanges = cms.vdouble()
),
TECRing2 = cms.PSet(
phiRanges = cms.vdouble(),
rRanges = cms.vdouble(30,40),
etaRanges = cms.vdouble(),
yRanges = cms.vdouble(),
xRanges = cms.vdouble(),
zRanges = cms.vdouble()
),
TECRing3 = cms.PSet(
phiRanges = cms.vdouble(),
rRanges = cms.vdouble(40,50),
etaRanges = cms.vdouble(),
yRanges = cms.vdouble(),
xRanges = cms.vdouble(),
zRanges = cms.vdouble()
),
TECRing4 = cms.PSet(
phiRanges = cms.vdouble(),
rRanges = cms.vdouble(50,60),
etaRanges = cms.vdouble(),
yRanges = cms.vdouble(),
xRanges = cms.vdouble(),
zRanges = cms.vdouble()
),
TECRing5 = cms.PSet(
phiRanges = cms.vdouble(),
rRanges = cms.vdouble(65,75),
etaRanges = cms.vdouble(),
yRanges = cms.vdouble(),
xRanges = cms.vdouble(),
zRanges = cms.vdouble()
),
TECRing6 = cms.PSet(
phiRanges = cms.vdouble(),
rRanges = cms.vdouble(80,90),
etaRanges = cms.vdouble(),
yRanges = cms.vdouble(),
xRanges = cms.vdouble(),
zRanges = cms.vdouble()
),
TECRing7 = cms.PSet(
phiRanges = cms.vdouble(),
rRanges = cms.vdouble(95,105),
etaRanges = cms.vdouble(),
yRanges = cms.vdouble(),
xRanges = cms.vdouble(),
zRanges = cms.vdouble()
),
TOBscan = cms.PSet(
phiRanges = cms.vdouble(),
rRanges = cms.vdouble(82,90),
etaRanges = cms.vdouble(),
yRanges = cms.vdouble(),
xRanges = cms.vdouble(),
zRanges = cms.vdouble(90,110)
),
)
process.AlignmentProducer.algoConfig.maxRelParameterError=-1.
process.AlignmentProducer.algoConfig.maxAllowedHitPull=-1.
process.AlignmentProducer.algoConfig.minimumNumberOfHits=100
process.AlignmentProducer.algoConfig.applyCutsPerComponent = cms.bool(False) # Overrides settings above for the specified detectors
process.AlignmentProducer.algoConfig.cutsPerComponent = cms.VPSet(
cms.PSet(
Selector = process.AlignmentProducer.ParameterBuilder.SelectorRigid,
minRelParError = cms.double(0),
maxRelParError = cms.double(-1), # -1 for no cut
minNHits = cms.int32(30),
maxHitPull = cms.double(-1), # -1 for no cut
applyPixelProbCut = cms.bool(False),
usePixelProbXYOrProbQ = cms.bool(False),
minPixelProbXY = cms.double(0),
maxPixelProbXY = cms.double(1),
minPixelProbQ = cms.double(0),
maxPixelProbQ = cms.double(1),
),
cms.PSet(
Selector = process.AlignmentProducer.ParameterBuilder.SelectorBowed,
minRelParError = cms.double(0),
maxRelParError = cms.double(-1), # -1 for no cut
minNHits = cms.int32(30),
maxHitPull = cms.double(-1), # -1 for no cut
applyPixelProbCut = cms.bool(False),
usePixelProbXYOrProbQ = cms.bool(False),
minPixelProbXY = cms.double(0),
maxPixelProbXY = cms.double(1),
minPixelProbQ = cms.double(0),
maxPixelProbQ = cms.double(1),
),
cms.PSet(
Selector = process.AlignmentProducer.ParameterBuilder.SelectorTwoBowed,
minRelParError = cms.double(0),
maxRelParError = cms.double(-1), # -1 for no cut
minNHits = cms.int32(30),
maxHitPull = cms.double(-1), # -1 for no cut
applyPixelProbCut = cms.bool(False),
usePixelProbXYOrProbQ = cms.bool(False),
minPixelProbXY = cms.double(0),
maxPixelProbXY = cms.double(1),
minPixelProbQ = cms.double(0),
maxPixelProbQ = cms.double(1),
),
)
|