CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
alternateValidationTemplates.py
Go to the documentation of this file.
1 ######################################################################
2 ######################################################################
3 otherTemplate = """
4 schum schum
5 """
6 
7 
8 ######################################################################
9 ######################################################################
10 yResidualsOfflineValidation="""
11 import FWCore.ParameterSet.Config as cms
12 
13 process = cms.Process("OfflineValidator")
14 
15 process.load("Alignment.OfflineValidation..oO[dataset]Oo._cff")
16 
17 process.source.inputCommands = cms.untracked.vstring('keep *', 'drop *_MEtoEDMConverter_*_*') # hack to get rid of the memory consumption problem in 2_2_X and beond
18 process.options = cms.untracked.PSet(
19  wantSummary = cms.untracked.bool(False),
20  Rethrow = cms.untracked.vstring("ProductNotFound"), # make this exception fatal
21  fileMode = cms.untracked.string('NOMERGE') # no ordering needed, but calls endRun/beginRun etc. at file boundaries
22 )
23 
24  ##
25  ## Maximum number of Events
26  ##
27 process.maxEvents = cms.untracked.PSet(
28  input = cms.untracked.int32(.oO[nEvents]Oo.)
29  )
30 
31  ##
32  ## Messages & Convenience
33  ##
34 process.load("FWCore.MessageLogger.MessageLogger_cfi")
35 process.MessageLogger = cms.Service("MessageLogger",
36  destinations = cms.untracked.vstring('LOGFILE_Offline_.oO[name]Oo.',
37  'cout')
38 )
39 
40  ## report only every 100th record
41  ##process.MessageLogger.cerr.FwkReport.reportEvery = 100
42 
43 
44  ##
45  ## Alignment Track Selection
46  ##
47 process.load("Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi")
48 process.AlignmentTrackSelector.src = 'TrackRefitter1'
49 process.AlignmentTrackSelector.filter = True
50 process.AlignmentTrackSelector.applyBasicCuts = True
51 process.AlignmentTrackSelector.pMin = 4.
52 process.AlignmentTrackSelector.pMax = 9999.
53 process.AlignmentTrackSelector.ptMin = 0.
54 process.AlignmentTrackSelector.ptMax = 9999.
55 process.AlignmentTrackSelector.etaMin = -999.
56 process.AlignmentTrackSelector.etaMax = 999.
57 process.AlignmentTrackSelector.nHitMin = 8
58 process.AlignmentTrackSelector.nHitMin2D = 2
59 process.AlignmentTrackSelector.chi2nMax = 999.
60 process.AlignmentTrackSelector.applyMultiplicityFilter = False
61 process.AlignmentTrackSelector.maxMultiplicity = 1
62 process.AlignmentTrackSelector.applyNHighestPt = False
63 process.AlignmentTrackSelector.nHighestPt = 1
64 process.AlignmentTrackSelector.seedOnlyFrom = 0
65 process.AlignmentTrackSelector.applyIsolationCut = False
66 process.AlignmentTrackSelector.minHitIsolation = 0.8
67 process.AlignmentTrackSelector.applyChargeCheck = False
68 process.AlignmentTrackSelector.minHitChargeStrip = 50.
69 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
70 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
71 
72 #### new FILTER
73 #-- new track hit filter
74 # TrackerTrackHitFilter takes as input the tracks/trajectories coming out from TrackRefitter1
75 process.load("RecoTracker.FinalTrackSelectors.TrackerTrackHitFilter_cff")
76 process.TrackerTrackHitFilter.src = 'TrackRefitter1'
77 process.TrackerTrackHitFilter.useTrajectories= True # this is needed only if you require some selections; but it will work even if you don't ask for them
78 process.TrackerTrackHitFilter.minimumHits = 8
79 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
80 process.TrackerTrackHitFilter.detsToIgnore = [
81  # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
82  # TIB / TID
83  369136710, 369136714, 402668822,
84  # TOB
85  436310989, 436310990, 436299301, 436299302,
86  # TEC
87  470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
88 ]
89 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
90 process.TrackerTrackHitFilter.stripAllInvalidHits = False
91 process.TrackerTrackHitFilter.rejectBadStoNHits = True
92 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 14.0")
93 process.TrackerTrackHitFilter.rejectLowAngleHits= True
94 process.TrackerTrackHitFilter.TrackAngleCut= 0.35 # in rads, starting from the module surface
95 process.TrackerTrackHitFilter.usePixelQualityFlag= True
96 
97 #now we give the TrackCandidate coming out of the TrackerTrackHitFilter to the track producer
98 import RecoTracker.TrackProducer.CosmicFinalFitWithMaterialP5_cff
99 process.HitFilteredTracks = RecoTracker.TrackProducer.CosmicFinalFitWithMaterialP5_cff.cosmictrackfinderP5.clone(
100  src = 'TrackerTrackHitFilter'
101 )
102 
103  ##
104  ## Load and Configure TrackRefitter1
105  ##
106 
107 process.load("RecoTracker.TrackProducer.TrackRefitters_cff")
108 
109 process.TrackRefitter1 = RecoTracker.TrackProducer.TrackRefitterP5_cfi.TrackRefitterP5.clone(
110  src = '.oO[TrackCollection]Oo.',
111  TrajectoryInEvent = True,
112  TTRHBuilder = "WithTrackAngle",
113  NavigationSchool = ""
114 )
115 
116 process.TrackRefitter2 = process.TrackRefitter1.clone(
117  src = 'HitFilteredTracks')
118 
119 
120  ##
121  ## Get the BeamSpot
122  ##
123 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff")
124 
125  ##
126  ## GlobalTag Conditions (if needed)
127  ##
128 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
129 process.GlobalTag.globaltag = ".oO[GlobalTag]Oo."
130 #process.GlobalTag.connect="frontier://FrontierProd/CMS_COND_21X_GLOBALTAG"
131 # process.GlobalTag.connect="frontier://FrontierProd/CMS_COND_31X_GLOBALTAG"
132 
133 ## LAYERWISE Lorentz Angle ###################
134 
135 process.SiStripLorentzAngle = cms.ESSource("PoolDBESSource",
136  BlobStreamerName =
137 cms.untracked.string('TBufferBlobStreamingService'),
138  DBParameters = cms.PSet(
139  messageLevel = cms.untracked.int32(2),
140  authenticationPath =
141 cms.untracked.string('/afs/cern.ch/cms/DB/conddb')
142  ),
143  timetype = cms.string('runnumber'),
144  toGet = cms.VPSet(cms.PSet(
145  record = cms.string('SiStripLorentzAngleRcd'),
146  tag = cms.string('SiStripLA_CRAFT_layers')
147  )),
148  connect = cms.string('sqlite_file:/afs/cern.ch/user/j/jdraeger/public/LA_object/LA_CRAFT_layers.db')
149 )
150 process.es_prefer_SiStripLorentzAngle = cms.ESPrefer("PoolDBESSource","SiStripLorentzAngle")
151 
152  ##
153  ## Geometry
154  ##
155 process.load("Configuration.StandardSequences.Geometry_cff")
156 
157  ##
158  ## Magnetic Field
159  ##
160 process.load("Configuration/StandardSequences/MagneticField_38T_cff")
161 
162 .oO[condLoad]Oo.
163 
164 ## to apply misalignments
165 #TrackerDigiGeometryESModule.applyAlignment = True
166 
167  ##
168  ## Load and Configure OfflineValidation
169  ##
170 process.load("Alignment.OfflineValidation.TrackerOfflineValidation_.oO[offlineValidationMode]Oo._cff")
171 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..Tracks = 'TrackRefitter2'
172 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..trajectoryInput = 'TrackRefitter2'
173 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..moduleLevelHistsTransient = cms.bool(.oO[offlineModuleLevelHistsTransient]Oo.)
174 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..stripYResiduals = True
175 .oO[offlineValidationFileOutput]Oo.
176 
177  ##
178  ## PATH
179  ##
180 process.p = cms.Path(process.offlineBeamSpot*process.TrackRefitter1*process.TrackerTrackHitFilter*process.HitFilteredTracks
181  *process.TrackRefitter2*process.AlignmentTrackSelector*process.seqTrackerOfflineValidation.oO[offlineValidationMode]Oo.)
182 
183 """
184 
185 
186 ######################################################################
187 ######################################################################
188 zeroAPETemplate="""
189 from CondCore.DBCommon.CondDBSetup_cfi import *
190 process.APE = cms.ESSource("PoolDBESSource",CondDBSetup,
191  connect = cms.string('frontier://FrontierProd/CMS_COND_31X_FROM21X'),
192  timetype = cms.string("runnumber"),
193  toGet = cms.VPSet(
194  cms.PSet(record = cms.string('TrackerAlignmentErrorRcd'),
195  tag = cms.string('TrackerIdealGeometryErrors210_mc')
196  ))
197  )
198 process.es_prefer_APE = cms.ESPrefer("PoolDBESSource", "APE")
199 """
200 
201 
202 ######################################################################
203 ######################################################################
204 CosmicsOfflineValidation="""
205 import FWCore.ParameterSet.Config as cms
206 
207 process = cms.Process("OfflineValidator")
208 
209 process.load("Alignment.OfflineValidation..oO[dataset]Oo._cff")
210 
211 process.options = cms.untracked.PSet(
212  wantSummary = cms.untracked.bool(False),
213  Rethrow = cms.untracked.vstring("ProductNotFound"), # make this exception fatal
214 # fileMode = cms.untracked.string('NOMERGE') # no ordering needed, but calls endRun/beginRun etc. at file boundaries
215 )
216 
217  ##
218  ## Maximum number of Events
219  ##
220 process.maxEvents = cms.untracked.PSet(
221  input = cms.untracked.int32(.oO[nEvents]Oo.)
222  )
223 
224  ##
225  ## Messages & Convenience
226  ##
227 process.load("FWCore.MessageLogger.MessageLogger_cfi")
228 process.MessageLogger.cerr = cms.untracked.PSet(placeholder = cms.untracked.bool(True))
229 process.MessageLogger.cout = cms.untracked.PSet(INFO = cms.untracked.PSet(
230 reportEvery = cms.untracked.int32(1000) # every 1000th only
231 # limit = cms.untracked.int32(10) # or limit to 10 printouts...
232 ))
233 process.MessageLogger.statistics.append('cout')
234 
235  ##
236  ## Get the BeamSpot
237  ##
238 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff")
239 
240  #-- Refitting
241 process.load("RecoTracker.TrackProducer.TrackRefitters_cff")
242 
243 ##-- Track hit filter
244 ## TrackerTrackHitFilter takes as input the tracks/trajectories coming out from TrackRefitter1
245 #process.load("RecoTracker.FinalTrackSelectors.TrackerTrackHitFilter_cff")
246 #process.TrackerTrackHitFilter.src = 'TrackRefitter1'
247 
248 #-- 1st refit from file
249 process.TrackRefitter1 = process.TrackRefitterP5.clone(
250  src ='ALCARECOTkAlCosmicsCTF0T',
251  NavigationSchool = cms.string(''),
252  TrajectoryInEvent = True,
253  TTRHBuilder = "WithAngleAndTemplate" #default
254  )
255 
256 #-- 2nd fit for AlignmentProducer
257 process.TrackRefitter2 = process.TrackRefitter1.clone(
258  src = 'AlignmentTrackSelector'
259  )
260 
261 #-- Filter bad hits
262 process.load("RecoTracker.FinalTrackSelectors.TrackerTrackHitFilter_cff")
263 process.TrackerTrackHitFilter.src = 'TrackRefitter1'
264 process.TrackerTrackHitFilter.useTrajectories= True # this is needed only if you require some selections; but it will work even if you don't ask for them
265 process.TrackerTrackHitFilter.minimumHits = 8
266 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
267 process.TrackerTrackHitFilter.detsToIgnore = []
268 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
269 process.TrackerTrackHitFilter.stripAllInvalidHits = False
270 process.TrackerTrackHitFilter.rejectBadStoNHits = True
271 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 18.0")
272 process.TrackerTrackHitFilter.rejectLowAngleHits = True
273 process.TrackerTrackHitFilter.TrackAngleCut = 0.1# in rads, starting from the module surface; small value since we have bows!
274 process.TrackerTrackHitFilter.usePixelQualityFlag = True #False
275 
276 #-- TrackProducer
277 ## now we give the TrackCandidate coming out of the TrackerTrackHitFilter to the track producer
278 import RecoTracker.TrackProducer.CTFFinalFitWithMaterialP5_cff
279 process.TrackCandidateFitter = RecoTracker.TrackProducer.CTFFinalFitWithMaterialP5_cff.ctfWithMaterialTracksCosmics.clone(
280 src = 'TrackerTrackHitFilter',
281  NavigationSchool = cms.string(''),
282  TTRHBuilder = "WithAngleAndTemplate"
283  )
284 #-- Filter tracks for alignment
285 process.load("Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi")
286 process.AlignmentTrackSelector.src = 'TrackCandidateFitter'
287 process.AlignmentTrackSelector.applyBasicCuts = True
288 process.AlignmentTrackSelector.pMin = 4
289 process.AlignmentTrackSelector.pMax = 9999.
290 process.AlignmentTrackSelector.ptMin = 0
291 process.AlignmentTrackSelector.etaMin = -999.
292 process.AlignmentTrackSelector.etaMax = 999.
293 process.AlignmentTrackSelector.nHitMin = 8
294 process.AlignmentTrackSelector.nHitMin2D = 2
295 process.AlignmentTrackSelector.chi2nMax = 99.
296 process.AlignmentTrackSelector.applyMultiplicityFilter = True# False
297 process.AlignmentTrackSelector.maxMultiplicity = 1
298 
299 ## GlobalTag Conditions (if needed)
300 ##
301 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
302 process.GlobalTag.globaltag = ".oO[GlobalTag]Oo."
303 
304 
305 ##
306 ## Geometry
307 ##
308 process.load("Configuration.StandardSequences.GeometryDB_cff")
309 
310 ##
311 ## Magnetic Field
312 ##
313 process.load("Configuration/StandardSequences/MagneticField_38T_cff")
314 
315 .oO[LorentzAngleTemplate]Oo.
316 
317  ##
318  ## Geometry
319  ##
320 #process.load("Configuration.StandardSequences.Geometry_cff")
321 
322 .oO[condLoad]Oo.
323 
324  ##
325  ## Load and Configure OfflineValidation
326  ##
327 
328 process.load("Alignment.OfflineValidation.TrackerOfflineValidation_.oO[offlineValidationMode]Oo._cff")
329 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..Tracks = 'TrackRefitter2'
330 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..trajectoryInput = 'TrackRefitter2'
331 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..moduleLevelHistsTransient = cms.bool(.oO[offlineModuleLevelHistsTransient]Oo.)
332 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..moduleLevelProfiles = cms.bool(.oO[offlineModuleLevelProfiles]Oo.)
333 process.TFileService.fileName = '.oO[outputFile]Oo.'
334 
335  ##
336  ## PATH
337  ##
338 
339 process.p = cms.Path( process.offlineBeamSpot
340  *process.TrackRefitter1
341  *process.TrackerTrackHitFilter
342  *process.TrackCandidateFitter
343  *process.AlignmentTrackSelector
344  *process.TrackRefitter2
345  *process.seqTrackerOfflineValidationStandalone
346 )
347 
348 
349 """
350 
351 
352 ######################################################################
353 ######################################################################
354 CosmicsAt0TOfflineValidation="""
355 import FWCore.ParameterSet.Config as cms
356 
357 process = cms.Process("OfflineValidator")
358 
359 process.load("Alignment.OfflineValidation..oO[dataset]Oo._cff")
360 
361 process.options = cms.untracked.PSet(
362  wantSummary = cms.untracked.bool(False),
363  Rethrow = cms.untracked.vstring("ProductNotFound"), # make this exception fatal
364  fileMode = cms.untracked.string('NOMERGE') # no ordering needed, but calls endRun/beginRun etc. at file boundaries
365 )
366 
367  ##
368  ## Maximum number of Events
369  ##
370 process.maxEvents = cms.untracked.PSet(
371  input = cms.untracked.int32(.oO[nEvents]Oo.)
372  )
373 
374  ##
375  ## Messages & Convenience
376  ##
377 process.load("FWCore.MessageLogger.MessageLogger_cfi")
378 process.MessageLogger.cerr = cms.untracked.PSet(placeholder = cms.untracked.bool(True))
379 process.MessageLogger.cout = cms.untracked.PSet(INFO = cms.untracked.PSet(
380 reportEvery = cms.untracked.int32(1000) # every 1000th only
381 # limit = cms.untracked.int32(10) # or limit to 10 printouts...
382 ))
383 process.MessageLogger.statistics.append('cout')
384 
385 
386 #-- Track hit filter
387 # TrackerTrackHitFilter takes as input the tracks/trajectories coming out from TrackRefitter1
388 process.load("RecoTracker.FinalTrackSelectors.TrackerTrackHitFilter_cff")
389 process.TrackerTrackHitFilter.src = 'TrackRefitter1'
390 
391 #-- Alignment Track Selection
392 process.load("Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi")
393 process.AlignmentTrackSelector.src = 'HitFilteredTracks'
394 process.AlignmentTrackSelector.filter = True
395 
396 .oO[TrackSelectionTemplate]Oo.
397 # Override the pmin setting since not meaningful with B=0T
398 process.AlignmentTrackSelector.pMin = 4.
399 
400 #### momentum constraint for 0T
401 # First momentum constraint
402 process.load("RecoTracker.TrackProducer.MomentumConstraintProducer_cff")
403 import RecoTracker.TrackProducer.MomentumConstraintProducer_cff
404 process.AliMomConstraint1 = RecoTracker.TrackProducer.MomentumConstraintProducer_cff.MyMomConstraint.clone()
405 process.AliMomConstraint1.src = '.oO[TrackCollection]Oo.'
406 process.AliMomConstraint1.fixedMomentum = 5.0
407 process.AliMomConstraint1.fixedMomentumError = 0.005
408 
409 # Second momentum constraint
410 #process.load("RecoTracker.TrackProducer.MomentumConstraintProducer_cff")
411 #import RecoTracker.TrackProducer.MomentumConstraintProducer_cff
412 #process.AliMomConstraint2 = RecoTracker.TrackProducer.MomentumConstraintProducer_cff.MyMomConstraint.clone()
413 #process.AliMomConstraint2.src = 'AlignmentTrackSelector'
414 #process.AliMomConstraint2.fixedMomentum = 5.0
415 #process.AliMomConstraint2.fixedMomentumError = 0.005
416 
417 
418 
419 #now we give the TrackCandidate coming out of the TrackerTrackHitFilter to the track producer
420 import RecoTracker.TrackProducer.CTFFinalFitWithMaterialP5_cff
421 process.HitFilteredTracks = RecoTracker.TrackProducer.CTFFinalFitWithMaterialP5_cff.ctfWithMaterialTracksCosmics.clone(
422  src = 'TrackerTrackHitFilter'
423 ### ,
424 ### TrajectoryInEvent = True,
425 ### TTRHBuilder = "WithAngleAndTemplate"
426 )
427 
428  ##
429  ## Load and Configure TrackRefitter1
430  ##
431 
432 process.load("RecoTracker.TrackProducer.TrackRefitters_cff")
433 
434 #############
435 # parameters for TrackRefitter
436 #process.load("RecoTracker.TrackProducer.RefitterWithMaterial_cff")
437 import RecoTracker.TrackProducer.TrackRefitters_cff
438 process.TrackRefitter1 = process.TrackRefitterP5.clone(
439  src = '.oO[TrackCollection]Oo.', #'AliMomConstraint1',
440  TrajectoryInEvent = True,
441  TTRHBuilder = "WithAngleAndTemplate",
442  NavigationSchool = "",
443  constraint = 'momentum', ### SPECIFIC FOR CRUZET
444  srcConstr='AliMomConstraint1' ### SPECIFIC FOR CRUZET$works only with tag V02-10-02 TrackingTools/PatternTools / or CMSSW >=31X
445 )
446 
447 process.TrackRefitter2 = process.TrackRefitter1.clone(
448  src = 'AlignmentTrackSelector',
449  srcConstr='AliMomConstraint1',
450  constraint = 'momentum' ### SPECIFIC FOR CRUZET
451 )
452 
453 
454  ##
455  ## Get the BeamSpot
456  ##
457 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff")
458 
459  ##
460  ## GlobalTag Conditions (if needed)
461  ##
462 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
463 process.GlobalTag.globaltag = ".oO[GlobalTag]Oo."
464 # process.GlobalTag.connect="frontier://FrontierProd/CMS_COND_31X_GLOBALTAG"
465 
466 .oO[LorentzAngleTemplate]Oo.
467 
468  ##
469  ## Geometry
470  ##
471 process.load("Configuration.StandardSequences.Geometry_cff")
472 
473  ##
474  ## Magnetic Field
475  ##
476 #process.load("Configuration/StandardSequences/MagneticField_38T_cff")
477 process.load("Configuration.StandardSequences.MagneticField_0T_cff") # 0T runs
478 
479 .oO[condLoad]Oo.
480 
481 ## to apply misalignments
482 #TrackerDigiGeometryESModule.applyAlignment = True
483 
484  ##
485  ## Load and Configure OfflineValidation
486  ##
487 process.load("Alignment.OfflineValidation.TrackerOfflineValidation_.oO[offlineValidationMode]Oo._cff")
488 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..Tracks = 'TrackRefitter2'
489 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..trajectoryInput = 'TrackRefitter2'
490 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..moduleLevelHistsTransient = cms.bool(.oO[offlineModuleLevelHistsTransient]Oo.)
491 process.TFileService.fileName = '.oO[outputFile]Oo.'
492 
493  ##
494  ## PATH
495  ##
496 
497 process.p = cms.Path(process.offlineBeamSpot*process.AliMomConstraint1*process.TrackRefitter1*process.TrackerTrackHitFilter*process.HitFilteredTracks
498  *process.AlignmentTrackSelector*process.TrackRefitter2*process.seqTrackerOfflineValidation.oO[offlineValidationMode]Oo.)
499 
500 """
501 
502 
503 ######################################################################
504 ######################################################################
505 CosmicsAt0TParallelOfflineValidation="""
506 import FWCore.ParameterSet.Config as cms
507 
508 process = cms.Process("OfflineValidator")
509 
510 process.load("Alignment.OfflineValidation..oO[dataset]Oo._cff")
511 
512 process.options = cms.untracked.PSet(
513  wantSummary = cms.untracked.bool(False),
514  Rethrow = cms.untracked.vstring("ProductNotFound"), # make this exception fatal
515  fileMode = cms.untracked.string('NOMERGE') # no ordering needed, but calls endRun/beginRun etc. at file boundaries
516 )
517 
518  ##
519  ## Maximum number of Events
520  ## and number of events to be skipped
521  ## in case of parallel job nIndex
522  ## .oO[nIndex]Oo * .oO[nEvents]Oo/.oO[nJobs]Oo
523  ##
524 process.maxEvents = cms.untracked.PSet(
525  input = cms.untracked.int32(.oO[nEvents]Oo./.oO[nJobs]Oo.)
526  )
527 process.source.skipEvents=cms.untracked.uint32(.oO[nIndex]Oo.*.oO[nEvents]Oo./.oO[nJobs]Oo.)
528 
529  ##
530  ## Messages & Convenience
531  ##
532 process.load("FWCore.MessageLogger.MessageLogger_cfi")
533 process.MessageLogger.cerr = cms.untracked.PSet(placeholder = cms.untracked.bool(True))
534 process.MessageLogger.cout = cms.untracked.PSet(INFO = cms.untracked.PSet(
535 reportEvery = cms.untracked.int32(1000) # every 1000th only
536 # limit = cms.untracked.int32(10) # or limit to 10 printouts...
537 ))
538 process.MessageLogger.statistics.append('cout')
539 
540 #-- Track hit filter
541 # TrackerTrackHitFilter takes as input the tracks/trajectories coming out from TrackRefitter1
542 process.load("RecoTracker.FinalTrackSelectors.TrackerTrackHitFilter_cff")
543 process.TrackerTrackHitFilter.src = 'TrackRefitter1'
544 
545 #-- Alignment Track Selection
546 process.load("Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi")
547 process.AlignmentTrackSelector.src = 'HitFilteredTracks'
548 process.AlignmentTrackSelector.filter = True
549 
550 .oO[TrackSelectionTemplate]Oo.
551 # Override the pmin setting since not meaningful with B=0T
552 process.AlignmentTrackSelector.pMin = 4.
553 
554 #### momentum constraint for 0T
555 # First momentum constraint
556 process.load("RecoTracker.TrackProducer.MomentumConstraintProducer_cff")
557 import RecoTracker.TrackProducer.MomentumConstraintProducer_cff
558 process.AliMomConstraint1 = RecoTracker.TrackProducer.MomentumConstraintProducer_cff.MyMomConstraint.clone()
559 process.AliMomConstraint1.src = '.oO[TrackCollection]Oo.'
560 process.AliMomConstraint1.fixedMomentum = 5.0
561 process.AliMomConstraint1.fixedMomentumError = 0.005
562 
563 # Second momentum constraint
564 #process.load("RecoTracker.TrackProducer.MomentumConstraintProducer_cff")
565 #import RecoTracker.TrackProducer.MomentumConstraintProducer_cff
566 #process.AliMomConstraint2 = RecoTracker.TrackProducer.MomentumConstraintProducer_cff.MyMomConstraint.clone()
567 #process.AliMomConstraint2.src = 'AlignmentTrackSelector'
568 #process.AliMomConstraint2.fixedMomentum = 5.0
569 #process.AliMomConstraint2.fixedMomentumError = 0.005
570 
571 #now we give the TrackCandidate coming out of the TrackerTrackHitFilter to the track producer
572 import RecoTracker.TrackProducer.CTFFinalFitWithMaterialP5_cff
573 process.HitFilteredTracks = RecoTracker.TrackProducer.CTFFinalFitWithMaterialP5_cff.ctfWithMaterialTracksCosmics.clone(
574 src = 'TrackerTrackHitFilter',
575 NavigationSchool = cms.string(''),
576 TTRHBuilder = "WithAngleAndTemplate"
577 ### ,
578 ### TrajectoryInEvent = True,
579 ### TTRHBuilder = "WithAngleAndTemplate"
580 )
581 
582 ##
583 ## Load and Configure TrackRefitter1
584 ##
585 process.load("RecoTracker.TrackProducer.TrackRefitters_cff")
586 
587 #############
588 # parameters for TrackRefitter
589 #process.load("RecoTracker.TrackProducer.RefitterWithMaterial_cff")
590 import RecoTracker.TrackProducer.TrackRefitters_cff
591 process.TrackRefitter1 = process.TrackRefitterP5.clone(
592 src = '.oO[TrackCollection]Oo.', #'AliMomConstraint1',
593 TrajectoryInEvent = True,
594 TTRHBuilder = "WithAngleAndTemplate",
595 NavigationSchool = "",
596 constraint = 'momentum', ### SPECIFIC FOR CRUZET
597 srcConstr='AliMomConstraint1' ### SPECIFIC FOR CRUZET$works only with tag V02-10-02 TrackingTools/PatternTools / or CMSSW >=31X
598 )
599 
600 process.TrackRefitter2 = process.TrackRefitter1.clone(
601 src = 'AlignmentTrackSelector',
602 srcConstr='AliMomConstraint1',
603 constraint = 'momentum' ### SPECIFIC FOR CRUZET
604 )
605 
606 
607 ##
608 ## Get the BeamSpot
609 ##
610 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff")
611 
612 ##
613 ## GlobalTag Conditions (if needed)
614 ##
615 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
616 process.GlobalTag.globaltag = ".oO[GlobalTag]Oo."
617 # process.GlobalTag.connect="frontier://FrontierProd/CMS_COND_31X_GLOBALTAG"
618 .oO[LorentzAngleTemplate]Oo.
619 
620 ##
621 ## Geometry
622 ##
623 process.load("Configuration.StandardSequences.Geometry_cff")
624 
625 ##
626 ## Magnetic Field
627 ##
628 #process.load("Configuration/StandardSequences/MagneticField_38T_cff")
629 process.load("Configuration.StandardSequences.MagneticField_0T_cff") # 0T runs
630 .oO[condLoad]Oo.
631 
632 
633 ##
634 ## Load and Configure OfflineValidation
635 ##
636 process.load("Alignment.OfflineValidation.TrackerOfflineValidation_.oO[offlineValidationMode]Oo._cff")
637 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..Tracks = 'TrackRefitter2'
638 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..trajectoryInput = 'TrackRefitter2'
639 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..moduleLevelHistsTransient = cms.bool(.oO[offlineModuleLevelHistsTransient]Oo.)
640 process.TFileService.fileName = '.oO[outputFile]Oo.'
641 
642 ##
643 ## PATH
644 ##
645 process.p = cms.Path(process.offlineBeamSpot*process.AliMomConstraint1*process.TrackRefitter1*process.TrackerTrackHitFilter*process.HitFilteredTracks
646 *process.AlignmentTrackSelector*process.TrackRefitter2*process.seqTrackerOfflineValidation.oO[offlineValidationMode]Oo.)
647 """
648 
649 
650 ######################################################################
651 ######################################################################
652 CosmicsParallelOfflineValidation="""
653 import FWCore.ParameterSet.Config as cms
654 
655 process = cms.Process("OfflineValidator")
656 
657 process.load("Alignment.OfflineValidation..oO[dataset]Oo._cff")
658 
659 process.options = cms.untracked.PSet(
660  wantSummary = cms.untracked.bool(False),
661  Rethrow = cms.untracked.vstring("ProductNotFound"), # make this exception fatal
662  fileMode = cms.untracked.string('NOMERGE') # no ordering needed, but calls endRun/beginRun etc. at file boundaries
663 )
664 
665  ##
666  ## Maximum number of Events
667  ## and number of events to be skipped
668  ## in case of parallel job nIndex
669  ## .oO[nIndex]Oo * .oO[nEvents]Oo/.oO[nJobs]Oo
670  ##
671 process.maxEvents = cms.untracked.PSet(
672  input = cms.untracked.int32(.oO[nEvents]Oo./.oO[nJobs]Oo.)
673  )
674 process.source.skipEvents=cms.untracked.uint32(.oO[nIndex]Oo.*.oO[nEvents]Oo./.oO[nJobs]Oo.)
675 
676  ##
677  ## Messages & Convenience
678  ##
679 process.load("FWCore.MessageLogger.MessageLogger_cfi")
680 process.MessageLogger.cerr = cms.untracked.PSet(placeholder = cms.untracked.bool(True))
681 process.MessageLogger.cout = cms.untracked.PSet(INFO = cms.untracked.PSet(
682 reportEvery = cms.untracked.int32(1000) # every 1000th only
683 # limit = cms.untracked.int32(10) # or limit to 10 printouts...
684 ))
685 process.MessageLogger.statistics.append('cout')
686 
687  ##
688  ## Get the BeamSpot
689  ##
690 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff")
691 
692  #-- Refitting
693 process.load("RecoTracker.TrackProducer.TrackRefitters_cff")
694 
695 ##-- Track hit filter
696 ## TrackerTrackHitFilter takes as input the tracks/trajectories coming out from TrackRefitter1
697 #process.load("RecoTracker.FinalTrackSelectors.TrackerTrackHitFilter_cff")
698 #process.TrackerTrackHitFilter.src = 'TrackRefitter1'
699 
700 #-- 1st refit from file
701 process.TrackRefitter1 = process.TrackRefitterP5.clone(
702  src ='ALCARECOTkAlCosmicsCTF0T',
703  NavigationSchool = cms.string(''),
704  TrajectoryInEvent = True,
705  TTRHBuilder = "WithAngleAndTemplate" #default
706  )
707 
708 #-- 2nd fit for AlignmentProducer
709 process.TrackRefitter2 = process.TrackRefitter1.clone(
710  src = 'AlignmentTrackSelector'
711  )
712 
713 #-- Filter bad hits
714 process.load("RecoTracker.FinalTrackSelectors.TrackerTrackHitFilter_cff")
715 process.TrackerTrackHitFilter.src = 'TrackRefitter1'
716 process.TrackerTrackHitFilter.useTrajectories= True # this is needed only if you require some selections; but it will work even if you don't ask for them
717 process.TrackerTrackHitFilter.minimumHits = 8
718 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
719 process.TrackerTrackHitFilter.detsToIgnore = []
720 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
721 process.TrackerTrackHitFilter.stripAllInvalidHits = False
722 process.TrackerTrackHitFilter.rejectBadStoNHits = True
723 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 18.0")
724 process.TrackerTrackHitFilter.rejectLowAngleHits = True
725 process.TrackerTrackHitFilter.TrackAngleCut = 0.35# in rads, starting from the module surface
726 process.TrackerTrackHitFilter.usePixelQualityFlag = True #False
727 
728 #-- TrackProducer
729 ## now we give the TrackCandidate coming out of the TrackerTrackHitFilter to the track producer
730 import RecoTracker.TrackProducer.CTFFinalFitWithMaterialP5_cff
731 process.TrackCandidateFitter = RecoTracker.TrackProducer.CTFFinalFitWithMaterialP5_cff.ctfWithMaterialTracksCosmics.clone(
732 src = 'TrackerTrackHitFilter',
733  NavigationSchool = cms.string(''),
734  TTRHBuilder = "WithAngleAndTemplate"
735  )
736 #-- Filter tracks for alignment
737 process.load("Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi")
738 process.AlignmentTrackSelector.src = 'TrackCandidateFitter'
739 process.AlignmentTrackSelector.applyBasicCuts = True
740 process.AlignmentTrackSelector.pMin = 4
741 process.AlignmentTrackSelector.pMax = 9999.
742 process.AlignmentTrackSelector.ptMin = 0
743 process.AlignmentTrackSelector.etaMin = -999.
744 process.AlignmentTrackSelector.etaMax = 999.
745 process.AlignmentTrackSelector.nHitMin = 8
746 process.AlignmentTrackSelector.nHitMin2D = 2
747 process.AlignmentTrackSelector.chi2nMax = 99.
748 process.AlignmentTrackSelector.applyMultiplicityFilter = True# False
749 process.AlignmentTrackSelector.maxMultiplicity = 1
750 
751 ## GlobalTag Conditions (if needed)
752 ##
753 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
754 process.GlobalTag.globaltag = ".oO[GlobalTag]Oo."
755 
756 
757 ##
758 ## Geometry
759 ##
760 process.load("Configuration.StandardSequences.GeometryDB_cff")
761 
762 ##
763 ## Magnetic Field
764 ##
765 process.load("Configuration/StandardSequences/MagneticField_38T_cff")
766 
767 
768 .oO[LorentzAngleTemplate]Oo.
769 
770  ##
771  ## Geometry
772  ##
773 #process.load("Configuration.StandardSequences.Geometry_cff")
774 
775 .oO[condLoad]Oo.
776 
777  ##
778  ## Load and Configure OfflineValidation
779  ##
780 
781 process.load("Alignment.OfflineValidation.TrackerOfflineValidation_.oO[offlineValidationMode]Oo._cff")
782 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..Tracks = 'TrackRefitter2'
783 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..trajectoryInput = 'TrackRefitter2'
784 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..moduleLevelHistsTransient = cms.bool(.oO[offlineModuleLevelHistsTransient]Oo.)
785 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..moduleLevelProfiles = cms.bool(.oO[offlineModuleLevelProfiles]Oo.)
786 process.TFileService.fileName = '.oO[outputFile]Oo.'
787 
788  ##
789  ## PATH
790  ##
791 
792 process.p = cms.Path( process.offlineBeamSpot
793  *process.TrackRefitter1
794  *process.TrackerTrackHitFilter
795  *process.TrackCandidateFitter
796  *process.AlignmentTrackSelector
797  *process.TrackRefitter2
798  *process.seqTrackerOfflineValidationStandalone
799 )
800 
801 
802 """
803 
804 ######################################################################
805 ######################################################################
806 TrackSelectionCosmicsDuringCollisions = """
807 ##### For Tracks:
808 process.AlignmentTrackSelector.applyBasicCuts = True
809 # Note that pMin is overridden and set to zero in
810 # the offlineTemplate0T
811 process.AlignmentTrackSelector.pMin = 4.
812 process.AlignmentTrackSelector.pMax = 9999.
813 process.AlignmentTrackSelector.ptMin = 0.
814 process.AlignmentTrackSelector.ptMax = 9999.
815 process.AlignmentTrackSelector.etaMin = -999.
816 process.AlignmentTrackSelector.etaMax = 999.
817 process.AlignmentTrackSelector.nHitMin = 8
818 process.AlignmentTrackSelector.nHitMin2D = 2
819 process.AlignmentTrackSelector.chi2nMax = 999.
820 process.AlignmentTrackSelector.applyMultiplicityFilter = False
821 process.AlignmentTrackSelector.maxMultiplicity = 1
822 process.AlignmentTrackSelector.applyNHighestPt = False
823 process.AlignmentTrackSelector.nHighestPt = 1
824 process.AlignmentTrackSelector.seedOnlyFrom = 0
825 process.AlignmentTrackSelector.applyIsolationCut = False
826 process.AlignmentTrackSelector.minHitIsolation = 0.8
827 process.AlignmentTrackSelector.applyChargeCheck = False
828 process.AlignmentTrackSelector.minHitChargeStrip = 50.
829 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
830 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
831 
832 ##### For Hits:
833 process.TrackerTrackHitFilter.useTrajectories= True # this is needed only if you require some selections; but it will work even if you don't ask for them
834 process.TrackerTrackHitFilter.minimumHits = 8
835 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
836 process.TrackerTrackHitFilter.detsToIgnore = [
837  # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
838  # TIB / TID
839  #369136710, 369136714, 402668822,
840  # TOB
841  #436310989, 436310990, 436299301, 436299302,
842  # TEC
843  #470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
844 ]
845 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
846 process.TrackerTrackHitFilter.stripAllInvalidHits = False
847 process.TrackerTrackHitFilter.rejectBadStoNHits = True
848 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 18.0")
849 process.TrackerTrackHitFilter.rejectLowAngleHits= True
850 process.TrackerTrackHitFilter.TrackAngleCut= 0.35 # in rads, starting from the module surface
851 process.TrackerTrackHitFilter.usePixelQualityFlag= True
852 
853 #######################################
854 ##Trigger settings for Cosmics during collisions
855 #######################################
856 process.load('L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskTechTrigConfig_cff')
857 process.load('HLTrigger/HLTfilters/hltLevel1GTSeed_cfi')
858 process.L1T1=process.hltLevel1GTSeed.clone()
859 process.L1T1.L1TechTriggerSeeding = cms.bool(True)
860 process.L1T1.L1SeedsLogicalExpression=cms.string('25')
861 process.hltHighLevel = cms.EDFilter("HLTHighLevel",
862  TriggerResultsTag = cms.InputTag("TriggerResults","","HLT"),
863  HLTPaths = cms.vstring('HLT_TrackerCosmics'),
864  eventSetupPathsKey = cms.string(''),
865  andOr = cms.bool(False),
866  throw = cms.bool(True)
867 )
868 
869 
870 process.triggerSelection=cms.Sequence(process.L1T1*process.hltHighLevel)
871 """
872 
873 
874 ######################################################################
875 ######################################################################
876 TrackSelectionCosmicsData = """
877 ##### For Tracks:
878 process.AlignmentTrackSelector.applyBasicCuts = True
879 # Note that pMin is overridden and set to zero in
880 # the offlineTemplate0T
881 process.AlignmentTrackSelector.pMin = 4.
882 process.AlignmentTrackSelector.pMax = 9999.
883 process.AlignmentTrackSelector.ptMin = 0.
884 process.AlignmentTrackSelector.ptMax = 9999.
885 process.AlignmentTrackSelector.etaMin = -999.
886 process.AlignmentTrackSelector.etaMax = 999.
887 process.AlignmentTrackSelector.nHitMin = 8
888 process.AlignmentTrackSelector.nHitMin2D = 2
889 process.AlignmentTrackSelector.chi2nMax = 999.
890 process.AlignmentTrackSelector.applyMultiplicityFilter = False
891 process.AlignmentTrackSelector.maxMultiplicity = 1
892 process.AlignmentTrackSelector.applyNHighestPt = False
893 process.AlignmentTrackSelector.nHighestPt = 1
894 process.AlignmentTrackSelector.seedOnlyFrom = 0
895 process.AlignmentTrackSelector.applyIsolationCut = False
896 process.AlignmentTrackSelector.minHitIsolation = 0.8
897 process.AlignmentTrackSelector.applyChargeCheck = False
898 process.AlignmentTrackSelector.minHitChargeStrip = 50.
899 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
900 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
901 
902 ##### For Hits:
903 process.TrackerTrackHitFilter.useTrajectories= True # this is needed only if you require some selections; but it will work even if you don't ask for them
904 process.TrackerTrackHitFilter.minimumHits = 8
905 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
906 process.TrackerTrackHitFilter.detsToIgnore = [
907  # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
908  # TIB / TID
909  #369136710, 369136714, 402668822,
910  # TOB
911  #436310989, 436310990, 436299301, 436299302,
912  # TEC
913  #470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
914 ]
915 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
916 process.TrackerTrackHitFilter.stripAllInvalidHits = False
917 process.TrackerTrackHitFilter.rejectBadStoNHits = True
918 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 18.0")
919 process.TrackerTrackHitFilter.rejectLowAngleHits= True
920 process.TrackerTrackHitFilter.TrackAngleCut= 0.35 # in rads, starting from the module surface
921 process.TrackerTrackHitFilter.usePixelQualityFlag= True
922 #process.TrackerTrackHitFilter.PxlCorrClusterChargeCut = 10000.0
923 #process.triggerSelection=cms.Sequence(process.hltPhysicsDeclared)
924 """
925 
926 
927 ######################################################################
928 ######################################################################
929 TrackSelectionCosmicsDataBPIX = """
930 ##### For Tracks:
931 process.AlignmentTrackSelector.applyBasicCuts = True
932 # Note that pMin is overridden and set to zero in
933 # the offlineTemplate0T
934 process.AlignmentTrackSelector.pMin = 4.
935 process.AlignmentTrackSelector.pMax = 9999.
936 process.AlignmentTrackSelector.ptMin = 0.
937 process.AlignmentTrackSelector.ptMax = 9999.
938 process.AlignmentTrackSelector.etaMin = -999.
939 process.AlignmentTrackSelector.etaMax = 999.
940 process.AlignmentTrackSelector.nHitMin = 8
941 process.AlignmentTrackSelector.nHitMin2D = 2
942 process.AlignmentTrackSelector.chi2nMax = 999.
943 process.AlignmentTrackSelector.applyMultiplicityFilter = False
944 process.AlignmentTrackSelector.maxMultiplicity = 1
945 process.AlignmentTrackSelector.applyNHighestPt = False
946 process.AlignmentTrackSelector.nHighestPt = 1
947 process.AlignmentTrackSelector.seedOnlyFrom = 0
948 process.AlignmentTrackSelector.applyIsolationCut = False
949 process.AlignmentTrackSelector.minHitIsolation = 0.8
950 process.AlignmentTrackSelector.applyChargeCheck = False
951 process.AlignmentTrackSelector.minHitChargeStrip = 50.
952 process.AlignmentTrackSelector.minHitsPerSubDet = cms.PSet(
953  inTEC = cms.int32(0),
954  inTOB = cms.int32(0),
955  inFPIX = cms.int32(0),
956  inTID = cms.int32(0),
957  inBPIX = cms.int32(1),
958  inTIB = cms.int32(0),
959  inPIXEL = cms.int32(0),
960  inTIDplus = cms.int32(0),
961  inTIDminus = cms.int32(0),
962  inTECplus = cms.int32(0),
963  inTECminus = cms.int32(0),
964  inFPIXplus = cms.int32(0),
965  inFPIXminus = cms.int32(0),
966  inENDCAP = cms.int32(0),
967  inENDCAPplus = cms.int32(0),
968  inENDCAPminus = cms.int32(0),
969  )
970 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
971 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
972 
973 ##### For Hits:
974 process.TrackerTrackHitFilter.useTrajectories= True # this is needed only if you require some selections; but it will work even if you don't ask for them
975 process.TrackerTrackHitFilter.minimumHits = 8
976 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
977 process.TrackerTrackHitFilter.detsToIgnore = [
978  # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
979  # TIB / TID
980  #369136710, 369136714, 402668822,
981  # TOB
982  #436310989, 436310990, 436299301, 436299302,
983  # TEC
984  #470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
985 ]
986 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
987 process.TrackerTrackHitFilter.stripAllInvalidHits = False
988 process.TrackerTrackHitFilter.rejectBadStoNHits = True
989 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 18.0")
990 process.TrackerTrackHitFilter.rejectLowAngleHits= True
991 process.TrackerTrackHitFilter.TrackAngleCut= 0.35 # in rads, starting from the module surface
992 process.TrackerTrackHitFilter.usePixelQualityFlag= True
993 
994 process.triggerSelection=cms.Sequence(process.hltPhysicsDeclared)
995 """
996 
997 
998 ######################################################################
999 ######################################################################
1000 TrackSelectionCosmicsDataFPIXplus = """
1001 ##### For Tracks:
1002 process.AlignmentTrackSelector.applyBasicCuts = True
1003 # Note that pMin is overridden and set to zero in
1004 # the offlineTemplate0T
1005 process.AlignmentTrackSelector.pMin = 4.
1006 process.AlignmentTrackSelector.pMax = 9999.
1007 process.AlignmentTrackSelector.ptMin = 0.
1008 process.AlignmentTrackSelector.ptMax = 9999.
1009 process.AlignmentTrackSelector.etaMin = -999.
1010 process.AlignmentTrackSelector.etaMax = 999.
1011 process.AlignmentTrackSelector.nHitMin = 8
1012 process.AlignmentTrackSelector.nHitMin2D = 2
1013 process.AlignmentTrackSelector.chi2nMax = 999.
1014 process.AlignmentTrackSelector.applyMultiplicityFilter = False
1015 process.AlignmentTrackSelector.maxMultiplicity = 1
1016 process.AlignmentTrackSelector.applyNHighestPt = False
1017 process.AlignmentTrackSelector.nHighestPt = 1
1018 process.AlignmentTrackSelector.seedOnlyFrom = 0
1019 process.AlignmentTrackSelector.applyIsolationCut = False
1020 process.AlignmentTrackSelector.minHitIsolation = 0.8
1021 process.AlignmentTrackSelector.applyChargeCheck = False
1022 process.AlignmentTrackSelector.minHitChargeStrip = 50.
1023 process.AlignmentTrackSelector.minHitsPerSubDet = cms.PSet(
1024  inTEC = cms.int32(0),
1025  inTOB = cms.int32(0),
1026  inFPIX = cms.int32(0),
1027  inTID = cms.int32(0),
1028  inBPIX = cms.int32(0),
1029  inTIB = cms.int32(0),
1030  inPIXEL = cms.int32(0),
1031  inTIDplus = cms.int32(0),
1032  inTIDminus = cms.int32(0),
1033  inTECplus = cms.int32(0),
1034  inTECminus = cms.int32(0),
1035  inFPIXplus = cms.int32(1),
1036  inFPIXminus = cms.int32(0),
1037  inENDCAP = cms.int32(0),
1038  inENDCAPplus = cms.int32(0),
1039  inENDCAPminus = cms.int32(0),
1040  )
1041 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
1042 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
1043 
1044 ##### For Hits:
1045 process.TrackerTrackHitFilter.useTrajectories= True # this is needed only if you require some selections; but it will work even if you don't ask for them
1046 process.TrackerTrackHitFilter.minimumHits = 8
1047 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
1048 process.TrackerTrackHitFilter.detsToIgnore = [
1049  # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
1050  # TIB / TID
1051  #369136710, 369136714, 402668822,
1052  # TOB
1053  #436310989, 436310990, 436299301, 436299302,
1054  # TEC
1055  #470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
1056 ]
1057 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
1058 process.TrackerTrackHitFilter.stripAllInvalidHits = False
1059 process.TrackerTrackHitFilter.rejectBadStoNHits = True
1060 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 18.0")
1061 process.TrackerTrackHitFilter.rejectLowAngleHits= True
1062 process.TrackerTrackHitFilter.TrackAngleCut= 0.35 # in rads, starting from the module surface
1063 process.TrackerTrackHitFilter.usePixelQualityFlag= True
1064 
1065 process.triggerSelection=cms.Sequence(process.hltPhysicsDeclared)
1066 """
1067 
1068 
1069 ######################################################################
1070 ######################################################################
1071 TrackSelectionCosmicsDataFPIXminus = """
1072 ##### For Tracks:
1073 process.AlignmentTrackSelector.applyBasicCuts = True
1074 # Note that pMin is overridden and set to zero in
1075 # the offlineTemplate0T
1076 process.AlignmentTrackSelector.pMin = 4.
1077 process.AlignmentTrackSelector.pMax = 9999.
1078 process.AlignmentTrackSelector.ptMin = 0.
1079 process.AlignmentTrackSelector.ptMax = 9999.
1080 process.AlignmentTrackSelector.etaMin = -999.
1081 process.AlignmentTrackSelector.etaMax = 999.
1082 process.AlignmentTrackSelector.nHitMin = 8
1083 process.AlignmentTrackSelector.nHitMin2D = 2
1084 process.AlignmentTrackSelector.chi2nMax = 999.
1085 process.AlignmentTrackSelector.applyMultiplicityFilter = False
1086 process.AlignmentTrackSelector.maxMultiplicity = 1
1087 process.AlignmentTrackSelector.applyNHighestPt = False
1088 process.AlignmentTrackSelector.nHighestPt = 1
1089 process.AlignmentTrackSelector.seedOnlyFrom = 0
1090 process.AlignmentTrackSelector.applyIsolationCut = False
1091 process.AlignmentTrackSelector.minHitIsolation = 0.8
1092 process.AlignmentTrackSelector.applyChargeCheck = False
1093 process.AlignmentTrackSelector.minHitChargeStrip = 50.
1094 process.AlignmentTrackSelector.minHitsPerSubDet = cms.PSet(
1095  inTEC = cms.int32(0),
1096  inTOB = cms.int32(0),
1097  inFPIX = cms.int32(0),
1098  inTID = cms.int32(0),
1099  inBPIX = cms.int32(0),
1100  inTIB = cms.int32(0),
1101  inPIXEL = cms.int32(0),
1102  inTIDplus = cms.int32(0),
1103  inTIDminus = cms.int32(0),
1104  inTECplus = cms.int32(0),
1105  inTECminus = cms.int32(0),
1106  inFPIXplus = cms.int32(0),
1107  inFPIXminus = cms.int32(1),
1108  inENDCAP = cms.int32(0),
1109  inENDCAPplus = cms.int32(0),
1110  inENDCAPminus = cms.int32(0),
1111  )
1112 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
1113 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
1114 
1115 ##### For Hits:
1116 process.TrackerTrackHitFilter.useTrajectories= True # this is needed only if you require some selections; but it will work even if you don't ask for them
1117 process.TrackerTrackHitFilter.minimumHits = 8
1118 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
1119 process.TrackerTrackHitFilter.detsToIgnore = [
1120  # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
1121  # TIB / TID
1122  #369136710, 369136714, 402668822,
1123  # TOB
1124  #436310989, 436310990, 436299301, 436299302,
1125  # TEC
1126  #470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
1127 ]
1128 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
1129 process.TrackerTrackHitFilter.stripAllInvalidHits = False
1130 process.TrackerTrackHitFilter.rejectBadStoNHits = True
1131 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 18.0")
1132 process.TrackerTrackHitFilter.rejectLowAngleHits= True
1133 process.TrackerTrackHitFilter.TrackAngleCut= 0.35 # in rads, starting from the module surface
1134 process.TrackerTrackHitFilter.usePixelQualityFlag= True
1135 
1136 process.triggerSelection=cms.Sequence(process.hltPhysicsDeclared)
1137 """
1138 
1139 
1140 ######################################################################
1141 ######################################################################
1142 TrackSelectionMinBiasData = """
1143 ##### For Tracks:collisions taken in deco mode
1144 process.AlignmentTrackSelector.applyBasicCuts = True
1145 # Note that pMin is overridden and set to zero in
1146 # the offlineTemplate0T
1147 process.AlignmentTrackSelector.pMin = 3
1148 process.AlignmentTrackSelector.pMax = 9999.
1149 process.AlignmentTrackSelector.ptMin = 0.65
1150 process.AlignmentTrackSelector.ptMax = 9999.
1151 process.AlignmentTrackSelector.etaMin = -999.
1152 process.AlignmentTrackSelector.etaMax = 999.
1153 process.AlignmentTrackSelector.nHitMin = 8
1154 process.AlignmentTrackSelector.nHitMin2D = 2
1155 process.AlignmentTrackSelector.chi2nMax = 999.
1156 process.AlignmentTrackSelector.applyMultiplicityFilter = False
1157 process.AlignmentTrackSelector.maxMultiplicity = 1
1158 process.AlignmentTrackSelector.applyNHighestPt = False
1159 process.AlignmentTrackSelector.nHighestPt = 1
1160 process.AlignmentTrackSelector.seedOnlyFrom = 0
1161 process.AlignmentTrackSelector.applyIsolationCut = False
1162 process.AlignmentTrackSelector.minHitIsolation = 0.8
1163 process.AlignmentTrackSelector.applyChargeCheck = False
1164 process.AlignmentTrackSelector.minHitChargeStrip = 50.
1165 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
1166 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
1167 
1168 ##### For Hits:
1169 process.TrackerTrackHitFilter.useTrajectories= True # this is needed only if you require some selections; but it will work even if you don't ask for them
1170 process.TrackerTrackHitFilter.minimumHits = 8
1171 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
1172 process.TrackerTrackHitFilter.detsToIgnore = [
1173  # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
1174  # TIB / TID
1175  #369136710, 369136714, 402668822,
1176  # TOB
1177  #436310989, 436310990, 436299301, 436299302,
1178 
1179  # TEC
1180  #470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
1181 ]
1182 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
1183 process.TrackerTrackHitFilter.stripAllInvalidHits = False
1184 process.TrackerTrackHitFilter.rejectBadStoNHits = True
1185 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 12.0")
1186 process.TrackerTrackHitFilter.rejectLowAngleHits= True
1187 process.TrackerTrackHitFilter.TrackAngleCut= 0.17 # in rads, starting from the module surface
1188 process.TrackerTrackHitFilter.usePixelQualityFlag= True
1189 
1190 ##############
1191 ##Trigger sequence
1192 #############
1193 #bit 0 is selecting bunch crossing
1194 #bit 40 MinBias trigger
1195 
1196 
1197 process.triggerSelection=cms.Sequence(process.oneGoodVertexFilter)
1198 
1199 """
1200 
1201 
1202 ######################################################################
1203 ######################################################################
1204 TrackSelectionIsolatedMuons = """
1205 ##### For Tracks:collisions taken in deco mode
1206 
1207 process.AlignmentTrackSelector.applyBasicCuts = True
1208 # Note that pMin is overridden and set to zero in
1209 # the offlineTemplate0T
1210 process.AlignmentTrackSelector.pMin = 0
1211 process.AlignmentTrackSelector.pMax = 9999.
1212 process.AlignmentTrackSelector.ptMin = 3.
1213 process.AlignmentTrackSelector.ptMax = 9999.
1214 process.AlignmentTrackSelector.etaMin = -999.
1215 process.AlignmentTrackSelector.etaMax = 999.
1216 process.AlignmentTrackSelector.nHitMin = 8
1217 process.AlignmentTrackSelector.nHitMin2D = 2
1218 process.AlignmentTrackSelector.chi2nMax = 999.
1219 process.AlignmentTrackSelector.applyMultiplicityFilter = False
1220 process.AlignmentTrackSelector.maxMultiplicity = 1
1221 process.AlignmentTrackSelector.applyNHighestPt = False
1222 process.AlignmentTrackSelector.nHighestPt = 1
1223 process.AlignmentTrackSelector.seedOnlyFrom = 0
1224 process.AlignmentTrackSelector.applyIsolationCut = False
1225 process.AlignmentTrackSelector.minHitIsolation = 0.8
1226 process.AlignmentTrackSelector.applyChargeCheck = False
1227 process.AlignmentTrackSelector.minHitChargeStrip = 50.
1228 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
1229 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
1230 
1231 ##### For Hits:
1232 process.TrackerTrackHitFilter.useTrajectories= True # this is needed only if you require some selections; but it will work even if you don't ask for them
1233 process.TrackerTrackHitFilter.minimumHits = 8
1234 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
1235 process.TrackerTrackHitFilter.detsToIgnore = [
1236  # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
1237  # TIB / TID
1238  #369136710, 369136714, 402668822,
1239  # TOB
1240  #436310989, 436310990, 436299301, 436299302,
1241  # TEC
1242  #470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
1243 ]
1244 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
1245 process.TrackerTrackHitFilter.stripAllInvalidHits = False
1246 process.TrackerTrackHitFilter.rejectBadStoNHits = True
1247 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 12.0")
1248 process.TrackerTrackHitFilter.rejectLowAngleHits= True
1249 process.TrackerTrackHitFilter.TrackAngleCut= 0.17 # in rads, starting from the module surface
1250 process.TrackerTrackHitFilter.usePixelQualityFlag= True
1251 
1252 ##############
1253 ##Trigger sequence
1254 #############
1255 #bit 0 is selecting bunch crossing
1256 #bit xy for muons trigger
1257 
1258 
1259 #process.triggerSelection=cms.Sequence(process.bptxAnd)
1260 
1261 
1262 
1263 """
1264 
1265 
1266 ######################################################################
1267 ######################################################################
1268 CosmicsOfflineValidation_Deformations="""
1269 import FWCore.ParameterSet.Config as cms
1270 
1271 process = cms.Process("OfflineValidator")
1272 
1273 process.load("Alignment.OfflineValidation..oO[dataset]Oo._cff")
1274 
1275 #process.source.inputCommands = cms.untracked.vstring('keep *', 'drop *_MEtoEDMConverter_*_*') # hack to get rid of the memory consumption problem in 2_2_X and beond
1276 process.options = cms.untracked.PSet(
1277  wantSummary = cms.untracked.bool(False),
1278  Rethrow = cms.untracked.vstring("ProductNotFound"), # make this exception fatal
1279  fileMode = cms.untracked.string('NOMERGE') # no ordering needed, but calls endRun/beginRun etc. at file boundaries
1280 )
1281 
1282  ##
1283  ## Maximum number of Events
1284  ##
1285 process.maxEvents = cms.untracked.PSet(
1286  input = cms.untracked.int32(.oO[nEvents]Oo.)
1287  )
1288 
1289  ##
1290  ## Messages & Convenience
1291  ##
1292 process.load("FWCore.MessageLogger.MessageLogger_cfi")
1293 process.MessageLogger.cerr = cms.untracked.PSet(placeholder = cms.untracked.bool(True))
1294 process.MessageLogger.cout = cms.untracked.PSet(INFO = cms.untracked.PSet(
1295 reportEvery = cms.untracked.int32(1000) # every 1000th only
1296 # limit = cms.untracked.int32(10) # or limit to 10 printouts...
1297 ))
1298 process.MessageLogger.statistics.append('cout')
1299 
1300 
1301 #-- Track hit filter
1302 # TrackerTrackHitFilter takes as input the tracks/trajectories coming out from TrackRefitter1
1303 process.load("RecoTracker.FinalTrackSelectors.TrackerTrackHitFilter_cff")
1304 process.TrackerTrackHitFilter.src = 'TrackRefitter1'
1305 
1306 
1307 
1308 #-- Alignment Track Selection
1309 process.load("Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi")
1310 process.AlignmentTrackSelector.src = 'HitFilteredTracks'
1311 process.AlignmentTrackSelector.filter = True
1312 
1313 .oO[TrackSelectionTemplate]Oo.
1314 
1315 #now we give the TrackCandidate coming out of the TrackerTrackHitFilter to the track producer
1316 import RecoTracker.TrackProducer.CTFFinalFitWithMaterialP5_cff
1317 process.HitFilteredTracks = RecoTracker.TrackProducer.CTFFinalFitWithMaterialP5_cff.ctfWithMaterialTracksCosmics.clone(
1318  src = 'TrackerTrackHitFilter',
1319 ### TrajectoryInEvent = True,
1320  NavigationSchool = '',
1321  TTRHBuilder = "WithAngleAndTemplate"
1322 )
1323 
1324  ##
1325  ## Load and Configure TrackRefitter1
1326  ##
1327 
1328 
1329 #############
1330 process.load("RecoTracker.TrackProducer.TrackRefitters_cff")
1331 
1332 process.TrackRefitter1 = process.TrackRefitterP5.clone(
1333  src = 'ALCARECOTkAlCosmicsCTF0T',
1334  TrajectoryInEvent = True,
1335  NavigationSchool = '',
1336  TTRHBuilder = "WithAngleAndTemplate"
1337 )
1338 process.TrackRefitter2 = process.TrackRefitter1.clone(
1339  src = 'AlignmentTrackSelector',
1340 
1341  )
1342 
1343 
1344  ##
1345  ## Get the BeamSpot
1346  ##
1347 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff")
1348 
1349  ##
1350  ## GlobalTag Conditions (if needed)
1351  ##
1352 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
1353 # process.GlobalTag.connect = "frontier://FrontierProd/CMS_COND_31X_GLOBALTAG"
1354 process.GlobalTag.globaltag = ".oO[GlobalTag]Oo."
1355 
1356 
1357 .oO[LorentzAngleTemplate]Oo.
1358 
1359  ##
1360  ## Geometry
1361  ##
1362 process.load("Configuration.StandardSequences.Geometry_cff")
1363 
1364  ##
1365  ## Magnetic Field
1366  ##
1367 process.load("Configuration/StandardSequences/MagneticField_38T_cff")
1368 
1369 .oO[condLoad]Oo.
1370 
1371 from CondCore.DBCommon.CondDBSetup_cfi import *
1372 process.trackerSurfaces = cms.ESSource(
1373  "PoolDBESSource",
1374  CondDBSetup,
1375  connect = cms.string('.oO[dbpath]Oo.'),
1376  toGet = cms.VPSet(cms.PSet(record = cms.string("TrackerSurfaceDeformationRcd"),
1377  tag = cms.string("Deformations")
1378  )
1379  )
1380  )
1381 process.es_prefer_trackerSurfaces = cms.ESPrefer("PoolDBESSource", "trackerSurfaces")
1382 
1383 ## to apply misalignments
1384 #TrackerDigiGeometryESModule.applyAlignment = True
1385 
1386  ##
1387  ## Load and Configure OfflineValidation
1388  ##
1389 
1390 process.load("Alignment.OfflineValidation.TrackerOfflineValidation_.oO[offlineValidationMode]Oo._cff")
1391 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..Tracks = 'TrackRefitter2'
1392 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..trajectoryInput = 'TrackRefitter2'
1393 #process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..moduleLevelHistsTransient = cms.bool(.oO[offlineModuleLevelHistsTransient]Oo.)
1394 process.TrackerOfflineValidationStandalone.moduleLevelHistsTransient = cms.bool(False)
1395 process.TrackerOfflineValidationStandalone.moduleLevelProfiles = cms.bool(True)
1396 process.TFileService.fileName = '.oO[outputFile]Oo.'
1397 
1398  ##
1399  ## PATH
1400  ##
1401 process.p = cms.Path(process.offlineBeamSpot*process.TrackRefitter1*process.TrackerTrackHitFilter*process.HitFilteredTracks
1402  *process.AlignmentTrackSelector*process.TrackRefitter2*process.seqTrackerOfflineValidation.oO[offlineValidationMode]Oo.)
1403 
1404 
1405 """
1406 
1407 
1408 ######################################################################
1409 ######################################################################
1410 TrackSelectionCosmicsDataDef = """
1411 # import CalibTracker.Configuration.Common.PoolDBESSource_cfi
1412 # process.trackerBowedSensors = CalibTracker.Configuration.Common.PoolDBESSource_cfi.poolDBESSource.clone(
1413 # connect = cms.string('.oO[dbpath]Oo.'),
1414 
1415 # toGet = cms.VPSet(cms.PSet(record = cms.string('TrackerSurfaceDeformationRcd'),
1416 # tag = cms.string('Deformations')
1417 # )
1418 # )
1419 # )
1420 # process.prefer_trackerBowedSensors = cms.ESPrefer("PoolDBESSource", "trackerBowedSensors")
1421 ##### For Tracks:
1422 process.AlignmentTrackSelector.applyBasicCuts = True
1423 # Note that pMin is overridden and set to zero in
1424 # the offlineTemplate0T
1425 process.AlignmentTrackSelector.pMin = 4.
1426 process.AlignmentTrackSelector.pMax = 9999.
1427 process.AlignmentTrackSelector.ptMin = 0.
1428 process.AlignmentTrackSelector.ptMax = 9999.
1429 process.AlignmentTrackSelector.etaMin = -999.
1430 process.AlignmentTrackSelector.etaMax = 999.
1431 process.AlignmentTrackSelector.nHitMin = 8
1432 process.AlignmentTrackSelector.nHitMin2D = 2
1433 process.AlignmentTrackSelector.chi2nMax = 999.
1434 process.AlignmentTrackSelector.applyMultiplicityFilter = True
1435 process.AlignmentTrackSelector.maxMultiplicity = 1
1436 process.AlignmentTrackSelector.applyNHighestPt = False
1437 process.AlignmentTrackSelector.nHighestPt = 1
1438 process.AlignmentTrackSelector.seedOnlyFrom = 0
1439 process.AlignmentTrackSelector.applyIsolationCut = False
1440 process.AlignmentTrackSelector.minHitIsolation = 0.8
1441 process.AlignmentTrackSelector.applyChargeCheck = False
1442 process.AlignmentTrackSelector.minHitChargeStrip = 50.
1443 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
1444 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
1445 
1446 ##### For Hits:
1447 process.TrackerTrackHitFilter.useTrajectories= True # this is needed only if you require some selections; but it will work even if you don't ask for them
1448 process.TrackerTrackHitFilter.minimumHits = 8
1449 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
1450 process.TrackerTrackHitFilter.detsToIgnore = [
1451  # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
1452  # TIB / TID
1453  #369136710, 369136714, 402668822,
1454  # TOB
1455  #436310989, 436310990, 436299301, 436299302,
1456  # TEC
1457  #470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
1458 ]
1459 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
1460 process.TrackerTrackHitFilter.stripAllInvalidHits = False
1461 process.TrackerTrackHitFilter.rejectBadStoNHits = True
1462 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 18.0")
1463 process.TrackerTrackHitFilter.rejectLowAngleHits= True
1464 process.TrackerTrackHitFilter.TrackAngleCut= 0.35 # in rads, starting from the module surface
1465 process.TrackerTrackHitFilter.usePixelQualityFlag= True
1466 #process.TrackerTrackHitFilter.PxlCorrClusterChargeCut = 10000.0
1467 process.triggerSelection=cms.Sequence(process.hltPhysicsDeclared)
1468 """
1469 
1470 
1471 ######################################################################
1472 ######################################################################
1473 TrackSelectionCosmicsInterfillLADef = """
1474 # import CalibTracker.Configuration.Common.PoolDBESSource_cfi
1475 # process.trackerBowedSensors = CalibTracker.Configuration.Common.PoolDBESSource_cfi.poolDBESSource.clone(
1476 # connect = cms.string('.oO[dbpath]Oo.'),
1477 
1478 # toGet = cms.VPSet(cms.PSet(record = cms.string('TrackerSurfaceDeformationRcd'),
1479 # tag = cms.string('Deformations')
1480 # )
1481 # )
1482 # )
1483 # process.prefer_trackerBowedSensors = cms.ESPrefer("PoolDBESSource", "trackerBowedSensors")
1484 
1485 #LA
1486 process.myLA = CalibTracker.Configuration.Common.PoolDBESSource_cfi.poolDBESSource.clone(
1487  connect = cms.string ('frontier://PromptProd/CMS_COND_31X_STRIP'),
1488  toGet = cms.VPSet(cms.PSet(
1489  record = cms.string('SiStripLorentzAngleRcd'),
1490  tag = cms.string('SiStripLorentzAnglePeak_GR10_v1_offline')
1491 
1492  ))
1493  )
1494 process.es_prefer_myLA = cms.ESPrefer("PoolDBESSource","myLA")
1495 
1496 #-- initialize beam spot
1497 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cfi")
1498 
1499 ##### For Tracks:
1500 process.AlignmentTrackSelector.applyBasicCuts = True
1501 # Note that pMin is overridden and set to zero in
1502 # the offlineTemplate0T
1503 process.AlignmentTrackSelector.pMin = 4.
1504 process.AlignmentTrackSelector.pMax = 9999.
1505 process.AlignmentTrackSelector.ptMin = 0.
1506 process.AlignmentTrackSelector.ptMax = 9999.
1507 process.AlignmentTrackSelector.etaMin = -999.
1508 process.AlignmentTrackSelector.etaMax = 999.
1509 process.AlignmentTrackSelector.nHitMin = 8
1510 process.AlignmentTrackSelector.nHitMin2D = 2
1511 process.AlignmentTrackSelector.chi2nMax = 999.
1512 process.AlignmentTrackSelector.applyMultiplicityFilter = False
1513 process.AlignmentTrackSelector.maxMultiplicity = 1
1514 process.AlignmentTrackSelector.applyNHighestPt = False
1515 process.AlignmentTrackSelector.nHighestPt = 1
1516 process.AlignmentTrackSelector.seedOnlyFrom = 0
1517 process.AlignmentTrackSelector.applyIsolationCut = False
1518 process.AlignmentTrackSelector.minHitIsolation = 0.8
1519 process.AlignmentTrackSelector.applyChargeCheck = False
1520 process.AlignmentTrackSelector.minHitChargeStrip = 50.
1521 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
1522 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
1523 
1524 ##### For Hits:
1525 process.TrackerTrackHitFilter.useTrajectories= True # this is needed only if you require some selections; but it will work even if you don't ask for them
1526 process.TrackerTrackHitFilter.minimumHits = 8
1527 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
1528 process.TrackerTrackHitFilter.detsToIgnore = [
1529  # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
1530  # TIB / TID
1531  #369136710, 369136714, 402668822,
1532  # TOB
1533  #436310989, 436310990, 436299301, 436299302,
1534  # TEC
1535  #470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
1536 ]
1537 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
1538 process.TrackerTrackHitFilter.stripAllInvalidHits = False
1539 process.TrackerTrackHitFilter.rejectBadStoNHits = True
1540 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 18.0")
1541 process.TrackerTrackHitFilter.rejectLowAngleHits= True
1542 process.TrackerTrackHitFilter.TrackAngleCut= 0.35 # in rads, starting from the module surface
1543 process.TrackerTrackHitFilter.usePixelQualityFlag= True
1544 
1545 #######################################
1546 ##Trigger settings for Cosmics during collisions
1547 #######################################
1548 process.load('L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskTechTrigConfig_cff')
1549 process.load('HLTrigger/HLTfilters/hltLevel1GTSeed_cfi')
1550 process.L1T1=process.hltLevel1GTSeed.clone()
1551 process.L1T1.L1TechTriggerSeeding = cms.bool(True)
1552 process.L1T1.L1SeedsLogicalExpression=cms.string('25')
1553 process.hltHighLevel = cms.EDFilter("HLTHighLevel",
1554  TriggerResultsTag = cms.InputTag("TriggerResults","","HLT"),
1555  HLTPaths = cms.vstring('HLT_TrackerCosmics'),
1556  eventSetupPathsKey = cms.string(''),
1557  andOr = cms.bool(False),
1558  throw = cms.bool(True)
1559 )
1560 
1561 
1562 process.triggerSelection=cms.Sequence(process.L1T1*process.hltHighLevel)
1563 """
1564 
1565 
1566 ######################################################################
1567 ######################################################################
1568 TrackSelectionMinBiasDataDef = """
1569 # import CalibTracker.Configuration.Common.PoolDBESSource_cfi
1570 # process.trackerBowedSensors = CalibTracker.Configuration.Common.PoolDBESSource_cfi.poolDBESSource.clone(
1571 # connect = cms.string('.oO[dbpath]Oo.'),
1572 
1573 # toGet = cms.VPSet(cms.PSet(record = cms.string('TrackerSurfaceDeformationRcd'),
1574 # tag = cms.string('Deformations')
1575 # )
1576 # )
1577 # )
1578 # process.prefer_trackerBowedSensors = cms.ESPrefer("PoolDBESSource", "trackerBowedSensors")
1579 
1580 ##### For Tracks:collisions taken in deco mode
1581 process.AlignmentTrackSelector.applyBasicCuts = True
1582 # Note that pMin is overridden and set to zero in
1583 # the offlineTemplate0T
1584 process.AlignmentTrackSelector.pMin = 3
1585 process.AlignmentTrackSelector.pMax = 9999.
1586 process.AlignmentTrackSelector.ptMin = 0.65
1587 process.AlignmentTrackSelector.ptMax = 9999.
1588 process.AlignmentTrackSelector.etaMin = -999.
1589 process.AlignmentTrackSelector.etaMax = 999.
1590 process.AlignmentTrackSelector.nHitMin = 8
1591 process.AlignmentTrackSelector.nHitMin2D = 2
1592 process.AlignmentTrackSelector.chi2nMax = 999.
1593 process.AlignmentTrackSelector.applyMultiplicityFilter = False
1594 process.AlignmentTrackSelector.maxMultiplicity = 1
1595 process.AlignmentTrackSelector.applyNHighestPt = False
1596 process.AlignmentTrackSelector.nHighestPt = 1
1597 process.AlignmentTrackSelector.seedOnlyFrom = 0
1598 process.AlignmentTrackSelector.applyIsolationCut = False
1599 process.AlignmentTrackSelector.minHitIsolation = 0.8
1600 process.AlignmentTrackSelector.applyChargeCheck = False
1601 process.AlignmentTrackSelector.minHitChargeStrip = 50.
1602 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
1603 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
1604 
1605 ##### For Hits:
1606 process.TrackerTrackHitFilter.useTrajectories= True # this is needed only if you require some selections; but it will work even if you don't ask for them
1607 process.TrackerTrackHitFilter.minimumHits = 8
1608 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
1609 process.TrackerTrackHitFilter.detsToIgnore = [
1610  # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
1611  # TIB / TID
1612  #369136710, 369136714, 402668822,
1613  # TOB
1614  #436310989, 436310990, 436299301, 436299302,
1615 
1616  # TEC
1617  #470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
1618 ]
1619 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
1620 process.TrackerTrackHitFilter.stripAllInvalidHits = False
1621 process.TrackerTrackHitFilter.rejectBadStoNHits = True
1622 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 12.0")
1623 process.TrackerTrackHitFilter.rejectLowAngleHits= True
1624 process.TrackerTrackHitFilter.TrackAngleCut= 0.17 # in rads, starting from the module surface
1625 process.TrackerTrackHitFilter.usePixelQualityFlag= True
1626 
1627 ##############
1628 ##Trigger sequence
1629 #############
1630 #bit 0 is selecting bunch crossing
1631 #bit 40 MinBias trigger
1632 
1633 
1634 process.triggerSelection=cms.Sequence(process.oneGoodVertexFilter)
1635 
1636 """
1637 
1638 
1639 ######################################################################
1640 ######################################################################
1641 TrackSelectionIsolatedMuonsDef = """
1642 ##### For Tracks:collisions taken in deco mode
1643 # import CalibTracker.Configuration.Common.PoolDBESSource_cfi
1644 # process.trackerBowedSensors = CalibTracker.Configuration.Common.PoolDBESSource_cfi.poolDBESSource.clone(
1645 # connect = cms.string('.oO[dbpath]Oo.'),
1646 
1647 # toGet = cms.VPSet(cms.PSet(record = cms.string('TrackerSurfaceDeformationRcd'),
1648 # tag = cms.string('Deformations')
1649 # )
1650 # )
1651 # )
1652 # process.prefer_trackerBowedSensors = cms.ESPrefer("PoolDBESSource", "trackerBowedSensors")
1653 
1654 
1655 process.AlignmentTrackSelector.applyBasicCuts = True
1656 # Note that pMin is overridden and set to zero in
1657 # the offlineTemplate0T
1658 process.AlignmentTrackSelector.pMin = 3.
1659 process.AlignmentTrackSelector.pMax = 9999.
1660 process.AlignmentTrackSelector.ptMin = 5.
1661 process.AlignmentTrackSelector.ptMax = 9999.
1662 process.AlignmentTrackSelector.etaMin = -3.
1663 process.AlignmentTrackSelector.etaMax = 3.
1664 process.AlignmentTrackSelector.nHitMin = 10
1665 process.AlignmentTrackSelector.nHitMin2D = 2
1666 process.AlignmentTrackSelector.chi2nMax = 999.
1667 process.AlignmentTrackSelector.applyMultiplicityFilter = False
1668 process.AlignmentTrackSelector.maxMultiplicity = 1
1669 process.AlignmentTrackSelector.applyNHighestPt = False
1670 process.AlignmentTrackSelector.nHighestPt = 1
1671 process.AlignmentTrackSelector.seedOnlyFrom = 0
1672 process.AlignmentTrackSelector.applyIsolationCut = False
1673 process.AlignmentTrackSelector.minHitIsolation = 0.8
1674 process.AlignmentTrackSelector.applyChargeCheck = False
1675 process.AlignmentTrackSelector.minHitChargeStrip = 30.
1676 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
1677 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
1678 
1679 ##### For Hits:
1680 process.TrackerTrackHitFilter.useTrajectories= True # this is needed only if you require some selections; but it will work even if you don't ask for them
1681 process.TrackerTrackHitFilter.minimumHits = 8
1682 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
1683 process.TrackerTrackHitFilter.detsToIgnore = [
1684  # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
1685  # TIB / TID
1686  #369136710, 369136714, 402668822,
1687  # TOB
1688  #436310989, 436310990, 436299301, 436299302,
1689  # TEC
1690  #470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
1691 ]
1692 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
1693 process.TrackerTrackHitFilter.stripAllInvalidHits = False
1694 process.TrackerTrackHitFilter.rejectBadStoNHits = True
1695 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 12.0")
1696 process.TrackerTrackHitFilter.rejectLowAngleHits= True
1697 process.TrackerTrackHitFilter.TrackAngleCut= 0.17 # in rads, starting from the module surface
1698 process.TrackerTrackHitFilter.usePixelQualityFlag= True
1699 
1700 ##############
1701 ##Trigger sequence
1702 #############
1703 #bit 0 is selecting bunch crossing
1704 #bit xy for muons trigger
1705 
1706 
1707 #process.triggerSelection=cms.Sequence(process.bptxAnd)
1708 
1709 """