CMS 3D CMS Logo

digitizers_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 # configuration to model pileup for initial physics phase
14 
15 theDigitizers = cms.PSet(
16  pixel = cms.PSet(
17  pixelDigitizer
18  ),
19  strip = cms.PSet(
20  stripDigitizer
21  ),
22  ecal = cms.PSet(
23  ecalDigitizer
24  ),
25  hcal = cms.PSet(
26  hcalDigitizer
27  ),
28  castor = cms.PSet(
29  castorDigitizer
30  ),
31  puVtx = cms.PSet(
32  pileupVtxDigitizer
33  ),
34  mergedtruth = cms.PSet(
35  trackingParticles
36  )
37 )
38 
39 from Configuration.Eras.Modifier_fastSim_cff import fastSim
40 fastSim.toModify(theDigitizers,
41  # fastsim does not model castor
42  castor = None,
43  # fastsim does not digitize pixel and strip hits
44  pixel = None,
45  strip = None,
46  tracks = recoTrackAccumulator
47 )
48 from Configuration.ProcessModifiers.premix_stage2_cff import premix_stage2
49 (fastSim & premix_stage2).toModify(theDigitizers,
50  tracks = None
51 )
52 
53 
54 from SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi import hgceeDigitizer, hgchebackDigitizer, hgchefrontDigitizer
55 
56 from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal
57 phase2_hgcal.toModify( theDigitizers,
58  hgceeDigitizer = cms.PSet(hgceeDigitizer),
59  hgchebackDigitizer = cms.PSet(hgchebackDigitizer),
60  hgchefrontDigitizer = cms.PSet(hgchefrontDigitizer),
61 )
62 
63 from Configuration.Eras.Modifier_run3_common_cff import run3_common
64 run3_common.toModify( theDigitizers, castor = None )
65 
66 from SimGeneral.MixingModule.ecalTimeDigitizer_cfi import ecalTimeDigitizer
67 from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing
68 from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer
69 phase2_timing.toModify( theDigitizers,
70  ecalTime = ecalTimeDigitizer.clone() )
71 
72 from SimFastTiming.Configuration.SimFastTiming_cff import fastTimeDigitizer
73 phase2_timing_layer.toModify( theDigitizers,
74  fastTimingLayer = fastTimeDigitizer.clone() )
75 
76 premix_stage2.toModify(theDigitizers,
77  ecal = None,
78  hcal = None,
79  # TODO: what to do with hgcal?
80 )
81 
82 
83 theDigitizersValid = cms.PSet(theDigitizers)
84 theDigitizers.mergedtruth.select.signalOnlyTP = True
85 
86 phase2_hgcal.toModify( theDigitizersValid,
87  calotruth = cms.PSet( caloParticles ) )
88 
89 
90 phase2_timing.toModify( theDigitizersValid.mergedtruth,
91  createInitialVertexCollection = cms.bool(True) )
92 
93 
94 from Configuration.ProcessModifiers.premix_stage1_cff import premix_stage1
96  # To avoid this if-else structure we'd need an "_InverseModifier"
97  # to customize pixel/strip for everything else than fastSim.
98  if hasattr(mod, "pixel"):
99  if hasattr(mod.pixel, "PixelDigitizerAlgorithm"):
100  mod.pixel.PixelDigitizerAlgorithm.makeDigiSimLinks = True
101  mod.pixel.PSPDigitizerAlgorithm.makeDigiSimLinks = True
102  mod.pixel.PSSDigitizerAlgorithm.makeDigiSimLinks = True
103  mod.pixel.SSDigitizerAlgorithm.makeDigiSimLinks = True
104  else:
105  mod.pixel.makeDigiSimLinks = True
106  if hasattr(mod, "strip"):
107  mod.strip.makeDigiSimLinks = True
108  mod.mergedtruth.select.signalOnlyTP = False
109 premix_stage1.toModify(theDigitizersValid, _customizePremixStage1)
110 
112  process.load("SimGeneral.MixingModule.aliases_PreMix_cfi")
113 modifyDigitizers_loadPremixStage2Aliases = premix_stage2.makeProcessModifier(_loadPremixStage2Aliases)
def _loadPremixStage2Aliases(process)
def _customizePremixStage1(mod)