Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:26:57

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 # register 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 tauIdDiscrMVA_version = "v1"
0219 for training, gbrForestName in tauIdDiscrMVA_trainings.items():
0220     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0221         cms.PSet(
0222             record = cms.string('GBRWrapperRcd'),
0223             tag = cms.string("RecoTauTag_%s%s" % (gbrForestName, tauIdDiscrMVA_version)),
0224             label = cms.untracked.string("RecoTauTag_%s%s" % (gbrForestName, tauIdDiscrMVA_version))
0225         )
0226     )
0227     for WP in tauIdDiscrMVA_WPs[training].keys():
0228         loadRecoTauTagMVAsFromPrepDB.toGet.append(
0229             cms.PSet(
0230                 record = cms.string('PhysicsTGraphPayloadRcd'),
0231                 tag = cms.string("RecoTauTag_%s%s_WP%s" % (gbrForestName, tauIdDiscrMVA_version, WP)),
0232                 label = cms.untracked.string("RecoTauTag_%s%s_WP%s" % (gbrForestName, tauIdDiscrMVA_version, WP))
0233             )
0234         )
0235     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0236         cms.PSet(
0237             record = cms.string('PhysicsTFormulaPayloadRcd'),
0238             tag = cms.string("RecoTauTag_%s%s_mvaOutput_normalization" % (gbrForestName, tauIdDiscrMVA_version)),
0239             label = cms.untracked.string("RecoTauTag_%s%s_mvaOutput_normalization" % (gbrForestName, tauIdDiscrMVA_version))
0240         )
0241     )
0242 for training, gbrForestName in tauIdDiscrMVA_trainings_run2.items():
0243     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0244         cms.PSet(
0245             record = cms.string('GBRWrapperRcd'),
0246             tag = cms.string("RecoTauTag_%s%s" % (gbrForestName, tauIdDiscrMVA_version)),
0247             label = cms.untracked.string("RecoTauTag_%s%s" % (gbrForestName, tauIdDiscrMVA_version))
0248         )
0249     )
0250     for WP in tauIdDiscrMVA_WPs_run2[training].keys():
0251         loadRecoTauTagMVAsFromPrepDB.toGet.append(
0252             cms.PSet(
0253                 record = cms.string('PhysicsTGraphPayloadRcd'),
0254                 tag = cms.string("RecoTauTag_%s%s_WP%s" % (gbrForestName, tauIdDiscrMVA_version, WP)),
0255                 label = cms.untracked.string("RecoTauTag_%s%s_WP%s" % (gbrForestName, tauIdDiscrMVA_version, WP))
0256             )
0257         )
0258     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0259         cms.PSet(
0260             record = cms.string('PhysicsTFormulaPayloadRcd'),
0261             tag = cms.string("RecoTauTag_%s%s_mvaOutput_normalization" % (gbrForestName, tauIdDiscrMVA_version)),
0262             label = cms.untracked.string("RecoTauTag_%s%s_mvaOutput_normalization" % (gbrForestName, tauIdDiscrMVA_version))
0263         )
0264     )
0265 # MVAIso 2016
0266 for training, gbrForestName in tauIdDiscrMVA_trainings_run2_2016.items():
0267     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0268     cms.PSet(
0269         record = cms.string('GBRWrapperRcd'),
0270         tag = cms.string("RecoTauTag_%s%s" % (gbrForestName, tauIdDiscrMVA_version)),
0271         label = cms.untracked.string("RecoTauTag_%s%s" % (gbrForestName, tauIdDiscrMVA_version))
0272     )
0273     )
0274     for WP in tauIdDiscrMVA_WPs_run2_2016[training].keys():
0275         loadRecoTauTagMVAsFromPrepDB.toGet.append(
0276         cms.PSet(
0277         record = cms.string('PhysicsTGraphPayloadRcd'),
0278         tag = cms.string("RecoTauTag_%s%s_WP%s" % (gbrForestName, tauIdDiscrMVA_version, WP)),
0279         label = cms.untracked.string("RecoTauTag_%s%s_WP%s" % (gbrForestName, tauIdDiscrMVA_version, WP))
0280         )
0281     )
0282     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0283     cms.PSet(
0284         record = cms.string('PhysicsTFormulaPayloadRcd'),
0285         tag = cms.string("RecoTauTag_%s%s_mvaOutput_normalization" % (gbrForestName, tauIdDiscrMVA_version)),
0286         label = cms.untracked.string("RecoTauTag_%s%s_mvaOutput_normalization" % (gbrForestName, tauIdDiscrMVA_version))
0287     )
0288     )
0289 # MVAIso 2017
0290 tauIdDiscrMVA_2017_version = ["v1","v2"]
0291 for ver2017 in tauIdDiscrMVA_2017_version:
0292     for training, gbrForestName in tauIdDiscrMVA_trainings_run2_2017.items():
0293         if ver2017=="v1" and (training.find("newDM")>-1 or training.find("dR0p3")>-1):
0294             continue #skip nonexistent trainings
0295         loadRecoTauTagMVAsFromPrepDB.toGet.append(
0296             cms.PSet(
0297                 record = cms.string('GBRWrapperRcd'),
0298                 tag = cms.string("RecoTauTag_%s%s" % (gbrForestName, ver2017)),
0299                 label = cms.untracked.string("RecoTauTag_%s%s" % (gbrForestName, ver2017))
0300             )
0301         )
0302         for WP in tauIdDiscrMVA_WPs_run2_2017[training].keys():
0303             loadRecoTauTagMVAsFromPrepDB.toGet.append(
0304                 cms.PSet(
0305                     record = cms.string('PhysicsTGraphPayloadRcd'),
0306                     tag = cms.string("RecoTauTag_%s%s_WP%s" % (gbrForestName, ver2017, WP)),
0307                     label = cms.untracked.string("RecoTauTag_%s%s_WP%s" % (gbrForestName, ver2017, WP))
0308                 )
0309             )
0310         loadRecoTauTagMVAsFromPrepDB.toGet.append(
0311             cms.PSet(
0312                 record = cms.string('PhysicsTFormulaPayloadRcd'),
0313                 tag = cms.string("RecoTauTag_%s%s_mvaOutput_normalization" % (gbrForestName, ver2017)),
0314                 label = cms.untracked.string("RecoTauTag_%s%s_mvaOutput_normalization" % (gbrForestName, ver2017))
0315         )
0316         )
0317 
0318 # MVAIso Phase2
0319 for training, gbrForestName in tauIdDiscrMVA_trainings_phase2.items():
0320     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0321         cms.PSet(
0322             record = cms.string('GBRWrapperRcd'),
0323             tag = cms.string("RecoTauTag_%s" % (gbrForestName)),
0324             label = cms.untracked.string("RecoTauTag_%s" % (training))
0325         )
0326     )
0327     for WP in tauIdDiscrMVA_WPs_phase2[training].keys():
0328         loadRecoTauTagMVAsFromPrepDB.toGet.append(
0329             cms.PSet(
0330                 record = cms.string('PhysicsTGraphPayloadRcd'),
0331                 tag = cms.string("RecoTauTag_%s_WP%s" % (gbrForestName, WP)),
0332                 label = cms.untracked.string("RecoTauTag_%s_WP%s" % (training, WP))
0333             )
0334          )
0335     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0336         cms.PSet(
0337             record = cms.string('PhysicsTFormulaPayloadRcd'),
0338             tag = cms.string("RecoTauTag_%s_mvaOutput_normalization" % (gbrForestName)),
0339             label = cms.untracked.string("RecoTauTag_%s_mvaOutput_normalization" % (training))
0340        )
0341     )
0342 
0343 ####
0344 ## register anti-electron discriminator MVA
0345 # MVA5
0346 antiElectronDiscrMVA5_categories = {
0347      '0' : "gbr_NoEleMatch_woGwoGSF_BL",
0348      '1' : "gbr_NoEleMatch_woGwGSF_BL",
0349      '2' : "gbr_NoEleMatch_wGwoGSF_BL",
0350      '3' : "gbr_NoEleMatch_wGwGSF_BL",
0351      '4' : "gbr_woGwoGSF_BL",
0352      '5' : "gbr_woGwGSF_BL",
0353      '6' : "gbr_wGwoGSF_BL",
0354      '7' : "gbr_wGwGSF_BL",
0355      '8' : "gbr_NoEleMatch_woGwoGSF_EC",
0356      '9' : "gbr_NoEleMatch_woGwGSF_EC",
0357     '10' : "gbr_NoEleMatch_wGwoGSF_EC",
0358     '11' : "gbr_NoEleMatch_wGwGSF_EC",
0359     '12' : "gbr_woGwoGSF_EC",
0360     '13' : "gbr_woGwGSF_EC",
0361     '14' : "gbr_wGwoGSF_EC",
0362     '15' : "gbr_wGwGSF_EC"
0363 }
0364 antiElectronDiscrMVA5_WPs = [ "eff99", "eff96", "eff91", "eff85", "eff79" ]
0365 antiElectronDiscrMVA5_version = "v1"
0366 for category, gbrForestName in antiElectronDiscrMVA5_categories.items():
0367     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0368         cms.PSet(
0369             record = cms.string('GBRWrapperRcd'),
0370             tag = cms.string("RecoTauTag_antiElectronMVA5%s_%s" % (antiElectronDiscrMVA5_version, gbrForestName)),
0371             label = cms.untracked.string("RecoTauTag_antiElectronMVA5%s_%s" % (antiElectronDiscrMVA5_version, gbrForestName))
0372         )
0373     )
0374     for WP in antiElectronDiscrMVA5_WPs:
0375         loadRecoTauTagMVAsFromPrepDB.toGet.append(
0376             cms.PSet(
0377                 record = cms.string('PhysicsTGraphPayloadRcd'),
0378                 tag = cms.string("RecoTauTag_antiElectronMVA5%s_%s_WP%s" % (antiElectronDiscrMVA5_version, gbrForestName, WP)),
0379                 label = cms.untracked.string("RecoTauTag_antiElectronMVA5%s_%s_WP%s" % (antiElectronDiscrMVA5_version, gbrForestName, WP))
0380             )
0381         )
0382 
0383 # MVA6v1
0384 antiElectronDiscrMVA6_categories = {
0385      '0' : "gbr_NoEleMatch_woGwoGSF_BL",
0386      '2' : "gbr_NoEleMatch_wGwoGSF_BL",
0387      '5' : "gbr_woGwGSF_BL",
0388      '7' : "gbr_wGwGSF_BL",
0389      '8' : "gbr_NoEleMatch_woGwoGSF_EC",
0390     '10' : "gbr_NoEleMatch_wGwoGSF_EC",
0391     '13' : "gbr_woGwGSF_EC",
0392     '15' : "gbr_wGwGSF_EC"
0393 }
0394 antiElectronDiscrMVA6_WPs = [ "Eff99", "Eff96", "Eff91", "Eff85", "Eff79" ]
0395 antiElectronDiscrMVA6_version = "v1"
0396 for category, gbrForestName in antiElectronDiscrMVA6_categories.items():
0397     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0398         cms.PSet(
0399             record = cms.string('GBRWrapperRcd'),
0400             tag = cms.string("RecoTauTag_antiElectronMVA6%s_%s" % (antiElectronDiscrMVA6_version, gbrForestName)),
0401             label = cms.untracked.string("RecoTauTag_antiElectronMVA6%s_%s" % (antiElectronDiscrMVA6_version, gbrForestName))
0402         )
0403     )
0404     for WP in antiElectronDiscrMVA6_WPs:
0405         loadRecoTauTagMVAsFromPrepDB.toGet.append(
0406             cms.PSet(
0407                 record = cms.string('PhysicsTGraphPayloadRcd'),
0408                 tag = cms.string("RecoTauTag_antiElectronMVA6%s_%s_WP%s" % (antiElectronDiscrMVA6_version, gbrForestName, WP)),
0409                 label = cms.untracked.string("RecoTauTag_antiElectronMVA6%s_%s_WP%s" % (antiElectronDiscrMVA6_version, gbrForestName, WP))
0410             )
0411         )
0412 # MVA6v3
0413 # MB: categories as in MVA6v1
0414 antiElectronDiscrMVA6_2017_WPs = [ "eff98", "eff90", "eff80", "eff70", "eff60" ]
0415 antiElectronDiscrMVA6_2017_version = "v3_noeveto"
0416 for category, gbrForestName in antiElectronDiscrMVA6_categories.items():
0417     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0418         cms.PSet(
0419             record = cms.string('GBRWrapperRcd'),
0420             tag = cms.string("RecoTauTag_antiElectronMVA6%s_%s" % (antiElectronDiscrMVA6_2017_version, gbrForestName)),
0421             label = cms.untracked.string("RecoTauTag_antiElectronMVA6%s_%s" % (antiElectronDiscrMVA6_2017_version, gbrForestName))
0422         )
0423     )
0424     for WP in antiElectronDiscrMVA6_2017_WPs:
0425         loadRecoTauTagMVAsFromPrepDB.toGet.append(
0426             cms.PSet(
0427                 record = cms.string('PhysicsTGraphPayloadRcd'),
0428                 tag = cms.string("RecoTauTag_antiElectronMVA6%s_%s_WP%s" % (antiElectronDiscrMVA6_2017_version, gbrForestName, WP)),
0429                 label = cms.untracked.string("RecoTauTag_antiElectronMVA6%s_%s_WP%s" % (antiElectronDiscrMVA6_2017_version, gbrForestName, WP))
0430             )
0431         )
0432 
0433 # MVA6 phase2
0434 antiElectronDiscrMVA_phase2_categories = {
0435      '0' : "gbr_NoEleMatch_woGwoGSF_BL",
0436      '2' : "gbr_NoEleMatch_wGwoGSF_BL",
0437      '5' : "gbr_woGwGSF_BL",
0438      '7' : "gbr_wGwGSF_BL",
0439      '8' : "gbr_NoEleMatch_woGwoGSF_FWEC",
0440      '9' : "gbr_NoEleMatch_woGwoGSF_VFWEC",
0441     '10' : "gbr_NoEleMatch_wGwoGSF_FWEC",
0442     '11' : "gbr_NoEleMatch_wGwoGSF_VFWEC",
0443     '13' : "gbr_woGwGSF_FWEC",
0444     '14' : "gbr_woGwGSF_VFWEC",
0445     '15' : "gbr_wGwGSF_FWEC",
0446     '16' : "gbr_wGwGSF_VFWEC"
0447 }
0448 antiElectronDiscrMVA_phase2_WPs = [ "Eff98", "Eff90", "Eff80", "Eff70", "Eff60" ]
0449 antiElectronDiscrMVA_phase2_version = "v1"
0450 for category, gbrForestName in antiElectronDiscrMVA_phase2_categories.items():
0451     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0452         cms.PSet(
0453             record = cms.string('GBRWrapperRcd'),
0454             tag = cms.string("RecoTauTag_antiElectronPhase2MVA6%s_%s" % (antiElectronDiscrMVA_phase2_version, gbrForestName)),
0455             label = cms.untracked.string("RecoTauTag_antiElectronPhase2MVA6%s_%s" % (antiElectronDiscrMVA_phase2_version, gbrForestName))
0456         )
0457     )
0458     for WP in antiElectronDiscrMVA_phase2_WPs:
0459         loadRecoTauTagMVAsFromPrepDB.toGet.append(
0460             cms.PSet(
0461                 record = cms.string('PhysicsTGraphPayloadRcd'),
0462                 tag = cms.string("RecoTauTag_antiElectronPhase2MVA6%s_%s_WP%s" % (antiElectronDiscrMVA_phase2_version, gbrForestName, WP)),
0463                 label = cms.untracked.string("RecoTauTag_antiElectronPhase2MVA6%s_%s_WP%s" % (antiElectronDiscrMVA_phase2_version, gbrForestName, WP))
0464             )
0465         )
0466 
0467 ####
0468 # register anti-muon discriminator MVA
0469 antiMuonDiscrMVA_WPs = [ "eff99_5", "eff99_0", "eff98_0" ]
0470 antiMuonDiscrMVA_version = "v1"
0471 gbrForestName = "againstMuonMVA"
0472 loadRecoTauTagMVAsFromPrepDB.toGet.append(
0473     cms.PSet(
0474         record = cms.string('GBRWrapperRcd'),
0475         tag = cms.string("RecoTauTag_%s%s" % (gbrForestName, antiMuonDiscrMVA_version)),
0476         label = cms.untracked.string("RecoTauTag_%s%s" % (gbrForestName, antiMuonDiscrMVA_version))
0477     )
0478 )
0479 for WP in antiMuonDiscrMVA_WPs:
0480     loadRecoTauTagMVAsFromPrepDB.toGet.append(
0481         cms.PSet(
0482             record = cms.string('PhysicsTGraphPayloadRcd'),
0483             tag = cms.string("RecoTauTag_%s%s_WP%s" % (gbrForestName, antiMuonDiscrMVA_version, WP)),
0484             label = cms.untracked.string("RecoTauTag_%s%s_WP%s" % (gbrForestName, antiMuonDiscrMVA_version, WP))
0485         )
0486     )
0487 loadRecoTauTagMVAsFromPrepDB.toGet.append(
0488     cms.PSet(
0489         record = cms.string('PhysicsTFormulaPayloadRcd'),
0490         tag = cms.string("RecoTauTag_%s%s_mvaOutput_normalization" % (gbrForestName, antiMuonDiscrMVA_version)),
0491         label = cms.untracked.string("RecoTauTag_%s%s_mvaOutput_normalization" % (gbrForestName, antiMuonDiscrMVA_version))
0492     )
0493 )