5 import FWCore.ParameterSet.Config
as cms
28 steps=["SELECT", "CLEAN", "SIM", "MERGE"],
44 to_bemanipulate.append(
46 module_name=
"siPixelClusters",
47 manipulator_name=
"Pixel",
48 steps=[
"SELECT",
"CLEAN"],
51 to_bemanipulate.append(
53 module_name=
"siStripClusters",
54 manipulator_name=
"Strip",
55 steps=[
"SELECT",
"CLEAN"],
59 to_bemanipulate.append(
61 module_name=
"generalTracks", manipulator_name=
"Track", steps=[
"SIM",
"MERGE"]
64 to_bemanipulate.append(
66 module_name=
"cosmicsVetoTracksRaw", manipulator_name=
"Track", steps=[
"SIM",
"MERGE"]
69 to_bemanipulate.append(
71 module_name=
"electronGsfTracks",
72 manipulator_name=
"GsfTrack",
73 steps=[
"SIM",
"MERGE"],
76 to_bemanipulate.append(
78 module_name=
"lowPtGsfEleGsfTracks",
79 manipulator_name=
"GsfTrack",
80 steps=[
"SIM",
"MERGE"],
83 to_bemanipulate.append(
85 module_name=
"conversionStepTracks",
86 manipulator_name=
"Track",
87 steps=[
"SIM",
"MERGE"],
90 to_bemanipulate.append(
92 module_name=
"displacedTracks",
93 manipulator_name=
"Track",
94 steps=[
"SIM",
"MERGE"],
97 to_bemanipulate.append(
99 module_name=
"ckfInOutTracksFromConversions",
100 manipulator_name=
"Track",
101 steps=[
"SIM",
"MERGE"],
104 to_bemanipulate.append(
106 module_name=
"ckfOutInTracksFromConversions",
107 manipulator_name=
"Track",
108 steps=[
"SIM",
"MERGE"],
112 to_bemanipulate.append(
114 module_name=
"muons1stStep", manipulator_name=
"Muon", steps=[
"SIM",
"MERGE"]
117 to_bemanipulate.append(
119 module_name=
"displacedMuons1stStep", manipulator_name=
"Muon", steps=[
"SIM",
"MERGE"]
124 to_bemanipulate.append(
126 module_name=
"conversions", manipulator_name=
"Conversion", steps=[
"SIM",
"MERGE"]
129 to_bemanipulate.append(
131 module_name=
"allConversions",
132 manipulator_name=
"Conversion",
133 steps=[
"SIM",
"MERGE"],
136 to_bemanipulate.append(
138 module_name=
"particleFlowTmp",
139 manipulator_name=
"PF",
140 steps=[
"SIM",
"MERGE"],
144 "CleanedCosmicsMuons",
145 "CleanedTrackerAndGlobalMuons",
147 "CleanedPunchThroughMuons",
148 "CleanedPunchThroughNeutralHadrons",
149 "AddedMuonsAndHadrons",
153 to_bemanipulate.append(
155 module_name=
"ecalDigis", manipulator_name=
"EcalSrFlag", steps=[
"SIM",
"MERGE"]
158 to_bemanipulate.append(
160 module_name=
"hcalDigis", manipulator_name=
"HcalDigi", steps=[
"SIM",
"MERGE"]
163 to_bemanipulate.append(
165 module_name=
"electronMergedSeeds",
166 manipulator_name=
"ElectronSeed",
167 steps=[
"SIM",
"MERGE"],
170 to_bemanipulate.append(
172 module_name=
"ecalDrivenElectronSeeds",
173 manipulator_name=
"EcalDrivenElectronSeed",
174 steps=[
"SIM",
"MERGE"],
178 to_bemanipulate.append(
180 module_name=
"ecalRecHit",
181 manipulator_name=
"EcalRecHit",
182 instance=[
"EcalRecHitsEB",
"EcalRecHitsEE"],
185 to_bemanipulate.append(
187 module_name=
"ecalPreshowerRecHit",
188 manipulator_name=
"EcalRecHit",
189 instance=[
"EcalRecHitsES"],
193 to_bemanipulate.append(
196 to_bemanipulate.append(
199 to_bemanipulate.append(
203 to_bemanipulate.append(
206 to_bemanipulate.append(
211 to_bemanipulate.append(
213 module_name=
"dt1DRecHits",
214 manipulator_name=
"DTRecHit",
215 steps=[
"SELECT",
"CLEAN"],
218 to_bemanipulate.append(
220 module_name=
"dt1DCosmicRecHits",
221 manipulator_name=
"DTRecHit",
222 steps=[
"SELECT",
"CLEAN"],
226 to_bemanipulate.append(
228 module_name=
"dt4DSegments",
229 manipulator_name=
"DTRecSegment4D",
230 steps=[
"SELECT",
"CLEAN"],
234 to_bemanipulate.append(
236 module_name=
"dt4DCosmicSegments",
237 manipulator_name=
"DTRecSegment4D",
238 steps=[
"SELECT",
"CLEAN"],
242 to_bemanipulate.append(
244 module_name=
"csc2DRecHits",
245 manipulator_name=
"CSCRecHit",
246 steps=[
"SELECT",
"CLEAN"],
250 to_bemanipulate.append(
252 module_name=
"cscSegments",
253 manipulator_name=
"CSCSegment",
254 steps=[
"SELECT",
"CLEAN"],
258 to_bemanipulate.append(
260 module_name=
"rpcRecHits",
261 manipulator_name=
"RPCRecHit",
262 steps=[
"SELECT",
"CLEAN"],
268 outputModulesList = [key
for key, value
in process.outputModules.items()]
269 for outputModule
in outputModulesList:
270 if outputModule
in module_veto_list:
272 outputModule = getattr(process, outputModule)
273 for add_element
in keep_drop_list:
274 outputModule.outputCommands.extend(add_element)
282 ret_vstring = cms.untracked.vstring(
284 "keep *_patMuonsAfterID_*_" + dataTier,
285 "keep *_slimmedMuons_*_" + dataTier,
286 "keep *_slimmedMuonTrackExtras_*_" + dataTier,
287 "keep *_selectedMuonsForEmbedding_*_" + dataTier,
288 "keep recoVertexs_offlineSlimmedPrimaryVertices_*_" + dataTier,
289 "keep *_firstStepPrimaryVertices_*_" + dataTier,
290 "keep *_offlineBeamSpot_*_" + dataTier,
291 "keep *_ecalDrivenElectronSeeds_*_" + dataTier,
293 for akt_manimod
in to_bemanipulate:
294 if "CLEAN" in akt_manimod.steps:
295 ret_vstring.append(
"keep *_" + akt_manimod.module_name +
"_*_" + dataTier)
301 process._Process__name =
"RESELECT" 302 dataTier =
"RESELECT" 308 process._Process__name =
"SELECT" 311 process.load(
"TauAnalysis.MCEmbeddingTools.SelectingProcedure_cff")
312 process.patMuonsAfterKinCuts.src = cms.InputTag(
"slimmedMuons",
"", dataTier)
313 process.selectedMuonsForEmbedding.PuppiMet = cms.InputTag(
314 "slimmedMETsPuppi",
"", dataTier
316 process.selectedMuonsForEmbedding.Met = cms.InputTag(
"slimmedMETs",
"", dataTier)
317 process.patMuonsAfterID = process.patMuonsAfterLooseID.clone()
319 process.selecting = cms.Path(process.makePatMuonsZmumuSelection)
320 process.schedule.insert(-1, process.selecting)
322 outputModulesList = [key
for key, value
in process.outputModules.items()]
323 for outputModule
in outputModulesList:
324 outputModule = getattr(process, outputModule)
325 outputModule.SelectEvents = cms.untracked.PSet(
326 SelectEvents=cms.vstring(
"selecting")
328 outputModule.outputCommands.extend(
keepSelected(dataTier))
342 ret_vstring = cms.untracked.vstring(
345 "drop *_*_*_" + dataTier,
346 "keep *_patMuonsAfterID_*_" + dataTier,
347 "keep *_slimmedMuons_*_" + dataTier,
349 "keep *_selectedMuonsForEmbedding_*_" + dataTier,
350 "keep recoVertexs_offlineSlimmedPrimaryVertices_*_" + dataTier,
351 "keep *_firstStepPrimaryVertices_*_" + dataTier,
352 "keep *_offlineBeamSpot_*_" + dataTier,
353 "keep *_l1extraParticles_*_" + dataTier,
354 "keep TrajectorySeeds_*_*_*",
355 "keep recoElectronSeeds_*_*_*",
356 "drop recoIsoDepositedmValueMap_muIsoDepositTk_*_*" ,
357 "drop recoIsoDepositedmValueMap_muIsoDepositTkDisplaced_*_*",
358 "drop *_ctppsProtons_*_*",
359 "drop *_ctppsLocalTrackLiteProducer_*_*",
360 "drop *_ctppsDiamondLocalTracks_*_*",
361 "drop *_ctppsDiamondRecHits_*_*",
362 "drop *_ctppsDiamondRawToDigi_*_*",
363 "drop *_ctppsPixelLocalTracks_*_*",
364 "drop *_ctppsPixelRecHits_*_*",
365 "drop *_ctppsPixelClusters_*_*",
366 "drop *_ctppsPixelDigis_*_*",
367 "drop *_totemRPLocalTrackFitter_*_*",
368 "drop *_totemRPUVPatternFinder_*_*",
369 "drop *_totemRPRecHitProducer_*_*",
370 "drop *_totemRPClusterProducer_*_*",
371 "drop *_totemRPRawToDigi_*_*",
372 "drop *_muonSimClassifier_*_*",
377 for akt_manimod
in to_bemanipulate:
378 if "MERGE" in akt_manimod.steps:
380 "keep *_" + akt_manimod.module_name +
"_*_LHEembeddingCLEAN" 382 ret_vstring.append(
"keep *_" + akt_manimod.module_name +
"_*_CLEAN")
383 ret_vstring.append(
"keep *_standAloneMuons_*_LHEembeddingCLEAN")
384 ret_vstring.append(
"keep *_glbTrackQual_*_LHEembeddingCLEAN")
389 if changeProcessname:
390 process._Process__name =
"CLEAN" 392 dataTier =
"RESELECT" 398 TrackAssociatorParameterBlock.TrackAssociatorParameters.CSCSegmentCollectionLabel = cms.InputTag(
399 "cscSegments",
"", dataTier
401 TrackAssociatorParameterBlock.TrackAssociatorParameters.CaloTowerCollectionLabel = (
402 cms.InputTag(
"towerMaker",
"", dataTier)
404 TrackAssociatorParameterBlock.TrackAssociatorParameters.DTRecSegment4DCollectionLabel = cms.InputTag(
405 "dt4DSegments",
"", dataTier
407 TrackAssociatorParameterBlock.TrackAssociatorParameters.EBRecHitCollectionLabel = (
408 cms.InputTag(
"ecalRecHit",
"EcalRecHitsEB", dataTier)
410 TrackAssociatorParameterBlock.TrackAssociatorParameters.EERecHitCollectionLabel = (
411 cms.InputTag(
"ecalRecHit",
"EcalRecHitsEE", dataTier)
413 TrackAssociatorParameterBlock.TrackAssociatorParameters.HBHERecHitCollectionLabel = cms.InputTag(
414 "hbhereco",
"", dataTier
416 TrackAssociatorParameterBlock.TrackAssociatorParameters.HORecHitCollectionLabel = (
417 cms.InputTag(
"horeco",
"", dataTier)
419 TrackAssociatorParameterBlock.TrackAssociatorParameters.ME0HitCollectionLabel = (
420 cms.InputTag(
"me0RecHits",
"", dataTier)
422 TrackAssociatorParameterBlock.TrackAssociatorParameters.ME0SegmentCollectionLabel = (
423 cms.InputTag(
"me0Segments",
"", dataTier)
425 TrackAssociatorParameterBlock.TrackAssociatorParameters.RPCHitCollectionLabel = (
426 cms.InputTag(
"rpcRecHits",
"", dataTier)
429 MuonImput = cms.InputTag(
"selectedMuonsForEmbedding",
"",
"")
430 for akt_manimod
in to_bemanipulate:
431 if "CLEAN" in akt_manimod.steps:
432 oldCollections_in = cms.VInputTag()
433 for instance
in akt_manimod.instance:
434 oldCollections_in.append(
435 cms.InputTag(akt_manimod.module_name, instance, dataTier)
439 akt_manimod.module_name,
441 akt_manimod.cleaner_name,
442 MuonCollection=MuonImput,
443 TrackAssociatorParameters=TrackAssociatorParameterBlock.TrackAssociatorParameters,
444 oldCollection=oldCollections_in,
445 cscDigiCollectionLabel = cms.InputTag(
"muonCSCDigis",
"MuonCSCStripDigi"),
446 digiMaxDistanceX = cms.double(25.0),
447 dtDigiCollectionLabel = cms.InputTag(
"muonDTDigis"),
450 process.ecalPreshowerRecHit.TrackAssociatorParameters.usePreshower = cms.bool(
True)
461 ret_vstring = cms.untracked.vstring()
462 ret_vstring.append(
"keep *_externalLHEProducer_*_LHEembedding")
463 ret_vstring.append(
"keep *_externalLHEProducer_*_LHEembeddingCLEAN")
469 dataTier =
"RESELECT" 472 if changeProcessname:
473 process._Process__name =
"LHEembedding" 474 process.load(
"TauAnalysis.MCEmbeddingTools.EmbeddingLHEProducer_cfi")
476 process.externalLHEProducer.vertices = cms.InputTag(
477 "offlineSlimmedPrimaryVertices",
"",
"RESELECT" 479 process.lheproduction = cms.Path(process.makeexternalLHEProducer)
480 process.schedule.insert(0, process.lheproduction)
491 process._Process__name =
"LHEembeddingCLEAN" 493 process =
customiseLHE(process, changeProcessname=
False, reselect=reselect)
505 ret_vstring = cms.untracked.vstring()
506 for akt_manimod
in to_bemanipulate:
507 if "MERGE" in akt_manimod.steps:
509 "keep *_" + akt_manimod.module_name +
"_*_{}".
format(processname)
511 ret_vstring.append(
"keep *_genParticles_*_{}".
format(processname))
512 ret_vstring.append(
"keep *_standAloneMuons_*_{}".
format(processname))
513 ret_vstring.append(
"keep *_glbTrackQual_*_{}".
format(processname))
514 ret_vstring.append(
"keep *_generator_*_{}".
format(processname))
515 ret_vstring.append(
"keep *_addPileupInfo_*_{}".
format(processname))
516 ret_vstring.append(
"keep *_selectedMuonsForEmbedding_*_*")
517 ret_vstring.append(
"keep *_slimmedAddPileupInfo_*_*")
518 ret_vstring.append(
"keep *_embeddingHltPixelVertices_*_*")
519 ret_vstring.append(
"keep *_*_vertexPosition_*")
520 ret_vstring.append(
"keep recoMuons_muonsFromCosmics_*_*")
521 ret_vstring.append(
"keep recoTracks_cosmicMuons1Leg_*_*")
522 ret_vstring.append(
"keep recoMuons_muonsFromCosmics1Leg_*_*")
523 ret_vstring.append(
"keep *_muonDTDigis_*_*")
524 ret_vstring.append(
"keep *_muonCSCDigis_*_*")
525 ret_vstring.append(
"keep TrajectorySeeds_*_*_*")
526 ret_vstring.append(
"keep recoElectronSeeds_*_*_*")
527 ret_vstring.append(
"drop recoIsoDepositedmValueMap_muIsoDepositTk_*_*")
528 ret_vstring.append(
"drop recoIsoDepositedmValueMap_muIsoDepositTkDisplaced_*_*")
529 ret_vstring.append(
"drop *_ctppsProtons_*_*")
530 ret_vstring.append(
"drop *_ctppsLocalTrackLiteProducer_*_*")
531 ret_vstring.append(
"drop *_ctppsDiamondLocalTracks_*_*")
532 ret_vstring.append(
"drop *_ctppsDiamondRecHits_*_*")
533 ret_vstring.append(
"drop *_ctppsDiamondRawToDigi_*_*")
534 ret_vstring.append(
"drop *_ctppsPixelLocalTracks_*_*")
535 ret_vstring.append(
"drop *_ctppsPixelRecHits_*_*")
536 ret_vstring.append(
"drop *_ctppsPixelClusters_*_*")
537 ret_vstring.append(
"drop *_ctppsPixelDigis_*_*")
538 ret_vstring.append(
"drop *_totemRPLocalTrackFitter_*_*")
539 ret_vstring.append(
"drop *_totemRPUVPatternFinder_*_*")
540 ret_vstring.append(
"drop *_totemRPRecHitProducer_*_*")
541 ret_vstring.append(
"drop *_totemRPClusterProducer_*_*")
542 ret_vstring.append(
"drop *_totemRPRawToDigi_*_*")
543 ret_vstring.append(
"drop *_muonSimClassifier_*_*")
547 if processname ==
"SIMembeddingpreHLT" or processname ==
"SIMembeddingHLT":
548 rawreco_commands = set(process.RAWRECOEventContent.outputCommands)
549 rawreco_commands_excl = rawreco_commands - set(
550 process.RAWSIMEventContent.outputCommands
552 for entry
in rawreco_commands_excl:
554 processname ==
"SIMembeddingpreHLT" 555 and "muonReducedTrackExtras" in entry
561 "TotemTimingLocalTrack",
563 "ctppsDiamondLocalTracks",
566 ret_vstring.append(entry)
571 dataTier =
"RESELECT" 574 if changeProcessname:
575 process._Process__name =
"SIMembeddingpreHLT" 579 process.load(
"TauAnalysis.MCEmbeddingTools.EmbeddingVertexCorrector_cfi")
580 process.VtxSmeared = process.VtxCorrectedToInput.clone()
582 "Correcting Vertex in genEvent to one from input. Replaced 'VtxSmeared' with the Corrector." 586 process.mix.digitizers.castor.doNoise = cms.bool(
False)
588 process.mix.digitizers.ecal.doESNoise = cms.bool(
False)
589 process.mix.digitizers.ecal.doENoise = cms.bool(
False)
591 process.mix.digitizers.hcal.doNoise = cms.bool(
False)
592 process.mix.digitizers.hcal.doThermalNoise = cms.bool(
False)
593 process.mix.digitizers.hcal.doHPDNoise = cms.bool(
False)
595 process.mix.digitizers.pixel.AddNoisyPixels = cms.bool(
False)
596 process.mix.digitizers.pixel.AddNoise = cms.bool(
False)
598 process.mix.digitizers.strip.Noise = cms.bool(
False)
620 dataTier =
"RESELECT" 623 if changeProcessname:
624 process._Process__name =
"SIMembeddingHLT" 627 process.load(
"TauAnalysis.MCEmbeddingTools.EmbeddingBeamSpotOnline_cfi")
628 process.hltOnlineBeamSpot = process.onlineEmbeddingBeamSpotProducer.clone()
630 "Setting online beam spot in HLTSchedule to the one from input data. Replaced 'hltOnlineBeamSpot' with the offline beam spot." 634 process.load(
"TauAnalysis.MCEmbeddingTools.EmbeddingHltPixelVerticesProducer_cfi")
635 process.hltPixelVertices = process.embeddingHltPixelVertices.clone()
636 process.offlinePrimaryVertices = process.embeddingHltPixelVertices.clone()
637 process.firstStepPrimaryVerticesUnsorted = process.embeddingHltPixelVertices.clone()
638 process.firstStepPrimaryVerticesPreSplitting = (
639 process.embeddingHltPixelVertices.clone()
664 dataTier =
"RESELECT" 667 if changeProcessname:
668 process._Process__name =
"SIMembedding" 680 process.reconstruction.remove(process.offlineBeamSpot)
707 ret_vstring = cms.untracked.vstring()
708 ret_vstring.append(
"drop *_*_*_" + dataTier)
709 ret_vstring.append(
"keep *_prunedGenParticles_*_MERGE")
710 ret_vstring.append(
"keep *_generator_*_SIMembeddingpreHLT")
711 ret_vstring.append(
"keep *_generator_*_SIMembeddingHLT")
712 ret_vstring.append(
"keep *_generator_*_SIMembedding")
713 ret_vstring.append(
"keep *_selectedMuonsForEmbedding_*_*")
714 ret_vstring.append(
"keep *_unpackedPatTrigger_*_*")
715 ret_vstring.extend(cms.untracked.vstring(
716 'keep patPackedGenParticles_packedGenParticles_*_*',
717 'keep recoGenParticles_prunedGenParticles_*_*',
718 'keep *_packedPFCandidateToGenAssociation_*_*',
719 'keep *_lostTracksToGenAssociation_*_*',
720 'keep LHEEventProduct_*_*_*',
721 'keep GenFilterInfo_*_*_*',
722 'keep GenLumiInfoHeader_generator_*_*',
723 'keep GenLumiInfoProduct_*_*_*',
724 'keep GenEventInfoProduct_generator_*_*',
725 'keep recoGenParticles_genPUProtons_*_*',
726 'keep *_slimmedGenJetsFlavourInfos_*_*',
727 'keep *_slimmedGenJets__*',
728 'keep *_slimmedGenJetsAK8__*',
729 'keep *_slimmedGenJetsAK8SoftDropSubJets__*',
730 'keep *_genMetTrue_*_*',
732 'keep LHERunInfoProduct_*_*_*',
733 'keep GenRunInfoProduct_*_*_*',
734 'keep *_genParticles_xyz0_*',
735 'keep *_genParticles_t0_*'))
741 dataTier =
"RESELECT" 745 process.keep_step = cms.Path()
747 process.load(
"PhysicsTools.PatAlgos.slimming.genParticles_cff")
748 process.keep_step += process.prunedGenParticlesWithStatusOne
749 process.load(
"PhysicsTools.PatAlgos.slimming.prunedGenParticles_cfi")
750 process.keep_step += process.prunedGenParticles
751 process.load(
"PhysicsTools.PatAlgos.slimming.packedGenParticles_cfi")
752 process.keep_step += process.packedGenParticles
753 process.load(
"PhysicsTools.PatAlgos.slimming.slimmedGenJets_cfi")
754 process.keep_step += process.slimmedGenJets
756 process.load(
"PhysicsTools.PatAlgos.mcMatchLayer0.muonMatch_cfi")
757 process.keep_step += process.muonMatch
758 process.load(
"PhysicsTools.PatAlgos.mcMatchLayer0.electronMatch_cfi")
759 process.keep_step += process.electronMatch
760 process.load(
"PhysicsTools.PatAlgos.mcMatchLayer0.photonMatch_cfi")
761 process.keep_step += process.photonMatch
762 process.load(
"PhysicsTools.PatAlgos.mcMatchLayer0.tauMatch_cfi")
763 process.keep_step += process.tauMatch
764 process.load(
"PhysicsTools.JetMCAlgos.TauGenJets_cfi")
765 process.keep_step += process.tauGenJets
766 process.load(
"PhysicsTools.PatAlgos.mcMatchLayer0.jetFlavourId_cff")
767 process.keep_step += process.patJetPartons
768 process.load(
"PhysicsTools.PatAlgos.mcMatchLayer0.jetMatch_cfi")
769 process.keep_step += process.patJetPartonMatch
771 process.muonMatch.matched =
"prunedGenParticles" 772 process.electronMatch.matched =
"prunedGenParticles" 773 process.electronMatch.src = cms.InputTag(
"reducedEgamma",
"reducedGedGsfElectrons")
774 process.photonMatch.matched =
"prunedGenParticles" 775 process.photonMatch.src = cms.InputTag(
"reducedEgamma",
"reducedGedPhotons")
776 process.tauMatch.matched =
"prunedGenParticles" 777 process.tauGenJets.GenParticles =
"prunedGenParticles" 781 process.patJetPartons.particles =
"prunedGenParticles" 782 process.patJetPartonMatch.matched =
"prunedGenParticles" 783 process.patJetPartonMatch.mcStatus = [3, 23]
784 process.patJetGenJetMatch.matched =
"slimmedGenJets" 785 process.patJetGenJetMatchAK8.matched =
"slimmedGenJetsAK8" 786 process.patMuons.embedGenMatch =
False 787 process.patElectrons.embedGenMatch =
False 788 process.patPhotons.embedGenMatch =
False 789 process.patTaus.embedGenMatch =
False 790 process.patTausBoosted.embedGenMatch =
False 791 process.patJets.embedGenPartonMatch =
False 793 process.patJetFlavourAssociation.rParam = 0.4
795 process.schedule.insert(0, process.keep_step)
802 print(
"**** Attention: overriding behaviour of 'removeMCMatching' ****")
804 from PhysicsTools.PatAlgos.slimming.miniAOD_tools
import miniAOD_customizeMC
805 def performMCMatching(process, names, postfix, outputModules):
809 PhysicsTools.PatAlgos.tools.coreTools.removeMCMatching = performMCMatching
811 if changeProcessname:
812 process._Process__name =
"MERGE" 814 dataTier =
"RESELECT" 818 process.source.inputCommands = cms.untracked.vstring()
819 process.source.inputCommands.append(
"keep *_*_*_*")
820 process.load(
"PhysicsTools.PatAlgos.slimming.unpackedPatTrigger_cfi")
821 process.unpackedPatTrigger.triggerResults = cms.InputTag(
"TriggerResults::SIMembeddingHLT")
829 process.load(
'Configuration.StandardSequences.RawToDigi_cff')
830 process.load(
"Configuration.StandardSequences.Reconstruction_Data_cff")
831 process.merge_step = cms.Path()
833 process.load(
"RecoPPS.Configuration.recoCTPPS_cff")
834 process.totemRPRawToDigi.rawDataTag = cms.InputTag(
"rawDataCollector",
"",
"LHC")
835 process.ctppsDiamondRawToDigi.rawDataTag = cms.InputTag(
"rawDataCollector",
"",
"LHC")
836 process.ctppsPixelDigis.inputLabel = cms.InputTag(
"rawDataCollector",
"",
"LHC")
837 process.merge_step += process.totemRPRawToDigi
838 process.merge_step += process.ctppsDiamondRawToDigi
839 process.merge_step += process.ctppsPixelDigis
840 process.merge_step += cms.Sequence(process.recoCTPPSTask)
842 process.load(
"RecoLocalCalo.Configuration.RecoLocalCalo_cff")
843 process.merge_step += process.calolocalreco
845 process.merge_step += process.reducedHcalRecHitsSequence
848 process.load(
"RecoLocalCalo.CaloTowersCreator.calotowermaker_cfi")
849 process.merge_step += process.calotowermaker
850 process.merge_step += process.towerMaker
853 process.load(
"RecoEcal.Configuration.RecoEcal_cff")
854 process.merge_step += process.ecalClusters
857 process.load(
"RecoParticleFlow.PFClusterProducer.particleFlowCluster_cff")
858 process.merge_step += process.particleFlowCluster
860 "RecoEcal.EgammaClusterProducers.particleFlowSuperClusteringSequence_cff" 862 process.merge_step += process.particleFlowSuperClusteringSequence
865 process.load(
"RecoMuon.MuonIdentification.muons1stStep_cfi")
866 process.merge_step += process.muonEcalDetIds
867 process.merge_step += process.muonShowerInformation
870 process.load(
"RecoMuon.MuonIsolationProducers.muIsolation_cff")
871 process.merge_step += process.muIsolation
872 process.merge_step += process.muIsolationDisplaced
875 process.load(
"RecoMuon.MuonIdentification.muonSelectionTypeValueMapProducer_cff")
876 process.merge_step += process.muonSelectionTypeSequence
879 process.load(
"RecoMuon.MuonIdentification.displacedMuonReducedTrackExtras_cfi")
880 process.merge_step += process.displacedMuonReducedTrackExtras
882 process.load(
"RecoMuon.Configuration.MergeDisplacedTrackCollections_cff")
883 process.merge_step += process.displacedTracksSequence
886 process.merge_step += process.doAlldEdXEstimators
887 process.merge_step += process.vertexreco
888 process.unsortedOfflinePrimaryVertices.beamSpotLabel = cms.InputTag(
889 "offlineBeamSpot",
"", dataTier
891 process.ak4CaloJetsForTrk.srcPVs = cms.InputTag(
892 "firstStepPrimaryVertices",
"", dataTier
894 process.dedxHitInfo.clusterShapeCache = cms.InputTag(
"")
914 process.merge_step += process.highlevelreco
929 process.load(
"CommonTools.ParticleFlow.genForPF2PAT_cff")
933 process.merge_step += process.genForPF2PATSequence
937 modules_to_be_ordered = {}
939 reconstruction_modules_list =
str(process.RawToDigi).
split(
",")
940 reconstruction_modules_list +=
str(process.reconstruction).
split(
",")
941 for akt_manimod
in to_bemanipulate:
942 if "MERGE" in akt_manimod.steps:
943 mergCollections_in = cms.VInputTag()
944 for instance
in akt_manimod.instance:
945 mergCollections_in.append(
947 akt_manimod.merge_prefix + akt_manimod.module_name,
952 mergCollections_in.append(
954 akt_manimod.merge_prefix + akt_manimod.module_name,
961 akt_manimod.module_name,
963 akt_manimod.merger_name, mergCollections=mergCollections_in
966 if not process.merge_step.contains(getattr(process, akt_manimod.module_name)):
967 modules_to_be_ordered[akt_manimod.module_name] = -1
969 for name,index
in modules_to_be_ordered.items():
970 if name
in reconstruction_modules_list:
971 modules_to_be_ordered[name] = reconstruction_modules_list.index(name)
973 print(
"ERROR:",name,
"not prepared in modules list. Please adapt 'customiseMerging'")
976 modules_ordered = sorted(list(modules_to_be_ordered.items()), key=
lambda x : -x[1])
977 for m
in modules_ordered:
978 process.merge_step.insert(0, getattr(process, m[0]))
981 process.schedule.insert(0, process.merge_step)
988 return customiseMerging(process, changeProcessname=changeProcessname, reselect=
True)
996 process.load(
"PhysicsTools.NanoAOD.nano_cff")
997 process.nanoAOD_step.insert(0, cms.Sequence(process.nanoTableTaskFS))
1000 for outputModule
in process.outputModules.values():
1001 outputModule.outputCommands.append(
"keep edmTriggerResults_*_*_SIMembeddingpreHLT")
1002 outputModule.outputCommands.append(
"keep edmTriggerResults_*_*_SIMembeddingHLT")
1003 outputModule.outputCommands.append(
"keep edmTriggerResults_*_*_SIMembedding")
1004 outputModule.outputCommands.append(
"keep edmTriggerResults_*_*_MERGE")
1005 outputModule.outputCommands.append(
"keep edmTriggerResults_*_*_NANO")
1006 outputModule.outputCommands.remove(
"keep edmTriggerResults_*_*_*")
1008 process.load(
"PhysicsTools.NanoAOD.l1trig_cff")
1009 process.nanoAOD_step.insert(0, cms.Sequence(process.l1TablesTask))
1011 process.embeddingTable = cms.EDProducer(
1012 "GlobalVariablesTableProducer",
1013 name=cms.string(
"TauEmbedding"),
1016 nInitialPairCandidates=
ExtVar(
1017 cms.InputTag(
"selectedMuonsForEmbedding",
"nPairCandidates"),
1019 doc=
"number of muons pairs suitable for selection (for internal studies only)",
1022 cms.InputTag(
"selectedMuonsForEmbedding",
"oldMass"),
1024 doc=
"Mass of the Dimuon pair using the old selection algorithm (for internal studies only)",
1027 cms.InputTag(
"selectedMuonsForEmbedding",
"newMass"),
1029 doc=
"Mass of the Dimuon pair using the new selection algorithm (for internal studies only)",
1031 isMediumLeadingMuon=
ExtVar(
1032 cms.InputTag(
"selectedMuonsForEmbedding",
"isMediumLeadingMuon"),
1034 doc=
"leading muon ID (medium)",
1036 isMediumTrailingMuon=
ExtVar(
1037 cms.InputTag(
"selectedMuonsForEmbedding",
"isMediumTrailingMuon"),
1039 doc=
"trailing muon ID (medium)",
1041 isTightLeadingMuon=
ExtVar(
1042 cms.InputTag(
"selectedMuonsForEmbedding",
"isTightLeadingMuon"),
1044 doc=
"leading muon ID (tight)",
1046 isTightTrailingMuon=
ExtVar(
1047 cms.InputTag(
"selectedMuonsForEmbedding",
"isTightTrailingMuon"),
1049 doc=
"trailing muon ID (tight)",
1052 cms.InputTag(
"selectedMuonsForEmbedding",
"initialMETEt"),
1054 doc=
"MET Et of selected event",
1057 cms.InputTag(
"selectedMuonsForEmbedding",
"initialMETphi"),
1059 doc=
"MET phi of selected event",
1061 initialPuppiMETEt=
ExtVar(
1062 cms.InputTag(
"selectedMuonsForEmbedding",
"initialPuppiMETEt"),
1064 doc=
"PuppiMET Et of selected event",
1066 initialPuppiMETphi=
ExtVar(
1067 cms.InputTag(
"selectedMuonsForEmbedding",
"initialPuppiMETphi"),
1069 doc=
"PuppiMET phi of selected event",
1073 process.embeddingTableTask = cms.Task(process.embeddingTable)
1074 process.schedule.associate(process.embeddingTableTask)
1086 if not hasattr(process,
"options"):
1087 process.options = cms.untracked.PSet()
1088 process.options.emptyRunLumiMode = cms.untracked.string(
1089 "doNotHandleEmptyRunsAndLumis" 1091 if not hasattr(process,
"bunchSpacingProducer"):
1092 process.bunchSpacingProducer = cms.EDProducer(
"BunchSpacingProducer")
1093 process.bunchSpacingProducer.bunchSpacingOverride = cms.uint32(25)
1094 process.bunchSpacingProducer.overrideBunchSpacing = cms.bool(
True)
1095 process.options.numberOfThreads = cms.untracked.uint32(1)
1096 process.options.numberOfStreams = cms.untracked.uint32(0)
1104 process.load(
"TauAnalysis.MCEmbeddingTools.DYToMuMuGenFilter_cfi")
1105 process.ZToMuMuFilter = cms.Path(process.dYToMuMuGenFilter)
1106 process.schedule.insert(-1, process.ZToMuMuFilter)
1111 process.load(
"TauAnalysis.MCEmbeddingTools.TTbartoMuMuGenFilter_cfi")
1112 process.MCFilter = cms.Path(process.TTbartoMuMuGenFilter)
1117 process.schedule.insert(-1, process.MCFilter)
1118 outputModulesList = [key
for key, value
in process.outputModules.items()]
1119 for outputModule
in outputModulesList:
1120 outputModule = getattr(process, outputModule)
1121 outputModule.SelectEvents = cms.untracked.PSet(
1122 SelectEvents=cms.vstring(
"MCFilter")
1128 process, formodules=["generalTracks", "cscSegments", "dt4DSegments", "rpcRecHits"]
1130 def change_tags_process(test_input):
1131 if isinstance(test_input, cms.InputTag):
1132 if test_input.getModuleLabel()
in formodules:
1133 test_input.setProcessName(process._Process__name)
1135 def search_for_tags(pset):
1136 if isinstance(pset, dict):
1138 if isinstance(pset[key], cms.VInputTag):
1139 for akt_inputTag
in pset[key]:
1140 change_tags_process(akt_inputTag)
1141 elif isinstance(pset[key], cms.PSet):
1142 search_for_tags(pset[key].__dict__)
1143 elif isinstance(pset[key], cms.VPSet):
1144 for akt_pset
in pset[key]:
1145 search_for_tags(akt_pset.__dict__)
1147 change_tags_process(pset[key])
1149 print(
"must be python dict not a {}".
format(type(pset)))
1151 for module
in process.producers_():
1152 search_for_tags(getattr(process, module).__dict__)
1153 for module
in process.filters_():
1154 search_for_tags(getattr(process, module).__dict__)
1155 for module
in process.analyzers_():
1156 search_for_tags(getattr(process, module).__dict__)
def customiseSelecting(process, reselect=False)
def keepCleaned(dataTier)
Customizer for cleaning ###########################.
def keepSimulated(process, processname="SIMembedding")
Customizer for simulaton ###########################.
bool any(const std::vector< T > &v, const T &what)
def customiseLHEandCleaning_Reselect(process)
def ExtVar(tag, valtype, doc=None, precision=-1)
def customiseSelecting_Reselect(process)
Customizer for skimming ########################### There are four different parts.
def customiseGenerator_postHLT_Reselect(process)
def keepLHE()
Customizer for LHE ###########################.
def customiseKeepPrunedGenParticles(process, reselect=False)
def keepMerged(dataTier="SELECT")
Customizer for merging ###########################.
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
def customiseFilterZToMuMu(process)
MC specific Customizer ###########################.
def customiseMerging(process, changeProcessname=True, reselect=False)
def fix_input_tags(process, formodules=["generalTracks", cscSegments, dt4DSegments, rpcRecHits)
def customiseNanoAOD(process)
Customize NanoAOD ################################.
def customiseGenerator_preHLT(process, changeProcessname=True, reselect=False)
def customiseGenerator_postHLT(process, changeProcessname=True, reselect=False)
def split(sequence, size)
def customiseMerging_Reselect(process, changeProcessname=True)
def customiseLHEandCleaning(process, reselect=False)
def customiseMCFilter(process)
def __init__(self, module_name, manipulator_name, steps=["SELECT", CLEAN, SIM, MERGE, instance=[""], merge_prefix="")
def customisoptions(process)
cross Customizers ###########################
def customiseGenerator_preHLT_Reselect(process)
def modify_outputModules(process, keep_drop_list=[], module_veto_list=[])
def customiseLHE(process, changeProcessname=True, reselect=False)
def keepSelected(dataTier)
Customizer for Selecting ###########################.
def customiseGenerator_HLT_Reselect(process)
def customiseGenerator_HLT(process, changeProcessname=True, reselect=False)
def customiseCleaning(process, changeProcessname=True, reselect=False)
def customiseFilterTTbartoMuMu(process)