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