CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
gemCustoms.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 def customise2019(process):
4  if hasattr(process,'digitisation_step'):
5  process=customise_Digi(process)
6  if hasattr(process,'L1simulation_step'):
7  process=customise_L1Emulator2019(process,'pt0')
8  if hasattr(process,'DigiToRaw'):
9  process=customise_DigiToRaw(process)
10  if hasattr(process,'RawToDigi'):
11  process=customise_RawToDigi(process)
12  if hasattr(process,'reconstruction'):
13  process=customise_Reco(process)
14  if hasattr(process,'dqmoffline_step'):
15  process=customise_DQM(process)
16  if hasattr(process,'dqmHarvesting'):
17  process=customise_harvesting(process)
18  if hasattr(process,'validation_step'):
19  process=customise_Validation(process)
20  if hasattr(process,'HLTSchedule'):
21  process=customise_gem_hlt(process)
22  return process
23 
24 def customise2023(process):
25  process = customise2019(process)
26  if hasattr(process,'L1simulation_step'):
27  process=customise_L1Emulator2023(process,'pt0')
28  return process
29 
30 def customise_Digi(process):
31  # original from SLHC:
32  # ----------------------------
33  # process.RandomNumberGeneratorService.simMuonGEMDigis = cms.PSet(
34  # initialSeed = cms.untracked.uint32(1234567),
35  # engineName = cms.untracked.string('HepJamesRandom')
36  # )
37  process.mix.mixObjects.mixSH.crossingFrames.append('MuonGEMHits')
38  process.mix.mixObjects.mixSH.input.append(cms.InputTag("g4SimHits","MuonGEMHits"))
39  process.mix.mixObjects.mixSH.subdets.append('MuonGEMHits')
40  process.load('SimMuon.GEMDigitizer.muonGEMDigi_cff')
41  process.muonDigi += process.muonGEMDigi
42  # process.load('SimCalorimetry.Configuration.SimCalorimetry_cff')
43  # process.digitisation_step.remove(process.calDigi)
44  # process.load('SimCalorimetry.Configuration.ecalDigiSequence_cff')
45  # process.load('SimCalorimetry.Configuration.hcalDigiSequence_cff')
46  # process.load('SimCalorimetry.Configuration.castorDigiSequence_cff')
47  # process.digitisation_step.remove(process.ecalDigiSequence)
48  # process.digitisation_step.remove(process.hcalDigiSequence)
49  # process.digitisation_step.remove(process.castorDigiSequence)
50  process=outputCustoms(process)
51  # ----------------------------
52 
53  # original from 75X:
54  # ----------------------------
55  # from SimMuon.GEMDigitizer.customizeGEMDigi import customize_digi_addGEM_muon_only
56  # process = customize_digi_addGEM_muon_only(process)
57  # process.simMuonGEMDigis.mixLabel = cms.string("mix")
58  # process.simMuonRPCDigis.digiModel = cms.string('RPCSimAverageNoiseEff')
59  # ----------------------------
60  return process
61 
62 #
63 # Here come the L1 Trigger Customizations, below comes from 620 SLHC
64 # ------------------------------------------------------------------
65 # def customise_L1Emulator2019(process, ptdphi):
66 # from L1Trigger.CSCTriggerPrimitives.cscTriggerPrimitiveDigisPostLS2_cfi import cscTriggerPrimitiveDigisPostLS2
67 # process.simCscTriggerPrimitiveDigis = cscTriggerPrimitiveDigisPostLS2
68 # process.simCscTriggerPrimitiveDigis.clctSLHC.clctNplanesHitPattern = 3
69 # process.simCscTriggerPrimitiveDigis.clctSLHC.clctPidThreshPretrig = 2
70 # process.simCscTriggerPrimitiveDigis.clctParam07.clctPidThreshPretrig = 2
71 # ## give a random number generator
72 # process.RandomNumberGeneratorService.simCscTriggerPrimitiveDigis = cms.PSet(
73 # initialSeed = cms.untracked.uint32(1234567),
74 # engineName = cms.untracked.string('HepJamesRandom')
75 # )
76 # return process
77 
78 # def customise_L1Emulator2023(process, ptdphi):
79 # from L1Trigger.CSCTriggerPrimitives.cscTriggerPrimitiveDigisPostLS3_cfi import cscTriggerPrimitiveDigisPostLS3
80 # process.simCscTriggerPrimitiveDigis = cscTriggerPrimitiveDigisPostLS3
81 # process.simCscTriggerPrimitiveDigis.clctSLHC.clctNplanesHitPattern = 3
82 # process.simCscTriggerPrimitiveDigis.clctSLHC.clctPidThreshPretrig = 2
83 # process.simCscTriggerPrimitiveDigis.clctParam07.clctPidThreshPretrig = 2
84 # ## ME21 has its own SLHC processors
85 # process.simCscTriggerPrimitiveDigis.alctSLHCME21 = process.simCscTriggerPrimitiveDigis.alctSLHC.clone()
86 # process.simCscTriggerPrimitiveDigis.clctSLHCME21 = process.simCscTriggerPrimitiveDigis.clctSLHC.clone()
87 # process.simCscTriggerPrimitiveDigis.alctSLHCME21.alctNplanesHitPattern = 3
88 # process.simCscTriggerPrimitiveDigis.alctSLHCME21.runME21ILT = cms.bool(True)
89 # process.simCscTriggerPrimitiveDigis.clctSLHCME21.clctNplanesHitPattern = 3
90 # process.simCscTriggerPrimitiveDigis.clctSLHCME21.clctPidThreshPretrig = 2
91 # return process
92 # ------------------------------------------------------------------
93 
94 def customise_DigiToRaw(process):
95  return process
96 
97 def customise_RawToDigi(process):
98  return process
99 
100 def customise_Reco(process):
101  process.load('RecoLocalMuon.GEMRecHit.gemRecHits_cfi')
102  process.muonlocalreco += process.gemRecHits
103  process.standAloneMuons.STATrajBuilderParameters.EnableGEMMeasurement = cms.bool(True)
104  process.standAloneMuons.STATrajBuilderParameters.BWFilterParameters.EnableGEMMeasurement = cms.bool(True)
105  process.refittedStandAloneMuons.STATrajBuilderParameters.EnableGEMMeasurement = cms.bool(True)
106  process.refittedStandAloneMuons.STATrajBuilderParameters.BWFilterParameters.EnableGEMMeasurement = cms.bool(True)
107  process=outputCustoms(process)
108  return process
109 
110 def customise_DQM(process):
111  return process
112 
113 def customise_Validation(process):
114  process.load('Validation.Configuration.gemSimValid_cff')
115  process.load('Validation.MuonGEMDigis.MuonGEMDigis_cfi')
116  process.genvalid_all += process.gemSimValid
117  process.genvalid_all += process.gemDigiValidation
118  # Additional in SLHC: 2B checked whether needed / necessary
119  # ---------------------------------------------------------
120  process.load('Validation.RecoMuon.MuonTrackValidator_cfi')
121  process.load('SimMuon.MCTruth.MuonAssociatorByHits_cfi')
122  process.muonAssociatorByHitsCommonParameters.useGEMs = cms.bool(True)
123  process.muonTrackValidator.useGEMs = cms.bool(True)
124  # ---------------------------------------------------------
125  return process
126 
127 def customise_harvesting(process):
128  process.load('Validation.Configuration.gemPostValidation_cff')
129  process.genHarvesting += process.gemPostValidation
130  return process
131 
132 def outputCustoms(process):
133  alist=['AODSIM','RECOSIM','FEVTSIM','FEVTDEBUG','FEVTDEBUGHLT','RECODEBUG','RAWRECOSIMHLT','RAWRECODEBUGHLT']
134  for a in alist:
135  b=a+'output'
136  if hasattr(process,b):
137  getattr(process,b).outputCommands.append('keep *_simMuonGEMDigis_*_*')
138  getattr(process,b).outputCommands.append('keep *_simMuonGEMCSCPadDigis_*_*')
139  getattr(process,b).outputCommands.append('keep *_gemRecHits_*_*')
140  return process
141 
142 
143 def customise_gem_hlt(process):
144  process.hltL2OfflineMuonSeeds.EnableGEMMeasurement = cms.bool( True )
145  process.hltL2Muons.L2TrajBuilderParameters.EnableGEMMeasurement = cms.bool( True )
146  process.hltL2Muons.BWFilterParameters.EnableGEMMeasurement = cms.bool( True )
147  return process
148 
149 
def customise2019
Definition: gemCustoms.py:3
def customise_RawToDigi
Definition: gemCustoms.py:97
def customise_harvesting
Definition: gemCustoms.py:127
def customise_gem_hlt
Definition: gemCustoms.py:143
def customise_Validation
Definition: gemCustoms.py:113
def outputCustoms
Definition: gemCustoms.py:132
def customise_Digi
Definition: gemCustoms.py:30
def customise_DQM
Definition: gemCustoms.py:110
def customise_Reco
Definition: gemCustoms.py:100
def customise2023
Definition: gemCustoms.py:24
def customise_DigiToRaw
Definition: gemCustoms.py:94