CMS 3D CMS Logo

customizeHLTforCMSSW.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 # helper fuctions
5 
6 # add one customisation function per PR
7 # - put the PR number into the name of the function
8 # - add a short comment
9 # for example:
10 
11 # CCCTF tuning
12 # def customiseFor12718(process):
13 # for pset in process._Process__psets.values():
14 # if hasattr(pset,'ComponentType'):
15 # if (pset.ComponentType == 'CkfBaseTrajectoryFilter'):
16 # if not hasattr(pset,'minGoodStripCharge'):
17 # pset.minGoodStripCharge = cms.PSet(refToPSet_ = cms.string('HLTSiStripClusterChargeCutNone'))
18 # return process
19 
20 
22  """Customise the HLT to run on Run 2 data/MC using the old readout for the HCAL barel"""
23 
24  for producer in producers_by_type(process, "HBHEPhase1Reconstructor"):
25  # switch on the QI8 processing for 2018 HCAL barrel
26  producer.processQIE8 = True
27 
28  # adapt CaloTowers threshold for 2018 HCAL barrel with only one depth
29  for producer in producers_by_type(process, "CaloTowersCreator"):
30  producer.HBThreshold1 = 0.7
31  producer.HBThreshold2 = 0.7
32  producer.HBThreshold = 0.7
33 
34  # adapt Particle Flow threshold for 2018 HCAL barrel with only one depth
35  from RecoParticleFlow.PFClusterProducer.particleFlowClusterHBHE_cfi import _thresholdsHB, _thresholdsHEphase1, _seedingThresholdsHB
36 
37  logWeightDenominatorHCAL2018 = cms.VPSet(
38  cms.PSet(
39  depths = cms.vint32(1, 2, 3, 4),
40  detector = cms.string('HCAL_BARREL1'),
41  logWeightDenominator = _thresholdsHB
42  ),
43  cms.PSet(
44  depths = cms.vint32(1, 2, 3, 4, 5, 6, 7),
45  detector = cms.string('HCAL_ENDCAP'),
46  logWeightDenominator = _thresholdsHEphase1
47  )
48  )
49 
50  for producer in producers_by_type(process, "PFRecHitProducer"):
51  if producer.producers[0].name.value() == 'PFHBHERecHitCreator':
52  producer.producers[0].qualityTests[0].cuts[0].threshold = _thresholdsHB
53 
54  for producer in producers_by_type(process, "PFClusterProducer"):
55  if producer.seedFinder.thresholdsByDetector[0].detector.value() == 'HCAL_BARREL1':
56  producer.seedFinder.thresholdsByDetector[0].seedingThreshold = _seedingThresholdsHB
57  producer.initialClusteringStep.thresholdsByDetector[0].gatheringThreshold = _thresholdsHB
58  producer.pfClusterBuilder.recHitEnergyNorms[0].recHitEnergyNorm = _thresholdsHB
59  producer.pfClusterBuilder.positionCalc.logWeightDenominatorByDetector = logWeightDenominatorHCAL2018
60  producer.pfClusterBuilder.allCellsPositionCalc.logWeightDenominatorByDetector = logWeightDenominatorHCAL2018
61 
62  for producer in producers_by_type(process, "PFMultiDepthClusterProducer"):
63  producer.pfClusterBuilder.allCellsPositionCalc.logWeightDenominatorByDetector = logWeightDenominatorHCAL2018
64 
65  # done
66  return process
67 
68 
70  """Adapt the HLT to run the legacy DT unpacking
71  for pre2018 data/MC workflows as the default"""
72 
73  if hasattr(process,'hltMuonDTDigis'):
74  process.hltMuonDTDigis = cms.EDProducer( "DTUnpackingModule",
75  useStandardFEDid = cms.bool( True ),
76  maxFEDid = cms.untracked.int32( 779 ),
77  inputLabel = cms.InputTag( "rawDataCollector" ),
78  minFEDid = cms.untracked.int32( 770 ),
79  dataType = cms.string( "DDU" ),
80  readOutParameters = cms.PSet(
81  localDAQ = cms.untracked.bool( False ),
82  debug = cms.untracked.bool( False ),
83  rosParameters = cms.PSet(
84  localDAQ = cms.untracked.bool( False ),
85  debug = cms.untracked.bool( False ),
86  writeSC = cms.untracked.bool( True ),
87  readDDUIDfromDDU = cms.untracked.bool( True ),
88  readingDDU = cms.untracked.bool( True ),
89  performDataIntegrityMonitor = cms.untracked.bool( False )
90  ),
91  performDataIntegrityMonitor = cms.untracked.bool( False )
92  ),
93  dqmOnly = cms.bool( False )
94  )
95 
96  return process
97 
99  """Customise the HLT to run on Run 2 data/MC using the old definition of the pixel calibrations
100 
101  Up to 11.0.x, the pixel calibarations were fully specified in the configuration:
102  VCaltoElectronGain = 47
103  VCaltoElectronGain_L1 = 50
104  VCaltoElectronOffset = -60
105  VCaltoElectronOffset_L1 = -670
106 
107  Starting with 11.1.x, the calibrations for Run 3 were moved to the conditions, leaving in the configuration only:
108  VCaltoElectronGain = 1
109  VCaltoElectronGain_L1 = 1
110  VCaltoElectronOffset = 0
111  VCaltoElectronOffset_L1 = 0
112 
113  Since the conditions for Run 2 have not been updated to the new scheme, the HLT configuration needs to be reverted.
114  """
115  # revert the Pixel parameters to be compatible with the Run 2 conditions
116  for producer in producers_by_type(process, "SiPixelClusterProducer"):
117  producer.VCaltoElectronGain = 47
118  producer.VCaltoElectronGain_L1 = 50
119  producer.VCaltoElectronOffset = -60
120  producer.VCaltoElectronOffset_L1 = -670
121 
122  return process
123 
124 
126  """Customise the HLT to run on Run 2 data/MC"""
127  process = customisePixelGainForRun2Input(process)
128  process = customiseHCALFor2018Input(process)
129 
130  return process
131 
132 
133 # CMSSW version specific customizations
134 def customizeHLTforCMSSW(process, menuType="GRun"):
135 
136  # add call to action function in proper order: newest last!
137  # process = customiseFor12718(process)
138 
139  return process
common
customizeHLTforCMSSW.customizeHLTforCMSSW
def customizeHLTforCMSSW(process, menuType="GRun")
Definition: customizeHLTforCMSSW.py:134
particleFlowClusterHBHE_cfi
customizeHLTforCMSSW.customiseHCALFor2018Input
def customiseHCALFor2018Input(process)
Definition: customizeHLTforCMSSW.py:21
customizeHLTforCMSSW.customiseFor2017DtUnpacking
def customiseFor2017DtUnpacking(process)
Definition: customizeHLTforCMSSW.py:69
customizeHLTforCMSSW.customisePixelGainForRun2Input
def customisePixelGainForRun2Input(process)
Definition: customizeHLTforCMSSW.py:98
customizeHLTforCMSSW.customiseFor2018Input
def customiseFor2018Input(process)
Definition: customizeHLTforCMSSW.py:125
common.producers_by_type
def producers_by_type(process, *types)
Definition: common.py:5