1 |
|
import FWCore.ParameterSet.Config as cms |
2 |
|
|
3 |
+ |
# IPHC variable for specifying geometry alignment scenario : |
4 |
+ |
# 1 -> STARTUP |
5 |
+ |
# 2 -> IDEAL |
6 |
+ |
# 3 -> SAGITTA |
7 |
+ |
# 4 -> TWIST |
8 |
+ |
IPHC_GEOM=2 |
9 |
+ |
|
10 |
|
process = cms.Process("Demo") |
11 |
|
|
12 |
|
process.load("FWCore.MessageService.MessageLogger_cfi") |
22 |
|
process.load( "Configuration.StandardSequences.FrontierConditions_GlobalTag_cff" ) |
23 |
|
process.GlobalTag.globaltag = "START44_V7::All" |
24 |
|
|
18 |
– |
# process.GlobalTag.toGet = cms.VPSet( |
19 |
– |
# cms.PSet( record = cms.string( "TrackerAlignmentRcd" ), |
20 |
– |
# tag = cms.string( "TrackerIdealGeometry210_mc" ), |
21 |
– |
# connect = cms.untracked.string( "frontier://FrontierProd/CMS_COND_31X_FROM21X" ) ), |
22 |
– |
# cms.PSet( record = cms.string( "TrackerAlignmentErrorRcd" ), |
23 |
– |
# tag = cms.string( "TrackerIdealGeometryErrors210_mc" ), |
24 |
– |
# connect = cms.untracked.string( "frontier://FrontierProd/CMS_COND_31X_FROM21X" ) ) |
25 |
– |
# ) |
25 |
|
|
26 |
|
process.source = cms.Source( "PoolSource", |
27 |
|
fileNames = cms.untracked.vstring( |
45 |
|
# ------------------------------------------------------------------------------ |
46 |
|
# 0) Change geometry |
47 |
|
# ------------------------------------------------------------------------------ |
48 |
< |
#from CondCore.DBCommon.CondDBSetup_cfi import * |
49 |
< |
#process.trackerAlignment = cms.ESSource("PoolDBESSource", |
50 |
< |
# CondDBSetup, |
51 |
< |
# timetype = cms.string('runnumber'), |
52 |
< |
# toGet = cms.VPSet( cms.PSet( |
53 |
< |
# record = cms.string('TrackerAlignmentRcd'), |
54 |
< |
# tag = cms.string('Alignments') )), |
55 |
< |
# connect = |
56 |
< |
#cms.string('sqlite_file:/afs/cern.ch/cms/CAF/CMSALCA/ALCA_TRACKERALIGN/PayLoads/SystematicMisalignmentsMoriond/mcScenarioMoriond/misalignment_on_ideal39X/IDEALplusDelta_ichepVrealignedTwist.db') |
57 |
< |
#cms.string('sqlite_file:/afs/cern.ch/cms/CAF/CMSALCA/ALCA_TRACKERALIGN/PayLoads/SystematicMisalignmentsMoriond/mcScenarioMoriond/misalignment_on_ideal39X/IDEALplusDelta_ichepVrealignedSagitta.db') |
58 |
< |
|
59 |
< |
# ) |
48 |
> |
if IPHC_GEOM==1: |
49 |
> |
print "\x1b[31mIPHC config : STARTUP geometry !!!\x1b[0m" |
50 |
> |
pass |
51 |
> |
elif IPHC_GEOM==2: |
52 |
> |
print "\x1b[31mIPHC config : IDEAL geometry !!!\x1b[0m" |
53 |
> |
process.GlobalTag.toGet = cms.VPSet( |
54 |
> |
cms.PSet( record = cms.string( "TrackerAlignmentRcd" ), |
55 |
> |
tag = cms.string( "TrackerIdealGeometry210_mc" ), |
56 |
> |
connect = cms.untracked.string( "frontier://FrontierProd/CMS_COND_31X_FROM21X" ) ), |
57 |
> |
cms.PSet( record = cms.string( "TrackerAlignmentErrorRcd" ), |
58 |
> |
tag = cms.string( "TrackerIdealGeometryErrors210_mc" ), |
59 |
> |
connect = cms.untracked.string( "frontier://FrontierProd/CMS_COND_31X_FROM21X" ) ) |
60 |
> |
) |
61 |
> |
elif IPHC_GEOM==3 or IPHC_GEOM==4: |
62 |
> |
if IPHC_GEOM==4: |
63 |
> |
print "\x1b[31mIPHC config : TWIST geometry !!!\x1b[0m" |
64 |
> |
IPHC_STRING = 'sqlite_file:/afs/cern.ch/cms/CAF/CMSALCA/ALCA_TRACKERALIGN/PayLoads/SystematicMisalignmentsMoriond/mcScenarioMoriond/misalignment_on_ideal39X/IDEALplusDelta_ichepVrealignedTwist.db' |
65 |
> |
elif IPHC_GEOM==3: |
66 |
> |
print "\x1b[31mIPHC config : SAGITTA geometry !!!\x1b[0m" |
67 |
> |
IPHC_STRING = 'sqlite_file:/afs/cern.ch/cms/CAF/CMSALCA/ALCA_TRACKERALIGN/PayLoads/SystematicMisalignmentsMoriond/mcScenarioMoriond/misalignment_on_ideal39X/IDEALplusDelta_ichepVrealignedSagitta.db' |
68 |
> |
|
69 |
> |
|
70 |
> |
from CondCore.DBCommon.CondDBSetup_cfi import * |
71 |
> |
process.trackerAlignment = cms.ESSource("PoolDBESSource", |
72 |
> |
CondDBSetup, |
73 |
> |
timetype = cms.string('runnumber'), |
74 |
> |
toGet = cms.VPSet( cms.PSet( |
75 |
> |
record = cms.string('TrackerAlignmentRcd'), |
76 |
> |
tag = cms.string('Alignments') )), |
77 |
> |
connect = cms.string(IPHC_STRING) |
78 |
> |
) |
79 |
|
|
80 |
< |
#process.es_prefer_trackerAlignment = cms.ESPrefer("PoolDBESSource","trackerAlignment") |
80 |
> |
process.es_prefer_trackerAlignment = cms.ESPrefer("PoolDBESSource","trackerAlignment") |
81 |
> |
|
82 |
> |
else: |
83 |
> |
print "\x1b[31mIPHC config : UNKNOWN geometry !!!\x1b[0m" |
84 |
> |
exit |
85 |
> |
|
86 |
|
|
87 |
|
|
88 |
|
# ------------------------------------------------------------------------------ |
102 |
|
# 2) Constructs transient tracks and trajectories from persistent tracks |
103 |
|
# ------------------------------------------------------------------------------ |
104 |
|
from RecoTracker.TrackProducer.TrackRefitter_cfi import TrackRefitter |
105 |
< |
process.Refitter = TrackRefitter.clone( |
105 |
> |
process.GeomRefitter = TrackRefitter.clone( |
106 |
|
src = "AlignmentTrackSelector", |
107 |
|
TrajectoryInEvent = True ) |
108 |
|
|
122 |
|
# A-4) Refitter tracks without constraint |
123 |
|
# ------------------------------------------------------------------------------ |
124 |
|
process.TrackRefitterWithoutConstraint = TrackRefitter.clone( |
125 |
< |
src = "AlignmentTrackSelector", |
125 |
> |
src = "GeomRefitter", |
126 |
|
Fitter = cms.string('TwoBodyDecayTrackFitter')) |
127 |
|
|
128 |
|
# ------------------------------------------------------------------------------ |
129 |
|
# A-5) Fill Tree with refit tracks (without constraint) |
130 |
|
# ------------------------------------------------------------------------------ |
131 |
< |
process.treeproducer1 = cms.EDAnalyzer('AlignmentTree', |
131 |
> |
process.treeWithoutConstraints = cms.EDAnalyzer('AlignmentTree', |
132 |
|
trackLabel = cms.InputTag('TrackRefitterWithoutConstraint'), |
133 |
|
tkTraj = cms.InputTag('TrackRefitterWithoutConstraint'), |
134 |
|
labelTrajToTrack = cms.InputTag('TrackRefitterWithoutConstraint'), |
136 |
|
primaryVertexColl= cms.InputTag('offlinePrimaryVertices'), |
137 |
|
isLaserRun = cms.bool(False), |
138 |
|
isMC = cms.bool(True), |
139 |
< |
algoName = cms.string("NoAlgo") |
139 |
> |
algoName = cms.string("NoAlgo"), |
140 |
> |
trkVertexconstrcoll = cms.InputTag(''), |
141 |
> |
trkMomconstrcoll = cms.InputTag(''), |
142 |
> |
trkFullconstrcoll = cms.InputTag('') |
143 |
|
) |
144 |
|
|
145 |
|
# ------------------------------------------------------------------------------ |
146 |
|
# B-4) Producer for full TwoBodyDecay constraint |
147 |
|
# ------------------------------------------------------------------------------ |
148 |
|
process.load("RecoTracker.TrackProducer.TwoBodyDecayConstraintProducer_cff") |
149 |
< |
#process.TwoBodyDecayConstraint.chi2Cut = 100 |
149 |
> |
process.TwoBodyDecayConstraint.src = "GeomRefitter" |
150 |
> |
process.TwoBodyDecayConstraint.chi2Cut = 10 |
151 |
> |
|
152 |
> |
|
153 |
|
|
154 |
|
# ------------------------------------------------------------------------------ |
155 |
|
# B-5) Refitter using the full TwoBodyDecay constraint |
156 |
|
# ------------------------------------------------------------------------------ |
157 |
|
process.TrackRefitterTBDFullConstraint = TrackRefitter.clone( |
158 |
< |
src = "AlignmentTrackSelector", |
158 |
> |
src = "GeomRefitter", |
159 |
|
srcConstr = "TwoBodyDecayConstraint", |
160 |
|
Fitter = cms.string('TwoBodyDecayTrackFitter'), |
161 |
|
constraint = "trackParameters", |
164 |
|
# ------------------------------------------------------------------------------ |
165 |
|
# B-6) Fill Tree with full TBD constraint |
166 |
|
# ------------------------------------------------------------------------------ |
167 |
< |
process.treeproducer2 = cms.EDAnalyzer('AlignmentTree', |
167 |
> |
process.treeTBDFullConstraints = cms.EDAnalyzer('AlignmentTree', |
168 |
|
trackLabel = cms.InputTag('TrackRefitterTBDFullConstraint'), |
169 |
|
tkTraj = cms.InputTag('TrackRefitterTBDFullConstraint'), |
170 |
|
labelTrajToTrack = cms.InputTag('TrackRefitterTBDFullConstraint'), |
172 |
|
primaryVertexColl= cms.InputTag('offlinePrimaryVertices'), |
173 |
|
isLaserRun = cms.bool(False), |
174 |
|
isMC = cms.bool(True), |
175 |
< |
algoName = cms.string("FullTBD") |
175 |
> |
algoName = cms.string("FullTBD"), |
176 |
> |
trkVertexconstrcoll = cms.InputTag('TwoBodyDecayConstraint'), |
177 |
> |
trkMomconstrcoll = cms.InputTag('TwoBodyDecayConstraint'), |
178 |
> |
trkFullconstrcoll = cms.InputTag('TwoBodyDecayConstraint') |
179 |
|
) |
180 |
|
|
181 |
|
# ------------------------------------------------------------------------------ |
183 |
|
# ------------------------------------------------------------------------------ |
184 |
|
process.load("RecoTracker.TrackProducer.TwoBodyDecayMomConstraintProducer_cff") |
185 |
|
process.TwoBodyDecayMomConstraint.isMC = True |
186 |
< |
#process.TwoBodyDecayMomConstraint.chi2Cut = 100 |
186 |
> |
process.TwoBodyDecayMomConstraint.src = "GeomRefitter" |
187 |
> |
process.TwoBodyDecayMomConstraint.chi2Cut = 10 |
188 |
|
|
189 |
|
# ------------------------------------------------------------------------------ |
190 |
|
# C-5) Refit the tracks with momentum constraint |
191 |
|
# ------------------------------------------------------------------------------ |
192 |
|
process.TrackRefitterTBDMomConstraint = TrackRefitter.clone( |
193 |
< |
src = "AlignmentTrackSelector", |
193 |
> |
src = "GeomRefitter", |
194 |
|
srcConstr = "TwoBodyDecayMomConstraint", |
195 |
|
Fitter = cms.string('TwoBodyDecayTrackFitter'), |
196 |
|
constraint = "momentum", |
199 |
|
# ------------------------------------------------------------------------------ |
200 |
|
# C-6) Fill Tree with mom TBD constraint |
201 |
|
# ------------------------------------------------------------------------------ |
202 |
< |
process.treeproducer3 = cms.EDAnalyzer('AlignmentTree', |
202 |
> |
process.treeTBDMomConstraints = cms.EDAnalyzer('AlignmentTree', |
203 |
|
trackLabel = cms.InputTag('TrackRefitterTBDMomConstraint'), |
204 |
|
tkTraj = cms.InputTag('TrackRefitterTBDMomConstraint'), |
205 |
|
labelTrajToTrack = cms.InputTag('TrackRefitterTBDMomConstraint'), |
207 |
|
primaryVertexColl= cms.InputTag('offlinePrimaryVertices'), |
208 |
|
isLaserRun = cms.bool(False), |
209 |
|
isMC = cms.bool(True), |
210 |
< |
algoName = cms.string("MomTBD") |
210 |
> |
algoName = cms.string("MomTBD"), |
211 |
> |
trkVertexconstrcoll = cms.InputTag('TwoBodyDecayMomConstraint'), |
212 |
> |
trkMomconstrcoll = cms.InputTag('TwoBodyDecayMomConstraint'), |
213 |
> |
trkFullconstrcoll = cms.InputTag('TwoBodyDecayMomConstraint') |
214 |
|
) |
215 |
|
|
216 |
|
# ------------------------------------------------------------------------------ |
218 |
|
# ------------------------------------------------------------------------------ |
219 |
|
process.doConstraintKinFit = cms.EDProducer('ZmassConstraintsProd', |
220 |
|
isMC = cms.bool(True), |
221 |
< |
trackLabel = cms.InputTag('AlignmentTrackSelector') |
221 |
> |
trackLabel = cms.InputTag('GeomRefitter') |
222 |
|
) |
223 |
|
|
224 |
|
# ------------------------------------------------------------------------------ |
225 |
|
# D-5) Refitter for KinFit |
226 |
|
# ------------------------------------------------------------------------------ |
227 |
|
process.TrackRefitterKinFit = TrackRefitter.clone( |
228 |
< |
src = "AlignmentTrackSelector", |
228 |
> |
src = "GeomRefitter", |
229 |
|
srcConstr = "doConstraintKinFit", |
230 |
|
Fitter = cms.string('TwoBodyDecayTrackFitter'), |
231 |
|
constraint = "momentum", |
234 |
|
# ------------------------------------------------------------------------------ |
235 |
|
# D-6) Fill Tree with KinFit constraint |
236 |
|
# ------------------------------------------------------------------------------ |
237 |
< |
process.treeproducer4 = cms.EDAnalyzer('AlignmentTree', |
237 |
> |
process.treeKinFitConstraints = cms.EDAnalyzer('AlignmentTree', |
238 |
|
trackLabel = cms.InputTag('TrackRefitterKinFit'), |
239 |
|
tkTraj = cms.InputTag('TrackRefitterKinFit'), |
240 |
|
labelTrajToTrack = cms.InputTag('TrackRefitterKinFit'), |
242 |
|
primaryVertexColl= cms.InputTag('offlinePrimaryVertices'), |
243 |
|
isLaserRun = cms.bool(False), |
244 |
|
isMC = cms.bool(True), |
245 |
< |
algoName = cms.string("KinFit") |
245 |
> |
algoName = cms.string("KinFit"), |
246 |
> |
trkVertexconstrcoll = cms.InputTag(''), |
247 |
> |
trkMomconstrcoll = cms.InputTag(''), |
248 |
> |
trkFullconstrcoll = cms.InputTag('') |
249 |
|
) |
250 |
|
|
251 |
|
# ------------------------------------------------------------------------------ |
252 |
< |
# E-4) Producer for TwoBodyDecay vertex constraint |
252 |
> |
# E-4) Producer for TwoBodyDecay vertex constraints |
253 |
|
# ------------------------------------------------------------------------------ |
254 |
|
process.load("RecoTracker.TrackProducer.TwoBodyDecayVertexConstraintProducer_cff") |
255 |
|
process.TwoBodyDecayVertexConstraint.isMC = True |
256 |
< |
#process.TwoBodyDecayVertexConstraint.chi2Cut = 100 |
256 |
> |
process.TwoBodyDecayVertexConstraint.src = "GeomRefitter" |
257 |
> |
process.TwoBodyDecayVertexConstraint.chi2Cut = 10 |
258 |
|
|
259 |
|
# ------------------------------------------------------------------------------ |
260 |
< |
# E-5) Producer for TwoBodyDecay vertex constraint |
260 |
> |
# E-5) Track refitter with vertex constraints |
261 |
|
# ------------------------------------------------------------------------------ |
262 |
|
process.TrackRefitterTBDVertexConstraint = TrackRefitter.clone( |
263 |
< |
src = "AlignmentTrackSelector", |
263 |
> |
src = "GeomRefitter", |
264 |
|
srcConstr = "TwoBodyDecayVertexConstraint", |
265 |
|
Fitter = cms.string('TwoBodyDecayTrackFitter'), |
266 |
|
constraint = "vertex", |
269 |
|
# ------------------------------------------------------------------------------ |
270 |
|
# E-6) Fill Tree with vertex TBD constraint |
271 |
|
# ------------------------------------------------------------------------------ |
272 |
< |
process.treeproducer5 = cms.EDAnalyzer('AlignmentTree', |
272 |
> |
process.treeTBDVertexConstraints = cms.EDAnalyzer('AlignmentTree', |
273 |
|
trackLabel = cms.InputTag('TrackRefitterTBDVertexConstraint'), |
274 |
|
tkTraj = cms.InputTag('TrackRefitterTBDVertexConstraint'), |
275 |
|
labelTrajToTrack = cms.InputTag('TrackRefitterTBDVertexConstraint'), |
277 |
|
primaryVertexColl= cms.InputTag('offlinePrimaryVertices'), |
278 |
|
isLaserRun = cms.bool(False), |
279 |
|
isMC = cms.bool(True), |
280 |
< |
algoName = cms.string("VtxTBD") |
280 |
> |
algoName = cms.string("VtxTBD"), |
281 |
> |
trkVertexconstrcoll = cms.InputTag('TwoBodyDecayVertexConstraint'), |
282 |
> |
trkMomconstrcoll = cms.InputTag('TwoBodyDecayVertexConstraint'), |
283 |
> |
trkFullconstrcoll = cms.InputTag('TwoBodyDecayVertexConstraint') |
284 |
|
) |
285 |
|
|
286 |
|
|
289 |
|
|
290 |
|
|
291 |
|
process.p = cms.Path( process.AlignmentTrackSelector * |
292 |
< |
process.Refitter * |
292 |
> |
process.GeomRefitter * |
293 |
|
process.TrackRefitterWithoutConstraint * |
294 |
< |
process.treeproducer1 * |
294 |
> |
process.treeWithoutConstraints * |
295 |
|
process.TwoBodyDecayConstraint * |
296 |
|
process.TrackRefitterTBDFullConstraint * |
297 |
< |
process.treeproducer2 * |
297 |
> |
process.treeTBDFullConstraints * |
298 |
|
process.TwoBodyDecayMomConstraint * |
299 |
|
process.TrackRefitterTBDMomConstraint * |
300 |
< |
process.treeproducer3 * |
300 |
> |
process.treeTBDMomConstraints * |
301 |
|
process.doConstraintKinFit * |
302 |
|
process.TrackRefitterKinFit * |
303 |
< |
process.treeproducer4* |
303 |
> |
process.treeKinFitConstraints* |
304 |
|
process.TwoBodyDecayVertexConstraint * |
305 |
|
process.TrackRefitterTBDVertexConstraint * |
306 |
< |
process.treeproducer5) |
306 |
> |
process.treeTBDVertexConstraints) |
307 |
|
|
308 |
|
process.outpath = cms.EndPath(process.out) |
309 |
+ |
|
310 |
+ |
|
311 |
+ |
|