CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FamosSequences_cff.py
Go to the documentation of this file.
2 
4 
5 # Conversion to GenParticleCandidates
7 
8 # Pile-up options: FAMOS-style or with the Mixing Module
9 #the sequence is defined as a p[lace holder, to be defined separatedly
10 #from FastSimulation.Configuration.MixingFamos_cff import *
11 #from FastSimulation.Configuration.MixingFull_cff import *
12 
13 # Famos SimHits producer
15 
16 # Gaussian Smearing RecHit producer
18 
19 # Rec Hit Tranlator to the Full map with DeTId'
21 
22 # CTF and Iterative tracking (contains pixelTracks and pixelVertices)
23 
24 # 1) Common algorithms and configuration taken from full reconstruction
25 # Note: The runge-kutta propagator is not used here
26 # (because no magnetic field inhomogeneities are simulated between layers)
28 
29 # 2) Specific cuts - not needed anymore, as a specific KFFittingSmoother deals with that.
30 # Add a chi**2 cut to retain/reject hits
31 # KFFittingSmoother.EstimateCut = 15.0
32 # Request three hits to make a track
33 # KFFittingSmoother.MinNumberOfHits = 3
34 
35 # 3) Fast Simulation tracking sequences
36 # this one is added before 340pre3 to cope with adding SiPixelTemplateDBObjectESProducer and corresponding objects to the ConfDB (MC_3XY_V11, STARTUP3X_V10)
40 
41 # Calo RecHits producer (with no HCAL miscalibration by default)
44 
45 # ECAL clusters
47 reducedEcalRecHitsSequence.remove(seldigis)
48 # HCAL clusters
50 reducedHcalRecHitsSequence = cms.Sequence( reducedHcalRecHits )
51 
52 reducedRecHits = cms.Sequence ( reducedEcalRecHitsSequence * reducedHcalRecHitsSequence )
53 
54 
55 # Calo Towers
57 
58 # Particle Flow (all interactions with ParticleFlow are dealt with in the following configuration)
59 #from FastSimulation.ParticleFlow.ParticleFlowFastSim_cff import *
60 from FastSimulation.ParticleFlow.ParticleFlowFastSimNeutralHadron_cff import * # this is the famous "PF patch", see https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideFastSimFAQ#I_observe_a_discrepancy_in_energ
61 
62 
63 # Reco Jets and MET
66 metreco.remove(BeamHaloId)
67 
68 
69 caloJets = cms.Sequence(
70  recoJets+
71  recoJetIds+
72  recoTrackJets
73 )
74 
75 jetTrackAssoc = cms.Sequence (
76  recoJetAssociations
77  )
78 
79 jetPlusTracks = cms.Sequence(
80  recoJPTJets
81  )
82 
83 metReco = cms.Sequence(
84  metreco
85  )
86 
87 
88 
89 # Gen Jets
95 caloJetMetGen = cms.Sequence(
96  genParticles+
97  genJetParticles+
98  recoGenJets+
99  genMETParticles+
100  recoGenMET
101 )
102 
103 
104 # Muon simHit sequence
106 
107 # Muon Digi sequence
109 simMuonCSCDigis.strips.doCorrelatedNoise = False ## Saves a little bit of time
110 
111 
112 simMuonCSCDigis.InputCollection = 'MuonSimHitsMuonCSCHits'
113 simMuonDTDigis.InputCollection = 'MuonSimHitsMuonDTHits'
114 simMuonRPCDigis.InputCollection = 'MuonSimHitsMuonRPCHits'
115 
116 # Muon RecHit sequence
118 csc2DRecHits.stripDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCStripDigi")
119 csc2DRecHits.wireDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCWireDigi")
120 rpcRecHits.rpcDigiLabel = 'simMuonRPCDigis'
121 dt1DRecHits.dtDigiLabel = 'simMuonDTDigis'
122 dt1DCosmicRecHits.dtDigiLabel = 'simMuonDTDigis'
123 
124 # Muon reconstruction sequence
127 KFSmootherForMuonTrackLoader.Propagator = 'SmartPropagatorAny'
130 from RecoMuon.Configuration.RecoMuonPPonly_cff import refittedStandAloneMuons
132 globalMuons.GLBTrajBuilderParameters.TrackTransformer.TrackerRecHitBuilder = 'WithoutRefit'
133 globalMuons.GLBTrajBuilderParameters.TrackerRecHitBuilder = 'WithoutRefit'
134 globalMuons.GLBTrajBuilderParameters.TransformerOutPropagator = cms.string('SmartPropagatorAny')
135 globalMuons.GLBTrajBuilderParameters.MatcherOutPropagator = cms.string('SmartPropagator')
136 
138 GlobalMuonRefitter.TrackerRecHitBuilder = 'WithoutRefit'
139 GlobalMuonRefitter.Propagator = 'SmartPropagatorAny'
140 GlobalTrajectoryBuilderCommon.TrackerRecHitBuilder = 'WithoutRefit'
141 tevMuons.RefitterParameters.TrackerRecHitBuilder = 'WithoutRefit'
142 tevMuons.RefitterParameters.Propagator = 'SmartPropagatorAny'
143 KFSmootherForRefitInsideOut.Propagator = 'SmartPropagatorAny'
144 KFSmootherForRefitOutsideIn.Propagator = 'SmartPropagator'
145 KFFitterForRefitInsideOut.Propagator = 'SmartPropagatorAny'
146 KFFitterForRefitOutsideIn.Propagator = 'SmartPropagatorAny'
147 
148 if (CaloMode==3):
149  famosMuonSequence = cms.Sequence(
150  muonlocalreco+
151  ancientMuonSeed+
152  standAloneMuons+
153  refittedStandAloneMuons+
154  globalMuons+
155  tevMuons
156  )
157 else:
158  famosMuonSequence = cms.Sequence(
159  muonDigi+
160  muonlocalreco+
161  ancientMuonSeed+
162  standAloneMuons+
163  refittedStandAloneMuons+
164  globalMuons+
165  tevMuons
166  )
167 
168 #Muon identification sequence
170 
171 # Muon isolation
173 
174 famosMuonIdAndIsolationSequence = cms.Sequence(
175  ak4CaloJets+
176  muonIdProducerSequence+
177  muIsolation
178 )
179 
181 muons.FillSelectorMaps = False
182 muons.FillCosmicsIdMap = False
184 
185 muonshighlevelreco = cms.Sequence(muonPFIsolationSequence*muons)
186 
187 
188 # Electron reconstruction
199 from RecoEgamma.Configuration.RecoEgamma_cff import egammaHighLevelRecoPostPF
200 allConversions.src = 'gsfGeneralConversionTrackMerger'
201 famosConversionSequence = cms.Sequence(conversionTrackSequenceNoEcalSeeded*allConversionSequence)
202 
203 if (MixingMode=='DigiRecoMixing'):
204  generalConversionTrackProducer.TrackProducer = 'generalTracksBeforeMixing'
205 
209 
210 egammaEcalDrivenReco = cms.Sequence(gsfEcalDrivenElectronSequence)
211 electronGsfTracks = TrackingTools.GsfTracking.GsfElectronFit_cfi.GsfGlobalElectronTest.clone()
212 electronGsfTracks.src = 'electronGSGsfTrackCandidates'
213 electronGsfTracks.TTRHBuilder = 'WithoutRefit'
214 electronGsfTracks.TrajectoryInEvent = True
215 
216 
217 # PF related electron sequences defined in FastSimulation.ParticleFlow.ParticleFlowFastSim_cff
219 
220 iterativeTrackingBeginning = cms.Sequence(
221  iterativeInitialSeeds+
222  iterativePixelPairSeeds+
223  iterativeMixedTripletStepSeeds+
224  iterativePixelLessSeeds
225  )
226 
227 famosGsfTrackSequence = cms.Sequence(
228  iterativeTrackingBeginning+
229  newCombinedSeeds+
230  particleFlowCluster+
231  ecalDrivenElectronSeeds+
232  trackerDrivenElectronSeeds+
233  electronMergedSeeds+
234  electronGSGsfTrackCandidates+
235  electronGsfTracks
236 )
237 
238 # Photon reconstruction
240 photons.hbheInstance = ''
242 
243 famosPhotonSequence = cms.Sequence(
244  photonSequence+
245  photonIDSequence
246 )
247 
248 # Add pre-calculated isolation sums for electrons (NB for photons they are stored in the Photon. All is done in the
249 # sequence above
251 
252 #Add egamma ecal interesting rec hits
255 
257 
258 
259 
260 # B tagging
262 ak4JetTracksAssociatorAtVertex.tracks = 'generalTracks'
266 
267 famosBTaggingSequence = cms.Sequence(
268  btagging
269 )
270 
271 
272 ############### FastSim sequences
273 
274 # Calo simulation mode is defined in FastSimulation/CaloRecHitsProducer/python/CaloRecHits_cff.py
275 if(CaloMode==0):
276  simulationSequence = cms.Sequence(
277  offlineBeamSpot+
278  cms.SequencePlaceholder("famosMixing")+
279  famosSimHits+
280  MuonSimHits+
281  cms.SequencePlaceholder("mix")
282  )
283  lowLevelRecoSequence = cms.Sequence(
284  siTrackerGaussianSmearingRecHits+
285  caloRecHits
286  )
287  famosSimulationSequence = cms.Sequence(
288  simulationSequence+
289  lowLevelRecoSequence
290  )
291  trackVertexReco = cms.Sequence(
292  cms.SequencePlaceholder("mix")+
293  iterativeTracking+
294  vertexreco
295  )
296  caloTowersSequence = cms.Sequence(
297  caloTowersRec
298  )
299 elif(CaloMode==1):
300  simulationSequence = cms.Sequence(
301  offlineBeamSpot+
302  cms.SequencePlaceholder("famosMixing")+
303  famosSimHits+
304  MuonSimHits+
305  cms.SequencePlaceholder("mix")
306  )
307  lowLevelRecoSequence = cms.Sequence(
308  siTrackerGaussianSmearingRecHits+
309  caloDigis+
310  caloRecHits
311  )
312  famosSimulationSequence = cms.Sequence(
313  simulationSequence+
314  lowLevelRecoSequence
315  )
316  trackVertexReco = cms.Sequence(
317  cms.SequencePlaceholder("mix")+
318  iterativeTracking+
319  vertexreco
320  )
321  caloTowersSequence = cms.Sequence(
322  caloTowersRec
323  )
324 elif(CaloMode==2):
325  simulationSequence = cms.Sequence(
326  offlineBeamSpot+
327  cms.SequencePlaceholder("famosMixing")+
328  famosSimHits+
329  MuonSimHits+
330  cms.SequencePlaceholder("mix")
331  )
332  lowLevelRecoSequence = cms.Sequence(
333  siTrackerGaussianSmearingRecHits+
334  iterativeTracking+ # because tracks are used for noise cleaning in HCAL low-level reco
335  caloDigis+
336  caloRecHits
337  )
338  famosSimulationSequence = cms.Sequence(
339  simulationSequence+
340  lowLevelRecoSequence
341  )
342  trackVertexReco = cms.Sequence(
343  cms.SequencePlaceholder("mix")+
344  iterativeTracking+ # this repetition is normally harmless, but it is annoying if you want to run SIM and RECO in two steps
345  vertexreco
346  )
347  caloTowersSequence = cms.Sequence(
348  caloTowersRec
349  )
350 elif(CaloMode==3):
351  if(MixingMode=='GenMixing'):
352  simulationSequence = cms.Sequence(
353  offlineBeamSpot+
354  cms.SequencePlaceholder("famosMixing")+
355  famosSimHits+
356  MuonSimHits
357  )
358  digitizationSequence = cms.Sequence(
359  cms.SequencePlaceholder("mix")+
360  muonDigi+
361  caloDigis
362  )
363  trackVertexReco = cms.Sequence(
364  siTrackerGaussianSmearingRecHits+
365  iterativeTracking+
366  vertexreco
367  )
368  elif(MixingMode=='DigiRecoMixing'):
369  #dump = cms.EDAnalyzer("EventContentAnalyzer") #TEMP
370  simulationSequence = cms.Sequence(
371  offlineBeamSpot+
372  famosSimHits+
373  MuonSimHits
374  )
375  trackReco = cms.Sequence(
376  siTrackerGaussianSmearingRecHits+
377  iterativeTracking
378  )
379  digitizationSequence = cms.Sequence(
380  cms.SequencePlaceholder("mixHitsAndTracks")+
381  muonDigi+
382  caloDigis
383  )
384  trackDigiVertexSequence = cms.Sequence(
385  trackReco+
386  #dump+ #TEMP
387  digitizationSequence+
388  vertexreco
389  )
390  trackVertexReco = cms.Sequence( # for backward compatibility
391  trackDigiVertexSequence
392  )
393  else:
394  print 'unsupported MixingMode label'
395 # out of the 'if':
396  caloTowersSequence = cms.Sequence(
397  caloRecHits+
398  caloTowersRec
399  )
400  if(MixingMode=='GenMixing'):
401  famosSimulationSequence = cms.Sequence(
402  simulationSequence+
403  digitizationSequence#+ # temporary; eventually it will be a block of its own, but it requires intervention on ConfigBuilder
404  )
405  elif(MixingMode=='DigiRecoMixing'):
406  famosSimulationSequence = cms.Sequence(
407  simulationSequence+
408  trackDigiVertexSequence
409  )
410  else:
411  print 'unsupported MixingMode label'
412 
413 famosEcalDrivenElectronSequence = cms.Sequence(
414  famosGsfTrackSequence+
415  egammaEcalDrivenReco
416 )
417 
418 simulationSequence.insert(0,genParticles)
419 
420 # The reconstruction sequence
421 if(CaloMode==3):
422  if(MixingMode=='GenMixing'):
423  reconstructionWithFamos = cms.Sequence(
424  digitizationSequence+ # temporary; repetition!
425  trackVertexReco+
426  caloTowersSequence+
427  particleFlowCluster+
428  ecalClusters+
429  famosGsfTrackSequence+
430  famosMuonSequence+
431  famosMuonIdAndIsolationSequence+
432  famosConversionSequence+
433  particleFlowTrackWithDisplacedVertex+
434  famosEcalDrivenElectronSequence+
435  famosPhotonSequence+
436  famosParticleFlowSequence+
437  egammaHighLevelRecoPostPF+
438  muonshighlevelreco+
439  particleFlowLinks+
440  caloJetMetGen+
441  caloJets+
442  PFJetMet+
443  jetTrackAssoc+
444  recoJPTJets+
445  metreco+
446  reducedRecHits+
447  famosBTaggingSequence+
448  famosPFTauTaggingSequence
449  )
450  elif(MixingMode=='DigiRecoMixing'):
451  reconstructionWithFamos = cms.Sequence(
452  caloTowersSequence+
453  particleFlowCluster+
454  ecalClusters+
455  famosGsfTrackSequence+
456  famosMuonSequence+
457  famosMuonIdAndIsolationSequence+
458  famosConversionSequence+
459  particleFlowTrackWithDisplacedVertex+
460  famosEcalDrivenElectronSequence+
461  famosPhotonSequence+
462  famosParticleFlowSequence+
463  egammaHighLevelRecoPostPF+
464  muonshighlevelreco+
465  particleFlowLinks+
466  caloJetMetGen+
467  caloJets+
468  PFJetMet+
469  jetTrackAssoc+
470  recoJPTJets+
471  metreco+
472  reducedRecHits+
473  famosBTaggingSequence+
474  famosPFTauTaggingSequence
475  )
476  else:
477  print 'unsupported MixingMode label'
478 else:
479  reconstructionWithFamos = cms.Sequence(
480  trackVertexReco+
481  caloTowersSequence+
482  particleFlowCluster+
483  ecalClusters+
484  famosGsfTrackSequence+
485  famosMuonSequence+
486  famosMuonIdAndIsolationSequence+
487  famosConversionSequence+
488  particleFlowTrackWithDisplacedVertex+
489  famosEcalDrivenElectronSequence+
490  famosPhotonSequence+
491  famosParticleFlowSequence+
492  egammaHighLevelRecoPostPF+
493  muonshighlevelreco+
494  particleFlowLinks+
495  caloJetMetGen+
496  caloJets+
497  PFJetMet+
498  jetTrackAssoc+
499  recoJPTJets+
500  metreco+
501  reducedRecHits+
502  famosBTaggingSequence+
503  famosPFTauTaggingSequence
504  )
505 
506 
507 
508 
509 
510 # Special sequences for two-step operation
511 simulationWithSomeReconstruction = cms.Sequence(
512  famosSimulationSequence+
513  siTrackerGaussianSmearingRecHits+
514  iterativeTracking+
515  vertexreco+
516  caloTowersSequence+
517  particleFlowCluster+
518  ecalClusters+
519  famosGsfTrackSequence+
520  famosMuonSequence+
521  famosMuonIdAndIsolationSequence+
522  famosConversionSequence+
523  particleFlowTrackWithDisplacedVertex+
524  famosEcalDrivenElectronSequence+
525  famosPhotonSequence+
526  famosParticleFlowSequence+
527  egammaHighLevelRecoPostPF
528  )
529 
530 reconstructionHighLevel = cms.Sequence(
531  cms.SequencePlaceholder("mix")+
532  muonshighlevelreco+
533  particleFlowLinks+
534  caloJetMetGen+
535  caloJets+
536  PFJetMet+
537  jetTrackAssoc+
538  recoJPTJets+
539  metreco+
540  reducedRecHits+
541  famosBTaggingSequence+
542  famosPFTauTaggingSequence
543 )
544 
545 # Famos pre-defined sequences (and self-explanatory names)
546 
547 famosWithTrackerHits = cms.Sequence(
548  famosSimulationSequence+
549  siTrackerGaussianSmearingRecHits
550 )
551 
552 famosWithTracks = cms.Sequence(
553  famosWithTrackerHits+
554  iterativeTracking
555  )
556 
557 famosWithTracksAndMuonHits = cms.Sequence(
558  famosSimulationSequence+
559  siTrackerGaussianSmearingRecHits+
560  iterativeTracking+
561  vertexreco+
562  famosMuonSequence
563 )
564 
565 famosWithTracksAndMuons = cms.Sequence(
566  famosSimulationSequence+
567  siTrackerGaussianSmearingRecHits+
568  iterativeTracking+
569  vertexreco+
570  famosMuonSequence+
571  caloTowersSequence+
572  famosMuonIdAndIsolationSequence
573 )
574 
575 famosWithCaloHits = cms.Sequence(
576  famosSimulationSequence+
577  caloTowersSequence
578 )
579 
580 famosWithEcalClusters = cms.Sequence(
581  famosWithCaloHits+
582  particleFlowCluster+
583  ecalClusters
584 )
585 
586 famosWithTracksAndCaloHits = cms.Sequence(
587  famosWithTracks+
588  caloTowersSequence
589 )
590 
591 famosWithTracksAndEcalClusters = cms.Sequence(
592  famosWithTracksAndCaloHits+
593  particleFlowCluster+
594  ecalClusters
595 )
596 
597 
598 famosWithParticleFlow = cms.Sequence(
599  famosWithTracksAndEcalClusters+
600  vertexreco+
601  famosGsfTrackSequence+
602  famosConversionSequence+
603  caloTowersSequence+
604  famosParticleFlowSequence+
605  PFJetMet
606 )
607 
608 famosWithCaloTowers = cms.Sequence(
609  famosWithCaloHits+
610  caloTowersSequence
611 )
612 
613 famosElectronSequence = cms.Sequence(
614  famosGsfTrackSequence+
615  famosEcalDrivenElectronSequence+
616  famosWithParticleFlow+
617  egammaHighLevelRecoPostPF+
618  gsfElectronSequence+
619  eIdSequence
620 )
621 
622 famosWithTracksAndCaloTowers = cms.Sequence(
623  famosWithTracksAndCaloHits+
624  caloTowersSequence
625 )
626 
627 famosWithTracksAndJets = cms.Sequence(
628  famosWithTracksAndCaloTowers+
629  vertexreco+
630  caloJetMetGen+
631  caloJets+
632  PFJetMet+
633  jetTrackAssoc+
634  recoJPTJets+
635  metreco
636 )
637 
638 ### Standard Jets _cannot_ be done without many other things...
639 #######################################################################
640 famosWithJets = cms.Sequence(
641  famosWithTracksAndCaloTowers+
642  vertexreco+
643  particleFlowCluster+
644  ecalClusters+
645  famosGsfTrackSequence+
646  famosMuonSequence+
647  famosMuonIdAndIsolationSequence+
648  famosParticleFlowSequence+
649  gsfElectronSequence+
650  caloJetMetGen+
651  caloJets+
652  PFJetMet+
653  jetTrackAssoc+
654  recoJPTJets+
655  metreco
656 )
657 
658 famosWithCaloTowersAndParticleFlow = cms.Sequence(
659  famosWithParticleFlow+
660  caloTowersSequence
661 )
662 
663 
664 famosWithElectrons = cms.Sequence(
665  famosWithTracksAndEcalClusters+
666  caloTowersSequence+
667  famosGsfTrackSequence+
668  famosParticleFlowSequence+
669  famosElectronSequence+
670  interestingGedEleIsoDetIdEB+
671  interestingGedEleIsoDetIdEE+
672  egammaIsolationSequence
673 )
674 
675 famosWithPhotons = cms.Sequence(
676  famosWithTracks+
677  vertexreco+
678  caloRecHits+
679  ecalClustersNoPFBox+
680  famosPhotonSequence+
681  interestingGedGamIsoDetIdEB+
682  interestingGedGamIsoDetIdEE+
683  interestingGamIsoDetIdEB+
684  interestingGamIsoDetIdEE
685 )
686 
687 famosWithElectronsAndPhotons = cms.Sequence(
688  famosWithTracks+
689  vertexreco+
690  caloTowersSequence+
691  ecalClustersNoPFBox+
692  famosElectronSequence+
693  famosPhotonSequence+
694  interestingEgammaIsoDetIds+
695  egammaIsolationSequence
696 )
697 
698 famosWithBTagging = cms.Sequence(
699  famosWithTracksAndCaloTowers+
700  vertexreco+
701  ak4PFJetsCHS+
702  ak4JetTracksAssociatorAtVertexPF+
703  ecalClustersNoPFBox+
704  famosMuonSequence+
705  reducedRecHits+
706  famosBTaggingSequence
707  )
708 
709 
710 famosWithPFTauTagging = cms.Sequence(
711  famosWithCaloTowersAndParticleFlow+
712  famosPFTauTaggingSequence
713 )
714 
715 # The simulation sequence without muon digitization
716 simulationNoMuonDigiWithFamos = cms.Sequence(
717  famosSimulationSequence+
718  siTrackerGaussianSmearingRecHits
719 )
720 
721 # The simulation and digitization sequence
722 simulationWithFamos = cms.Sequence(
723  famosSimulationSequence#+
724 # muonDigi+
725 # siTrackerGaussianSmearingRecHits
726 )
727 
728 
729 
730 reconstructionWithFamosNoTk = cms.Sequence(
731  vertexreco+
732  caloTowersSequence+
733  particleFlowCluster+
734  ecalClusters+
735  famosGsfTrackSequence+
736  famosMuonSequence+
737  famosMuonIdAndIsolationSequence+
738  famosConversionSequence+
739  particleFlowTrackWithDisplacedVertex+
740  famosEcalDrivenElectronSequence+
741  famosPhotonSequence+
742  famosParticleFlowSequence+
743  egammaHighLevelRecoPostPF+
744  muonshighlevelreco+
745  caloJetMetGen+
746  caloJets+
747  PFJetMet+
748  jetTrackAssoc+
749  recoJPTJets+
750  metreco+
751  reducedRecHits+
752  famosBTaggingSequence+
753  famosPFTauTaggingSequence
754 )
755 
756 # Simulation plus reconstruction
757 famosWithEverything = cms.Sequence(
758  simulationWithFamos+
759  reconstructionWithFamos
760 )
if(dp >Float(M_PI)) dp-