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, HGCAL_noise_fC, HGCAL_noise_MIP, HGCAL_chargeCollectionEfficiencies, HGCAL_noises
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 
64 
65 from Configuration.Eras.Modifier_phase2_hfnose_cff import phase2_hfnose
66 phase2_hfnose.toModify( theDigitizers,
67  hfnoseDigitizer = cms.PSet(hfnoseDigitizer),
68 )
69 
70 from Configuration.Eras.Modifier_run3_common_cff import run3_common
71 run3_common.toModify( theDigitizers, castor = None )
72 
73 from SimGeneral.MixingModule.ecalTimeDigitizer_cfi import ecalTimeDigitizer
74 from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing
75 from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer
76 phase2_timing.toModify( theDigitizers,
77  ecalTime = ecalTimeDigitizer.clone() )
78 
79 from SimFastTiming.Configuration.SimFastTiming_cff import fastTimeDigitizer
80 phase2_timing_layer.toModify( theDigitizers,
81  fastTimingLayer = fastTimeDigitizer.clone() )
82 
83 from SimFastTiming.Configuration.SimFastTiming_cff import mtdDigitizer
84 from Configuration.Eras.Modifier_phase2_timing_layer_tile_cff import phase2_timing_layer_tile
85 from Configuration.Eras.Modifier_phase2_timing_layer_bar_cff import phase2_timing_layer_bar
86 (phase2_timing_layer_tile | phase2_timing_layer_bar).toModify( theDigitizers,
87  fastTimingLayer = mtdDigitizer.clone() )
88 
89 premix_stage2.toModify(theDigitizers,
90  ecal = None,
91  hcal = None,
92 )
93 (premix_stage2 & phase2_hgcal).toModify(theDigitizers,
94  hgceeDigitizer = dict(premixStage1 = True),
95  hgchebackDigitizer = dict(premixStage1 = True),
96  hgchefrontDigitizer = dict(premixStage1 = True),
97 )
98 (premix_stage2 & phase2_hfnose).toModify(theDigitizers,
99  hfnoseDigitizer = dict(premixStage1 = True),
100 )
101 
102 theDigitizersValid = cms.PSet(theDigitizers)
103 theDigitizers.mergedtruth.select.signalOnlyTP = True
104 
105 phase2_hgcal.toModify( theDigitizersValid,
106  calotruth = cms.PSet( caloParticles ) ) # Doesn't HGCal need these also without validation?
107 (premix_stage2 & phase2_hgcal).toModify(theDigitizersValid, calotruth = dict(premixStage1 = True))
108 
109 
110 phase2_timing.toModify( theDigitizersValid.mergedtruth,
111  createInitialVertexCollection = cms.bool(True) )
112 
113 
114 from Configuration.ProcessModifiers.premix_stage1_cff import premix_stage1
116  # To avoid this if-else structure we'd need an "_InverseModifier"
117  # to customize pixel/strip for everything else than fastSim.
118  if hasattr(mod, "pixel"):
119  if hasattr(mod.pixel, "AlgorithmCommon"):
120  mod.pixel.AlgorithmCommon.makeDigiSimLinks = True
121  else:
122  mod.pixel.makeDigiSimLinks = True
123  if hasattr(mod, "strip"):
124  mod.strip.makeDigiSimLinks = True
125  mod.mergedtruth.select.signalOnlyTP = False
126 premix_stage1.toModify(theDigitizersValid, _customizePremixStage1)
127 
129  process.load("SimGeneral.MixingModule.aliases_PreMix_cfi")
130 modifyDigitizers_loadPremixStage2Aliases = premix_stage2.makeProcessModifier(_loadPremixStage2Aliases)
def _loadPremixStage2Aliases(process)
def _customizePremixStage1(mod)