CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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
15 
16 theDigitizers = cms.PSet(
17  pixel = cms.PSet(
18  pixelDigitizer
19  ),
20  strip = cms.PSet(
21  stripDigitizer
22  ),
23  ecal = cms.PSet(
24  ecalDigitizer
25  ),
26  hcal = cms.PSet(
27  hcalDigitizer
28  ),
29  castor = cms.PSet(
30  castorDigitizer
31  ),
32  puVtx = cms.PSet(
33  pileupVtxDigitizer
34  ),
35  mergedtruth = cms.PSet(
36  trackingParticles
37  )
38 )
39 
40 from Configuration.Eras.Modifier_fastSim_cff import fastSim
41 fastSim.toModify(theDigitizers,
42  # fastsim does not model castor
43  castor = None,
44  # fastsim does not digitize pixel and strip hits
45  pixel = None,
46  strip = None,
47  tracks = recoTrackAccumulator
48 )
49 from Configuration.ProcessModifiers.premix_stage2_cff import premix_stage2
50 (fastSim & premix_stage2).toModify(theDigitizers,
51  tracks = None
52 )
53 
54 
55 from SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi import hgceeDigitizer, hgchebackDigitizer, hgchefrontDigitizer, HGCAL_noise_fC, HGCAL_noise_heback, HFNose_noise_fC, HGCAL_chargeCollectionEfficiencies, HGCAL_ileakParam_toUse, HGCAL_cceParams_toUse, HGCAL_noises
56 
57 from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal
58 phase2_hgcal.toModify( theDigitizers,
59  hgceeDigitizer = cms.PSet(hgceeDigitizer),
60  hgchebackDigitizer = cms.PSet(hgchebackDigitizer),
61  hgchefrontDigitizer = cms.PSet(hgchefrontDigitizer),
62  calotruth = cms.PSet(caloParticles), #HGCAL still needs calotruth for production mode
63 )
64 
66 
67 from Configuration.Eras.Modifier_phase2_hfnose_cff import phase2_hfnose
68 phase2_hfnose.toModify( theDigitizers,
69  hfnoseDigitizer = cms.PSet(hfnoseDigitizer),
70 )
71 
72 from Configuration.Eras.Modifier_run3_common_cff import run3_common
73 (run3_common & ~fastSim).toModify( theDigitizers, castor = None )
74 
75 from SimGeneral.MixingModule.ecalTimeDigitizer_cfi import ecalTimeDigitizer
76 from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing
77 phase2_timing.toModify( theDigitizers,
78  ecalTime = ecalTimeDigitizer.clone() )
79 
80 from SimGeneral.MixingModule.ecalTimeDigitizer_cfi import ecalTimeDigitizer
81 from Configuration.Eras.Modifier_run3_ecal_devel_cff import run3_ecal_devel
82 run3_ecal_devel.toModify( theDigitizers,
83  ecalTime = ecalTimeDigitizer.clone() )
84 
85 from SimFastTiming.Configuration.SimFastTiming_cff import mtdDigitizer
86 from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer
87 phase2_timing_layer.toModify( theDigitizers,
88  fastTimingLayer = mtdDigitizer.clone(),
89  MC_fastTimingLayer = mtdTruth.clone()
90 )
91 
92 premix_stage2.toModify(theDigitizers,
93  ecal = None,
94  hcal = None,
95 )
96 (premix_stage2 & phase2_hgcal).toModify(theDigitizers,
97  hgceeDigitizer = dict(premixStage1 = True),
98  hgchebackDigitizer = dict(premixStage1 = True),
99  hgchefrontDigitizer = dict(premixStage1 = True),
100  calotruth = dict(premixStage1 = True), #HGCAL still needs calotruth for production mode
101 )
102 (premix_stage2 & phase2_hfnose).toModify(theDigitizers,
103  hfnoseDigitizer = dict(premixStage1 = True),
104 )
105 (premix_stage2 & phase2_timing_layer).toModify(theDigitizers,
106  fastTimingLayer = dict(
107  barrelDigitizer = dict(premixStage1 = True),
108  endcapDigitizer = dict(premixStage1 = True)
109  ),
110  MC_fastTimingLayer = dict(premixStage1 = True),
111 )
112 
113 from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
114 phase2_tracker.toModify(theDigitizers,
115  strip = None)
116 
117 theDigitizersValid = cms.PSet(theDigitizers)
118 theDigitizers.mergedtruth.select.signalOnlyTP = True
119 
120 from Configuration.ProcessModifiers.run3_ecalclustering_cff import run3_ecalclustering
121 run3_ecalclustering.toModify( theDigitizersValid,
122  calotruth = cms.PSet( caloParticles ) )
123 
124 phase2_timing.toModify( theDigitizersValid.mergedtruth,
125  createInitialVertexCollection = cms.bool(True) )
126 
127 from Configuration.ProcessModifiers.premix_stage1_cff import premix_stage1
129  # To avoid this if-else structure we'd need an "_InverseModifier"
130  # to customize pixel/strip for everything else than fastSim.
131  if hasattr(mod, "pixel"):
132  if hasattr(mod.pixel, "AlgorithmCommon"):
133  mod.pixel.AlgorithmCommon.makeDigiSimLinks = True
134  else:
135  mod.pixel.makeDigiSimLinks = True
136  if hasattr(mod, "strip"):
137  mod.strip.makeDigiSimLinks = True
138  mod.mergedtruth.select.signalOnlyTP = False
139 premix_stage1.toModify(theDigitizersValid, _customizePremixStage1)
140 
142  process.load("SimGeneral.MixingModule.aliases_PreMix_cfi")
143 modifyDigitizers_loadPremixStage2Aliases = premix_stage2.makeProcessModifier(_loadPremixStage2Aliases)
def _loadPremixStage2Aliases(process)
def _customizePremixStage1(mod)