CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/SLHCUpgradeSimulations/Configuration/python/aging.py

Go to the documentation of this file.
00001 import FWCore.ParameterSet.Config as cms
00002 
00003 def agePixel(process,lumi):
00004     prd=1.0
00005     if lumi==300:
00006         prd=1.0
00007     if lumi==500:
00008         prd=1.5
00009     if lumi==1000:
00010         prd=0.
00011     if lumi==3000:
00012         prd=0. #no aging yet
00013         
00014     # danger - watch for someone turning off pixel aging - if off - leave off
00015     if hasattr(process,'mix') and not hasattr(process.mix.digitizers.pixel,'NoAging'):
00016         process.mix.digitizers.pixel.PseudoRadDamage =  cms.double(float(prd*7.65))
00017         process.mix.digitizers.pixel.PseudoRadDamageRadius =  cms.double(16.5)
00018     return process    
00019 
00020 def ageHcal(process,lumi):
00021 
00022     instLumi=1.0e34
00023     if lumi>=1000:
00024         instLumi=5.0e34
00025 
00026     if hasattr(process,'g4SimHits'):
00027         process.g4SimHits.HCalSD.InstLuminosity = cms.double(float(instLumi))  
00028         process.g4SimHits.HCalSD.DelivLuminosity = cms.double(float(lumi))  # integrated lumi in fb-1
00029         process.g4SimHits.HCalSD.HEDarkening       = cms.bool(True)
00030         process.g4SimHits.HCalSD.HFDarkening       = cms.bool(True)
00031     return process
00032 
00033 def ageEcal(process,lumi):
00034 
00035     instLumi=1.0e34
00036     if lumi>=1000:
00037         instLumi=5.0e34
00038         
00039     if hasattr(process,'g4SimHits'):
00040         #these lines need to be further activiated by tuning on 'complete' aging for ecal 
00041         process.g4SimHits.ECalSD.InstLuminosity = cms.double(instLumi)
00042         process.g4SimHits.ECalSD.DelivLuminosity = cms.double(float(lumi))
00043     return process
00044 
00045 def customise_aging_300(process):
00046 
00047     process=ageHcal(process,300)
00048     process=ageEcal(process,300)
00049     process=agePixel(process,300)
00050     return process
00051 
00052 def customise_aging_500(process):
00053 
00054     process=ageHcal(process,500)
00055     process=ageEcal(process,500)
00056     process=agePixel(process,500)
00057     return process
00058 
00059 def customise_aging_1000(process):
00060 
00061     process=ageHcal(process,1000)
00062     process=ageEcal(process,1000)
00063     process=agePixel(process,1000)
00064     return process
00065 
00066 def customise_aging_3000(process):
00067 
00068     process=ageHcal(process,3000)
00069     process=ageEcal(process,3000)
00070     process=agePixel(process,3000)
00071     return process
00072 
00073 def customise_aging_ecalonly_300(process):
00074 
00075     process=ageEcal(process,300)
00076     return process
00077 
00078 def customise_aging_ecalonly_1000(process):
00079 
00080     process=ageEcal(process,1000)
00081     return process
00082 
00083 def customise_aging_ecalonly_3000(process):
00084 
00085     process=ageEcal(process,3000)
00086     return process
00087 
00088 def customise_aging_newpixel_1000(process):
00089 
00090     process=ageEcal(process,1000)
00091     process=ageHcal(process,1000)
00092     return process
00093 
00094 def customise_aging_newpixel_3000(process):
00095 
00096     process=ageEcal(process,3000)
00097     process=ageHcal(process,3000)
00098     return process
00099 
00100 #no hcal 3000
00101 
00102 def ecal_complete_aging(process):
00103     if hasattr(process,'g4SimHits'):
00104         process.g4SimHits.ECalSD.AgeingWithSlopeLY = cms.untracked.bool(True)
00105     if hasattr(process,'ecal_digi_parameters'):    
00106         process.ecal_digi_parameters.UseLCcorrection = cms.untracked.bool(False)
00107     return process
00108 
00109 def turn_off_HE_aging(process):
00110     if hasattr(process,'g4SimHits'):
00111         process.g4SimHits.HHCalSD.HEDarkening       = cms.bool(False)
00112     return process
00113 
00114 def turn_off_HF_aging(process):
00115     if hasattr(process,'g4SimHits'):
00116         process.g4SimHits.HCalSD.HFDarkening       = cms.bool(False)
00117     return process
00118 
00119 def turn_off_Pixel_aging(process):
00120 
00121     if hasattr(process,'mix'):
00122         setattr(process.mix.digitizers.pixel,'NoAging',cms.double(1.))
00123         process.mix.digitizers.pixel.PseudoRadDamage =  cms.double(0.)
00124     return process
00125 
00126 def turn_on_Pixel_aging_1000(process):
00127     # just incase we want aging afterall
00128     if hasattr(process,'mix'):
00129         process.mix.digitizers.pixel.PseudoRadDamage =  cms.double(1.5)
00130         process.mix.digitizers.pixel.PseudoRadDamageRadius =  cms.double(4.0)
00131 
00132     return process
00133 
00134 
00135 def reco_aging_hcal_stdgeom(process):
00136     process.load("CalibCalorimetry/HcalPlugins/Hcal_Conditions_forGlobalTag_cff")
00137 
00138     process.es_hardcode.HcalReLabel.RelabelHits = cms.untracked.bool(True)
00139     process.es_hardcode.HcalReLabel.RelabelRules.Eta1  =    cms.untracked.vint32(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)
00140     process.es_hardcode.HcalReLabel.RelabelRules.Eta16 =    cms.untracked.vint32(1,1,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3)
00141     process.es_hardcode.HcalReLabel.RelabelRules.Eta17 =    cms.untracked.vint32(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)
00142     process.es_hardcode.HcalReLabel.RelabelRules.Eta18 =    cms.untracked.vint32(1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2)
00143     process.es_hardcode.HcalReLabel.RelabelRules.Eta19 =    cms.untracked.vint32(1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2)
00144     process.es_hardcode.HcalReLabel.RelabelRules.Eta27 =    cms.untracked.vint32(1,1,1,1,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3)
00145 
00146     process.es_hardcode.toGet = cms.untracked.vstring(
00147         'GainWidths',
00148         'RespCorrs'
00149         )
00150     process.es_hardcode.HERecalibration = cms.bool(True)
00151     process.es_hardcode.HFRecalibration = cms.bool(True)
00152     
00153     return process
00154 
00155 def reco_aging_hcal_stdgeom_300(process):
00156     process=reco_aging_hcal_stdgeom(process)
00157     process.es_hardcode.iLumi = cms.double(300.)
00158     return process
00159 
00160 def reco_aging_hcal_stdgeom_500(process):
00161     process=reco_aging_hcal_stdgeom(process)
00162     process.es_hardcode.iLumi = cms.double(500.)
00163     return process
00164 
00165 def reco_aging_hcal_stdgeom_1000(process):
00166     process=reco_aging_hcal_stdgeom(process)
00167     process.es_hardcode.iLumi = cms.double(1000.)
00168     return process
00169 
00170 def reco_aging_hcal_stdgeom_3000(process):
00171     process=reco_aging_hcal_stdgeom(process)
00172     process.es_hardcode.iLumi = cms.double(3000.)
00173     return process
00174 
00175 
00176 def ecal_complete_aging_300(process):
00177     process=ecal_complete_aging(process)
00178 
00179     if not hasattr(process.GlobalTag,'toGet'):
00180         process.GLobalTag.toGet=cms.VPSet()
00181     process.GlobalTag.toGet.extend( cms.VPSet(
00182         cms.PSet(record = cms.string("EcalPedestalsRcd"),
00183                  tag = cms.string("EcalPedestals_TL300_IL1E34_mc"),
00184                  connect = cms.untracked.string("frontier://FrontierPrep/CMS_COND_ECAL")
00185                  ),
00186         ## laser D
00187         cms.PSet(record = cms.string("EcalLaserAPDPNRatiosRcd"),
00188                  tag = cms.string("EcalLaserAPDPNRatios_TL300_IL1E34_v2_mc"),
00189                  connect = cms.untracked.string("frontier://FrontierPrep/CMS_COND_ECAL")
00190                  ),
00191         ## L1 trigger
00192         cms.PSet(record = cms.string("EcalTPGLinearizationConstRcd"),
00193                  tag = cms.string("EcalTPGLinearizationConst_TL300_IL1E34_v2_mc"),
00194                  connect = cms.untracked.string("frontier://FrontierPrep/CMS_COND_ECAL")
00195                  ),
00196         cms.PSet(record = cms.string('EcalLaserAlphasRcd'),
00197                  tag = cms.string('EcalLaserAlphas_EB_sic1_btcp1_EE_sic1_btcp1'),
00198                  connect = cms.untracked.string('frontier://FrontierPrep/CMS_COND_ECAL')
00199                  ),
00200         #VPT aging
00201         cms.PSet(record = cms.string('EcalLinearCorrectionsRcd'),
00202                  tag = cms.string('EcalLinearCorrections_mc'),
00203                  connect = cms.untracked.string('frontier://FrontierPrep/CMS_COND_ECAL')
00204                  )
00205         )
00206                                     )
00207     return process
00208 
00209     
00210 def ecal_complete_aging_1000(process):
00211     process=ecal_complete_aging(process)
00212 
00213     if not hasattr(process.GlobalTag,'toGet'):
00214         process.GLobalTag.toGet=cms.VPSet()
00215     process.GlobalTag.toGet.extend( cms.VPSet(
00216         cms.PSet(record = cms.string("EcalPedestalsRcd"),
00217                  tag = cms.string("EcalPedestals_TL1000_IL5E34_mc"),
00218                  connect = cms.untracked.string("frontier://FrontierPrep/CMS_COND_ECAL")
00219                  ),
00220         ## laser D
00221         cms.PSet(record = cms.string("EcalLaserAPDPNRatiosRcd"),
00222                  tag = cms.string("EcalLaserAPDPNRatios_TL1000_IL5E34_v2_mc"),
00223                  connect = cms.untracked.string("frontier://FrontierPrep/CMS_COND_ECAL")
00224                  ),
00225         ## L1 trigger
00226         cms.PSet(record = cms.string("EcalTPGLinearizationConstRcd"),
00227                  tag = cms.string("EcalTPGLinearizationConst_TL1000_IL5E34_v2_mc"),
00228                  connect = cms.untracked.string("frontier://FrontierPrep/CMS_COND_ECAL")
00229                  ),
00230         cms.PSet(record = cms.string('EcalLaserAlphasRcd'),
00231                  tag = cms.string('EcalLaserAlphas_EB_sic1_btcp1_EE_sic1_btcp1'),
00232                  connect = cms.untracked.string('frontier://FrontierPrep/CMS_COND_ECAL')
00233                  ),
00234         #VPT aging
00235         cms.PSet(record = cms.string('EcalLinearCorrectionsRcd'),
00236                  tag = cms.string('EcalLinearCorrections_mc'),
00237                  connect = cms.untracked.string('frontier://FrontierPrep/CMS_COND_ECAL')
00238                  )
00239         )
00240                                     )
00241     return process
00242 
00243 
00244 def ecal_complete_aging_3000(process):
00245     process=ecal_complete_aging(process)
00246 
00247     if not hasattr(process.GlobalTag,'toGet'):
00248         process.GLobalTag.toGet=cms.VPSet()
00249     process.GlobalTag.toGet.extend( cms.VPSet(
00250         cms.PSet(record = cms.string("EcalPedestalsRcd"),
00251                  tag = cms.string("EcalPedestals_TL3000_IL5E34_mc"),
00252                  connect = cms.untracked.string("frontier://FrontierPrep/CMS_COND_ECAL")
00253                  ),
00254         ## laser D
00255         cms.PSet(record = cms.string("EcalLaserAPDPNRatiosRcd"),
00256                  tag = cms.string("EcalLaserAPDPNRatios_TL3000_IL5E34_v2_mc"),
00257                  connect = cms.untracked.string("frontier://FrontierPrep/CMS_COND_ECAL")
00258                  ),
00259         ## L1 trigger
00260         cms.PSet(record = cms.string("EcalTPGLinearizationConstRcd"),
00261                  tag = cms.string("EcalTPGLinearizationConst_TL3000_IL5E34_v2_mc"),
00262                  connect = cms.untracked.string("frontier://FrontierPrep/CMS_COND_ECAL")
00263                  ),
00264         cms.PSet(record = cms.string('EcalLaserAlphasRcd'),
00265                  tag = cms.string('EcalLaserAlphas_EB_sic1_btcp1_EE_sic1_btcp1'),
00266                  connect = cms.untracked.string('frontier://FrontierPrep/CMS_COND_ECAL')
00267                  ),
00268         #VPT aging
00269         cms.PSet(record = cms.string('EcalLinearCorrectionsRcd'),
00270                  tag = cms.string('EcalLinearCorrections_mc'),
00271                  connect = cms.untracked.string('frontier://FrontierPrep/CMS_COND_ECAL')
00272                  )
00273         )
00274                                     )
00275 
00276     return process
00277