test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
customise_PPwithHI.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 # Customize process to run HI-style photon isolation in the pp RECO sequences
4 def addHIIsolationProducer(process):
5 
6  process.load('Configuration.EventContent.EventContent_cff')
7 
8  # extend RecoEgammaFEVT content
9  process.RecoEgammaFEVT.outputCommands.extend(['keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerppGED_*_*',
10  'keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerpp_*_*'
11  ])
12 
13  # extend RecoEgammaRECO content
14  process.RECOEventContent.outputCommands.extend(['keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerppGED_*_*',
15  'keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerpp_*_*',
16  'keep recoCaloClusters_islandBasicClusters_*_*'
17  ])
18 
19  process.FEVTEventContent.outputCommands.extend(['keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerppGED_*_*',
20  'keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerpp_*_*',
21  'keep recoCaloClusters_islandBasicClusters_*_*'
22  ])
23  process.FEVTSIMEventContent.outputCommands.extend(['keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerppGED_*_*',
24  'keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerpp_*_*',
25  'keep recoCaloClusters_islandBasicClusters_*_*'
26  ])
27  # extend RecoEgammaRECO content
28  process.RAWRECOEventContent.outputCommands.extend(['keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerppGED_*_*',
29  'keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerpp_*_*',
30  'keep recoCaloClusters_islandBasicClusters_*_*'
31  ])
32 
33  process.RECOSIMEventContent.outputCommands.extend(['keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerppGED_*_*',
34  'keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerpp_*_*',
35  'keep recoCaloClusters_islandBasicClusters_*_*'
36  ])
37 
38  process.RAWRECOSIMHLTEventContent.outputCommands.extend(['keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerppGED_*_*',
39  'keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerpp_*_*',
40  'keep recoCaloClusters_islandBasicClusters_*_*'
41  ])
42 
43  process.RAWRECODEBUGHLTEventContent.outputCommands.extend(['keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerppGED_*_*',
44  'keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerpp_*_*',
45  'keep recoCaloClusters_islandBasicClusters_*_*'
46  ])
47 
48  process.FEVTHLTALLEventContent.outputCommands.extend(['keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerppGED_*_*',
49  'keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerpp_*_*',
50  'keep recoCaloClusters_islandBasicClusters_*_*'
51  ])
52 
53  process.FEVTDEBUGEventContent.outputCommands.extend(['keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerppGED_*_*',
54  'keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerpp_*_*',
55  'keep recoCaloClusters_islandBasicClusters_*_*'
56  ])
57 
58  # extend RecoEgammaAOD content
59  process.AODEventContent.outputCommands.extend(['keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerppGED_*_*',
60  'keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerpp_*_*'
61  ])
62 
63  process.AODSIMEventContent.outputCommands.extend(['keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerppGED_*_*',
64  'keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerpp_*_*'
65  ])
66 
67  # add HI Photon isolation sequence to pp RECO
68  process.load('RecoHI.HiEgammaAlgos.photonIsolationHIProducer_cfi')
69  process.load('RecoEcal.EgammaClusterProducers.islandBasicClusters_cfi')
70 
71  process.photonIsolationHISequencePP = cms.Sequence(process.islandBasicClusters
72  * process.photonIsolationHIProducerpp
73  * process.photonIsolationHIProducerppGED)
74 
75  process.reconstruction *= process.photonIsolationHISequencePP
76 
77  return process
78 
79 
80  # modify cluster limits to run pp reconstruction on peripheral PbPb
81 def modifyClusterLimits(process):
82 
83  hiClusterCut = cms.string("strip < 400000 && pixel < 40000 && (strip < 60000 + 7.0*pixel) && (pixel < 8000 + 0.14*strip)")
84 
85  if hasattr(process,'initialStepSeedsPreSplitting'): process.initialStepSeedsPreSplitting.ClusterCheckPSet.cut = hiClusterCut
86  if hasattr(process,'initialStepSeeds'): process.initialStepSeeds.ClusterCheckPSet.cut = hiClusterCut
87  if hasattr(process,'lowPtTripletStepSeeds'): process.lowPtTripletStepSeeds.ClusterCheckPSet.cut = hiClusterCut
88  if hasattr(process,'globalSeedsFromTriplets'): process.globalSeedsFromTriplets.ClusterCheckPSet.cut = hiClusterCut
89  if hasattr(process,'detachedTripletStepSeeds'): process.detachedTripletStepSeeds.ClusterCheckPSet.cut = hiClusterCut
90  if hasattr(process,'mixedTripletStepSeedsA'): process.mixedTripletStepSeedsA.ClusterCheckPSet.cut = hiClusterCut
91  if hasattr(process,'mixedTripletStepSeedsB'): process.mixedTripletStepSeedsB.ClusterCheckPSet.cut = hiClusterCut
92  if hasattr(process,'globalMixedSeeds'): process.globalMixedSeeds.ClusterCheckPSet.cut = hiClusterCut
93  if hasattr(process,'pixelLessStepSeeds'): process.pixelLessStepSeeds.ClusterCheckPSet.cut = hiClusterCut
94  if hasattr(process,'globalPixelLessSeeds'): process.globalPixelLessSeeds.ClusterCheckPSet.cut = hiClusterCut
95  if hasattr(process,'globalPixelSeeds'): process.globalPixelSeeds.ClusterCheckPSet.cut = hiClusterCut
96  if hasattr(process,'pixelPairStepSeeds'): process.pixelPairStepSeeds.ClusterCheckPSet.cut = hiClusterCut
97  if hasattr(process,'globalSeedsFromPairsWithVertices'): process.globalSeedsFromPairsWithVertices.ClusterCheckPSet.cut = hiClusterCut
98  if hasattr(process,'tobTecStepSeedsPair'): process.tobTecStepSeedsPair.ClusterCheckPSet.cut = hiClusterCut
99  if hasattr(process,'tobTecStepSeedsTripl'): process.tobTecStepSeedsTripl.ClusterCheckPSet.cut = hiClusterCut
100  if hasattr(process,'pixelPairElectronSeeds'): process.pixelPairElectronSeeds.ClusterCheckPSet.cut = hiClusterCut
101  if hasattr(process,'regionalCosmicTrackerSeeds'): process.regionalCosmicTrackerSeeds.ClusterCheckPSet.cut = hiClusterCut
102  if hasattr(process,'stripPairElectronSeeds'): process.stripPairElectronSeeds.ClusterCheckPSet.cut = hiClusterCut
103  if hasattr(process,'photonConvTrajSeedFromSingleLeg'): process.photonConvTrajSeedFromSingleLeg.ClusterCheckPSet.cut = hiClusterCut
104  if hasattr(process,'photonConvTrajSeedFromQuadruplets'): process.photonConvTrajSeedFromQuadruplets.ClusterCheckPSet.cut = hiClusterCut
105  if hasattr(process,'tripletElectronSeeds'): process.tripletElectronSeeds.ClusterCheckPSet.cut = hiClusterCut
106  if hasattr(process,'jetCoreRegionalStepSeeds'): process.jetCoreRegionalStepSeeds.ClusterCheckPSet.cut = hiClusterCut
107 
108 
109  maxElement = cms.uint32(1000000)
110 
111  if hasattr(process,'initialStepSeedsPreSplitting'): process.initialStepSeedsPreSplitting.OrderedHitsFactoryPSet.GeneratorPSet.maxElement = maxElement
112  if hasattr(process,'initialStepSeeds'): process.initialStepSeeds.OrderedHitsFactoryPSet.GeneratorPSet.maxElement = maxElement
113  if hasattr(process,'lowPtTripletStepSeeds'): process.lowPtTripletStepSeeds.OrderedHitsFactoryPSet.GeneratorPSet.maxElement = maxElement
114  if hasattr(process,'mixedTripletStepSeedsA'): process.mixedTripletStepSeedsA.OrderedHitsFactoryPSet.GeneratorPSet.maxElement = maxElement
115  if hasattr(process,'mixedTripletStepSeedsB'): process.mixedTripletStepSeedsB.OrderedHitsFactoryPSet.GeneratorPSet.maxElement = maxElement
116  if hasattr(process,'detachedTripletStepSeeds'): process.detachedTripletStepSeeds.OrderedHitsFactoryPSet.GeneratorPSet.maxElement = maxElement
117  if hasattr(process,'pixelLessStepSeeds'): process.pixelLessStepSeeds.OrderedHitsFactoryPSet.GeneratorPSet.maxElement = maxElement
118  if hasattr(process,'tobTecStepSeedsTripl'): process.tobTecStepSeedsTripl.OrderedHitsFactoryPSet.GeneratorPSet.maxElement = maxElement
119  if hasattr(process,'tobTecStepSeedsPair'): process.tobTecStepSeedsPair.OrderedHitsFactoryPSet.maxElement = maxElement
120  if hasattr(process,'pixelPairStepSeeds'): process.pixelPairStepSeeds.OrderedHitsFactoryPSet.maxElement = maxElement
121  if hasattr(process,'jetCoreRegionalStepSeeds'): process.jetCoreRegionalStepSeeds.OrderedHitsFactoryPSet.maxElement = maxElement
122 
123  return process
124 
125 
126 # Add caloTowers to AOD event content
127 def storeCaloTowersAOD(process):
128 
129  process.load('Configuration.EventContent.EventContent_cff')
130 
131  # extend AOD content
132  if hasattr(process,'AODoutput'):
133  process.AODoutput.outputCommands.extend(['keep *_towerMaker_*_*'])
134 
135  if hasattr(process,'AODSIMoutput'):
136  process.AODSIMoutput.outputCommands.extend(['keep *_towerMaker_*_*'])
137 
138  return process
139 
141 
142  process=addHIIsolationProducer(process)
143  process=storeCaloTowersAOD(process)
144 
145  return process
146 
148 
149  process=addHIIsolationProducer(process)
150  process=modifyClusterLimits(process)
151  process=storeCaloTowersAOD(process)
152 
153  return process
154