Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-06-06 07:38:54

0001 # This is the PreMixing config. Not only does it do a RawToDigi
0002 # conversion to the secondary input source, it also holds its own
0003 # instances of an EcalDigiProducer and an HcalDigitizer. It also
0004 # replicates the noise adding functions in the SiStripDigitizer.
0005 #
0006 # Adapted from DataMixingModule
0007 
0008 
0009 import FWCore.ParameterSet.Config as cms
0010 from SimCalorimetry.HcalSimProducers.hcalUnsuppressedDigis_cfi import hcalSimBlock
0011 from SimGeneral.MixingModule.SiStripSimParameters_cfi import SiStripSimBlock
0012 from SimGeneral.MixingModule.SiPixelSimParameters_cfi import SiPixelSimBlock
0013 from SimTracker.SiPhase2Digitizer.phase2TrackerDigitizer_cfi import phase2TrackerDigitizer, _premixStage1ModifyDict as _phase2TrackerPremixStage1ModifyDict
0014 from SimGeneral.MixingModule.ecalDigitizer_cfi import ecalDigitizer
0015 from SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi import hgceeDigitizer, hgchebackDigitizer, hgchefrontDigitizer, hfnoseDigitizer
0016 from SimFastTiming.FastTimingCommon.mtdDigitizer_cfi import mtdDigitizer
0017 
0018 hcalSimBlock.HcalPreMixStage2 = cms.bool(True)
0019 
0020 mixData = cms.EDProducer("PreMixingModule",
0021     input = cms.SecSource("EmbeddedRootSource",
0022         producers = cms.VPSet(),
0023         nbPileupEvents = cms.PSet(
0024             averageNumber = cms.double(1.0)
0025         ),
0026         seed = cms.int32(1234567),
0027         type = cms.string('fixed'),
0028         sequential = cms.untracked.bool(False), # set to true for sequential reading of pileup
0029         fileNames = cms.untracked.vstring('file:DMPreProcess_RAW2DIGI.root'),
0030         consecutiveRejectionsLimit = cms.untracked.uint32(100) # should be sufficiently large to allow enough tails
0031     ),
0032     # Mixing Module parameters
0033     bunchspace = cms.int32(25),
0034     minBunch = cms.int32(0),
0035     maxBunch = cms.int32(0),
0036     mixProdStep1 = cms.bool(False),
0037     mixProdStep2 = cms.bool(False),
0038     # Optionally adjust the pileup distribution
0039     adjustPileupDistribution = cms.VPSet(),
0040     # Workers
0041     workers = cms.PSet(
0042         pileup = cms.PSet(
0043             PileupInfoInputTag = cms.InputTag("addPileupInfo"),
0044             BunchSpacingInputTag = cms.InputTag("addPileupInfo","bunchSpacing"),
0045             CFPlaybackInputTag = cms.InputTag("mix"),
0046             GenPUProtonsInputTags = cms.VInputTag("genPUProtons"),
0047         ),
0048         # Note: elements with "@MIXING" in the input tag are generated by
0049         pixel = cms.PSet(
0050             SiPixelSimBlock.clone(
0051                 # To preserve the behaviour of copy-pasted version of premix worker
0052                 # All these are done in stage1 (for both signal and pileup)
0053                 AddNoise = False,
0054                 killModules = False,
0055                 MissCalibrate = False,
0056             ),
0057             workerType = cms.string("PreMixingSiPixelWorker"),
0058             pixeldigiCollectionSig = cms.InputTag("simSiPixelDigis"),
0059             pixeldigiCollectionPile = cms.InputTag("simSiPixelDigis"),
0060             pixeldigiExtraCollectionPile = cms.InputTag("simSiPixelDigis"),
0061             PixelDigiCollectionDM = cms.string('siPixelDigisDM'),                   
0062         ),
0063         strip = cms.PSet(
0064             SiStripSimBlock,
0065             workerType = cms.string("PreMixingSiStripWorker"),
0066 
0067             SistripLabelSig = cms.InputTag("simSiStripDigis","ZeroSuppressed"),
0068             SiStripPileInputTag = cms.InputTag("simSiStripDigis","ZeroSuppressed"),
0069             # Dead APV Vector
0070             SistripAPVPileInputTag = cms.InputTag("mix","AffectedAPVList"),
0071             SistripAPVLabelSig = cms.InputTag("mix","AffectedAPVList"),
0072             # output
0073             SiStripDigiCollectionDM = cms.string('siStripDigisDM'),
0074             SiStripAPVListDM = cms.string('SiStripAPVList'),
0075         ),
0076         ecal = cms.PSet(
0077             ecalDigitizer.clone(accumulatorType = None, makeDigiSimLinks=None),
0078             workerType = cms.string("PreMixingEcalWorker"),
0079 
0080             EBdigiProducerSig = cms.InputTag("simEcalUnsuppressedDigis"),
0081             EEdigiProducerSig = cms.InputTag("simEcalUnsuppressedDigis"),
0082             ESdigiProducerSig = cms.InputTag("simEcalPreshowerDigis"),
0083 
0084             EBPileInputTag = cms.InputTag("simEcalDigis", "ebDigis"),
0085             EEPileInputTag = cms.InputTag("simEcalDigis", "eeDigis"),
0086             ESPileInputTag = cms.InputTag("simEcalUnsuppressedDigis"),
0087 
0088             EBDigiCollectionDM   = cms.string(''),
0089             EEDigiCollectionDM   = cms.string(''),
0090             ESDigiCollectionDM   = cms.string(''),
0091         ),
0092         hcal = cms.PSet(
0093             hcalSimBlock,
0094             workerType = cms.string("PreMixingHcalWorker"),
0095 
0096             HBHEdigiCollectionSig  = cms.InputTag("simHcalUnsuppressedDigis"),
0097             HOdigiCollectionSig    = cms.InputTag("simHcalUnsuppressedDigis"),
0098             HFdigiCollectionSig    = cms.InputTag("simHcalUnsuppressedDigis"),
0099             QIE10digiCollectionSig = cms.InputTag("simHcalUnsuppressedDigis"),
0100             QIE11digiCollectionSig = cms.InputTag("simHcalUnsuppressedDigis"),
0101             ZDCdigiCollectionSig   = cms.InputTag("simHcalUnsuppressedDigis"),
0102 
0103             HBHEPileInputTag = cms.InputTag("simHcalDigis"),
0104             HOPileInputTag   = cms.InputTag("simHcalDigis"),
0105             HFPileInputTag   = cms.InputTag("simHcalDigis"),
0106             QIE10PileInputTag   = cms.InputTag("simHcalDigis", "HFQIE10DigiCollection"),
0107             QIE11PileInputTag   = cms.InputTag("simHcalDigis", "HBHEQIE11DigiCollection"),
0108             ZDCPileInputTag  = cms.InputTag(""),
0109 
0110             HBHEDigiCollectionDM = cms.string(''),
0111             HODigiCollectionDM   = cms.string(''),
0112             HFDigiCollectionDM   = cms.string(''),
0113             QIE10DigiCollectionDM   = cms.string(''),
0114             QIE11DigiCollectionDM   = cms.string(''),
0115             ZDCDigiCollectionDM  = cms.string('')
0116         ),
0117         dt = cms.PSet(
0118             workerType = cms.string("PreMixingCrossingFramePSimHitWorker"),
0119             labelSig = cms.InputTag("mix", "g4SimHitsMuonDTHits"),
0120             pileInputTag = cms.InputTag("mix", "g4SimHitsMuonDTHits"),
0121             collectionDM = cms.string("g4SimHitsMuonDTHits"),
0122         ),
0123         rpc = cms.PSet(
0124             workerType = cms.string("PreMixingCrossingFramePSimHitWorker"),
0125             labelSig = cms.InputTag("mix", "g4SimHitsMuonRPCHits"),
0126             pileInputTag = cms.InputTag("mix", "g4SimHitsMuonRPCHits"),
0127             collectionDM = cms.string("g4SimHitsMuonRPCHits"),
0128         ),
0129         csc = cms.PSet(
0130             workerType = cms.string("PreMixingCrossingFramePSimHitWorker"),
0131             labelSig = cms.InputTag("mix", "g4SimHitsMuonCSCHits"),
0132             pileInputTag = cms.InputTag("mix", "g4SimHitsMuonCSCHits"),
0133             collectionDM = cms.string("g4SimHitsMuonCSCHits"),
0134         ),
0135         trackingTruth = cms.PSet(
0136             workerType = cms.string("PreMixingTrackingParticleWorker"),
0137             labelSig = cms.InputTag("mix","MergedTrackTruth"),
0138             pileInputTag = cms.InputTag("mix","MergedTrackTruth"),
0139             collectionDM = cms.string('MergedTrackTruth'),
0140         ),
0141         pixelSimLink = cms.PSet(
0142             workerType = cms.string("PreMixingPixelDigiSimLinkWorker"),
0143             labelSig = cms.InputTag("simSiPixelDigis"),
0144             pileInputTag = cms.InputTag("simSiPixelDigis"),
0145             collectionDM = cms.string('PixelDigiSimLink'),
0146         ),
0147         stripSimLink = cms.PSet(
0148             workerType = cms.string("PreMixingStripDigiSimLinkWorker"),
0149             labelSig = cms.InputTag("simSiStripDigis"),
0150             pileInputTag = cms.InputTag("simSiStripDigis"),
0151             collectionDM = cms.string('StripDigiSimLink'),
0152         ),
0153     ),
0154 )
0155 
0156 # pixel run-dependent
0157 from Configuration.ProcessModifiers.runDependentForPixel_cff import runDependentForPixel
0158 from Configuration.ProcessModifiers.premix_stage2_cff import premix_stage2
0159 (runDependentForPixel & premix_stage2).toModify(mixData.workers.pixel,
0160          UseReweighting=False,
0161          applyLateReweighting=True,
0162          store_SimHitEntryExitPoints=False
0163 )
0164 
0165 from Configuration.Eras.Modifier_fastSim_cff import fastSim
0166 from FastSimulation.Tracking.recoTrackAccumulator_cfi import recoTrackAccumulator as _recoTrackAccumulator
0167 fastSim.toModify(mixData,
0168     # from signal: mix tracks not strip or pixel digis
0169     workers = dict(
0170         pixel = None,
0171         strip = None,
0172         pixelSimLink = None,
0173         stripSimLink = None,
0174         tracks = cms.PSet(
0175             workerType = cms.string("PreMixingDigiAccumulatorWorker"),
0176             accumulator = _recoTrackAccumulator.clone(
0177                 pileUpTracks = "mix:generalTracks"
0178             )
0179         ),
0180         dt = dict(
0181             labelSig = "mix:MuonSimHitsMuonDTHits",
0182             pileInputTag = "mix:MuonSimHitsMuonDTHits",
0183             collectionDM = "MuonSimHitsMuonDTHits",
0184         ),
0185         rpc = dict(
0186             labelSig = "mix:MuonSimHitsMuonRPCHits",
0187             pileInputTag = "mix:MuonSimHitsMuonRPCHits",
0188             collectionDM = "MuonSimHitsMuonRPCHits",
0189         ),
0190         csc = dict(
0191             labelSig = "mix:MuonSimHitsMuonCSCHits",
0192             pileInputTag = "mix:MuonSimHitsMuonCSCHits",
0193             collectionDM = "MuonSimHitsMuonCSCHits",
0194         ),
0195     ),
0196 )
0197 
0198 from Configuration.Eras.Modifier_run2_GEM_2017_cff import run2_GEM_2017
0199 from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM
0200 (run2_GEM_2017 | run3_GEM).toModify(
0201     mixData,
0202     workers = dict(
0203         gem = cms.PSet(
0204             workerType = cms.string("PreMixingCrossingFramePSimHitWorker"),
0205             labelSig = cms.InputTag("mix", "g4SimHitsMuonGEMHits"),
0206             pileInputTag = cms.InputTag("mix", "g4SimHitsMuonGEMHits"),
0207             collectionDM = cms.string("g4SimHitsMuonGEMHits"),
0208         ),
0209     )
0210 )
0211 
0212 from Configuration.Eras.Modifier_phase2_common_cff import phase2_common
0213 from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
0214 from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer
0215 from Configuration.Eras.Modifier_phase2_hcal_cff import phase2_hcal
0216 from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal
0217 from Configuration.Eras.Modifier_phase2_hfnose_cff import phase2_hfnose
0218 from Configuration.Eras.Modifier_phase2_muon_cff import phase2_muon
0219 from Configuration.Eras.Modifier_phase2_GE0_cff import phase2_GE0
0220 phase2_common.toModify(mixData, input = dict(producers = [])) # we use digis directly, no need for raw2digi producers
0221 
0222 # Tracker
0223 phase2_tracker.toModify(mixData,
0224     workers = dict(
0225         # Disable SiStrip
0226         strip = None,
0227         stripSimLink = None,
0228         # Replace pixel with Phase2 tracker
0229         pixel = cms.PSet(
0230             phase2TrackerDigitizer,
0231             workerType = cms.string("PreMixingPhase2TrackerWorker"),
0232 
0233             pixelLabelSig = cms.InputTag("simSiPixelDigis:Pixel"),
0234             pixelPileInputTag = cms.InputTag("simSiPixelDigis:Pixel"),
0235             trackerLabelSig = cms.InputTag("simSiPixelDigis:Tracker"),
0236             trackerPileInputTag = cms.InputTag("simSiPixelDigis:Tracker"),
0237             pixelPmxStage1ElectronPerAdc = cms.double(phase2TrackerDigitizer.PixelDigitizerAlgorithm.ElectronPerAdc.value()),
0238             trackerPmxStage1ElectronPerAdc = cms.double(phase2TrackerDigitizer.PSPDigitizerAlgorithm.ElectronPerAdc.value())
0239         ),
0240         pixelSimLink = dict(
0241             labelSig = "simSiPixelDigis:Pixel",
0242             pileInputTag = "simSiPixelDigis:Pixel",
0243         ),
0244         phase2OTSimLink = cms.PSet(
0245             workerType = cms.string("PreMixingPixelDigiSimLinkWorker"),
0246             labelSig = cms.InputTag("simSiPixelDigis:Tracker"),
0247             pileInputTag = cms.InputTag("simSiPixelDigis:Tracker"),
0248             collectionDM = cms.string("Phase2OTDigiSimLink"),
0249         ),
0250     ),
0251 )
0252 
0253 # MTD
0254 phase2_timing_layer.toModify(mixData,
0255     workers = dict(
0256         mtdBarrel = cms.PSet(
0257             mtdDigitizer.barrelDigitizer,
0258             workerType = cms.string("PreMixingMTDWorker"),
0259             digiTagSig = cms.InputTag("mix", "FTLBarrel"),
0260             pileInputTag = cms.InputTag("mix", "FTLBarrel"),
0261         ),
0262         mtdEndcap = cms.PSet(
0263             mtdDigitizer.endcapDigitizer,
0264             workerType = cms.string("PreMixingMTDWorker"),
0265             digiTagSig = cms.InputTag("mix", "FTLEndcap"),
0266             pileInputTag = cms.InputTag("mix", "FTLEndcap"),
0267         ),
0268     )
0269 )
0270 # ECAL
0271 phase2_common.toModify (mixData, workers=dict(ecal=dict(doES=False)))
0272 phase2_hgcal.toModify(mixData, workers=dict(ecal=dict(doEE=False)))
0273 
0274 # HGCAL
0275 phase2_hgcal.toModify(mixData,
0276     workers = dict(
0277         hgcee = cms.PSet(
0278             hgceeDigitizer,
0279             workerType = cms.string("PreMixingHGCalWorker"),
0280             digiTagSig = cms.InputTag("mix", "HGCDigisEE"),
0281             pileInputTag = cms.InputTag("simHGCalUnsuppressedDigis", "EE"),
0282         ),
0283         hgchefront = cms.PSet(
0284             hgchefrontDigitizer,
0285             workerType = cms.string("PreMixingHGCalWorker"),
0286             digiTagSig = cms.InputTag("mix", "HGCDigisHEfront"),
0287             pileInputTag = cms.InputTag("simHGCalUnsuppressedDigis", "HEfront"),
0288         ),
0289         hgcheback = cms.PSet(
0290             hgchebackDigitizer,
0291             workerType = cms.string("PreMixingHGCalWorker"),
0292             digiTagSig = cms.InputTag("mix", "HGCDigisHEback"),
0293             pileInputTag = cms.InputTag("simHGCalUnsuppressedDigis", "HEback"),
0294         ),
0295         caloTruth = cms.PSet(
0296             workerType = cms.string("PreMixingCaloParticleWorker"),
0297             labelSig = cms.InputTag("mix", "MergedCaloTruth"),
0298             pileInputTag = cms.InputTag("mix", "MergedCaloTruth"),
0299             collectionDM = cms.string("MergedCaloTruth"),
0300         )
0301     )
0302 )
0303 
0304 phase2_hfnose.toModify(mixData,
0305     workers = dict(
0306         hfnose = cms.PSet(
0307             hfnoseDigitizer,
0308             workerType = cms.string("PreMixingHGCalWorker"),
0309             digiTagSig = cms.InputTag("mix", "HFNoseDigis"),
0310             pileInputTag = cms.InputTag("simHGCalUnsuppressedDigis", "HFNose"),
0311         ),
0312     )
0313 )
0314 
0315 # Muon
0316 (phase2_muon & ~phase2_GE0).toModify(mixData,
0317     workers = dict(
0318         me0 = cms.PSet(
0319             workerType = cms.string("PreMixingCrossingFramePSimHitWorker"),
0320             labelSig = cms.InputTag("mix", "g4SimHitsMuonME0Hits"),
0321             pileInputTag = cms.InputTag("mix", "g4SimHitsMuonME0Hits"),
0322             collectionDM = cms.string("g4SimHitsMuonME0Hits"),
0323         ),
0324     )
0325 )
0326 
0327 # Run-dependent MC
0328 from Configuration.ProcessModifiers.runDependent_cff import runDependent
0329 runDependent.toModify(mixData.workers.ecal, timeDependent=True)