CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
customizeHLTforHighPU.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 #
4 # reusable functions
5 def producers_by_type(process, *types):
6  return (module for module in process._Process__producers.values() if module._TypedParameterizable__type in types)
7 def filters_by_type(process, *types):
8  return (filter for filter in process._Process__filters.values() if filter._TypedParameterizable__type in types)
9 def analyzers_by_type(process, *types):
10  return (analyzer for analyzer in process._Process__analyzers.values() if analyzer._TypedParameterizable__type in types)
11 
12 def esproducers_by_type(process, *types):
13  return (module for module in process._Process__esproducers.values() if module._TypedParameterizable__type in types)
14 
15 #
16 # CMSSW version specific customizations
17 def customizeHLTforHighPU(process):
18  for module in producers_by_type(process,"SiPixelClusterProducer"):
19  if hasattr(module, "maxNumberOfClusters"):
20  module.maxNumberOfClusters = cms.int32( 80000 ) # default: 20000
21 
22  for module in producers_by_type(process,"SeedGeneratorFromRegionHitsEDProducer"):
23  if hasattr(module,"OrderedHitsFactoryPSet"):
24  OrderedHitsFactory_pset = module.OrderedHitsFactoryPSet
25  if hasattr(OrderedHitsFactory_pset,"GeneratorPSet"):
26  Generator_pset = OrderedHitsFactory_pset.GeneratorPSet
27  if hasattr(Generator_pset,"maxElement"):
28 # if getattr(Generator_pset,"maxElement") != 100000:
29 # print module, Generator_pset.maxElement
30  Generator_pset.maxElement = 100000 # default 100000 for pp modules, 1000000 for PA modules
31 
32  if hasattr(module,"ClusterCheckPSet"):
33  ClusterCheck_pset = module.ClusterCheckPSet
34  if hasattr(ClusterCheck_pset,"MaxNumberOfCosmicClusters"):
35 # if getattr(ClusterCheck_pset,"MaxNumberOfCosmicClusters") != 800000:
36 # print module,ClusterCheck_pset.MaxNumberOfCosmicClusters
37  ClusterCheck_pset.MaxNumberOfCosmicClusters = 800000 # default 50000 for pp modules, 400000 for PA modules
38  if hasattr(ClusterCheck_pset,"MaxNumberOfPixelClusters"):
39 # if getattr(ClusterCheck_pset,"MaxNumberOfPixelClusters") != 80000:
40 # print module,ClusterCheck_pset.MaxNumberOfPixelClusters
41  ClusterCheck_pset.MaxNumberOfPixelClusters = 80000 # default 10000 for pp modules, 40000 for PA modules
42  return process