Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hasattr function for safe if attribute is not existed. #11271

Merged
merged 8 commits into from
Sep 18, 2015
18 changes: 8 additions & 10 deletions SLHCUpgradeSimulations/Configuration/python/gemCustom.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,23 @@ def customise2023(process):
return process
def customise_digitization(process):
from SimMuon.GEMDigitizer.customizeGEMDigi import customize_digi_addGEM_muon_only
process = customize_digi_addGEM_muon_only(process)
process.simMuonGEMDigis.mixLabel = cms.string("mix")
process.simMuonME0Digis.mixLabel = cms.string("mix")
# process.digitisation_step.remove(process.simMuonRPCDigis)
# process.simMuonRPCDigis.digiModel = cms.string('RPCSimParam')
process.simMuonRPCDigis.digiModel = cms.string('RPCSimAverageNoiseEff')
if (hasattr(process,"simMuonGEMDigis")) :
if ( not hasattr(process.simMuonGEMDigis,"mixLabel")) :
process.simMuonGEMDigis.mixLabel = cms.string("mix")
if ( hasattr(process,"simMuonME0Digis")) :
if ( not hasattr(process.simMuonME0Digis,"mixLabel")) :
process.simMuonME0Digis.mixLabel = cms.string("mix")
return process

def customise_Validation(process):
#process.load('Validation.MuonGEMHits.MuonGEMHits_cfi')
process.load('Validation.MuonGEMHits.gemSimValid_cff')
process.load('Validation.MuonGEMDigis.MuonGEMDigis_cfi')
process.genvalid_all += process.gemSimValid
process.genvalid_all += process.gemDigiValidation
return process

def customise_harvesting(process):
#process.load('Validation.MuonGEMHits.MuonGEMHits_cfi')
process.load('Validation.MuonGEMHits.gemPostValidation_cff')
process.genHarvesting += process.gemPostValidation
process.load('DQMServices.Components.EDMtoMEConverter_cff')
process.genHarvesting += process.EDMtoMEConverter
return process