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