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.EgammaIsolationAlgos.egmIsolationDefinitions_cff import *
200 from RecoEgamma.Configuration.RecoEgamma_cff import egammaHighLevelRecoPostPF
201 allConversions.src = 'gsfGeneralConversionTrackMerger'
202 famosConversionSequence = cms.Sequence(conversionTrackSequenceNoEcalSeeded*allConversionSequence)
203 
204 if (MixingMode=='DigiRecoMixing'):
205  generalConversionTrackProducer.TrackProducer = 'generalTracksBeforeMixing'
206 
210 
211 egammaEcalDrivenReco = cms.Sequence(gsfEcalDrivenElectronSequence)
212 electronGsfTracks = TrackingTools.GsfTracking.GsfElectronFit_cfi.GsfGlobalElectronTest.clone()
213 electronGsfTracks.src = 'electronGSGsfTrackCandidates'
214 electronGsfTracks.TTRHBuilder = 'WithoutRefit'
215 electronGsfTracks.TrajectoryInEvent = True
216 
217 
218 # PF related electron sequences defined in FastSimulation.ParticleFlow.ParticleFlowFastSim_cff
220 
221 iterativeTrackingBeginning = cms.Sequence(
222  iterativeInitialSeeds+
223  iterativePixelPairSeeds+
224  iterativeMixedTripletStepSeeds+
225  iterativePixelLessSeeds
226  )
227 
228 famosGsfTrackSequence = cms.Sequence(
229  iterativeTrackingBeginning+
230  newCombinedSeeds+
231  particleFlowCluster+
232  ecalDrivenElectronSeeds+
233  trackerDrivenElectronSeeds+
234  electronMergedSeeds+
235  electronGSGsfTrackCandidates+
236  electronGsfTracks
237 )
238 
239 # Photon reconstruction
241 photons.hbheInstance = ''
243 
244 famosPhotonSequence = cms.Sequence(
245  photonSequence+
246  photonIDSequence
247 )
248 
249 # Add pre-calculated isolation sums for electrons (NB for photons they are stored in the Photon. All is done in the
250 # sequence above
252 
253 #Add egamma ecal interesting rec hits
256 
258 
259 
260 
261 # B tagging
263 ak4JetTracksAssociatorAtVertex.tracks = 'generalTracks'
267 
268 famosBTaggingSequence = cms.Sequence(
269  btagging
270 )
271 
272 
273 ############### FastSim sequences
274 
275 # Calo simulation mode is defined in FastSimulation/CaloRecHitsProducer/python/CaloRecHits_cff.py
276 if(CaloMode==0):
277  simulationSequence = cms.Sequence(
278  offlineBeamSpot+
279  cms.SequencePlaceholder("famosMixing")+
280  famosSimHits+
281  MuonSimHits+
282  cms.SequencePlaceholder("mix")
283  )
284  lowLevelRecoSequence = cms.Sequence(
285  siTrackerGaussianSmearingRecHits+
286  caloRecHits
287  )
288  famosSimulationSequence = cms.Sequence(
289  simulationSequence+
290  lowLevelRecoSequence
291  )
292  trackVertexReco = cms.Sequence(
293  cms.SequencePlaceholder("mix")+
294  iterativeTracking+
295  vertexreco
296  )
297  caloTowersSequence = cms.Sequence(
298  caloTowersRec
299  )
300 elif(CaloMode==1):
301  simulationSequence = cms.Sequence(
302  offlineBeamSpot+
303  cms.SequencePlaceholder("famosMixing")+
304  famosSimHits+
305  MuonSimHits+
306  cms.SequencePlaceholder("mix")
307  )
308  lowLevelRecoSequence = cms.Sequence(
309  siTrackerGaussianSmearingRecHits+
310  caloDigis+
311  caloRecHits
312  )
313  famosSimulationSequence = cms.Sequence(
314  simulationSequence+
315  lowLevelRecoSequence
316  )
317  trackVertexReco = cms.Sequence(
318  cms.SequencePlaceholder("mix")+
319  iterativeTracking+
320  vertexreco
321  )
322  caloTowersSequence = cms.Sequence(
323  caloTowersRec
324  )
325 elif(CaloMode==2):
326  simulationSequence = cms.Sequence(
327  offlineBeamSpot+
328  cms.SequencePlaceholder("famosMixing")+
329  famosSimHits+
330  MuonSimHits+
331  cms.SequencePlaceholder("mix")
332  )
333  lowLevelRecoSequence = cms.Sequence(
334  siTrackerGaussianSmearingRecHits+
335  iterativeTracking+ # because tracks are used for noise cleaning in HCAL low-level reco
336  caloDigis+
337  caloRecHits
338  )
339  famosSimulationSequence = cms.Sequence(
340  simulationSequence+
341  lowLevelRecoSequence
342  )
343  trackVertexReco = cms.Sequence(
344  cms.SequencePlaceholder("mix")+
345  iterativeTracking+ # this repetition is normally harmless, but it is annoying if you want to run SIM and RECO in two steps
346  vertexreco
347  )
348  caloTowersSequence = cms.Sequence(
349  caloTowersRec
350  )
351 elif(CaloMode==3):
352  if(MixingMode=='GenMixing'):
353  simulationSequence = cms.Sequence(
354  offlineBeamSpot+
355  cms.SequencePlaceholder("famosMixing")+
356  famosSimHits+
357  MuonSimHits
358  )
359  digitizationSequence = cms.Sequence(
360  cms.SequencePlaceholder("mix")+
361  muonDigi+
362  caloDigis
363  )
364  trackVertexReco = cms.Sequence(
365  siTrackerGaussianSmearingRecHits+
366  iterativeTracking+
367  vertexreco
368  )
369  elif(MixingMode=='DigiRecoMixing'):
370  #dump = cms.EDAnalyzer("EventContentAnalyzer") #TEMP
371  simulationSequence = cms.Sequence(
372  offlineBeamSpot+
373  famosSimHits+
374  MuonSimHits
375  )
376  trackReco = cms.Sequence(
377  siTrackerGaussianSmearingRecHits+
378  iterativeTracking
379  )
380  digitizationSequence = cms.Sequence(
381  cms.SequencePlaceholder("mixHitsAndTracks")+
382  muonDigi+
383  caloDigis
384  )
385  trackDigiVertexSequence = cms.Sequence(
386  trackReco+
387  #dump+ #TEMP
388  digitizationSequence+
389  vertexreco
390  )
391  trackVertexReco = cms.Sequence( # for backward compatibility
392  trackDigiVertexSequence
393  )
394  else:
395  print 'unsupported MixingMode label'
396 # out of the 'if':
397  caloTowersSequence = cms.Sequence(
398  caloRecHits+
399  caloTowersRec
400  )
401  if(MixingMode=='GenMixing'):
402  famosSimulationSequence = cms.Sequence(
403  simulationSequence+
404  digitizationSequence#+ # temporary; eventually it will be a block of its own, but it requires intervention on ConfigBuilder
405  )
406  elif(MixingMode=='DigiRecoMixing'):
407  famosSimulationSequence = cms.Sequence(
408  simulationSequence+
409  trackDigiVertexSequence
410  )
411  else:
412  print 'unsupported MixingMode label'
413 
414 famosEcalDrivenElectronSequence = cms.Sequence(
415  famosGsfTrackSequence+
416  egammaEcalDrivenReco
417 )
418 
419 simulationSequence.insert(0,genParticles)
420 
421 # The reconstruction sequence
422 if(CaloMode==3):
423  if(MixingMode=='GenMixing'):
424  reconstructionWithFamos = cms.Sequence(
425  digitizationSequence+ # temporary; repetition!
426  trackVertexReco+
427  caloTowersSequence+
428  particleFlowCluster+
429  ecalClusters+
430  famosGsfTrackSequence+
431  famosMuonSequence+
432  famosMuonIdAndIsolationSequence+
433  famosConversionSequence+
434  particleFlowTrackWithDisplacedVertex+
435  famosEcalDrivenElectronSequence+
436  famosPhotonSequence+
437  famosParticleFlowSequence+
438  egammaHighLevelRecoPostPF+
439  muonshighlevelreco+
440  particleFlowLinks+
441  caloJetMetGen+
442  caloJets+
443  PFJetMet+
444  jetTrackAssoc+
445  recoJPTJets+
446  metreco+
447  reducedRecHits+
448  famosBTaggingSequence+
449  famosPFTauTaggingSequence
450  )
451  elif(MixingMode=='DigiRecoMixing'):
452  reconstructionWithFamos = cms.Sequence(
453  caloTowersSequence+
454  particleFlowCluster+
455  ecalClusters+
456  famosGsfTrackSequence+
457  famosMuonSequence+
458  famosMuonIdAndIsolationSequence+
459  famosConversionSequence+
460  particleFlowTrackWithDisplacedVertex+
461  famosEcalDrivenElectronSequence+
462  famosPhotonSequence+
463  famosParticleFlowSequence+
464  egammaHighLevelRecoPostPF+
465  muonshighlevelreco+
466  particleFlowLinks+
467  caloJetMetGen+
468  caloJets+
469  PFJetMet+
470  jetTrackAssoc+
471  recoJPTJets+
472  metreco+
473  reducedRecHits+
474  famosBTaggingSequence+
475  famosPFTauTaggingSequence
476  )
477  else:
478  print 'unsupported MixingMode label'
479 else:
480  reconstructionWithFamos = cms.Sequence(
481  trackVertexReco+
482  caloTowersSequence+
483  particleFlowCluster+
484  ecalClusters+
485  famosGsfTrackSequence+
486  famosMuonSequence+
487  famosMuonIdAndIsolationSequence+
488  famosConversionSequence+
489  particleFlowTrackWithDisplacedVertex+
490  famosEcalDrivenElectronSequence+
491  famosPhotonSequence+
492  famosParticleFlowSequence+
493  egammaHighLevelRecoPostPF+
494  muonshighlevelreco+
495  particleFlowLinks+
496  caloJetMetGen+
497  caloJets+
498  PFJetMet+
499  jetTrackAssoc+
500  recoJPTJets+
501  metreco+
502  reducedRecHits+
503  famosBTaggingSequence+
504  famosPFTauTaggingSequence
505  )
506 
507 
508 
509 
510 
511 # Special sequences for two-step operation
512 simulationWithSomeReconstruction = cms.Sequence(
513  famosSimulationSequence+
514  siTrackerGaussianSmearingRecHits+
515  iterativeTracking+
516  vertexreco+
517  caloTowersSequence+
518  particleFlowCluster+
519  ecalClusters+
520  famosGsfTrackSequence+
521  famosMuonSequence+
522  famosMuonIdAndIsolationSequence+
523  famosConversionSequence+
524  particleFlowTrackWithDisplacedVertex+
525  famosEcalDrivenElectronSequence+
526  famosPhotonSequence+
527  famosParticleFlowSequence+
528  egammaHighLevelRecoPostPF
529  )
530 
531 reconstructionHighLevel = cms.Sequence(
532  cms.SequencePlaceholder("mix")+
533  muonshighlevelreco+
534  particleFlowLinks+
535  caloJetMetGen+
536  caloJets+
537  PFJetMet+
538  jetTrackAssoc+
539  recoJPTJets+
540  metreco+
541  reducedRecHits+
542  famosBTaggingSequence+
543  famosPFTauTaggingSequence
544 )
545 
546 # Famos pre-defined sequences (and self-explanatory names)
547 
548 famosWithTrackerHits = cms.Sequence(
549  famosSimulationSequence+
550  siTrackerGaussianSmearingRecHits
551 )
552 
553 famosWithTracks = cms.Sequence(
554  famosWithTrackerHits+
555  iterativeTracking
556  )
557 
558 famosWithTracksAndMuonHits = cms.Sequence(
559  famosSimulationSequence+
560  siTrackerGaussianSmearingRecHits+
561  iterativeTracking+
562  vertexreco+
563  famosMuonSequence
564 )
565 
566 famosWithTracksAndMuons = cms.Sequence(
567  famosSimulationSequence+
568  siTrackerGaussianSmearingRecHits+
569  iterativeTracking+
570  vertexreco+
571  famosMuonSequence+
572  caloTowersSequence+
573  famosMuonIdAndIsolationSequence
574 )
575 
576 famosWithCaloHits = cms.Sequence(
577  famosSimulationSequence+
578  caloTowersSequence
579 )
580 
581 famosWithEcalClusters = cms.Sequence(
582  famosWithCaloHits+
583  particleFlowCluster+
584  ecalClusters
585 )
586 
587 famosWithTracksAndCaloHits = cms.Sequence(
588  famosWithTracks+
589  caloTowersSequence
590 )
591 
592 famosWithTracksAndEcalClusters = cms.Sequence(
593  famosWithTracksAndCaloHits+
594  particleFlowCluster+
595  ecalClusters
596 )
597 
598 
599 famosWithParticleFlow = cms.Sequence(
600  famosWithTracksAndEcalClusters+
601  vertexreco+
602  famosGsfTrackSequence+
603  famosConversionSequence+
604  caloTowersSequence+
605  famosParticleFlowSequence+
606  PFJetMet
607 )
608 
609 famosWithCaloTowers = cms.Sequence(
610  famosWithCaloHits+
611  caloTowersSequence
612 )
613 
614 famosElectronSequence = cms.Sequence(
615  famosGsfTrackSequence+
616  famosEcalDrivenElectronSequence+
617  famosWithParticleFlow+
618  egammaHighLevelRecoPostPF+
619  gsfElectronSequence+
620  eIdSequence
621 )
622 
623 famosWithTracksAndCaloTowers = cms.Sequence(
624  famosWithTracksAndCaloHits+
625  caloTowersSequence
626 )
627 
628 famosWithTracksAndJets = cms.Sequence(
629  famosWithTracksAndCaloTowers+
630  vertexreco+
631  caloJetMetGen+
632  caloJets+
633  PFJetMet+
634  jetTrackAssoc+
635  recoJPTJets+
636  metreco
637 )
638 
639 ### Standard Jets _cannot_ be done without many other things...
640 #######################################################################
641 famosWithJets = cms.Sequence(
642  famosWithTracksAndCaloTowers+
643  vertexreco+
644  particleFlowCluster+
645  ecalClusters+
646  famosGsfTrackSequence+
647  famosMuonSequence+
648  famosMuonIdAndIsolationSequence+
649  famosParticleFlowSequence+
650  gsfElectronSequence+
651  caloJetMetGen+
652  caloJets+
653  PFJetMet+
654  jetTrackAssoc+
655  recoJPTJets+
656  metreco
657 )
658 
659 famosWithCaloTowersAndParticleFlow = cms.Sequence(
660  famosWithParticleFlow+
661  caloTowersSequence
662 )
663 
664 
665 famosWithElectrons = cms.Sequence(
666  famosWithTracksAndEcalClusters+
667  caloTowersSequence+
668  famosGsfTrackSequence+
669  famosParticleFlowSequence+
670  famosElectronSequence+
671  interestingGedEleIsoDetIdEB+
672  interestingGedEleIsoDetIdEE+
673  egammaIsolationSequence
674 )
675 
676 famosWithPhotons = cms.Sequence(
677  famosWithTracks+
678  vertexreco+
679  caloRecHits+
680  ecalClustersNoPFBox+
681  famosPhotonSequence+
682  interestingGedGamIsoDetIdEB+
683  interestingGedGamIsoDetIdEE+
684  interestingGamIsoDetIdEB+
685  interestingGamIsoDetIdEE
686 )
687 
688 famosWithElectronsAndPhotons = cms.Sequence(
689  famosWithTracks+
690  vertexreco+
691  caloTowersSequence+
692  ecalClustersNoPFBox+
693  famosElectronSequence+
694  famosPhotonSequence+
695  interestingEgammaIsoDetIds+
696  egammaIsolationSequence
697 )
698 
699 famosWithBTagging = cms.Sequence(
700  famosWithTracksAndCaloTowers+
701  vertexreco+
702  ak4PFJetsCHS+
703  ak4JetTracksAssociatorAtVertexPF+
704  ecalClustersNoPFBox+
705  famosMuonSequence+
706  reducedRecHits+
707  famosBTaggingSequence
708  )
709 
710 
711 famosWithPFTauTagging = cms.Sequence(
712  famosWithCaloTowersAndParticleFlow+
713  famosPFTauTaggingSequence
714 )
715 
716 # The simulation sequence without muon digitization
717 simulationNoMuonDigiWithFamos = cms.Sequence(
718  famosSimulationSequence+
719  siTrackerGaussianSmearingRecHits
720 )
721 
722 # The simulation and digitization sequence
723 simulationWithFamos = cms.Sequence(
724  famosSimulationSequence#+
725 # muonDigi+
726 # siTrackerGaussianSmearingRecHits
727 )
728 
729 
730 
731 reconstructionWithFamosNoTk = cms.Sequence(
732  vertexreco+
733  caloTowersSequence+
734  particleFlowCluster+
735  ecalClusters+
736  famosGsfTrackSequence+
737  famosMuonSequence+
738  famosMuonIdAndIsolationSequence+
739  famosConversionSequence+
740  particleFlowTrackWithDisplacedVertex+
741  famosEcalDrivenElectronSequence+
742  famosPhotonSequence+
743  famosParticleFlowSequence+
744  egammaHighLevelRecoPostPF+
745  muonshighlevelreco+
746  caloJetMetGen+
747  caloJets+
748  PFJetMet+
749  jetTrackAssoc+
750  recoJPTJets+
751  metreco+
752  reducedRecHits+
753  famosBTaggingSequence+
754  famosPFTauTaggingSequence
755 )
756 
757 # Simulation plus reconstruction
758 famosWithEverything = cms.Sequence(
759  simulationWithFamos+
760  reconstructionWithFamos
761 )
if(dp >Float(M_PI)) dp-