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_heback, HGCAL_chargeCollectionEfficiencies, HGCAL_ileakParam_toUse, HGCAL_cceParams_toUse, 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  calotruth = cms.PSet(caloParticles), #HGCAL still needs calotruth for production mode
62 )
63 
65 
66 from Configuration.Eras.Modifier_phase2_hfnose_cff import phase2_hfnose
67 phase2_hfnose.toModify( theDigitizers,
68  hfnoseDigitizer = cms.PSet(hfnoseDigitizer),
69 )
70 
71 from Configuration.Eras.Modifier_run3_common_cff import run3_common
72 run3_common.toModify( theDigitizers, castor = None )
73 
74 from SimGeneral.MixingModule.ecalTimeDigitizer_cfi import ecalTimeDigitizer
75 from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing
76 phase2_timing.toModify( theDigitizers,
77  ecalTime = ecalTimeDigitizer.clone() )
78 
79 from SimFastTiming.Configuration.SimFastTiming_cff import mtdDigitizer
80 from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer
81 phase2_timing_layer.toModify( theDigitizers,
82  fastTimingLayer = mtdDigitizer.clone() )
83 
84 premix_stage2.toModify(theDigitizers,
85  ecal = None,
86  hcal = None,
87 )
88 (premix_stage2 & phase2_hgcal).toModify(theDigitizers,
89  hgceeDigitizer = dict(premixStage1 = True),
90  hgchebackDigitizer = dict(premixStage1 = True),
91  hgchefrontDigitizer = dict(premixStage1 = True),
92  calotruth = dict(premixStage1 = True), #HGCAL still needs calotruth for production mode
93 )
94 (premix_stage2 & phase2_hfnose).toModify(theDigitizers,
95  hfnoseDigitizer = dict(premixStage1 = True),
96 )
97 (premix_stage2 & phase2_timing_layer).toModify(theDigitizers,
98  fastTimingLayer = dict(
99  barrelDigitizer = dict(premixStage1 = True),
100  endcapDigitizer = dict(premixStage1 = True)
101  )
102 )
103 
104 theDigitizersValid = cms.PSet(theDigitizers)
105 theDigitizers.mergedtruth.select.signalOnlyTP = True
106 
107 from Configuration.ProcessModifiers.run3_ecalclustering_cff import run3_ecalclustering
108 (run3_ecalclustering | phase2_hgcal).toModify( theDigitizersValid,
109  calotruth = cms.PSet( caloParticles ) )
110 (premix_stage2 & phase2_hgcal).toModify(theDigitizersValid, calotruth = dict(premixStage1 = True))
111 
112 phase2_timing.toModify( theDigitizersValid.mergedtruth,
113  createInitialVertexCollection = cms.bool(True) )
114 
115 
116 from Configuration.ProcessModifiers.premix_stage1_cff import premix_stage1
118  # To avoid this if-else structure we'd need an "_InverseModifier"
119  # to customize pixel/strip for everything else than fastSim.
120  if hasattr(mod, "pixel"):
121  if hasattr(mod.pixel, "AlgorithmCommon"):
122  mod.pixel.AlgorithmCommon.makeDigiSimLinks = True
123  else:
124  mod.pixel.makeDigiSimLinks = True
125  if hasattr(mod, "strip"):
126  mod.strip.makeDigiSimLinks = True
127  mod.mergedtruth.select.signalOnlyTP = False
128 premix_stage1.toModify(theDigitizersValid, _customizePremixStage1)
129 
131  process.load("SimGeneral.MixingModule.aliases_PreMix_cfi")
132 modifyDigitizers_loadPremixStage2Aliases = premix_stage2.makeProcessModifier(_loadPremixStage2Aliases)
hgcalDigitizer_cfi
pixelDigitizer_cfi
ecalDigitizer_cfi
digitizers_cfi._customizePremixStage1
def _customizePremixStage1(mod)
Definition: digitizers_cfi.py:117
trackingTruthProducerSelection_cfi
aliases_cfi
pileupVtxDigitizer_cfi
castorDigitizer_cfi
caloTruthProducer_cfi
digitizers_cfi._loadPremixStage2Aliases
def _loadPremixStage2Aliases(process)
Definition: digitizers_cfi.py:130
stripDigitizer_cfi
hcalDigitizer_cfi
recoTrackAccumulator_cfi