File indexing completed on 2024-11-28 03:56:33
0001 import FWCore.ParameterSet.Config as cms
0002
0003
0004 def useExternalWeight(process, analyzerName, vWeightProducerTags):
0005 analyzer = getattr(process,analyzerName)
0006 if analyzer != None:
0007 print("Changing weight in "+analyzerName)
0008 analyzer.UseWeightFromHepMC = cms.bool(False)
0009 analyzer.genEventInfos = vWeightProducerTags
0010 setattr(process, analyzerName, analyzer)
0011
0012
0013 def useExternalWeightForValidation(process, vWeightProducerTags):
0014 useExternalWeight(process, "basicGenParticleValidation", vWeightProducerTags)
0015 useExternalWeight(process, "mbueAndqcdValidation", vWeightProducerTags)
0016 useExternalWeight(process, "basicHepMCValidation", vWeightProducerTags)
0017 useExternalWeight(process, "drellYanEleValidation", vWeightProducerTags)
0018 useExternalWeight(process, "drellYanMuoValidation", vWeightProducerTags)
0019 useExternalWeight(process, "wMinusEleValidation", vWeightProducerTags)
0020 useExternalWeight(process, "wPlusEleValidation", vWeightProducerTags)
0021 useExternalWeight(process, "wMinusMuoValidation", vWeightProducerTags)
0022 useExternalWeight(process, "wPlusMuoValidation", vWeightProducerTags)
0023 useExternalWeight(process, "tauValidation", vWeightProducerTags)
0024 useExternalWeight(process, "duplicationChecker", vWeightProducerTags)
0025
0026
0027 def switchGenSource(process, analyzerName, source):
0028 analyzer = getattr(process,analyzerName)
0029 if analyzer != None:
0030 print("Changing inputSource in "+analyzerName)
0031 analyzer.hepmcCollection = source
0032 setattr(process, analyzerName, analyzer)
0033
0034
0035 def switchGenSourceForValidation(process, source):
0036 process.genParticles.src = 'lhe2HepMCConverter'
0037 switchGenSource(process, "basicGenParticleValidation", source)
0038 switchGenSource(process, "mbueAndqcdValidation", source)
0039 switchGenSource(process, "basicHepMCValidation", source)
0040 switchGenSource(process, "drellYanEleValidation", source)
0041 switchGenSource(process, "drellYanMuoValidation", source)
0042 switchGenSource(process, "wMinusEleValidation", source)
0043 switchGenSource(process, "wPlusEleValidation", source)
0044 switchGenSource(process, "wMinusMuoValidation", source)
0045 switchGenSource(process, "wPlusMuoValidation", source)
0046 switchGenSource(process, "tauValidation", source)
0047 switchGenSource(process, "duplicationChecker", source)