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.Geometry.GeometryDB_cff")
156 
157  ##
158  ## Magnetic Field
159  ##
160 process.load("Configuration/StandardSequences/MagneticField_.oO[magneticField]Oo._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('TrackerAlignmentErrorExtendedRcd'),
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 .oO[datasetDefinition]Oo.
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  ## Messages & Convenience
219  ##
220 process.load("FWCore.MessageLogger.MessageLogger_cfi")
221 process.MessageLogger.cerr = cms.untracked.PSet(placeholder = cms.untracked.bool(True))
222 process.MessageLogger.cout = cms.untracked.PSet(INFO = cms.untracked.PSet(
223 reportEvery = cms.untracked.int32(1000) # every 1000th only
224 # limit = cms.untracked.int32(10) # or limit to 10 printouts...
225 ))
226 process.MessageLogger.statistics.append('cout')
227 
228  ##
229  ## Get the BeamSpot
230  ##
231 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff")
232 
233  #-- Refitting
234 process.load("RecoTracker.TrackProducer.TrackRefitters_cff")
235 
236 ##-- Track hit filter
237 ## TrackerTrackHitFilter takes as input the tracks/trajectories coming out from TrackRefitter1
238 #process.load("RecoTracker.FinalTrackSelectors.TrackerTrackHitFilter_cff")
239 #process.TrackerTrackHitFilter.src = 'TrackRefitter1'
240 
241 #-- 1st refit from file
242 process.TrackRefitter1 = process.TrackRefitterP5.clone(
243  src ='ALCARECOTkAlCosmicsCTF0T',
244  NavigationSchool = cms.string(''),
245  TrajectoryInEvent = True,
246  TTRHBuilder = "WithAngleAndTemplate" #default
247  )
248 
249 #-- 2nd fit for AlignmentProducer
250 process.TrackRefitter2 = process.TrackRefitter1.clone(
251  src = 'AlignmentTrackSelector'
252  )
253 
254 #-- Filter bad hits
255 process.load("RecoTracker.FinalTrackSelectors.TrackerTrackHitFilter_cff")
256 process.TrackerTrackHitFilter.src = 'TrackRefitter1'
257 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
258 process.TrackerTrackHitFilter.minimumHits = 8
259 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
260 process.TrackerTrackHitFilter.detsToIgnore = []
261 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
262 process.TrackerTrackHitFilter.stripAllInvalidHits = False
263 process.TrackerTrackHitFilter.rejectBadStoNHits = True
264 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 18.0")
265 process.TrackerTrackHitFilter.rejectLowAngleHits = True
266 process.TrackerTrackHitFilter.TrackAngleCut = 0.35 # in rads, starting from the module surface
267 process.TrackerTrackHitFilter.usePixelQualityFlag = True #False
268 
269 #-- TrackProducer
270 ## now we give the TrackCandidate coming out of the TrackerTrackHitFilter to the track producer
271 import RecoTracker.TrackProducer.CTFFinalFitWithMaterialP5_cff
272 process.TrackCandidateFitter = RecoTracker.TrackProducer.CTFFinalFitWithMaterialP5_cff.ctfWithMaterialTracksCosmics.clone(
273 src = 'TrackerTrackHitFilter',
274  NavigationSchool = cms.string(''),
275  TTRHBuilder = "WithAngleAndTemplate"
276  )
277 #-- Filter tracks for alignment
278 process.load("Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi")
279 process.AlignmentTrackSelector.src = 'TrackCandidateFitter'
280 process.AlignmentTrackSelector.applyBasicCuts = True
281 process.AlignmentTrackSelector.pMin = 4
282 process.AlignmentTrackSelector.pMax = 9999.
283 process.AlignmentTrackSelector.ptMin = 0
284 process.AlignmentTrackSelector.etaMin = -999.
285 process.AlignmentTrackSelector.etaMax = 999.
286 process.AlignmentTrackSelector.nHitMin = 8
287 process.AlignmentTrackSelector.nHitMin2D = 2
288 process.AlignmentTrackSelector.chi2nMax = 99.
289 process.AlignmentTrackSelector.applyMultiplicityFilter = True# False
290 process.AlignmentTrackSelector.maxMultiplicity = 1
291 
292 ## GlobalTag Conditions (if needed)
293 ##
294 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
295 process.GlobalTag.globaltag = ".oO[GlobalTag]Oo."
296 
297 
298 ##
299 ## Geometry
300 ##
301 process.load("Configuration.Geometry.GeometryDB_cff")
302 
303 ##
304 ## Magnetic Field
305 ##
306 process.load("Configuration/StandardSequences/MagneticField_.oO[magneticField]Oo._cff")
307 
308 .oO[LorentzAngleTemplate]Oo.
309 
310  ##
311  ## Geometry
312  ##
313 #process.load("Configuration.Geometry.GeometryDB_cff")
314 
315 
316 .oO[condLoad]Oo.
317 
318  ##
319  ## Load and Configure OfflineValidation
320  ##
321 
322 process.load("Alignment.OfflineValidation.TrackerOfflineValidation_.oO[offlineValidationMode]Oo._cff")
323 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..Tracks = 'TrackRefitter2'
324 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..trajectoryInput = 'TrackRefitter2'
325 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..moduleLevelHistsTransient = cms.bool(.oO[offlineModuleLevelHistsTransient]Oo.)
326 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..moduleLevelProfiles = cms.bool(.oO[offlineModuleLevelProfiles]Oo.)
327 process.TFileService.fileName = '.oO[outputFile]Oo.'
328 
329  ##
330  ## PATH
331  ##
332 
333 process.p = cms.Path( process.offlineBeamSpot
334  *process.TrackRefitter1
335  *process.TrackerTrackHitFilter
336  *process.TrackCandidateFitter
337  *process.AlignmentTrackSelector
338  *process.TrackRefitter2
339  *process.seqTrackerOfflineValidationStandalone
340 )
341 
342 
343 """
344 
345 
346 ######################################################################
347 ######################################################################
348 CosmicsAt0TOfflineValidation="""
349 import FWCore.ParameterSet.Config as cms
350 
351 process = cms.Process("OfflineValidator")
352 
353 .oO[datasetDefinition]Oo.
354 
355 process.options = cms.untracked.PSet(
356  wantSummary = cms.untracked.bool(False),
357  Rethrow = cms.untracked.vstring("ProductNotFound"), # make this exception fatal
358  fileMode = cms.untracked.string('NOMERGE') # no ordering needed, but calls endRun/beginRun etc. at file boundaries
359 )
360 
361  ##
362  ## Messages & Convenience
363  ##
364 process.load("FWCore.MessageLogger.MessageLogger_cfi")
365 process.MessageLogger.cerr = cms.untracked.PSet(placeholder = cms.untracked.bool(True))
366 process.MessageLogger.cout = cms.untracked.PSet(INFO = cms.untracked.PSet(
367 reportEvery = cms.untracked.int32(1000) # every 1000th only
368 # limit = cms.untracked.int32(10) # or limit to 10 printouts...
369 ))
370 process.MessageLogger.statistics.append('cout')
371 
372 
373 #-- Track hit filter
374 # TrackerTrackHitFilter takes as input the tracks/trajectories coming out from TrackRefitter1
375 process.load("RecoTracker.FinalTrackSelectors.TrackerTrackHitFilter_cff")
376 process.TrackerTrackHitFilter.src = 'TrackRefitter1'
377 
378 #-- Alignment Track Selection
379 process.load("Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi")
380 process.AlignmentTrackSelector.src = 'HitFilteredTracks'
381 process.AlignmentTrackSelector.filter = True
382 
383 .oO[TrackSelectionTemplate]Oo.
384 # Override the pmin setting since not meaningful with B=0T
385 process.AlignmentTrackSelector.pMin = 4.
386 
387 #### momentum constraint for 0T
388 # First momentum constraint
389 process.load("RecoTracker.TrackProducer.MomentumConstraintProducer_cff")
390 import RecoTracker.TrackProducer.MomentumConstraintProducer_cff
391 process.AliMomConstraint1 = RecoTracker.TrackProducer.MomentumConstraintProducer_cff.MyMomConstraint.clone()
392 process.AliMomConstraint1.src = '.oO[TrackCollection]Oo.'
393 process.AliMomConstraint1.fixedMomentum = 5.0
394 process.AliMomConstraint1.fixedMomentumError = 0.005
395 
396 # Second momentum constraint
397 #process.load("RecoTracker.TrackProducer.MomentumConstraintProducer_cff")
398 #import RecoTracker.TrackProducer.MomentumConstraintProducer_cff
399 #process.AliMomConstraint2 = RecoTracker.TrackProducer.MomentumConstraintProducer_cff.MyMomConstraint.clone()
400 #process.AliMomConstraint2.src = 'AlignmentTrackSelector'
401 #process.AliMomConstraint2.fixedMomentum = 5.0
402 #process.AliMomConstraint2.fixedMomentumError = 0.005
403 
404 
405 
406 #now we give the TrackCandidate coming out of the TrackerTrackHitFilter to the track producer
407 import RecoTracker.TrackProducer.CTFFinalFitWithMaterialP5_cff
408 process.HitFilteredTracks = RecoTracker.TrackProducer.CTFFinalFitWithMaterialP5_cff.ctfWithMaterialTracksCosmics.clone(
409  src = 'TrackerTrackHitFilter',
410  NavigationSchool = "",
411 ### TrajectoryInEvent = True,
412  TTRHBuilder = "WithAngleAndTemplate"
413 )
414 
415  ##
416  ## Load and Configure TrackRefitter1
417  ##
418 
419 process.load("RecoTracker.TrackProducer.TrackRefitters_cff")
420 
421 #############
422 # parameters for TrackRefitter
423 #process.load("RecoTracker.TrackProducer.RefitterWithMaterial_cff")
424 import RecoTracker.TrackProducer.TrackRefitters_cff
425 process.TrackRefitter1 = process.TrackRefitterP5.clone(
426  src = '.oO[TrackCollection]Oo.', #'AliMomConstraint1',
427  TrajectoryInEvent = True,
428  TTRHBuilder = "WithAngleAndTemplate",
429  NavigationSchool = ""
430  #constraint = 'momentum', ### SPECIFIC FOR CRUZET
431  #srcConstr='AliMomConstraint1' ### SPECIFIC FOR CRUZET$works only with tag V02-10-02 TrackingTools/PatternTools / or CMSSW >=31X
432 )
433 
434 process.TrackRefitter2 = process.TrackRefitter1.clone(
435  src = 'AlignmentTrackSelector',
436  srcConstr='AliMomConstraint1',
437  #constraint = 'momentum' ### SPECIFIC FOR CRUZET
438 )
439 
440 
441  ##
442  ## Get the BeamSpot
443  ##
444 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff")
445 
446  ##
447  ## GlobalTag Conditions (if needed)
448  ##
449 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
450 process.GlobalTag.globaltag = ".oO[GlobalTag]Oo."
451 # process.GlobalTag.connect="frontier://FrontierProd/CMS_COND_31X_GLOBALTAG"
452 
453 .oO[LorentzAngleTemplate]Oo.
454 
455  ##
456  ## Geometry
457  ##
458 process.load("Configuration.Geometry.GeometryDB_cff")
459 
460  ##
461  ## Magnetic Field
462  ##
463 process.load("Configuration.StandardSequences.MagneticField_.oO[magneticField]Oo._cff")
464 
465 .oO[condLoad]Oo.
466 
467 ## to apply misalignments
468 #TrackerDigiGeometryESModule.applyAlignment = True
469 
470  ##
471  ## Load and Configure OfflineValidation
472  ##
473 process.load("Alignment.OfflineValidation.TrackerOfflineValidation_.oO[offlineValidationMode]Oo._cff")
474 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..Tracks = 'TrackRefitter2'
475 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..trajectoryInput = 'TrackRefitter2'
476 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..moduleLevelHistsTransient = cms.bool(.oO[offlineModuleLevelHistsTransient]Oo.)
477 process.TFileService.fileName = '.oO[outputFile]Oo.'
478 
479  ##
480  ## PATH
481  ##
482 
483 process.p = cms.Path(process.offlineBeamSpot*process.AliMomConstraint1*process.TrackRefitter1*process.TrackerTrackHitFilter*process.HitFilteredTracks
484  *process.AlignmentTrackSelector*process.TrackRefitter2*process.seqTrackerOfflineValidation.oO[offlineValidationMode]Oo.)
485 
486 """
487 
488 
489 ######################################################################
490 ######################################################################
491 TrackSelectionCosmicsDuringCollisions = """
492 ##### For Tracks:
493 process.AlignmentTrackSelector.applyBasicCuts = True
494 # Note that pMin is overridden and set to zero in
495 # the offlineTemplate0T
496 process.AlignmentTrackSelector.pMin = 4.
497 process.AlignmentTrackSelector.pMax = 9999.
498 process.AlignmentTrackSelector.ptMin = 0.
499 process.AlignmentTrackSelector.ptMax = 9999.
500 process.AlignmentTrackSelector.etaMin = -999.
501 process.AlignmentTrackSelector.etaMax = 999.
502 process.AlignmentTrackSelector.nHitMin = 8
503 process.AlignmentTrackSelector.nHitMin2D = 2
504 process.AlignmentTrackSelector.chi2nMax = 999.
505 process.AlignmentTrackSelector.applyMultiplicityFilter = False
506 process.AlignmentTrackSelector.maxMultiplicity = 1
507 process.AlignmentTrackSelector.applyNHighestPt = False
508 process.AlignmentTrackSelector.nHighestPt = 1
509 process.AlignmentTrackSelector.seedOnlyFrom = 0
510 process.AlignmentTrackSelector.applyIsolationCut = False
511 process.AlignmentTrackSelector.minHitIsolation = 0.8
512 process.AlignmentTrackSelector.applyChargeCheck = False
513 process.AlignmentTrackSelector.minHitChargeStrip = 50.
514 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
515 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
516 
517 ##### For Hits:
518 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
519 process.TrackerTrackHitFilter.minimumHits = 8
520 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
521 process.TrackerTrackHitFilter.detsToIgnore = [
522  # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
523  # TIB / TID
524  #369136710, 369136714, 402668822,
525  # TOB
526  #436310989, 436310990, 436299301, 436299302,
527  # TEC
528  #470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
529 ]
530 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
531 process.TrackerTrackHitFilter.stripAllInvalidHits = False
532 process.TrackerTrackHitFilter.rejectBadStoNHits = True
533 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 18.0")
534 process.TrackerTrackHitFilter.rejectLowAngleHits= True
535 process.TrackerTrackHitFilter.TrackAngleCut= 0.35 # in rads, starting from the module surface
536 process.TrackerTrackHitFilter.usePixelQualityFlag= True
537 
538 #######################################
539 ##Trigger settings for Cosmics during collisions
540 #######################################
541 process.load('L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskTechTrigConfig_cff')
542 process.load('HLTrigger/HLTfilters/hltLevel1GTSeed_cfi')
543 process.L1T1=process.hltLevel1GTSeed.clone()
544 process.L1T1.L1TechTriggerSeeding = cms.bool(True)
545 process.L1T1.L1SeedsLogicalExpression=cms.string('25')
546 process.hltHighLevel = cms.EDFilter("HLTHighLevel",
547  TriggerResultsTag = cms.InputTag("TriggerResults","","HLT"),
548  HLTPaths = cms.vstring('HLT_TrackerCosmics'),
549  eventSetupPathsKey = cms.string(''),
550  andOr = cms.bool(False),
551  throw = cms.bool(True)
552 )
553 
554 
555 process.triggerSelection=cms.Sequence(process.L1T1*process.hltHighLevel)
556 """
557 
558 
559 ######################################################################
560 ######################################################################
561 TrackSelectionCosmicsData = """
562 ##### For Tracks:
563 process.AlignmentTrackSelector.applyBasicCuts = True
564 # Note that pMin is overridden and set to zero in
565 # the offlineTemplate0T
566 process.AlignmentTrackSelector.pMin = 4.
567 process.AlignmentTrackSelector.pMax = 9999.
568 process.AlignmentTrackSelector.ptMin = 0.
569 process.AlignmentTrackSelector.ptMax = 9999.
570 process.AlignmentTrackSelector.etaMin = -999.
571 process.AlignmentTrackSelector.etaMax = 999.
572 process.AlignmentTrackSelector.nHitMin = 8
573 process.AlignmentTrackSelector.nHitMin2D = 2
574 process.AlignmentTrackSelector.chi2nMax = 999.
575 process.AlignmentTrackSelector.applyMultiplicityFilter = False
576 process.AlignmentTrackSelector.maxMultiplicity = 1
577 process.AlignmentTrackSelector.applyNHighestPt = False
578 process.AlignmentTrackSelector.nHighestPt = 1
579 process.AlignmentTrackSelector.seedOnlyFrom = 0
580 process.AlignmentTrackSelector.applyIsolationCut = False
581 process.AlignmentTrackSelector.minHitIsolation = 0.8
582 process.AlignmentTrackSelector.applyChargeCheck = False
583 process.AlignmentTrackSelector.minHitChargeStrip = 50.
584 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
585 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
586 
587 ##### For Hits:
588 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
589 process.TrackerTrackHitFilter.minimumHits = 8
590 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
591 process.TrackerTrackHitFilter.detsToIgnore = [
592  # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
593  # TIB / TID
594  #369136710, 369136714, 402668822,
595  # TOB
596  #436310989, 436310990, 436299301, 436299302,
597  # TEC
598  #470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
599 ]
600 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
601 process.TrackerTrackHitFilter.stripAllInvalidHits = False
602 process.TrackerTrackHitFilter.rejectBadStoNHits = True
603 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 18.0")
604 process.TrackerTrackHitFilter.rejectLowAngleHits= True
605 process.TrackerTrackHitFilter.TrackAngleCut= 0.35 # in rads, starting from the module surface
606 process.TrackerTrackHitFilter.usePixelQualityFlag= True
607 #process.TrackerTrackHitFilter.PxlCorrClusterChargeCut = 10000.0
608 #process.triggerSelection=cms.Sequence(process.hltPhysicsDeclared)
609 """
610 
611 
612 ######################################################################
613 ######################################################################
614 TrackSelectionCosmicsDataBPIX = """
615 ##### For Tracks:
616 process.AlignmentTrackSelector.applyBasicCuts = True
617 # Note that pMin is overridden and set to zero in
618 # the offlineTemplate0T
619 process.AlignmentTrackSelector.pMin = 4.
620 process.AlignmentTrackSelector.pMax = 9999.
621 process.AlignmentTrackSelector.ptMin = 0.
622 process.AlignmentTrackSelector.ptMax = 9999.
623 process.AlignmentTrackSelector.etaMin = -999.
624 process.AlignmentTrackSelector.etaMax = 999.
625 process.AlignmentTrackSelector.nHitMin = 8
626 process.AlignmentTrackSelector.nHitMin2D = 2
627 process.AlignmentTrackSelector.chi2nMax = 999.
628 process.AlignmentTrackSelector.applyMultiplicityFilter = False
629 process.AlignmentTrackSelector.maxMultiplicity = 1
630 process.AlignmentTrackSelector.applyNHighestPt = False
631 process.AlignmentTrackSelector.nHighestPt = 1
632 process.AlignmentTrackSelector.seedOnlyFrom = 0
633 process.AlignmentTrackSelector.applyIsolationCut = False
634 process.AlignmentTrackSelector.minHitIsolation = 0.8
635 process.AlignmentTrackSelector.applyChargeCheck = False
636 process.AlignmentTrackSelector.minHitChargeStrip = 50.
637 process.AlignmentTrackSelector.minHitsPerSubDet = cms.PSet(
638  inTEC = cms.int32(0),
639  inTOB = cms.int32(0),
640  inFPIX = cms.int32(0),
641  inTID = cms.int32(0),
642  inBPIX = cms.int32(1),
643  inTIB = cms.int32(0),
644  inPIXEL = cms.int32(0),
645  inTIDplus = cms.int32(0),
646  inTIDminus = cms.int32(0),
647  inTECplus = cms.int32(0),
648  inTECminus = cms.int32(0),
649  inFPIXplus = cms.int32(0),
650  inFPIXminus = cms.int32(0),
651  inENDCAP = cms.int32(0),
652  inENDCAPplus = cms.int32(0),
653  inENDCAPminus = cms.int32(0),
654  )
655 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
656 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
657 
658 ##### For Hits:
659 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
660 process.TrackerTrackHitFilter.minimumHits = 8
661 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
662 process.TrackerTrackHitFilter.detsToIgnore = [
663  # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
664  # TIB / TID
665  #369136710, 369136714, 402668822,
666  # TOB
667  #436310989, 436310990, 436299301, 436299302,
668  # TEC
669  #470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
670 ]
671 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
672 process.TrackerTrackHitFilter.stripAllInvalidHits = False
673 process.TrackerTrackHitFilter.rejectBadStoNHits = True
674 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 18.0")
675 process.TrackerTrackHitFilter.rejectLowAngleHits= True
676 process.TrackerTrackHitFilter.TrackAngleCut= 0.35 # in rads, starting from the module surface
677 process.TrackerTrackHitFilter.usePixelQualityFlag= True
678 
679 process.triggerSelection=cms.Sequence(process.hltPhysicsDeclared)
680 """
681 
682 
683 ######################################################################
684 ######################################################################
685 TrackSelectionCosmicsDataFPIXplus = """
686 ##### For Tracks:
687 process.AlignmentTrackSelector.applyBasicCuts = True
688 # Note that pMin is overridden and set to zero in
689 # the offlineTemplate0T
690 process.AlignmentTrackSelector.pMin = 4.
691 process.AlignmentTrackSelector.pMax = 9999.
692 process.AlignmentTrackSelector.ptMin = 0.
693 process.AlignmentTrackSelector.ptMax = 9999.
694 process.AlignmentTrackSelector.etaMin = -999.
695 process.AlignmentTrackSelector.etaMax = 999.
696 process.AlignmentTrackSelector.nHitMin = 8
697 process.AlignmentTrackSelector.nHitMin2D = 2
698 process.AlignmentTrackSelector.chi2nMax = 999.
699 process.AlignmentTrackSelector.applyMultiplicityFilter = False
700 process.AlignmentTrackSelector.maxMultiplicity = 1
701 process.AlignmentTrackSelector.applyNHighestPt = False
702 process.AlignmentTrackSelector.nHighestPt = 1
703 process.AlignmentTrackSelector.seedOnlyFrom = 0
704 process.AlignmentTrackSelector.applyIsolationCut = False
705 process.AlignmentTrackSelector.minHitIsolation = 0.8
706 process.AlignmentTrackSelector.applyChargeCheck = False
707 process.AlignmentTrackSelector.minHitChargeStrip = 50.
708 process.AlignmentTrackSelector.minHitsPerSubDet = cms.PSet(
709  inTEC = cms.int32(0),
710  inTOB = cms.int32(0),
711  inFPIX = cms.int32(0),
712  inTID = cms.int32(0),
713  inBPIX = cms.int32(0),
714  inTIB = cms.int32(0),
715  inPIXEL = cms.int32(0),
716  inTIDplus = cms.int32(0),
717  inTIDminus = cms.int32(0),
718  inTECplus = cms.int32(0),
719  inTECminus = cms.int32(0),
720  inFPIXplus = cms.int32(1),
721  inFPIXminus = cms.int32(0),
722  inENDCAP = cms.int32(0),
723  inENDCAPplus = cms.int32(0),
724  inENDCAPminus = cms.int32(0),
725  )
726 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
727 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
728 
729 ##### For Hits:
730 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
731 process.TrackerTrackHitFilter.minimumHits = 8
732 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
733 process.TrackerTrackHitFilter.detsToIgnore = [
734  # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
735  # TIB / TID
736  #369136710, 369136714, 402668822,
737  # TOB
738  #436310989, 436310990, 436299301, 436299302,
739  # TEC
740  #470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
741 ]
742 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
743 process.TrackerTrackHitFilter.stripAllInvalidHits = False
744 process.TrackerTrackHitFilter.rejectBadStoNHits = True
745 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 18.0")
746 process.TrackerTrackHitFilter.rejectLowAngleHits= True
747 process.TrackerTrackHitFilter.TrackAngleCut= 0.35 # in rads, starting from the module surface
748 process.TrackerTrackHitFilter.usePixelQualityFlag= True
749 
750 process.triggerSelection=cms.Sequence(process.hltPhysicsDeclared)
751 """
752 
753 
754 ######################################################################
755 ######################################################################
756 TrackSelectionCosmicsDataFPIXminus = """
757 ##### For Tracks:
758 process.AlignmentTrackSelector.applyBasicCuts = True
759 # Note that pMin is overridden and set to zero in
760 # the offlineTemplate0T
761 process.AlignmentTrackSelector.pMin = 4.
762 process.AlignmentTrackSelector.pMax = 9999.
763 process.AlignmentTrackSelector.ptMin = 0.
764 process.AlignmentTrackSelector.ptMax = 9999.
765 process.AlignmentTrackSelector.etaMin = -999.
766 process.AlignmentTrackSelector.etaMax = 999.
767 process.AlignmentTrackSelector.nHitMin = 8
768 process.AlignmentTrackSelector.nHitMin2D = 2
769 process.AlignmentTrackSelector.chi2nMax = 999.
770 process.AlignmentTrackSelector.applyMultiplicityFilter = False
771 process.AlignmentTrackSelector.maxMultiplicity = 1
772 process.AlignmentTrackSelector.applyNHighestPt = False
773 process.AlignmentTrackSelector.nHighestPt = 1
774 process.AlignmentTrackSelector.seedOnlyFrom = 0
775 process.AlignmentTrackSelector.applyIsolationCut = False
776 process.AlignmentTrackSelector.minHitIsolation = 0.8
777 process.AlignmentTrackSelector.applyChargeCheck = False
778 process.AlignmentTrackSelector.minHitChargeStrip = 50.
779 process.AlignmentTrackSelector.minHitsPerSubDet = cms.PSet(
780  inTEC = cms.int32(0),
781  inTOB = cms.int32(0),
782  inFPIX = cms.int32(0),
783  inTID = cms.int32(0),
784  inBPIX = cms.int32(0),
785  inTIB = cms.int32(0),
786  inPIXEL = cms.int32(0),
787  inTIDplus = cms.int32(0),
788  inTIDminus = cms.int32(0),
789  inTECplus = cms.int32(0),
790  inTECminus = cms.int32(0),
791  inFPIXplus = cms.int32(0),
792  inFPIXminus = cms.int32(1),
793  inENDCAP = cms.int32(0),
794  inENDCAPplus = cms.int32(0),
795  inENDCAPminus = cms.int32(0),
796  )
797 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
798 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
799 
800 ##### For Hits:
801 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
802 process.TrackerTrackHitFilter.minimumHits = 8
803 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
804 process.TrackerTrackHitFilter.detsToIgnore = [
805  # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
806  # TIB / TID
807  #369136710, 369136714, 402668822,
808  # TOB
809  #436310989, 436310990, 436299301, 436299302,
810  # TEC
811  #470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
812 ]
813 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
814 process.TrackerTrackHitFilter.stripAllInvalidHits = False
815 process.TrackerTrackHitFilter.rejectBadStoNHits = True
816 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 18.0")
817 process.TrackerTrackHitFilter.rejectLowAngleHits= True
818 process.TrackerTrackHitFilter.TrackAngleCut= 0.35 # in rads, starting from the module surface
819 process.TrackerTrackHitFilter.usePixelQualityFlag= True
820 
821 process.triggerSelection=cms.Sequence(process.hltPhysicsDeclared)
822 """
823 
824 
825 ######################################################################
826 ######################################################################
827 TrackSelectionMinBiasData = """
828 ##### For Tracks:collisions taken in deco mode
829 process.AlignmentTrackSelector.applyBasicCuts = True
830 # Note that pMin is overridden and set to zero in
831 # the offlineTemplate0T
832 process.AlignmentTrackSelector.pMin = 3
833 process.AlignmentTrackSelector.pMax = 9999.
834 process.AlignmentTrackSelector.ptMin = 0.65
835 process.AlignmentTrackSelector.ptMax = 9999.
836 process.AlignmentTrackSelector.etaMin = -999.
837 process.AlignmentTrackSelector.etaMax = 999.
838 process.AlignmentTrackSelector.nHitMin = 8
839 process.AlignmentTrackSelector.nHitMin2D = 2
840 process.AlignmentTrackSelector.chi2nMax = 999.
841 process.AlignmentTrackSelector.applyMultiplicityFilter = False
842 process.AlignmentTrackSelector.maxMultiplicity = 1
843 process.AlignmentTrackSelector.applyNHighestPt = False
844 process.AlignmentTrackSelector.nHighestPt = 1
845 process.AlignmentTrackSelector.seedOnlyFrom = 0
846 process.AlignmentTrackSelector.applyIsolationCut = False
847 process.AlignmentTrackSelector.minHitIsolation = 0.8
848 process.AlignmentTrackSelector.applyChargeCheck = False
849 process.AlignmentTrackSelector.minHitChargeStrip = 50.
850 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
851 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
852 
853 ##### For Hits:
854 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
855 process.TrackerTrackHitFilter.minimumHits = 8
856 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
857 process.TrackerTrackHitFilter.detsToIgnore = [
858  # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
859  # TIB / TID
860  #369136710, 369136714, 402668822,
861  # TOB
862  #436310989, 436310990, 436299301, 436299302,
863 
864  # TEC
865  #470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
866 ]
867 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
868 process.TrackerTrackHitFilter.stripAllInvalidHits = False
869 process.TrackerTrackHitFilter.rejectBadStoNHits = True
870 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 12.0")
871 process.TrackerTrackHitFilter.rejectLowAngleHits= True
872 process.TrackerTrackHitFilter.TrackAngleCut= 0.17 # in rads, starting from the module surface
873 process.TrackerTrackHitFilter.usePixelQualityFlag= True
874 
875 ##############
876 ##Trigger sequence
877 #############
878 #bit 0 is selecting bunch crossing
879 #bit 40 MinBias trigger
880 
881 
882 process.triggerSelection=cms.Sequence(process.oneGoodVertexFilter)
883 
884 """
885 
886 
887 ######################################################################
888 ######################################################################
889 TrackSelectionIsolatedMuons = """
890 ##### For Tracks:collisions taken in deco mode
891 
892 process.AlignmentTrackSelector.applyBasicCuts = True
893 # Note that pMin is overridden and set to zero in
894 # the offlineTemplate0T
895 process.AlignmentTrackSelector.pMin = 0
896 process.AlignmentTrackSelector.pMax = 9999.
897 process.AlignmentTrackSelector.ptMin = 3.
898 process.AlignmentTrackSelector.ptMax = 9999.
899 process.AlignmentTrackSelector.etaMin = -999.
900 process.AlignmentTrackSelector.etaMax = 999.
901 process.AlignmentTrackSelector.nHitMin = 8
902 process.AlignmentTrackSelector.nHitMin2D = 2
903 process.AlignmentTrackSelector.chi2nMax = 999.
904 process.AlignmentTrackSelector.applyMultiplicityFilter = False
905 process.AlignmentTrackSelector.maxMultiplicity = 1
906 process.AlignmentTrackSelector.applyNHighestPt = False
907 process.AlignmentTrackSelector.nHighestPt = 1
908 process.AlignmentTrackSelector.seedOnlyFrom = 0
909 process.AlignmentTrackSelector.applyIsolationCut = False
910 process.AlignmentTrackSelector.minHitIsolation = 0.8
911 process.AlignmentTrackSelector.applyChargeCheck = False
912 process.AlignmentTrackSelector.minHitChargeStrip = 50.
913 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
914 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
915 
916 ##### For Hits:
917 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
918 process.TrackerTrackHitFilter.minimumHits = 8
919 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
920 process.TrackerTrackHitFilter.detsToIgnore = [
921  # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
922  # TIB / TID
923  #369136710, 369136714, 402668822,
924  # TOB
925  #436310989, 436310990, 436299301, 436299302,
926  # TEC
927  #470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
928 ]
929 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
930 process.TrackerTrackHitFilter.stripAllInvalidHits = False
931 process.TrackerTrackHitFilter.rejectBadStoNHits = True
932 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 12.0")
933 process.TrackerTrackHitFilter.rejectLowAngleHits= True
934 process.TrackerTrackHitFilter.TrackAngleCut= 0.17 # in rads, starting from the module surface
935 process.TrackerTrackHitFilter.usePixelQualityFlag= True
936 
937 ##############
938 ##Trigger sequence
939 #############
940 #bit 0 is selecting bunch crossing
941 #bit xy for muons trigger
942 
943 
944 #process.triggerSelection=cms.Sequence(process.bptxAnd)
945 
946 
947 
948 """
949 
950 
951 ######################################################################
952 ######################################################################
953 CosmicsOfflineValidation_Deformations="""
954 import FWCore.ParameterSet.Config as cms
955 
956 process = cms.Process("OfflineValidator")
957 
958 process.load("Alignment.OfflineValidation..oO[dataset]Oo._cff")
959 
960 #process.source.inputCommands = cms.untracked.vstring('keep *', 'drop *_MEtoEDMConverter_*_*') # hack to get rid of the memory consumption problem in 2_2_X and beond
961 process.options = cms.untracked.PSet(
962  wantSummary = cms.untracked.bool(False),
963  Rethrow = cms.untracked.vstring("ProductNotFound"), # make this exception fatal
964  fileMode = cms.untracked.string('NOMERGE') # no ordering needed, but calls endRun/beginRun etc. at file boundaries
965 )
966 
967  ##
968  ## Maximum number of Events
969  ##
970 process.maxEvents = cms.untracked.PSet(
971  input = cms.untracked.int32(.oO[nEvents]Oo.)
972  )
973 
974  ##
975  ## Messages & Convenience
976  ##
977 process.load("FWCore.MessageLogger.MessageLogger_cfi")
978 process.MessageLogger.cerr = cms.untracked.PSet(placeholder = cms.untracked.bool(True))
979 process.MessageLogger.cout = cms.untracked.PSet(INFO = cms.untracked.PSet(
980 reportEvery = cms.untracked.int32(1000) # every 1000th only
981 # limit = cms.untracked.int32(10) # or limit to 10 printouts...
982 ))
983 process.MessageLogger.statistics.append('cout')
984 
985 
986 #-- Track hit filter
987 # TrackerTrackHitFilter takes as input the tracks/trajectories coming out from TrackRefitter1
988 process.load("RecoTracker.FinalTrackSelectors.TrackerTrackHitFilter_cff")
989 process.TrackerTrackHitFilter.src = 'TrackRefitter1'
990 
991 
992 
993 #-- Alignment Track Selection
994 process.load("Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi")
995 process.AlignmentTrackSelector.src = 'HitFilteredTracks'
996 process.AlignmentTrackSelector.filter = True
997 
998 .oO[TrackSelectionTemplate]Oo.
999 
1000 #now we give the TrackCandidate coming out of the TrackerTrackHitFilter to the track producer
1001 import RecoTracker.TrackProducer.CTFFinalFitWithMaterialP5_cff
1002 process.HitFilteredTracks = RecoTracker.TrackProducer.CTFFinalFitWithMaterialP5_cff.ctfWithMaterialTracksCosmics.clone(
1003  src = 'TrackerTrackHitFilter',
1004 ### TrajectoryInEvent = True,
1005  NavigationSchool = '',
1006  TTRHBuilder = "WithAngleAndTemplate"
1007 )
1008 
1009  ##
1010  ## Load and Configure TrackRefitter1
1011  ##
1012 
1013 
1014 #############
1015 process.load("RecoTracker.TrackProducer.TrackRefitters_cff")
1016 
1017 process.TrackRefitter1 = process.TrackRefitterP5.clone(
1018  src = 'ALCARECOTkAlCosmicsCTF0T',
1019  TrajectoryInEvent = True,
1020  NavigationSchool = '',
1021  TTRHBuilder = "WithAngleAndTemplate"
1022 )
1023 process.TrackRefitter2 = process.TrackRefitter1.clone(
1024  src = 'AlignmentTrackSelector',
1025 
1026  )
1027 
1028 
1029  ##
1030  ## Get the BeamSpot
1031  ##
1032 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff")
1033 
1034  ##
1035  ## GlobalTag Conditions (if needed)
1036  ##
1037 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
1038 # process.GlobalTag.connect = "frontier://FrontierProd/CMS_COND_31X_GLOBALTAG"
1039 process.GlobalTag.globaltag = ".oO[GlobalTag]Oo."
1040 
1041 
1042 .oO[LorentzAngleTemplate]Oo.
1043 
1044  ##
1045  ## Geometry
1046  ##
1047 process.load("Configuration.Geometry.GeometryDB_cff")
1048 
1049  ##
1050  ## Magnetic Field
1051  ##
1052 process.load("Configuration/StandardSequences/MagneticField_.oO[magneticField]Oo._cff")
1053 
1054 .oO[condLoad]Oo.
1055 
1056 from CondCore.DBCommon.CondDBSetup_cfi import *
1057 process.trackerSurfaces = cms.ESSource(
1058  "PoolDBESSource",
1059  CondDBSetup,
1060  connect = cms.string('.oO[dbpath]Oo.'),
1061  toGet = cms.VPSet(cms.PSet(record = cms.string("TrackerSurfaceDeformationRcd"),
1062  tag = cms.string("Deformations")
1063  )
1064  )
1065  )
1066 process.es_prefer_trackerSurfaces = cms.ESPrefer("PoolDBESSource", "trackerSurfaces")
1067 
1068 ## to apply misalignments
1069 #TrackerDigiGeometryESModule.applyAlignment = True
1070 
1071  ##
1072  ## Load and Configure OfflineValidation
1073  ##
1074 
1075 process.load("Alignment.OfflineValidation.TrackerOfflineValidation_.oO[offlineValidationMode]Oo._cff")
1076 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..Tracks = 'TrackRefitter2'
1077 process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..trajectoryInput = 'TrackRefitter2'
1078 #process.TrackerOfflineValidation.oO[offlineValidationMode]Oo..moduleLevelHistsTransient = cms.bool(.oO[offlineModuleLevelHistsTransient]Oo.)
1079 process.TrackerOfflineValidationStandalone.moduleLevelHistsTransient = cms.bool(False)
1080 process.TrackerOfflineValidationStandalone.moduleLevelProfiles = cms.bool(True)
1081 process.TFileService.fileName = '.oO[outputFile]Oo.'
1082 
1083  ##
1084  ## PATH
1085  ##
1086 process.p = cms.Path(process.offlineBeamSpot*process.TrackRefitter1*process.TrackerTrackHitFilter*process.HitFilteredTracks
1087  *process.AlignmentTrackSelector*process.TrackRefitter2*process.seqTrackerOfflineValidation.oO[offlineValidationMode]Oo.)
1088 
1089 
1090 """
1091 
1092 
1093 ######################################################################
1094 ######################################################################
1095 TrackSelectionCosmicsDataDef = """
1096 # import CalibTracker.Configuration.Common.PoolDBESSource_cfi
1097 # process.trackerBowedSensors = CalibTracker.Configuration.Common.PoolDBESSource_cfi.poolDBESSource.clone(
1098 # connect = cms.string('.oO[dbpath]Oo.'),
1099 
1100 # toGet = cms.VPSet(cms.PSet(record = cms.string('TrackerSurfaceDeformationRcd'),
1101 # tag = cms.string('Deformations')
1102 # )
1103 # )
1104 # )
1105 # process.prefer_trackerBowedSensors = cms.ESPrefer("PoolDBESSource", "trackerBowedSensors")
1106 ##### For Tracks:
1107 process.AlignmentTrackSelector.applyBasicCuts = True
1108 # Note that pMin is overridden and set to zero in
1109 # the offlineTemplate0T
1110 process.AlignmentTrackSelector.pMin = 4.
1111 process.AlignmentTrackSelector.pMax = 9999.
1112 process.AlignmentTrackSelector.ptMin = 0.
1113 process.AlignmentTrackSelector.ptMax = 9999.
1114 process.AlignmentTrackSelector.etaMin = -999.
1115 process.AlignmentTrackSelector.etaMax = 999.
1116 process.AlignmentTrackSelector.nHitMin = 8
1117 process.AlignmentTrackSelector.nHitMin2D = 2
1118 process.AlignmentTrackSelector.chi2nMax = 999.
1119 process.AlignmentTrackSelector.applyMultiplicityFilter = True
1120 process.AlignmentTrackSelector.maxMultiplicity = 1
1121 process.AlignmentTrackSelector.applyNHighestPt = False
1122 process.AlignmentTrackSelector.nHighestPt = 1
1123 process.AlignmentTrackSelector.seedOnlyFrom = 0
1124 process.AlignmentTrackSelector.applyIsolationCut = False
1125 process.AlignmentTrackSelector.minHitIsolation = 0.8
1126 process.AlignmentTrackSelector.applyChargeCheck = False
1127 process.AlignmentTrackSelector.minHitChargeStrip = 50.
1128 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
1129 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
1130 
1131 ##### For Hits:
1132 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
1133 process.TrackerTrackHitFilter.minimumHits = 8
1134 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
1135 process.TrackerTrackHitFilter.detsToIgnore = [
1136  # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
1137  # TIB / TID
1138  #369136710, 369136714, 402668822,
1139  # TOB
1140  #436310989, 436310990, 436299301, 436299302,
1141  # TEC
1142  #470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
1143 ]
1144 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
1145 process.TrackerTrackHitFilter.stripAllInvalidHits = False
1146 process.TrackerTrackHitFilter.rejectBadStoNHits = True
1147 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 18.0")
1148 process.TrackerTrackHitFilter.rejectLowAngleHits= True
1149 process.TrackerTrackHitFilter.TrackAngleCut= 0.35 # in rads, starting from the module surface
1150 process.TrackerTrackHitFilter.usePixelQualityFlag= True
1151 #process.TrackerTrackHitFilter.PxlCorrClusterChargeCut = 10000.0
1152 process.triggerSelection=cms.Sequence(process.hltPhysicsDeclared)
1153 """
1154 
1155 
1156 ######################################################################
1157 ######################################################################
1158 TrackSelectionCosmicsInterfillLADef = """
1159 # import CalibTracker.Configuration.Common.PoolDBESSource_cfi
1160 # process.trackerBowedSensors = CalibTracker.Configuration.Common.PoolDBESSource_cfi.poolDBESSource.clone(
1161 # connect = cms.string('.oO[dbpath]Oo.'),
1162 
1163 # toGet = cms.VPSet(cms.PSet(record = cms.string('TrackerSurfaceDeformationRcd'),
1164 # tag = cms.string('Deformations')
1165 # )
1166 # )
1167 # )
1168 # process.prefer_trackerBowedSensors = cms.ESPrefer("PoolDBESSource", "trackerBowedSensors")
1169 
1170 #LA
1171 process.myLA = CalibTracker.Configuration.Common.PoolDBESSource_cfi.poolDBESSource.clone(
1172  connect = cms.string ('frontier://PromptProd/CMS_COND_31X_STRIP'),
1173  toGet = cms.VPSet(cms.PSet(
1174  record = cms.string('SiStripLorentzAngleRcd'),
1175  tag = cms.string('SiStripLorentzAnglePeak_GR10_v1_offline')
1176 
1177  ))
1178  )
1179 process.es_prefer_myLA = cms.ESPrefer("PoolDBESSource","myLA")
1180 
1181 #-- initialize beam spot
1182 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cfi")
1183 
1184 ##### For Tracks:
1185 process.AlignmentTrackSelector.applyBasicCuts = True
1186 # Note that pMin is overridden and set to zero in
1187 # the offlineTemplate0T
1188 process.AlignmentTrackSelector.pMin = 4.
1189 process.AlignmentTrackSelector.pMax = 9999.
1190 process.AlignmentTrackSelector.ptMin = 0.
1191 process.AlignmentTrackSelector.ptMax = 9999.
1192 process.AlignmentTrackSelector.etaMin = -999.
1193 process.AlignmentTrackSelector.etaMax = 999.
1194 process.AlignmentTrackSelector.nHitMin = 8
1195 process.AlignmentTrackSelector.nHitMin2D = 2
1196 process.AlignmentTrackSelector.chi2nMax = 999.
1197 process.AlignmentTrackSelector.applyMultiplicityFilter = False
1198 process.AlignmentTrackSelector.maxMultiplicity = 1
1199 process.AlignmentTrackSelector.applyNHighestPt = False
1200 process.AlignmentTrackSelector.nHighestPt = 1
1201 process.AlignmentTrackSelector.seedOnlyFrom = 0
1202 process.AlignmentTrackSelector.applyIsolationCut = False
1203 process.AlignmentTrackSelector.minHitIsolation = 0.8
1204 process.AlignmentTrackSelector.applyChargeCheck = False
1205 process.AlignmentTrackSelector.minHitChargeStrip = 50.
1206 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
1207 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
1208 
1209 ##### For Hits:
1210 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
1211 process.TrackerTrackHitFilter.minimumHits = 8
1212 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
1213 process.TrackerTrackHitFilter.detsToIgnore = [
1214  # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
1215  # TIB / TID
1216  #369136710, 369136714, 402668822,
1217  # TOB
1218  #436310989, 436310990, 436299301, 436299302,
1219  # TEC
1220  #470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
1221 ]
1222 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
1223 process.TrackerTrackHitFilter.stripAllInvalidHits = False
1224 process.TrackerTrackHitFilter.rejectBadStoNHits = True
1225 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 18.0")
1226 process.TrackerTrackHitFilter.rejectLowAngleHits= True
1227 process.TrackerTrackHitFilter.TrackAngleCut= 0.35 # in rads, starting from the module surface
1228 process.TrackerTrackHitFilter.usePixelQualityFlag= True
1229 
1230 #######################################
1231 ##Trigger settings for Cosmics during collisions
1232 #######################################
1233 process.load('L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskTechTrigConfig_cff')
1234 process.load('HLTrigger/HLTfilters/hltLevel1GTSeed_cfi')
1235 process.L1T1=process.hltLevel1GTSeed.clone()
1236 process.L1T1.L1TechTriggerSeeding = cms.bool(True)
1237 process.L1T1.L1SeedsLogicalExpression=cms.string('25')
1238 process.hltHighLevel = cms.EDFilter("HLTHighLevel",
1239  TriggerResultsTag = cms.InputTag("TriggerResults","","HLT"),
1240  HLTPaths = cms.vstring('HLT_TrackerCosmics'),
1241  eventSetupPathsKey = cms.string(''),
1242  andOr = cms.bool(False),
1243  throw = cms.bool(True)
1244 )
1245 
1246 
1247 process.triggerSelection=cms.Sequence(process.L1T1*process.hltHighLevel)
1248 """
1249 
1250 
1251 ######################################################################
1252 ######################################################################
1253 TrackSelectionMinBiasDataDef = """
1254 # import CalibTracker.Configuration.Common.PoolDBESSource_cfi
1255 # process.trackerBowedSensors = CalibTracker.Configuration.Common.PoolDBESSource_cfi.poolDBESSource.clone(
1256 # connect = cms.string('.oO[dbpath]Oo.'),
1257 
1258 # toGet = cms.VPSet(cms.PSet(record = cms.string('TrackerSurfaceDeformationRcd'),
1259 # tag = cms.string('Deformations')
1260 # )
1261 # )
1262 # )
1263 # process.prefer_trackerBowedSensors = cms.ESPrefer("PoolDBESSource", "trackerBowedSensors")
1264 
1265 ##### For Tracks:collisions taken in deco mode
1266 process.AlignmentTrackSelector.applyBasicCuts = True
1267 # Note that pMin is overridden and set to zero in
1268 # the offlineTemplate0T
1269 process.AlignmentTrackSelector.pMin = 3
1270 process.AlignmentTrackSelector.pMax = 9999.
1271 process.AlignmentTrackSelector.ptMin = 0.65
1272 process.AlignmentTrackSelector.ptMax = 9999.
1273 process.AlignmentTrackSelector.etaMin = -999.
1274 process.AlignmentTrackSelector.etaMax = 999.
1275 process.AlignmentTrackSelector.nHitMin = 8
1276 process.AlignmentTrackSelector.nHitMin2D = 2
1277 process.AlignmentTrackSelector.chi2nMax = 999.
1278 process.AlignmentTrackSelector.applyMultiplicityFilter = False
1279 process.AlignmentTrackSelector.maxMultiplicity = 1
1280 process.AlignmentTrackSelector.applyNHighestPt = False
1281 process.AlignmentTrackSelector.nHighestPt = 1
1282 process.AlignmentTrackSelector.seedOnlyFrom = 0
1283 process.AlignmentTrackSelector.applyIsolationCut = False
1284 process.AlignmentTrackSelector.minHitIsolation = 0.8
1285 process.AlignmentTrackSelector.applyChargeCheck = False
1286 process.AlignmentTrackSelector.minHitChargeStrip = 50.
1287 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
1288 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
1289 
1290 ##### For Hits:
1291 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
1292 process.TrackerTrackHitFilter.minimumHits = 8
1293 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
1294 process.TrackerTrackHitFilter.detsToIgnore = [
1295  # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
1296  # TIB / TID
1297  #369136710, 369136714, 402668822,
1298  # TOB
1299  #436310989, 436310990, 436299301, 436299302,
1300 
1301  # TEC
1302  #470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
1303 ]
1304 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
1305 process.TrackerTrackHitFilter.stripAllInvalidHits = False
1306 process.TrackerTrackHitFilter.rejectBadStoNHits = True
1307 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 12.0")
1308 process.TrackerTrackHitFilter.rejectLowAngleHits= True
1309 process.TrackerTrackHitFilter.TrackAngleCut= 0.17 # in rads, starting from the module surface
1310 process.TrackerTrackHitFilter.usePixelQualityFlag= True
1311 
1312 ##############
1313 ##Trigger sequence
1314 #############
1315 #bit 0 is selecting bunch crossing
1316 #bit 40 MinBias trigger
1317 
1318 
1319 process.triggerSelection=cms.Sequence(process.oneGoodVertexFilter)
1320 
1321 """
1322 
1323 
1324 ######################################################################
1325 ######################################################################
1326 TrackSelectionIsolatedMuonsDef = """
1327 ##### For Tracks:collisions taken in deco mode
1328 # import CalibTracker.Configuration.Common.PoolDBESSource_cfi
1329 # process.trackerBowedSensors = CalibTracker.Configuration.Common.PoolDBESSource_cfi.poolDBESSource.clone(
1330 # connect = cms.string('.oO[dbpath]Oo.'),
1331 
1332 # toGet = cms.VPSet(cms.PSet(record = cms.string('TrackerSurfaceDeformationRcd'),
1333 # tag = cms.string('Deformations')
1334 # )
1335 # )
1336 # )
1337 # process.prefer_trackerBowedSensors = cms.ESPrefer("PoolDBESSource", "trackerBowedSensors")
1338 
1339 
1340 process.AlignmentTrackSelector.applyBasicCuts = True
1341 # Note that pMin is overridden and set to zero in
1342 # the offlineTemplate0T
1343 process.AlignmentTrackSelector.pMin = 3.
1344 process.AlignmentTrackSelector.pMax = 9999.
1345 process.AlignmentTrackSelector.ptMin = 5.
1346 process.AlignmentTrackSelector.ptMax = 9999.
1347 process.AlignmentTrackSelector.etaMin = -3.
1348 process.AlignmentTrackSelector.etaMax = 3.
1349 process.AlignmentTrackSelector.nHitMin = 10
1350 process.AlignmentTrackSelector.nHitMin2D = 2
1351 process.AlignmentTrackSelector.chi2nMax = 999.
1352 process.AlignmentTrackSelector.applyMultiplicityFilter = False
1353 process.AlignmentTrackSelector.maxMultiplicity = 1
1354 process.AlignmentTrackSelector.applyNHighestPt = False
1355 process.AlignmentTrackSelector.nHighestPt = 1
1356 process.AlignmentTrackSelector.seedOnlyFrom = 0
1357 process.AlignmentTrackSelector.applyIsolationCut = False
1358 process.AlignmentTrackSelector.minHitIsolation = 0.8
1359 process.AlignmentTrackSelector.applyChargeCheck = False
1360 process.AlignmentTrackSelector.minHitChargeStrip = 30.
1361 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
1362 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
1363 
1364 ##### For Hits:
1365 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
1366 process.TrackerTrackHitFilter.minimumHits = 8
1367 process.TrackerTrackHitFilter.commands = cms.vstring("keep PXB","keep PXE","keep TIB","keep TID","keep TOB","keep TEC")
1368 process.TrackerTrackHitFilter.detsToIgnore = [
1369  # see https://hypernews.cern.ch/HyperNews/CMS/get/tracker-performance/484.html
1370  # TIB / TID
1371  #369136710, 369136714, 402668822,
1372  # TOB
1373  #436310989, 436310990, 436299301, 436299302,
1374  # TEC
1375  #470340521, 470063045, 470063046, 470114669, 470114670, 470161093, 470161094, 470164333, 470164334, 470312005, 470312006, 470312009, 470067405, 470067406, 470128813
1376 ]
1377 process.TrackerTrackHitFilter.replaceWithInactiveHits = True
1378 process.TrackerTrackHitFilter.stripAllInvalidHits = False
1379 process.TrackerTrackHitFilter.rejectBadStoNHits = True
1380 process.TrackerTrackHitFilter.StoNcommands = cms.vstring("ALL 12.0")
1381 process.TrackerTrackHitFilter.rejectLowAngleHits= True
1382 process.TrackerTrackHitFilter.TrackAngleCut= 0.17 # in rads, starting from the module surface
1383 process.TrackerTrackHitFilter.usePixelQualityFlag= True
1384 
1385 ##############
1386 ##Trigger sequence
1387 #############
1388 #bit 0 is selecting bunch crossing
1389 #bit xy for muons trigger
1390 
1391 
1392 #process.triggerSelection=cms.Sequence(process.bptxAnd)
1393 
1394 """