Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-15 22:39:32

0001 import socket
0002 from CondCore.CondDB.CondDB_cfi import *
0003 '''Helper procedure that loads mva inputs from database'''
0004 
0005 CondDBTauConnection = CondDB.clone( connect = 'frontier://FrontierProd/CMS_CONDITIONS' )
0006 
0007 loadRecoTauTagMVAsFromPrepDB = cms.ESSource( "PoolDBESSource",
0008                                              CondDBTauConnection,
0009                                              globaltag        = cms.string( '' ),
0010                                              snapshotTime     = cms.string( '' ),
0011                                              toGet            = cms.VPSet(),   # hook to override or add single payloads
0012                                              DumpStat         = cms.untracked.bool( False ),
0013                                              ReconnectEachRun = cms.untracked.bool( False ),
0014                                              RefreshAlways    = cms.untracked.bool( False ),
0015                                              RefreshEachRun   = cms.untracked.bool( False ),
0016                                              RefreshOpenIOVs  = cms.untracked.bool( False ),
0017                                              pfnPostfix       = cms.untracked.string( '' ),
0018                                              pfnPrefix        = cms.untracked.string( '' ),
0019                                              )
0020 
0021 ####
0022 # define payloads names of tau ID (= isolation) discriminator MVA
0023 tauIdDiscrMVA_trainings = {
0024     'tauIdMVAoldDMwoLT' : "tauIdMVAoldDMwoLT",
0025     'tauIdMVAoldDMwLT'  : "tauIdMVAoldDMwLT",
0026     'tauIdMVAnewDMwoLT' : "tauIdMVAnewDMwoLT",
0027     'tauIdMVAnewDMwLT'  : "tauIdMVAnewDMwLT"
0028 }
0029 tauIdDiscrMVA_trainings_run2 = {
0030     'tauIdMVADBoldDMwLT' : "tauIdMVADBoldDMwLT",
0031     'tauIdMVADBnewDMwLT' : "tauIdMVADBnewDMwLT",
0032     'tauIdMVAPWoldDMwLT' : "tauIdMVAPWoldDMwLT",
0033     'tauIdMVAPWnewDMwLT' : "tauIdMVAPWnewDMwLT",
0034     'tauIdMVADBdR03oldDMwLT' : "tauIdMVADBdR03oldDMwLT",
0035     'tauIdMVAPWdR03oldDMwLT' : "tauIdMVAPWdR03oldDMwLT"
0036 }
0037 tauIdDiscrMVA_trainings_run2_2016 = {
0038     'tauIdMVAIsoDBoldDMwLT2016' : "tauIdMVAIsoDBoldDMwLT2016",
0039     'tauIdMVAIsoDBnewDMwLT2016' : "tauIdMVAIsoDBnewDMwLT2016"
0040 }
0041 tauIdDiscrMVA_trainings_run2_2017 = {
0042     'tauIdMVAIsoDBoldDMwLT2017' : "tauIdMVAIsoDBoldDMwLT2017",
0043     'tauIdMVAIsoDBnewDMwLT2017' : "tauIdMVAIsoDBnewDMwLT2017",
0044     'tauIdMVAIsoDBoldDMdR0p3wLT2017' : "tauIdMVAIsoDBoldDMdR0p3wLT2017",
0045 }
0046 tauIdDiscrMVA_trainings_phase2 = {
0047     'tauIdMVAIsoPhase2_v1' : "tauIdMVAIsoPhase2",
0048 }
0049 tauIdDiscrMVA_WPs = {
0050     'tauIdMVAoldDMwoLT' : {
0051         'Eff90' : "oldDMwoLTEff90",
0052         'Eff80' : "oldDMwoLTEff80",
0053         'Eff70' : "oldDMwoLTEff70",
0054         'Eff60' : "oldDMwoLTEff60",
0055         'Eff50' : "oldDMwoLTEff50",
0056         'Eff40' : "oldDMwoLTEff40"
0057     },
0058     'tauIdMVAoldDMwLT'  : {
0059         'Eff90' : "oldDMwLTEff90",
0060         'Eff80' : "oldDMwLTEff80",
0061         'Eff70' : "oldDMwLTEff70",
0062         'Eff60' : "oldDMwLTEff60",
0063         'Eff50' : "oldDMwLTEff50",
0064         'Eff40' : "oldDMwLTEff40"
0065     },
0066     'tauIdMVAnewDMwoLT' : {
0067         'Eff90' : "newDMwoLTEff90",
0068         'Eff80' : "newDMwoLTEff80",
0069         'Eff70' : "newDMwoLTEff70",
0070         'Eff60' : "newDMwoLTEff60",
0071         'Eff50' : "newDMwoLTEff50",
0072         'Eff40' : "newDMwoLTEff40"
0073     },
0074     'tauIdMVAnewDMwLT'  : {
0075         'Eff90' : "newDMwLTEff90",
0076         'Eff80' : "newDMwLTEff80",
0077         'Eff70' : "newDMwLTEff70",
0078         'Eff60' : "newDMwLTEff60",
0079         'Eff50' : "newDMwLTEff50",
0080         'Eff40' : "newDMwLTEff40"
0081     }
0082 }
0083 tauIdDiscrMVA_WPs_run2 = {
0084     'tauIdMVADBoldDMwLT' : {
0085         'Eff90' : "DBoldDMwLTEff90",
0086         'Eff80' : "DBoldDMwLTEff80",
0087         'Eff70' : "DBoldDMwLTEff70",
0088         'Eff60' : "DBoldDMwLTEff60",
0089         'Eff50' : "DBoldDMwLTEff50",
0090         'Eff40' : "DBoldDMwLTEff40"
0091     },
0092     'tauIdMVADBnewDMwLT'  : {
0093         'Eff90' : "DBnewDMwLTEff90",
0094         'Eff80' : "DBnewDMwLTEff80",
0095         'Eff70' : "DBnewDMwLTEff70",
0096         'Eff60' : "DBnewDMwLTEff60",
0097         'Eff50' : "DBnewDMwLTEff50",
0098         'Eff40' : "DBnewDMwLTEff40"
0099     },
0100     'tauIdMVAPWoldDMwLT' : {
0101         'Eff90' : "PWoldDMwLTEff90",
0102         'Eff80' : "PWoldDMwLTEff80",
0103         'Eff70' : "PWoldDMwLTEff70",
0104         'Eff60' : "PWoldDMwLTEff60",
0105         'Eff50' : "PWoldDMwLTEff50",
0106         'Eff40' : "PWoldDMwLTEff40"
0107     },
0108     'tauIdMVAPWnewDMwLT'  : {
0109         'Eff90' : "PWnewDMwLTEff90",
0110         'Eff80' : "PWnewDMwLTEff80",
0111         'Eff70' : "PWnewDMwLTEff70",
0112         'Eff60' : "PWnewDMwLTEff60",
0113         'Eff50' : "PWnewDMwLTEff50",
0114         'Eff40' : "PWnewDMwLTEff40"
0115     },
0116     'tauIdMVADBdR03oldDMwLT' : {
0117         'Eff90' : "DBdR03oldDMwLTEff90",
0118         'Eff80' : "DBdR03oldDMwLTEff80",
0119         'Eff70' : "DBdR03oldDMwLTEff70",
0120         'Eff60' : "DBdR03oldDMwLTEff60",
0121         'Eff50' : "DBdR03oldDMwLTEff50",
0122         'Eff40' : "DBdR03oldDMwLTEff40"
0123     },
0124     'tauIdMVAPWdR03oldDMwLT' : {
0125         'Eff90' : "PWdR03oldDMwLTEff90",
0126         'Eff80' : "PWdR03oldDMwLTEff80",
0127         'Eff70' : "PWdR03oldDMwLTEff70",
0128         'Eff60' : "PWdR03oldDMwLTEff60",
0129         'Eff50' : "PWdR03oldDMwLTEff50",
0130         'Eff40' : "PWdR03oldDMwLTEff40"
0131     }
0132 }
0133 tauIdDiscrMVA_WPs_run2_2016 = {
0134     'tauIdMVAIsoDBoldDMwLT2016' : {
0135     'Eff90' : "DBoldDMwLT2016Eff90",
0136     'Eff80' : "DBoldDMwLT2016Eff80",
0137     'Eff70' : "DBoldDMwLT2016Eff70",
0138     'Eff60' : "DBoldDMwLT2016Eff60",
0139     'Eff50' : "DBoldDMwLT2016Eff50",
0140     'Eff40' : "DBoldDMwLT2016Eff40"
0141     },
0142     'tauIdMVAIsoDBnewDMwLT2016' : {
0143     'Eff90' : "DBnewDMwLT2016Eff90",
0144     'Eff80' : "DBnewDMwLT2016Eff80",
0145     'Eff70' : "DBnewDMwLT2016Eff70",
0146     'Eff60' : "DBnewDMwLT2016Eff60",
0147     'Eff50' : "DBnewDMwLT2016Eff50",
0148     'Eff40' : "DBnewDMwLT2016Eff40"
0149     }
0150 }
0151 tauIdDiscrMVA_WPs_run2_2017 = {
0152     'tauIdMVAIsoDBoldDMwLT2017' : {
0153         'Eff95' : "DBoldDMwLTEff95",
0154         'Eff90' : "DBoldDMwLTEff90",
0155         'Eff80' : "DBoldDMwLTEff80",
0156         'Eff70' : "DBoldDMwLTEff70",
0157         'Eff60' : "DBoldDMwLTEff60",
0158         'Eff50' : "DBoldDMwLTEff50",
0159         'Eff40' : "DBoldDMwLTEff40"
0160     },
0161     'tauIdMVAIsoDBnewDMwLT2017' : {
0162         'Eff95' : "DBnewDMwLTEff95",
0163         'Eff90' : "DBnewDMwLTEff90",
0164         'Eff80' : "DBnewDMwLTEff80",
0165         'Eff70' : "DBnewDMwLTEff70",
0166         'Eff60' : "DBnewDMwLTEff60",
0167         'Eff50' : "DBnewDMwLTEff50",
0168         'Eff40' : "DBnewDMwLTEff40"
0169     },
0170     'tauIdMVAIsoDBoldDMdR0p3wLT2017' : {
0171         'Eff95' : "DBoldDMdR0p3wLTEff95",
0172         'Eff90' : "DBoldDMdR0p3wLTEff90",
0173         'Eff80' : "DBoldDMdR0p3wLTEff80",
0174         'Eff70' : "DBoldDMdR0p3wLTEff70",
0175         'Eff60' : "DBoldDMdR0p3wLTEff60",
0176         'Eff50' : "DBoldDMdR0p3wLTEff50",
0177         'Eff40' : "DBoldDMdR0p3wLTEff40"
0178     }
0179 }
0180 tauIdDiscrMVA_WPs_phase2 = {
0181     'tauIdMVAIsoPhase2_v1' : {
0182         'Eff95' : "Phase2Eff95",
0183         'Eff90' : "Phase2Eff90",
0184         'Eff80' : "Phase2Eff80",
0185         'Eff70' : "Phase2Eff70",
0186         'Eff60' : "Phase2Eff60",
0187         'Eff50' : "Phase2Eff50",
0188         'Eff40' : "Phase2Eff40"
0189     }
0190 }
0191 tauIdDiscrMVA_mvaOutput_normalizations = {
0192     'tauIdMVAoldDMwoLT' : "mvaOutput_normalization_oldDMwoLT",
0193     'tauIdMVAoldDMwLT'  : "mvaOutput_normalization_oldDMwLT",
0194     'tauIdMVAnewDMwoLT' : "mvaOutput_normalization_newDMwoLT",
0195     'tauIdMVAnewDMwLT'  : "mvaOutput_normalization_newDMwLT"
0196 }
0197 tauIdDiscrMVA_mvaOutput_normalizations_run2 = {
0198     'tauIdMVADBoldDMwLT' : "mvaOutput_normalization_DBoldDMwLT",
0199     'tauIdMVADBnewDMwLT' : "mvaOutput_normalization_DBnewDMwLT",
0200     'tauIdMVAPWoldDMwLT' : "mvaOutput_normalization_PWoldDMwLT",
0201     'tauIdMVAPWnewDMwLT' : "mvaOutput_normalization_PWnewDMwLT",
0202     'tauIdMVADBdR03oldDMwLT' : "mvaOutput_normalization_DBdR03oldDMwLT",
0203     'tauIdMVAPWdR03oldDMwLT' : "mvaOutput_normalization_PWdR03oldDMwLT"
0204 }
0205 tauIdDiscrMVA_mvaOutput_normalizations_run2_2016 = {
0206     'tauIdMVAIsoDBoldDMwLT2016' : "mvaOutput_normalization_DBoldDMwLT2016",
0207     'tauIdMVAIsoDBnewDMwLT2016' : "mvaOutput_normalization_DBnewDMwLT2016"
0208 }
0209 tauIdDiscrMVA_mvaOutput_normalizations_run2_2017 = {
0210     'tauIdMVAIsoDBoldDMwLT2017' : "mvaOutput_normalization",
0211     'tauIdMVAIsoDBnewDMwLT2017' : "mvaOutput_normalization",
0212     'tauIdMVAIsoDBoldDMdR0p3wLT2017' : "mvaOutput_normalization"
0213 }
0214 tauIdDiscrMVA_mvaOutput_normalizations_phase2 = {
0215     'tauIdMVAIsoPhase2_v1' : "mvaOutput_normalization",
0216 }
0217 
0218 '''
0219 # register the tau ID payloads
0220 tauIdDiscrMVA_version = "v1"
0221 for training, gbrForestName in tauIdDiscrMVA_trainings.items():
0222     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0223         cms.PSet(
0224             record = cms.string('GBRWrapperRcd'),
0225             tag = cms.string("RecoTauTag_%s%s" % (gbrForestName, tauIdDiscrMVA_version)),
0226             label = cms.untracked.string("RecoTauTag_%s%s" % (gbrForestName, tauIdDiscrMVA_version))
0227         )
0228     )
0229     for WP in tauIdDiscrMVA_WPs[training].keys():
0230         loadRecoTauTagMVAsFromPrepDB.toGet.append(
0231             cms.PSet(
0232                 record = cms.string('PhysicsTGraphPayloadRcd'),
0233                 tag = cms.string("RecoTauTag_%s%s_WP%s" % (gbrForestName, tauIdDiscrMVA_version, WP)),
0234                 label = cms.untracked.string("RecoTauTag_%s%s_WP%s" % (gbrForestName, tauIdDiscrMVA_version, WP))
0235             )
0236         )
0237     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0238         cms.PSet(
0239             record = cms.string('PhysicsTFormulaPayloadRcd'),
0240             tag = cms.string("RecoTauTag_%s%s_mvaOutput_normalization" % (gbrForestName, tauIdDiscrMVA_version)),
0241             label = cms.untracked.string("RecoTauTag_%s%s_mvaOutput_normalization" % (gbrForestName, tauIdDiscrMVA_version))
0242         )
0243     )
0244 for training, gbrForestName in tauIdDiscrMVA_trainings_run2.items():
0245     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0246         cms.PSet(
0247             record = cms.string('GBRWrapperRcd'),
0248             tag = cms.string("RecoTauTag_%s%s" % (gbrForestName, tauIdDiscrMVA_version)),
0249             label = cms.untracked.string("RecoTauTag_%s%s" % (gbrForestName, tauIdDiscrMVA_version))
0250         )
0251     )
0252     for WP in tauIdDiscrMVA_WPs_run2[training].keys():
0253         loadRecoTauTagMVAsFromPrepDB.toGet.append(
0254             cms.PSet(
0255                 record = cms.string('PhysicsTGraphPayloadRcd'),
0256                 tag = cms.string("RecoTauTag_%s%s_WP%s" % (gbrForestName, tauIdDiscrMVA_version, WP)),
0257                 label = cms.untracked.string("RecoTauTag_%s%s_WP%s" % (gbrForestName, tauIdDiscrMVA_version, WP))
0258             )
0259         )
0260     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0261         cms.PSet(
0262             record = cms.string('PhysicsTFormulaPayloadRcd'),
0263             tag = cms.string("RecoTauTag_%s%s_mvaOutput_normalization" % (gbrForestName, tauIdDiscrMVA_version)),
0264             label = cms.untracked.string("RecoTauTag_%s%s_mvaOutput_normalization" % (gbrForestName, tauIdDiscrMVA_version))
0265         )
0266     )
0267 # MVAIso 2016
0268 for training, gbrForestName in tauIdDiscrMVA_trainings_run2_2016.items():
0269     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0270     cms.PSet(
0271         record = cms.string('GBRWrapperRcd'),
0272         tag = cms.string("RecoTauTag_%s%s" % (gbrForestName, tauIdDiscrMVA_version)),
0273         label = cms.untracked.string("RecoTauTag_%s%s" % (gbrForestName, tauIdDiscrMVA_version))
0274     )
0275     )
0276     for WP in tauIdDiscrMVA_WPs_run2_2016[training].keys():
0277         loadRecoTauTagMVAsFromPrepDB.toGet.append(
0278         cms.PSet(
0279         record = cms.string('PhysicsTGraphPayloadRcd'),
0280         tag = cms.string("RecoTauTag_%s%s_WP%s" % (gbrForestName, tauIdDiscrMVA_version, WP)),
0281         label = cms.untracked.string("RecoTauTag_%s%s_WP%s" % (gbrForestName, tauIdDiscrMVA_version, WP))
0282         )
0283     )
0284     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0285     cms.PSet(
0286         record = cms.string('PhysicsTFormulaPayloadRcd'),
0287         tag = cms.string("RecoTauTag_%s%s_mvaOutput_normalization" % (gbrForestName, tauIdDiscrMVA_version)),
0288         label = cms.untracked.string("RecoTauTag_%s%s_mvaOutput_normalization" % (gbrForestName, tauIdDiscrMVA_version))
0289     )
0290     )
0291 # MVAIso 2017
0292 tauIdDiscrMVA_2017_version = ["v1","v2"]
0293 for ver2017 in tauIdDiscrMVA_2017_version:
0294     for training, gbrForestName in tauIdDiscrMVA_trainings_run2_2017.items():
0295         if ver2017=="v1" and (training.find("newDM")>-1 or training.find("dR0p3")>-1):
0296             continue #skip nonexistent trainings
0297         loadRecoTauTagMVAsFromPrepDB.toGet.append(
0298             cms.PSet(
0299                 record = cms.string('GBRWrapperRcd'),
0300                 tag = cms.string("RecoTauTag_%s%s" % (gbrForestName, ver2017)),
0301                 label = cms.untracked.string("RecoTauTag_%s%s" % (gbrForestName, ver2017))
0302             )
0303         )
0304         for WP in tauIdDiscrMVA_WPs_run2_2017[training].keys():
0305             loadRecoTauTagMVAsFromPrepDB.toGet.append(
0306                 cms.PSet(
0307                     record = cms.string('PhysicsTGraphPayloadRcd'),
0308                     tag = cms.string("RecoTauTag_%s%s_WP%s" % (gbrForestName, ver2017, WP)),
0309                     label = cms.untracked.string("RecoTauTag_%s%s_WP%s" % (gbrForestName, ver2017, WP))
0310                 )
0311             )
0312         loadRecoTauTagMVAsFromPrepDB.toGet.append(
0313             cms.PSet(
0314                 record = cms.string('PhysicsTFormulaPayloadRcd'),
0315                 tag = cms.string("RecoTauTag_%s%s_mvaOutput_normalization" % (gbrForestName, ver2017)),
0316                 label = cms.untracked.string("RecoTauTag_%s%s_mvaOutput_normalization" % (gbrForestName, ver2017))
0317         )
0318         )
0319 
0320 # MVAIso Phase2
0321 for training, gbrForestName in tauIdDiscrMVA_trainings_phase2.items():
0322     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0323         cms.PSet(
0324             record = cms.string('GBRWrapperRcd'),
0325             tag = cms.string("RecoTauTag_%s" % (gbrForestName)),
0326             label = cms.untracked.string("RecoTauTag_%s" % (training))
0327         )
0328     )
0329     for WP in tauIdDiscrMVA_WPs_phase2[training].keys():
0330         loadRecoTauTagMVAsFromPrepDB.toGet.append(
0331             cms.PSet(
0332                 record = cms.string('PhysicsTGraphPayloadRcd'),
0333                 tag = cms.string("RecoTauTag_%s_WP%s" % (gbrForestName, WP)),
0334                 label = cms.untracked.string("RecoTauTag_%s_WP%s" % (training, WP))
0335             )
0336          )
0337     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0338         cms.PSet(
0339             record = cms.string('PhysicsTFormulaPayloadRcd'),
0340             tag = cms.string("RecoTauTag_%s_mvaOutput_normalization" % (gbrForestName)),
0341             label = cms.untracked.string("RecoTauTag_%s_mvaOutput_normalization" % (training))
0342        )
0343     )
0344 '''
0345 
0346 ####
0347 ## define payloads of anti-electron discriminator MVA
0348 # MVA5
0349 antiElectronDiscrMVA5_categories = {
0350      '0' : "gbr_NoEleMatch_woGwoGSF_BL",
0351      '1' : "gbr_NoEleMatch_woGwGSF_BL",
0352      '2' : "gbr_NoEleMatch_wGwoGSF_BL",
0353      '3' : "gbr_NoEleMatch_wGwGSF_BL",
0354      '4' : "gbr_woGwoGSF_BL",
0355      '5' : "gbr_woGwGSF_BL",
0356      '6' : "gbr_wGwoGSF_BL",
0357      '7' : "gbr_wGwGSF_BL",
0358      '8' : "gbr_NoEleMatch_woGwoGSF_EC",
0359      '9' : "gbr_NoEleMatch_woGwGSF_EC",
0360     '10' : "gbr_NoEleMatch_wGwoGSF_EC",
0361     '11' : "gbr_NoEleMatch_wGwGSF_EC",
0362     '12' : "gbr_woGwoGSF_EC",
0363     '13' : "gbr_woGwGSF_EC",
0364     '14' : "gbr_wGwoGSF_EC",
0365     '15' : "gbr_wGwGSF_EC"
0366 }
0367 antiElectronDiscrMVA5_WPs = [ "eff99", "eff96", "eff91", "eff85", "eff79" ]
0368 antiElectronDiscrMVA5_version = "v1"
0369 '''
0370 # ...and register
0371 for category, gbrForestName in antiElectronDiscrMVA5_categories.items():
0372     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0373         cms.PSet(
0374             record = cms.string('GBRWrapperRcd'),
0375             tag = cms.string("RecoTauTag_antiElectronMVA5%s_%s" % (antiElectronDiscrMVA5_version, gbrForestName)),
0376             label = cms.untracked.string("RecoTauTag_antiElectronMVA5%s_%s" % (antiElectronDiscrMVA5_version, gbrForestName))
0377         )
0378     )
0379     for WP in antiElectronDiscrMVA5_WPs:
0380         loadRecoTauTagMVAsFromPrepDB.toGet.append(
0381             cms.PSet(
0382                 record = cms.string('PhysicsTGraphPayloadRcd'),
0383                 tag = cms.string("RecoTauTag_antiElectronMVA5%s_%s_WP%s" % (antiElectronDiscrMVA5_version, gbrForestName, WP)),
0384                 label = cms.untracked.string("RecoTauTag_antiElectronMVA5%s_%s_WP%s" % (antiElectronDiscrMVA5_version, gbrForestName, WP))
0385             )
0386         )
0387 '''
0388 
0389 # MVA6v1
0390 antiElectronDiscrMVA6_categories = {
0391      '0' : "gbr_NoEleMatch_woGwoGSF_BL",
0392      '2' : "gbr_NoEleMatch_wGwoGSF_BL",
0393      '5' : "gbr_woGwGSF_BL",
0394      '7' : "gbr_wGwGSF_BL",
0395      '8' : "gbr_NoEleMatch_woGwoGSF_EC",
0396     '10' : "gbr_NoEleMatch_wGwoGSF_EC",
0397     '13' : "gbr_woGwGSF_EC",
0398     '15' : "gbr_wGwGSF_EC"
0399 }
0400 antiElectronDiscrMVA6_WPs = [ "Eff99", "Eff96", "Eff91", "Eff85", "Eff79" ]
0401 antiElectronDiscrMVA6_version = "v1"
0402 '''
0403 # ...and register
0404 for category, gbrForestName in antiElectronDiscrMVA6_categories.items():
0405     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0406         cms.PSet(
0407             record = cms.string('GBRWrapperRcd'),
0408             tag = cms.string("RecoTauTag_antiElectronMVA6%s_%s" % (antiElectronDiscrMVA6_version, gbrForestName)),
0409             label = cms.untracked.string("RecoTauTag_antiElectronMVA6%s_%s" % (antiElectronDiscrMVA6_version, gbrForestName))
0410         )
0411     )
0412     for WP in antiElectronDiscrMVA6_WPs:
0413         loadRecoTauTagMVAsFromPrepDB.toGet.append(
0414             cms.PSet(
0415                 record = cms.string('PhysicsTGraphPayloadRcd'),
0416                 tag = cms.string("RecoTauTag_antiElectronMVA6%s_%s_WP%s" % (antiElectronDiscrMVA6_version, gbrForestName, WP)),
0417                 label = cms.untracked.string("RecoTauTag_antiElectronMVA6%s_%s_WP%s" % (antiElectronDiscrMVA6_version, gbrForestName, WP))
0418             )
0419         )
0420 '''
0421 
0422 # MVA6v3
0423 # MB: categories as in MVA6v1
0424 antiElectronDiscrMVA6_2017_WPs = [ "eff98", "eff90", "eff80", "eff70", "eff60" ]
0425 antiElectronDiscrMVA6_2017_version = "v3_noeveto"
0426 '''
0427 # ...and register
0428 for category, gbrForestName in antiElectronDiscrMVA6_categories.items():
0429     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0430         cms.PSet(
0431             record = cms.string('GBRWrapperRcd'),
0432             tag = cms.string("RecoTauTag_antiElectronMVA6%s_%s" % (antiElectronDiscrMVA6_2017_version, gbrForestName)),
0433             label = cms.untracked.string("RecoTauTag_antiElectronMVA6%s_%s" % (antiElectronDiscrMVA6_2017_version, gbrForestName))
0434         )
0435     )
0436     for WP in antiElectronDiscrMVA6_2017_WPs:
0437         loadRecoTauTagMVAsFromPrepDB.toGet.append(
0438             cms.PSet(
0439                 record = cms.string('PhysicsTGraphPayloadRcd'),
0440                 tag = cms.string("RecoTauTag_antiElectronMVA6%s_%s_WP%s" % (antiElectronDiscrMVA6_2017_version, gbrForestName, WP)),
0441                 label = cms.untracked.string("RecoTauTag_antiElectronMVA6%s_%s_WP%s" % (antiElectronDiscrMVA6_2017_version, gbrForestName, WP))
0442             )
0443         )
0444 '''
0445 
0446 # MVA6 phase2
0447 antiElectronDiscrMVA_phase2_categories = {
0448      '0' : "gbr_NoEleMatch_woGwoGSF_BL",
0449      '2' : "gbr_NoEleMatch_wGwoGSF_BL",
0450      '5' : "gbr_woGwGSF_BL",
0451      '7' : "gbr_wGwGSF_BL",
0452      '8' : "gbr_NoEleMatch_woGwoGSF_FWEC",
0453      '9' : "gbr_NoEleMatch_woGwoGSF_VFWEC",
0454     '10' : "gbr_NoEleMatch_wGwoGSF_FWEC",
0455     '11' : "gbr_NoEleMatch_wGwoGSF_VFWEC",
0456     '13' : "gbr_woGwGSF_FWEC",
0457     '14' : "gbr_woGwGSF_VFWEC",
0458     '15' : "gbr_wGwGSF_FWEC",
0459     '16' : "gbr_wGwGSF_VFWEC"
0460 }
0461 antiElectronDiscrMVA_phase2_WPs = [ "Eff98", "Eff90", "Eff80", "Eff70", "Eff60" ]
0462 antiElectronDiscrMVA_phase2_version = "v1"
0463 '''
0464 # ...and register
0465 for category, gbrForestName in antiElectronDiscrMVA_phase2_categories.items():
0466     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0467         cms.PSet(
0468             record = cms.string('GBRWrapperRcd'),
0469             tag = cms.string("RecoTauTag_antiElectronPhase2MVA6%s_%s" % (antiElectronDiscrMVA_phase2_version, gbrForestName)),
0470             label = cms.untracked.string("RecoTauTag_antiElectronPhase2MVA6%s_%s" % (antiElectronDiscrMVA_phase2_version, gbrForestName))
0471         )
0472     )
0473     for WP in antiElectronDiscrMVA_phase2_WPs:
0474         loadRecoTauTagMVAsFromPrepDB.toGet.append(
0475             cms.PSet(
0476                 record = cms.string('PhysicsTGraphPayloadRcd'),
0477                 tag = cms.string("RecoTauTag_antiElectronPhase2MVA6%s_%s_WP%s" % (antiElectronDiscrMVA_phase2_version, gbrForestName, WP)),
0478                 label = cms.untracked.string("RecoTauTag_antiElectronPhase2MVA6%s_%s_WP%s" % (antiElectronDiscrMVA_phase2_version, gbrForestName, WP))
0479             )
0480         )
0481 '''
0482 
0483 ####
0484 # define payloads of anti-muon discriminator MVA
0485 antiMuonDiscrMVA_WPs = [ "eff99_5", "eff99_0", "eff98_0" ]
0486 antiMuonDiscrMVA_version = "v1"
0487 gbrForestName = "againstMuonMVA"
0488 '''
0489 # ...and register
0490 loadRecoTauTagMVAsFromPrepDB.toGet.append(
0491     cms.PSet(
0492         record = cms.string('GBRWrapperRcd'),
0493         tag = cms.string("RecoTauTag_%s%s" % (gbrForestName, antiMuonDiscrMVA_version)),
0494         label = cms.untracked.string("RecoTauTag_%s%s" % (gbrForestName, antiMuonDiscrMVA_version))
0495     )
0496 )
0497 for WP in antiMuonDiscrMVA_WPs:
0498     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0499         cms.PSet(
0500             record = cms.string('PhysicsTGraphPayloadRcd'),
0501             tag = cms.string("RecoTauTag_%s%s_WP%s" % (gbrForestName, antiMuonDiscrMVA_version, WP)),
0502             label = cms.untracked.string("RecoTauTag_%s%s_WP%s" % (gbrForestName, antiMuonDiscrMVA_version, WP))
0503         )
0504     )
0505 loadRecoTauTagMVAsFromPrepDB.toGet.append(
0506     cms.PSet(
0507         record = cms.string('PhysicsTFormulaPayloadRcd'),
0508         tag = cms.string("RecoTauTag_%s%s_mvaOutput_normalization" % (gbrForestName, antiMuonDiscrMVA_version)),
0509         label = cms.untracked.string("RecoTauTag_%s%s_mvaOutput_normalization" % (gbrForestName, antiMuonDiscrMVA_version))
0510     )
0511 )
0512 '''