CMS 3D CMS Logo

Classes | Functions | Variables
customisers Namespace Reference

Classes

class  module_manipulate
 Customizer for skimming ########################### There are four different parts. More...
 

Functions

def customiseCleaning (process, changeProcessname=True, reselect=False)
 
def customiseFilterTTbartoMuMu (process)
 
def customiseFilterZToMuMu (process)
 MC specific Customizer ###########################. More...
 
def customiseGenerator_HLT (process, changeProcessname=True, reselect=False)
 
def customiseGenerator_HLT_Reselect (process)
 
def customiseGenerator_postHLT (process, changeProcessname=True, reselect=False)
 
def customiseGenerator_postHLT_Reselect (process)
 
def customiseGenerator_preHLT (process, changeProcessname=True, reselect=False)
 
def customiseGenerator_preHLT_Reselect (process)
 
def customiseKeepPrunedGenParticles (process, reselect=False)
 
def customiseLHE (process, changeProcessname=True, reselect=False)
 
def customiseLHEandCleaning (process, reselect=False)
 
def customiseLHEandCleaning_Reselect (process)
 
def customiseMCFilter (process)
 
def customiseMerging (process, changeProcessname=True, reselect=False)
 
def customiseMerging_Reselect (process, changeProcessname=True)
 
def customiseNanoAOD (process)
 Customize NanoAOD ################################. More...
 
def customiseSelecting (process, reselect=False)
 
def customiseSelecting_Reselect (process)
 
def customisoptions (process)
 cross Customizers ########################### More...
 
def fix_input_tags (process, formodules=["generalTracks", cscSegments, dt4DSegments, rpcRecHits)
 
def keepCleaned (dataTier)
 Customizer for cleaning ###########################. More...
 
def keepLHE ()
 Customizer for LHE ###########################. More...
 
def keepMerged (dataTier="SELECT")
 Customizer for merging ###########################. More...
 
def keepSelected (dataTier)
 Customizer for Selecting ###########################. More...
 
def keepSimulated (process, processname="SIMembedding")
 Customizer for simulaton ###########################. More...
 
def modify_outputModules (process, keep_drop_list=[], module_veto_list=[])
 

Variables

 instance
 
 manipulator_name
 
 module_name
 
 steps
 
 to_bemanipulate
 

Function Documentation

◆ customiseCleaning()

def customisers.customiseCleaning (   process,
  changeProcessname = True,
  reselect = False 
)

Definition at line 388 of file customisers.py.

References customisoptions(), keepCleaned(), keepSelected(), and modify_outputModules().

Referenced by customiseLHEandCleaning().

388 def customiseCleaning(process, changeProcessname=True, reselect=False):
389  if changeProcessname:
390  process._Process__name = "CLEAN"
391  if reselect:
392  dataTier = "RESELECT"
393  else:
394  dataTier = "SELECT"
395 
396  from TrackingTools.TrackAssociator.default_cfi import TrackAssociatorParameterBlock
397 
398  TrackAssociatorParameterBlock.TrackAssociatorParameters.CSCSegmentCollectionLabel = cms.InputTag(
399  "cscSegments", "", dataTier
400  )
401  TrackAssociatorParameterBlock.TrackAssociatorParameters.CaloTowerCollectionLabel = (
402  cms.InputTag("towerMaker", "", dataTier)
403  )
404  TrackAssociatorParameterBlock.TrackAssociatorParameters.DTRecSegment4DCollectionLabel = cms.InputTag(
405  "dt4DSegments", "", dataTier
406  )
407  TrackAssociatorParameterBlock.TrackAssociatorParameters.EBRecHitCollectionLabel = (
408  cms.InputTag("ecalRecHit", "EcalRecHitsEB", dataTier)
409  )
410  TrackAssociatorParameterBlock.TrackAssociatorParameters.EERecHitCollectionLabel = (
411  cms.InputTag("ecalRecHit", "EcalRecHitsEE", dataTier)
412  )
413  TrackAssociatorParameterBlock.TrackAssociatorParameters.HBHERecHitCollectionLabel = cms.InputTag(
414  "hbhereco", "", dataTier
415  )
416  TrackAssociatorParameterBlock.TrackAssociatorParameters.HORecHitCollectionLabel = (
417  cms.InputTag("horeco", "", dataTier)
418  )
419  TrackAssociatorParameterBlock.TrackAssociatorParameters.ME0HitCollectionLabel = (
420  cms.InputTag("me0RecHits", "", dataTier)
421  )
422  TrackAssociatorParameterBlock.TrackAssociatorParameters.ME0SegmentCollectionLabel = (
423  cms.InputTag("me0Segments", "", dataTier)
424  )
425  TrackAssociatorParameterBlock.TrackAssociatorParameters.RPCHitCollectionLabel = (
426  cms.InputTag("rpcRecHits", "", dataTier)
427  )
428 
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)
436  )
437  setattr(
438  process,
439  akt_manimod.module_name,
440  cms.EDProducer(
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"),
448  ),
449  )
450  process.ecalPreshowerRecHit.TrackAssociatorParameters.usePreshower = cms.bool(True)
451  process = customisoptions(process)
452  return modify_outputModules(
453  process, [keepSelected(dataTier), keepCleaned(dataTier)], ["MINIAODoutput"]
454  )
455 
456 
def keepCleaned(dataTier)
Customizer for cleaning ###########################.
Definition: customisers.py:341
def customisoptions(process)
cross Customizers ###########################
def modify_outputModules(process, keep_drop_list=[], module_veto_list=[])
Definition: customisers.py:267
def keepSelected(dataTier)
Customizer for Selecting ###########################.
Definition: customisers.py:281
def customiseCleaning(process, changeProcessname=True, reselect=False)
Definition: customisers.py:388

◆ customiseFilterTTbartoMuMu()

def customisers.customiseFilterTTbartoMuMu (   process)

Definition at line 1110 of file customisers.py.

References customiseMCFilter().

1110 def customiseFilterTTbartoMuMu(process):
1111  process.load("TauAnalysis.MCEmbeddingTools.TTbartoMuMuGenFilter_cfi")
1112  process.MCFilter = cms.Path(process.TTbartoMuMuGenFilter)
1113  return customiseMCFilter(process)
1114 
1115 
def customiseMCFilter(process)
def customiseFilterTTbartoMuMu(process)

◆ customiseFilterZToMuMu()

def customisers.customiseFilterZToMuMu (   process)

MC specific Customizer ###########################.

Definition at line 1103 of file customisers.py.

1103 def customiseFilterZToMuMu(process):
1104  process.load("TauAnalysis.MCEmbeddingTools.DYToMuMuGenFilter_cfi")
1105  process.ZToMuMuFilter = cms.Path(process.dYToMuMuGenFilter)
1106  process.schedule.insert(-1, process.ZToMuMuFilter)
1107  return process
1108 
1109 
def customiseFilterZToMuMu(process)
MC specific Customizer ###########################.

◆ customiseGenerator_HLT()

def customisers.customiseGenerator_HLT (   process,
  changeProcessname = True,
  reselect = False 
)

Definition at line 618 of file customisers.py.

References customisoptions(), keepCleaned(), keepLHE(), keepSelected(), keepSimulated(), modify_outputModules(), and print().

Referenced by customiseGenerator_HLT_Reselect().

618 def customiseGenerator_HLT(process, changeProcessname=True, reselect=False):
619  if reselect:
620  dataTier = "RESELECT"
621  else:
622  dataTier = "SELECT"
623  if changeProcessname:
624  process._Process__name = "SIMembeddingHLT"
625 
626 
627  process.load("TauAnalysis.MCEmbeddingTools.EmbeddingBeamSpotOnline_cfi")
628  process.hltOnlineBeamSpot = process.onlineEmbeddingBeamSpotProducer.clone()
629  print(
630  "Setting online beam spot in HLTSchedule to the one from input data. Replaced 'hltOnlineBeamSpot' with the offline beam spot."
631  )
632 
633  # Replace HLT vertexing with vertex taken from LHE step
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()
640  )
641 
642  process = customisoptions(process)
643 
644 
645  return modify_outputModules(
646  process,
647  [
648  keepSelected(dataTier),
649  keepCleaned(dataTier),
650  keepLHE(),
651  keepSimulated(process, processname="SIMembeddingpreHLT"),
652  keepSimulated(process, processname="SIMembeddingHLT"),
653  ],
654  ["AODSIMoutput"],
655  )
656 
657 
def keepCleaned(dataTier)
Customizer for cleaning ###########################.
Definition: customisers.py:341
def keepSimulated(process, processname="SIMembedding")
Customizer for simulaton ###########################.
Definition: customisers.py:504
def keepLHE()
Customizer for LHE ###########################.
Definition: customisers.py:460
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def customisoptions(process)
cross Customizers ###########################
def modify_outputModules(process, keep_drop_list=[], module_veto_list=[])
Definition: customisers.py:267
def keepSelected(dataTier)
Customizer for Selecting ###########################.
Definition: customisers.py:281
def customiseGenerator_HLT(process, changeProcessname=True, reselect=False)
Definition: customisers.py:618

◆ customiseGenerator_HLT_Reselect()

def customisers.customiseGenerator_HLT_Reselect (   process)

Definition at line 658 of file customisers.py.

References customiseGenerator_HLT().

659  return customiseGenerator_HLT(process, reselect=True)
660 
661 
def customiseGenerator_HLT_Reselect(process)
Definition: customisers.py:658
def customiseGenerator_HLT(process, changeProcessname=True, reselect=False)
Definition: customisers.py:618

◆ customiseGenerator_postHLT()

def customisers.customiseGenerator_postHLT (   process,
  changeProcessname = True,
  reselect = False 
)

Definition at line 662 of file customisers.py.

References customisoptions(), keepCleaned(), keepLHE(), keepSelected(), keepSimulated(), and modify_outputModules().

Referenced by customiseGenerator_postHLT_Reselect().

662 def customiseGenerator_postHLT(process, changeProcessname=True, reselect=False):
663  if reselect:
664  dataTier = "RESELECT"
665  else:
666  dataTier = "SELECT"
667  if changeProcessname:
668  process._Process__name = "SIMembedding"
669 
670 
671 
672  # process.load('TauAnalysis.MCEmbeddingTools.EmbeddingVertexCorrector_cfi')
673  # process.VtxSmeared = process.VtxCorrectedToInput.clone()
674  # print "Correcting Vertex in genEvent to one from input. Replaced 'VtxSmeared' with the Corrector."
675  # process.load('TauAnalysis.MCEmbeddingTools.EmbeddingBeamSpotOnline_cfi')
676  # process.hltOnlineBeamSpot = process.onlineEmbeddingBeamSpotProducer.clone()
677  # print "Setting online beam spot in HLTSchedule to the one from input data. Replaced 'hltOnlineBeamSpot' with the offline beam spot."
678 
679  # Remove BeamSpot Production, use the one from selected data instead.
680  process.reconstruction.remove(process.offlineBeamSpot)
681 
682  process = customisoptions(process)
683 
684 
685  return modify_outputModules(
686  process,
687  [
688  keepSelected(dataTier),
689  keepCleaned(dataTier),
690  keepLHE(),
691  keepSimulated(process, processname="SIMembeddingpreHLT"),
692  keepSimulated(process, processname="SIMembeddingHLT"),
693  keepSimulated(process, processname="SIMembedding"),
694  ],
695  ["AODSIMoutput"],
696  )
697 
698 
def keepCleaned(dataTier)
Customizer for cleaning ###########################.
Definition: customisers.py:341
def keepSimulated(process, processname="SIMembedding")
Customizer for simulaton ###########################.
Definition: customisers.py:504
def keepLHE()
Customizer for LHE ###########################.
Definition: customisers.py:460
def customiseGenerator_postHLT(process, changeProcessname=True, reselect=False)
Definition: customisers.py:662
def customisoptions(process)
cross Customizers ###########################
def modify_outputModules(process, keep_drop_list=[], module_veto_list=[])
Definition: customisers.py:267
def keepSelected(dataTier)
Customizer for Selecting ###########################.
Definition: customisers.py:281

◆ customiseGenerator_postHLT_Reselect()

def customisers.customiseGenerator_postHLT_Reselect (   process)

Definition at line 699 of file customisers.py.

References customiseGenerator_postHLT().

700  return customiseGenerator_postHLT(process, reselect=True)
701 
702 
def customiseGenerator_postHLT_Reselect(process)
Definition: customisers.py:699
def customiseGenerator_postHLT(process, changeProcessname=True, reselect=False)
Definition: customisers.py:662

◆ customiseGenerator_preHLT()

def customisers.customiseGenerator_preHLT (   process,
  changeProcessname = True,
  reselect = False 
)

Definition at line 569 of file customisers.py.

References customisoptions(), keepCleaned(), keepSelected(), keepSimulated(), modify_outputModules(), and print().

Referenced by customiseGenerator_preHLT_Reselect().

569 def customiseGenerator_preHLT(process, changeProcessname=True, reselect=False):
570  if reselect:
571  dataTier = "RESELECT"
572  else:
573  dataTier = "SELECT"
574  if changeProcessname:
575  process._Process__name = "SIMembeddingpreHLT"
576 
577 
578 
579  process.load("TauAnalysis.MCEmbeddingTools.EmbeddingVertexCorrector_cfi")
580  process.VtxSmeared = process.VtxCorrectedToInput.clone()
581  print(
582  "Correcting Vertex in genEvent to one from input. Replaced 'VtxSmeared' with the Corrector."
583  )
584 
585  # Disable noise simulation
586  process.mix.digitizers.castor.doNoise = cms.bool(False)
587 
588  process.mix.digitizers.ecal.doESNoise = cms.bool(False)
589  process.mix.digitizers.ecal.doENoise = cms.bool(False)
590 
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)
594 
595  process.mix.digitizers.pixel.AddNoisyPixels = cms.bool(False)
596  process.mix.digitizers.pixel.AddNoise = cms.bool(False)
597 
598  process.mix.digitizers.strip.Noise = cms.bool(False)
599 
600  process = customisoptions(process)
601 
602 
603  return modify_outputModules(
604  process,
605  [
606  keepSelected(dataTier),
607  keepCleaned(dataTier),
608  keepSimulated(process, processname="SIMembeddingpreHLT"),
609  ],
610  ["AODSIMoutput"],
611  )
612 
613 
def keepCleaned(dataTier)
Customizer for cleaning ###########################.
Definition: customisers.py:341
def keepSimulated(process, processname="SIMembedding")
Customizer for simulaton ###########################.
Definition: customisers.py:504
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def customiseGenerator_preHLT(process, changeProcessname=True, reselect=False)
Definition: customisers.py:569
def customisoptions(process)
cross Customizers ###########################
def modify_outputModules(process, keep_drop_list=[], module_veto_list=[])
Definition: customisers.py:267
def keepSelected(dataTier)
Customizer for Selecting ###########################.
Definition: customisers.py:281

◆ customiseGenerator_preHLT_Reselect()

def customisers.customiseGenerator_preHLT_Reselect (   process)

Definition at line 614 of file customisers.py.

References customiseGenerator_preHLT().

615  return customiseGenerator_preHLT(process, reselect=True)
616 
617 
def customiseGenerator_preHLT(process, changeProcessname=True, reselect=False)
Definition: customisers.py:569
def customiseGenerator_preHLT_Reselect(process)
Definition: customisers.py:614

◆ customiseKeepPrunedGenParticles()

def customisers.customiseKeepPrunedGenParticles (   process,
  reselect = False 
)

Definition at line 739 of file customisers.py.

References customisoptions(), keepMerged(), and modify_outputModules().

739 def customiseKeepPrunedGenParticles(process, reselect=False):
740  if reselect:
741  dataTier = "RESELECT"
742  else:
743  dataTier = "SELECT"
744 
745  process.keep_step = cms.Path()
746 
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
755 
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
770 
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"
778 
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
792  # also jet flavour must be switched
793  process.patJetFlavourAssociation.rParam = 0.4
794 
795  process.schedule.insert(0, process.keep_step)
796  process = customisoptions(process)
797  return modify_outputModules(process, [keepMerged(dataTier)])
798 
799 
def customiseKeepPrunedGenParticles(process, reselect=False)
Definition: customisers.py:739
def keepMerged(dataTier="SELECT")
Customizer for merging ###########################.
Definition: customisers.py:706
def customisoptions(process)
cross Customizers ###########################
def modify_outputModules(process, keep_drop_list=[], module_veto_list=[])
Definition: customisers.py:267

◆ customiseLHE()

def customisers.customiseLHE (   process,
  changeProcessname = True,
  reselect = False 
)

Definition at line 467 of file customisers.py.

References customisoptions(), keepCleaned(), keepLHE(), keepSelected(), and modify_outputModules().

Referenced by customiseLHEandCleaning().

467 def customiseLHE(process, changeProcessname=True, reselect=False):
468  if reselect:
469  dataTier = "RESELECT"
470  else:
471  dataTier = "SELECT"
472  if changeProcessname:
473  process._Process__name = "LHEembedding"
474  process.load("TauAnalysis.MCEmbeddingTools.EmbeddingLHEProducer_cfi")
475  if reselect:
476  process.externalLHEProducer.vertices = cms.InputTag(
477  "offlineSlimmedPrimaryVertices", "", "RESELECT"
478  )
479  process.lheproduction = cms.Path(process.makeexternalLHEProducer)
480  process.schedule.insert(0, process.lheproduction)
481 
482  process = customisoptions(process)
483  return modify_outputModules(
484  process,
485  [keepSelected(dataTier), keepCleaned(dataTier), keepLHE()],
486  ["MINIAODoutput"],
487  )
488 
489 
def keepCleaned(dataTier)
Customizer for cleaning ###########################.
Definition: customisers.py:341
def keepLHE()
Customizer for LHE ###########################.
Definition: customisers.py:460
def customisoptions(process)
cross Customizers ###########################
def modify_outputModules(process, keep_drop_list=[], module_veto_list=[])
Definition: customisers.py:267
def customiseLHE(process, changeProcessname=True, reselect=False)
Definition: customisers.py:467
def keepSelected(dataTier)
Customizer for Selecting ###########################.
Definition: customisers.py:281

◆ customiseLHEandCleaning()

def customisers.customiseLHEandCleaning (   process,
  reselect = False 
)

Definition at line 490 of file customisers.py.

References customiseCleaning(), and customiseLHE().

Referenced by customiseLHEandCleaning_Reselect().

490 def customiseLHEandCleaning(process, reselect=False):
491  process._Process__name = "LHEembeddingCLEAN"
492  process = customiseCleaning(process, changeProcessname=False, reselect=reselect)
493  process = customiseLHE(process, changeProcessname=False, reselect=reselect)
494  return process
495 
496 
def customiseLHEandCleaning(process, reselect=False)
Definition: customisers.py:490
def customiseLHE(process, changeProcessname=True, reselect=False)
Definition: customisers.py:467
def customiseCleaning(process, changeProcessname=True, reselect=False)
Definition: customisers.py:388

◆ customiseLHEandCleaning_Reselect()

def customisers.customiseLHEandCleaning_Reselect (   process)

Definition at line 497 of file customisers.py.

References customiseLHEandCleaning().

498  return customiseLHEandCleaning(process, reselect=True)
499 
500 
def customiseLHEandCleaning_Reselect(process)
Definition: customisers.py:497
def customiseLHEandCleaning(process, reselect=False)
Definition: customisers.py:490

◆ customiseMCFilter()

def customisers.customiseMCFilter (   process)

Definition at line 1116 of file customisers.py.

References fix_input_tags().

Referenced by customiseFilterTTbartoMuMu().

1116 def customiseMCFilter(process):
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")
1123  )
1124  return process
1125 
1126 
def customiseMCFilter(process)

◆ customiseMerging()

def customisers.customiseMerging (   process,
  changeProcessname = True,
  reselect = False 
)

Definition at line 800 of file customisers.py.

References customisoptions(), keepMerged(), miniAOD_tools.miniAOD_customizeMC(), modify_outputModules(), print(), submitPVValidationJobs.split(), and str.

Referenced by customiseMerging_Reselect().

800 def customiseMerging(process, changeProcessname=True, reselect=False):
801 
802  print("**** Attention: overriding behaviour of 'removeMCMatching' ****")
803 
804  from PhysicsTools.PatAlgos.slimming.miniAOD_tools import miniAOD_customizeMC
805  def performMCMatching(process, names, postfix, outputModules):
806  miniAOD_customizeMC(process)
807 
809  PhysicsTools.PatAlgos.tools.coreTools.removeMCMatching = performMCMatching
810 
811  if changeProcessname:
812  process._Process__name = "MERGE"
813  if reselect:
814  dataTier = "RESELECT"
815  else:
816  dataTier = "SELECT"
817 
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")
822 
823  # process.source.inputCommands.append("drop *_*_*_SELECT")
824  # process.source.inputCommands.append("drop *_*_*_SIMembedding")
825  # process.source.inputCommands.append("drop *_*_*_LHEembeddingCLEAN")
826  # process.source.inputCommands.extend(keepSimulated())
827  # process.source.inputCommands.extend(keepCleaned())
828 
829  process.load('Configuration.StandardSequences.RawToDigi_cff')
830  process.load("Configuration.StandardSequences.Reconstruction_Data_cff")
831  process.merge_step = cms.Path()
832  # produce local CT PPS reco
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)
841  # produce local Calo
842  process.load("RecoLocalCalo.Configuration.RecoLocalCalo_cff")
843  process.merge_step += process.calolocalreco
844  #process.merge_step += process.caloglobalreco
845  process.merge_step += process.reducedHcalRecHitsSequence
846 
847  # produce hcal towers
848  process.load("RecoLocalCalo.CaloTowersCreator.calotowermaker_cfi")
849  process.merge_step += process.calotowermaker
850  process.merge_step += process.towerMaker
851 
852  # produce clusters
853  process.load("RecoEcal.Configuration.RecoEcal_cff")
854  process.merge_step += process.ecalClusters
855 
856  # produce PFCluster Collections
857  process.load("RecoParticleFlow.PFClusterProducer.particleFlowCluster_cff")
858  process.merge_step += process.particleFlowCluster
859  process.load(
860  "RecoEcal.EgammaClusterProducers.particleFlowSuperClusteringSequence_cff"
861  )
862  process.merge_step += process.particleFlowSuperClusteringSequence
863 
864  # muonEcalDetIds
865  process.load("RecoMuon.MuonIdentification.muons1stStep_cfi")
866  process.merge_step += process.muonEcalDetIds
867  process.merge_step += process.muonShowerInformation
868 
869  # muon Isolation sequences
870  process.load("RecoMuon.MuonIsolationProducers.muIsolation_cff")
871  process.merge_step += process.muIsolation
872  process.merge_step += process.muIsolationDisplaced
873 
874  # muon ID selection type sequences
875  process.load("RecoMuon.MuonIdentification.muonSelectionTypeValueMapProducer_cff")
876  process.merge_step += process.muonSelectionTypeSequence
877 
878  # displaced muons extras & tracks
879  process.load("RecoMuon.MuonIdentification.displacedMuonReducedTrackExtras_cfi")
880  process.merge_step += process.displacedMuonReducedTrackExtras
881 
882  process.load("RecoMuon.Configuration.MergeDisplacedTrackCollections_cff")
883  process.merge_step += process.displacedTracksSequence
884 
885  # Other things
886  process.merge_step += process.doAlldEdXEstimators
887  process.merge_step += process.vertexreco
888  process.unsortedOfflinePrimaryVertices.beamSpotLabel = cms.InputTag(
889  "offlineBeamSpot", "", dataTier
890  )
891  process.ak4CaloJetsForTrk.srcPVs = cms.InputTag(
892  "firstStepPrimaryVertices", "", dataTier
893  )
894  process.dedxHitInfo.clusterShapeCache = cms.InputTag("")
895 
896  # process.muons.FillDetectorBasedIsolation = cms.bool(False)
897  # process.muons.FillSelectorMaps = cms.bool(False)
898  # process.muons.FillShoweringInfo = cms.bool(False)
899  # process.muons.FillCosmicsIdMap = cms.bool(False)
900 
901  # process.displacedMuons.FillDetectorBasedIsolation = cms.bool(False)
902  # process.displacedMuons.FillSelectorMaps = cms.bool(False)
903  # process.displacedMuons.FillShoweringInfo = cms.bool(False)
904  # process.displacedMuons.FillCosmicsIdMap = cms.bool(False)
905 
906  # seed configuration needed for seedmerger
907  #process.load(
908  # "RecoEgamma.EgammaElectronProducers.ecalDrivenElectronSeedsParameters_cff"
909  #)
910  #process.ecalDrivenElectronSeeds.SeedConfiguration = cms.PSet(
911  # process.ecalDrivenElectronSeedsParameters
912  #)
913 
914  process.merge_step += process.highlevelreco
915  # process.merge_step.remove(process.reducedEcalRecHitsEE)
916  # process.merge_step.remove(process.reducedEcalRecHitsEB)
917 
918  # process.merge_step.remove(process.ak4JetTracksAssociatorExplicit)
919 
920  # process.merge_step.remove(process.cosmicsVeto)
921  # process.merge_step.remove(process.cosmicsVetoTrackCandidates)
922  # process.merge_step.remove(process.ecalDrivenGsfElectronCores)
923  # process.merge_step.remove(process.ecalDrivenGsfElectrons)
924  # process.merge_step.remove(process.gedPhotonsTmp)
925  # process.merge_step.remove(process.particleFlowTmp)
926 
927  # process.merge_step.remove(process.hcalnoise)
928 
929  process.load("CommonTools.ParticleFlow.genForPF2PAT_cff")
930 
931  # process.muonsFromCosmics.ShowerDigiFillerParameters.dtDigiCollectionLabel = cms.InputTag("simMuonDTDigis")
932 
933  process.merge_step += process.genForPF2PATSequence
934 
935  # Replace manipulated modules contained in merg_step with Mergers, and
936  # put remaining ones into a list to be sorted to avoid deadlocks
937  modules_to_be_ordered = {}
938  # prepare reco list to determine indices
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(
946  cms.InputTag(
947  akt_manimod.merge_prefix + akt_manimod.module_name,
948  instance,
949  "SIMembedding",
950  )
951  )
952  mergCollections_in.append(
953  cms.InputTag(
954  akt_manimod.merge_prefix + akt_manimod.module_name,
955  instance,
956  "LHEembeddingCLEAN",
957  )
958  )
959  setattr(
960  process,
961  akt_manimod.module_name,
962  cms.EDProducer(
963  akt_manimod.merger_name, mergCollections=mergCollections_in
964  ),
965  )
966  if not process.merge_step.contains(getattr(process, akt_manimod.module_name)):
967  modules_to_be_ordered[akt_manimod.module_name] = -1
968  # Determine indices and place them in right order into the list
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)
972  else:
973  print("ERROR:",name,"not prepared in modules list. Please adapt 'customiseMerging'")
974  sys.exit(1)
975 
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]))
979 
980 
981  process.schedule.insert(0, process.merge_step)
982  # process.load('PhysicsTools.PatAlgos.slimming.slimmedGenJets_cfi')
983  process = customisoptions(process)
984  return modify_outputModules(process, [keepMerged(dataTier)])
985 
986 
def keepMerged(dataTier="SELECT")
Customizer for merging ###########################.
Definition: customisers.py:706
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def customiseMerging(process, changeProcessname=True, reselect=False)
Definition: customisers.py:800
def miniAOD_customizeMC(process)
def customisoptions(process)
cross Customizers ###########################
#define str(s)
def modify_outputModules(process, keep_drop_list=[], module_veto_list=[])
Definition: customisers.py:267

◆ customiseMerging_Reselect()

def customisers.customiseMerging_Reselect (   process,
  changeProcessname = True 
)

Definition at line 987 of file customisers.py.

References customiseMerging().

987 def customiseMerging_Reselect(process, changeProcessname=True):
988  return customiseMerging(process, changeProcessname=changeProcessname, reselect=True)
989 
990 
def customiseMerging(process, changeProcessname=True, reselect=False)
Definition: customisers.py:800
def customiseMerging_Reselect(process, changeProcessname=True)
Definition: customisers.py:987

◆ customiseNanoAOD()

def customisers.customiseNanoAOD (   process)

Customize NanoAOD ################################.

Definition at line 994 of file customisers.py.

References common_cff.ExtVar().

994 def customiseNanoAOD(process):
995 
996  process.load("PhysicsTools.NanoAOD.nano_cff")
997  process.nanoAOD_step.insert(0, cms.Sequence(process.nanoTableTaskFS))
998 
999 
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_*_*_*")
1007 
1008  process.load("PhysicsTools.NanoAOD.l1trig_cff")
1009  process.nanoAOD_step.insert(0, cms.Sequence(process.l1TablesTask))
1010 
1011  process.embeddingTable = cms.EDProducer(
1012  "GlobalVariablesTableProducer",
1013  name=cms.string("TauEmbedding"),
1014  # doc=cms.string("TauEmbedding"),
1015  variables=cms.PSet(
1016  nInitialPairCandidates=ExtVar(
1017  cms.InputTag("selectedMuonsForEmbedding", "nPairCandidates"),
1018  float,
1019  doc="number of muons pairs suitable for selection (for internal studies only)",
1020  ),
1021  SelectionOldMass=ExtVar(
1022  cms.InputTag("selectedMuonsForEmbedding", "oldMass"),
1023  float,
1024  doc="Mass of the Dimuon pair using the old selection algorithm (for internal studies only)",
1025  ),
1026  SelectionNewMass=ExtVar(
1027  cms.InputTag("selectedMuonsForEmbedding", "newMass"),
1028  float,
1029  doc="Mass of the Dimuon pair using the new selection algorithm (for internal studies only)",
1030  ),
1031  isMediumLeadingMuon=ExtVar(
1032  cms.InputTag("selectedMuonsForEmbedding", "isMediumLeadingMuon"),
1033  bool,
1034  doc="leading muon ID (medium)",
1035  ),
1036  isMediumTrailingMuon=ExtVar(
1037  cms.InputTag("selectedMuonsForEmbedding", "isMediumTrailingMuon"),
1038  bool,
1039  doc="trailing muon ID (medium)",
1040  ),
1041  isTightLeadingMuon=ExtVar(
1042  cms.InputTag("selectedMuonsForEmbedding", "isTightLeadingMuon"),
1043  bool,
1044  doc="leading muon ID (tight)",
1045  ),
1046  isTightTrailingMuon=ExtVar(
1047  cms.InputTag("selectedMuonsForEmbedding", "isTightTrailingMuon"),
1048  bool,
1049  doc="trailing muon ID (tight)",
1050  ),
1051  initialMETEt=ExtVar(
1052  cms.InputTag("selectedMuonsForEmbedding", "initialMETEt"),
1053  float,
1054  doc="MET Et of selected event",
1055  ),
1056  initialMETphi=ExtVar(
1057  cms.InputTag("selectedMuonsForEmbedding", "initialMETphi"),
1058  float,
1059  doc="MET phi of selected event",
1060  ),
1061  initialPuppiMETEt=ExtVar(
1062  cms.InputTag("selectedMuonsForEmbedding", "initialPuppiMETEt"),
1063  float,
1064  doc="PuppiMET Et of selected event",
1065  ),
1066  initialPuppiMETphi=ExtVar(
1067  cms.InputTag("selectedMuonsForEmbedding", "initialPuppiMETphi"),
1068  float,
1069  doc="PuppiMET phi of selected event",
1070  ),
1071  ),
1072  )
1073  process.embeddingTableTask = cms.Task(process.embeddingTable)
1074  process.schedule.associate(process.embeddingTableTask)
1075 
1076  return process
1077 
1078 
def ExtVar(tag, valtype, doc=None, precision=-1)
Definition: common_cff.py:28
def customiseNanoAOD(process)
Customize NanoAOD ################################.
Definition: customisers.py:994

◆ customiseSelecting()

def customisers.customiseSelecting (   process,
  reselect = False 
)

Definition at line 299 of file customisers.py.

References customisoptions(), keepSelected(), and modify_outputModules().

Referenced by customiseSelecting_Reselect().

299 def customiseSelecting(process, reselect=False):
300  if reselect:
301  process._Process__name = "RESELECT"
302  dataTier = "RESELECT"
303  # process.source.inputCommands = cms.untracked.vstring("drop *",
304  # "keep *_*_*_LHC",
305  # "keep *_*_*_HLT",
306  # )
307  else:
308  process._Process__name = "SELECT"
309  dataTier = "SELECT"
310 
311  process.load("TauAnalysis.MCEmbeddingTools.SelectingProcedure_cff")
312  process.patMuonsAfterKinCuts.src = cms.InputTag("slimmedMuons", "", dataTier)
313  process.selectedMuonsForEmbedding.PuppiMet = cms.InputTag(
314  "slimmedMETsPuppi", "", dataTier
315  )
316  process.selectedMuonsForEmbedding.Met = cms.InputTag("slimmedMETs", "", dataTier)
317  process.patMuonsAfterID = process.patMuonsAfterLooseID.clone()
318 
319  process.selecting = cms.Path(process.makePatMuonsZmumuSelection)
320  process.schedule.insert(-1, process.selecting)
321 
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")
327  )
328  outputModule.outputCommands.extend(keepSelected(dataTier))
329 
330  process = customisoptions(process)
331  return modify_outputModules(process, [keepSelected(dataTier)])
332 
333 
def customiseSelecting(process, reselect=False)
Definition: customisers.py:299
def customisoptions(process)
cross Customizers ###########################
def modify_outputModules(process, keep_drop_list=[], module_veto_list=[])
Definition: customisers.py:267
def keepSelected(dataTier)
Customizer for Selecting ###########################.
Definition: customisers.py:281

◆ customiseSelecting_Reselect()

def customisers.customiseSelecting_Reselect (   process)

Definition at line 334 of file customisers.py.

References customiseSelecting().

334 def customiseSelecting_Reselect(process):
335  return customiseSelecting(process, reselect=True)
336 
337 
def customiseSelecting(process, reselect=False)
Definition: customisers.py:299
def customiseSelecting_Reselect(process)
Definition: customisers.py:334

◆ customisoptions()

def customisers.customisoptions (   process)

cross Customizers ###########################

additional Customizer ###########################

Definition at line 1085 of file customisers.py.

Referenced by customiseCleaning(), customiseGenerator_HLT(), customiseGenerator_postHLT(), customiseGenerator_preHLT(), customiseKeepPrunedGenParticles(), customiseLHE(), customiseMerging(), and customiseSelecting().

1085 def customisoptions(process):
1086  if not hasattr(process, "options"):
1087  process.options = cms.untracked.PSet()
1088  process.options.emptyRunLumiMode = cms.untracked.string(
1089  "doNotHandleEmptyRunsAndLumis"
1090  )
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)
1097  return process
1098 
1099 
def customisoptions(process)
cross Customizers ###########################

◆ fix_input_tags()

def customisers.fix_input_tags (   process,
  formodules = ["generalTracks",
  cscSegments,
  dt4DSegments,
  rpcRecHits 
)

Definition at line 1129 of file customisers.py.

References print().

Referenced by customiseMCFilter().

1129 ):
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)
1134 
1135  def search_for_tags(pset):
1136  if isinstance(pset, dict):
1137  for key in pset:
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__)
1146  else:
1147  change_tags_process(pset[key])
1148  else:
1149  print("must be python dict not a {}".format(type(pset)))
1150 
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__)
1157 
1158  return process
1159 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

◆ keepCleaned()

def customisers.keepCleaned (   dataTier)

Customizer for cleaning ###########################.

Definition at line 341 of file customisers.py.

Referenced by customiseCleaning(), customiseGenerator_HLT(), customiseGenerator_postHLT(), customiseGenerator_preHLT(), and customiseLHE().

341 def keepCleaned(dataTier):
342  ret_vstring = cms.untracked.vstring(
343  # "drop *_*_*_LHEembeddingCLEAN",
344  # "drop *_*_*_CLEAN"
345  "drop *_*_*_" + dataTier,
346  "keep *_patMuonsAfterID_*_" + dataTier,
347  "keep *_slimmedMuons_*_" + dataTier,
348  # "keep *_slimmedMuonTrackExtras_*_" + 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_*_*",
373  # "keep recoPFClusters_*_*_*",
374  # "keep recoPFRecHits_*_*_*"
375  )
376 
377  for akt_manimod in to_bemanipulate:
378  if "MERGE" in akt_manimod.steps:
379  ret_vstring.append(
380  "keep *_" + akt_manimod.module_name + "_*_LHEembeddingCLEAN"
381  )
382  ret_vstring.append("keep *_" + akt_manimod.module_name + "_*_CLEAN")
383  ret_vstring.append("keep *_standAloneMuons_*_LHEembeddingCLEAN")
384  ret_vstring.append("keep *_glbTrackQual_*_LHEembeddingCLEAN")
385  return ret_vstring
386 
387 
def keepCleaned(dataTier)
Customizer for cleaning ###########################.
Definition: customisers.py:341

◆ keepLHE()

def customisers.keepLHE ( )

Customizer for LHE ###########################.

Definition at line 460 of file customisers.py.

Referenced by customiseGenerator_HLT(), customiseGenerator_postHLT(), and customiseLHE().

460 def keepLHE():
461  ret_vstring = cms.untracked.vstring()
462  ret_vstring.append("keep *_externalLHEProducer_*_LHEembedding")
463  ret_vstring.append("keep *_externalLHEProducer_*_LHEembeddingCLEAN")
464  return ret_vstring
465 
466 
def keepLHE()
Customizer for LHE ###########################.
Definition: customisers.py:460

◆ keepMerged()

def customisers.keepMerged (   dataTier = "SELECT")

Customizer for merging ###########################.

Definition at line 706 of file customisers.py.

Referenced by customiseKeepPrunedGenParticles(), and customiseMerging().

706 def keepMerged(dataTier="SELECT"):
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_*_*',
731  # RUN
732  'keep LHERunInfoProduct_*_*_*',
733  'keep GenRunInfoProduct_*_*_*',
734  'keep *_genParticles_xyz0_*',
735  'keep *_genParticles_t0_*'))
736  return ret_vstring
737 
738 
def keepMerged(dataTier="SELECT")
Customizer for merging ###########################.
Definition: customisers.py:706

◆ keepSelected()

def customisers.keepSelected (   dataTier)

Customizer for Selecting ###########################.

Definition at line 281 of file customisers.py.

Referenced by customiseCleaning(), customiseGenerator_HLT(), customiseGenerator_postHLT(), customiseGenerator_preHLT(), customiseLHE(), and customiseSelecting().

281 def keepSelected(dataTier):
282  ret_vstring = cms.untracked.vstring(
283  # "drop *_*_*_"+dataTier,
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,
292  )
293  for akt_manimod in to_bemanipulate:
294  if "CLEAN" in akt_manimod.steps:
295  ret_vstring.append("keep *_" + akt_manimod.module_name + "_*_" + dataTier)
296  return ret_vstring
297 
298 
def keepSelected(dataTier)
Customizer for Selecting ###########################.
Definition: customisers.py:281

◆ keepSimulated()

def customisers.keepSimulated (   process,
  processname = "SIMembedding" 
)

Customizer for simulaton ###########################.

Definition at line 504 of file customisers.py.

References any().

Referenced by customiseGenerator_HLT(), customiseGenerator_postHLT(), and customiseGenerator_preHLT().

504 def keepSimulated(process, processname="SIMembedding"):
505  ret_vstring = cms.untracked.vstring()
506  for akt_manimod in to_bemanipulate:
507  if "MERGE" in akt_manimod.steps:
508  ret_vstring.append(
509  "keep *_" + akt_manimod.module_name + "_*_{}".format(processname)
510  )
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_*_*")
544 
545  # for those two steps, the output has to be modified
546  # to keep the information from the cleaning step in the output file
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
551  )
552  for entry in rawreco_commands_excl:
553  if (
554  processname == "SIMembeddingpreHLT"
555  and "muonReducedTrackExtras" in entry
556  ):
557  continue
558  if not any(
559  x in entry
560  for x in [
561  "TotemTimingLocalTrack",
562  "ForwardProton",
563  "ctppsDiamondLocalTracks",
564  ]
565  ):
566  ret_vstring.append(entry)
567  return ret_vstring
568 
def keepSimulated(process, processname="SIMembedding")
Customizer for simulaton ###########################.
Definition: customisers.py:504
bool any(const std::vector< T > &v, const T &what)
Definition: ECalSD.cc:37

◆ modify_outputModules()

def customisers.modify_outputModules (   process,
  keep_drop_list = [],
  module_veto_list = [] 
)

Definition at line 267 of file customisers.py.

Referenced by customiseCleaning(), customiseGenerator_HLT(), customiseGenerator_postHLT(), customiseGenerator_preHLT(), customiseKeepPrunedGenParticles(), customiseLHE(), customiseMerging(), and customiseSelecting().

267 def modify_outputModules(process, keep_drop_list=[], module_veto_list=[]):
268  outputModulesList = [key for key, value in process.outputModules.items()]
269  for outputModule in outputModulesList:
270  if outputModule in module_veto_list:
271  continue
272  outputModule = getattr(process, outputModule)
273  for add_element in keep_drop_list:
274  outputModule.outputCommands.extend(add_element)
275  return process
276 
277 
def modify_outputModules(process, keep_drop_list=[], module_veto_list=[])
Definition: customisers.py:267

Variable Documentation

◆ instance

customisers.instance

Definition at line 141 of file customisers.py.

◆ manipulator_name

customisers.manipulator_name

Definition at line 47 of file customisers.py.

◆ module_name

customisers.module_name

Definition at line 46 of file customisers.py.

◆ steps

◆ to_bemanipulate

customisers.to_bemanipulate

Definition at line 41 of file customisers.py.