Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-04-18 22:24:07

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 def _commonCustomizeForInefficiency(process):
0004     ## for standard mixing
0005     if hasattr(process,'mix') and hasattr(process.mix,'digitizers') and hasattr(process.mix.digitizers,'pixel'): 
0006         if hasattr(process.mix.digitizers.pixel,'PSPDigitizerAlgorithm'):
0007             print("# Activating Bias Rail Inefficiency in macro-pixels")
0008             process.mix.digitizers.pixel.PSPDigitizerAlgorithm.AddBiasRailInefficiency = cms.bool(True)
0009 
0010         if hasattr(process.mix.digitizers.pixel,'PSSDigitizerAlgorithm'):
0011             print("# Activating bad strip simulation for s-sensors in PS modules from DB")
0012             process.mix.digitizers.pixel.PSSDigitizerAlgorithm.KillModules = cms.bool(True)
0013             process.mix.digitizers.pixel.PSSDigitizerAlgorithm.DeadModules_DB = cms.bool(True)
0014 
0015         if hasattr(process.mix.digitizers.pixel,'SSDigitizerAlgorithm'):
0016             print("# Activating bad strip simulation for SS modules from DB")
0017             process.mix.digitizers.pixel.SSDigitizerAlgorithm.KillModules = cms.bool(True)
0018             process.mix.digitizers.pixel.SSDigitizerAlgorithm.DeadModules_DB = cms.bool(True)
0019 
0020     ## for pre-mixing
0021     if hasattr(process, "mixData") and hasattr(process.mixData, "workers") and hasattr(process.mixData.workers, "pixel"):
0022         if hasattr(process.mixData.workers.pixel,'PSPDigitizerAlgorithm'):
0023             print("# Activating Bias Rail Inefficiency in macro-pixels")
0024             process.mixData.workers.pixel.PSPDigitizerAlgorithm.AddBiasRailInefficiency = cms.bool(True)
0025 
0026         if hasattr(process.mixData.workers.pixel,'PSSDigitizerAlgorithm'):
0027             print("# Activating bad strip simulation for s-sensors in PS modules from DB")
0028             process.mixData.workers.pixel.PSSDigitizerAlgorithm.KillModules = cms.bool(True)
0029             process.mixData.workers.pixel.PSSDigitizerAlgorithm.DeadModules_DB = cms.bool(True)
0030 
0031         if hasattr(process.mixData.workers.pixel,'SSDigitizerAlgorithm'):
0032             print("# Activating bad strip simulation for SS modules from DB")
0033             process.mixData.workers.pixel.SSDigitizerAlgorithm.KillModules = cms.bool(True)
0034             process.mixData.workers.pixel.SSDigitizerAlgorithm.DeadModules_DB = cms.bool(True)
0035 
0036     return process
0037 
0038 #
0039 # activate bias rail inefficiency only
0040 #
0041 def customizeSiPhase2OTInefficiencyZeroPercent(process):
0042 
0043     _commonCustomizeForInefficiency(process)
0044 
0045     return process
0046 
0047 #
0048 # activate bias rail inefficiency and 1% random bad strips
0049 #
0050 def customizeSiPhase2OTInefficiencyOnePercent(process):
0051 
0052     _commonCustomizeForInefficiency(process)
0053 
0054     if hasattr(process,'SiPhase2OTFakeBadStripsESSource') :
0055         print("# Adding 1% of randomly generated bad strips")
0056         process.SiPhase2OTFakeBadStripsESSource.badComponentsFraction = 0.01 # 1% bad components
0057 
0058     return process
0059 
0060 #
0061 # activate bias rail inefficiency and 5% random bad strips
0062 #
0063 def customizeSiPhase2OTInefficiencyFivePercent(process):
0064 
0065     _commonCustomizeForInefficiency(process)
0066 
0067     if hasattr(process,'SiPhase2OTFakeBadStripsESSource') :
0068         print("# Adding 5% of randomly generated bad strips")
0069         process.SiPhase2OTFakeBadStripsESSource.badComponentsFraction = 0.05 # 5% bad components
0070 
0071     return process
0072 
0073 #
0074 # activate bias rail inefficiency and 10% random bad strips
0075 #
0076 def customizeSiPhase2OTInefficiencyTenPercent(process):
0077 
0078     _commonCustomizeForInefficiency(process)
0079  
0080     if hasattr(process,'SiPhase2OTFakeBadStripsESSource') :
0081         print("# Adding 10% of randomly generated bad strips")
0082         process.SiPhase2OTFakeBadStripsESSource.badComponentsFraction = 0.1 # 10% bad components
0083 
0084     return process