Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:08

0001 from PhysicsTools.SelectorUtils.centralIDRegistry import central_id_registry
0002 from RecoEgamma.ElectronIdentification.Identification.mvaElectronID_tools import *
0003 import FWCore.ParameterSet.Config as cms
0004 
0005 #
0006 # In this file we define the locations of the MVA weights, cuts on the MVA values
0007 # for specific working points, and configure those cuts in VID
0008 #
0009 
0010 #
0011 # The following MVA is derived for 25ns Spring15 MC samples for non-triggering electrons.
0012 # See more documentation in this presentation (P.Pigard):
0013 #     https://indico.cern.ch/event/370506/contribution/1/attachments/1135340/1624370/20150726_EID_POG_circulating_vAsPresentedC.pdf
0014 #
0015 
0016 # The tag is an extra string attached to the names of the products
0017 # such as ValueMaps that needs to distinguish cases when the same MVA estimator
0018 # class is used with different tuning/weights
0019 mvaTag = "Spring15NonTrig25nsV1"
0020 
0021 # There are 6 categories in this MVA. They have to be configured in this strict order
0022 # (cuts and weight files order):
0023 #   0   EB1 (eta<0.8)  pt 5-10 GeV
0024 #   1   EB2 (eta>=0.8) pt 5-10 GeV
0025 #   2   EE             pt 5-10 GeV
0026 #   3   EB1 (eta<0.8)  pt 10-inf GeV
0027 #   4   EB2 (eta>=0.8) pt 10-inf GeV
0028 #   5   EE             pt 10-inf GeV
0029 
0030 mvaSpring15NonTrigWeightFiles_V1 = cms.vstring(
0031     "RecoEgamma/ElectronIdentification/data/Spring15/EIDmva_EB1_5_oldNonTrigSpring15_ConvVarCwoBoolean_TMVA412_FullStatLowPt_PairNegWeightsGlobal_BDT.weights.xml.gz",
0032     "RecoEgamma/ElectronIdentification/data/Spring15/EIDmva_EB2_5_oldNonTrigSpring15_ConvVarCwoBoolean_TMVA412_FullStatLowPt_PairNegWeightsGlobal_BDT.weights.xml.gz",
0033     "RecoEgamma/ElectronIdentification/data/Spring15/EIDmva_EE_5_oldNonTrigSpring15_ConvVarCwoBoolean_TMVA412_FullStatLowPt_PairNegWeightsGlobal_BDT.weights.xml.gz",
0034     "RecoEgamma/ElectronIdentification/data/Spring15/EIDmva_EB1_10_oldNonTrigSpring15_ConvVarCwoBoolean_TMVA412_FullStatLowPt_PairNegWeightsGlobal_BDT.weights.xml.gz",
0035     "RecoEgamma/ElectronIdentification/data/Spring15/EIDmva_EB2_10_oldNonTrigSpring15_ConvVarCwoBoolean_TMVA412_FullStatLowPt_PairNegWeightsGlobal_BDT.weights.xml.gz",
0036     "RecoEgamma/ElectronIdentification/data/Spring15/EIDmva_EE_10_oldNonTrigSpring15_ConvVarCwoBoolean_TMVA412_FullStatLowPt_PairNegWeightsGlobal_BDT.weights.xml.gz"
0037     )
0038 
0039 # The working point for this MVA that is expected to have about 90% signal
0040 # efficiency in each category
0041 idName90 = "mvaEleID-Spring15-25ns-nonTrig-V1-wp90"
0042 MVA_WP90 = EleMVA_WP(
0043     idName = idName90, mvaTag = mvaTag,
0044     cutCategory0 = "-0.083313", # EB1 low pt
0045     cutCategory1 = "-0.235222", # EB2 low pt
0046     cutCategory2 = "-0.67099", # EE low pt 
0047     cutCategory3 = " 0.913286", # EB1       
0048     cutCategory4 = " 0.805013", # EB2       
0049     cutCategory5 = " 0.358969"  # EE        
0050     )
0051 
0052 idName80 = "mvaEleID-Spring15-25ns-nonTrig-V1-wp80"
0053 MVA_WP80 = EleMVA_WP(
0054     idName = idName80, mvaTag = mvaTag,
0055     cutCategory0 = " 0.287435", # EB1 low pt
0056     cutCategory1 = " 0.221846", # EB2 low pt
0057     cutCategory2 = "-0.303263", # EE low pt 
0058     cutCategory3 = " 0.967083", # EB1       
0059     cutCategory4 = " 0.929117", # EB2       
0060     cutCategory5 = " 0.726311"  # EE        
0061     )
0062 
0063 ### WP tuned for HZZ analysis with very high efficiency (about 98%)
0064 idNameLoose = "mvaEleID-Spring15-25ns-nonTrig-V1-wpLoose"
0065 MVA_WPLoose = EleMVA_WP(
0066     idName = idNameLoose, mvaTag = mvaTag,
0067     cutCategory0 = " -0.265", # EB1 low pt
0068     cutCategory1 = " -0.556", # EB2 low pt
0069     cutCategory2 = " -0.551", # EE low pt
0070     cutCategory3 = " -0.072", # EB1
0071     cutCategory4 = " -0.286", # EB2
0072     cutCategory5 = " -0.267"  # EE
0073     )
0074 
0075 
0076 #
0077 # Finally, set up VID configuration for all cuts
0078 #
0079 
0080 # Create the PSet that will be fed to the MVA value map producer
0081 mvaEleID_Spring15_25ns_nonTrig_V1_producer_config = cms.PSet( 
0082     mvaName            = cms.string(mvaClassName),
0083     mvaTag             = cms.string(mvaTag),
0084     #
0085     # Category parameters
0086     nCategories         = cms.int32(6),
0087     categoryCuts        = cms.vstring(*EleMVA_6CategoriesCuts),
0088     # Weight files and variable definitions
0089     weightFileNames    = mvaSpring15NonTrigWeightFiles_V1,
0090     variableDefinition  = cms.string(mvaVariablesFile)
0091     )
0092 # Create the VPset's for VID cuts
0093 mvaEleID_Spring15_25ns_nonTrig_V1_wpLoose = configureVIDMVAEleID( MVA_WPLoose )
0094 mvaEleID_Spring15_25ns_nonTrig_V1_wp90    = configureVIDMVAEleID( MVA_WP90 )
0095 mvaEleID_Spring15_25ns_nonTrig_V1_wp80    = configureVIDMVAEleID( MVA_WP80 )
0096 
0097 
0098 # The MD5 sum numbers below reflect the exact set of cut variables
0099 # and values above. If anything changes, one has to
0100 # 1) comment out the lines below about the registry,
0101 # 2) run "calculateMD5 <this file name> <one of the VID config names just above>
0102 # 3) update the MD5 sum strings below and uncomment the lines again.
0103 #
0104 
0105 central_id_registry.register(mvaEleID_Spring15_25ns_nonTrig_V1_wpLoose.idName,
0106                              '99ff36834c4342110d84ea2350a1229c')
0107 central_id_registry.register(mvaEleID_Spring15_25ns_nonTrig_V1_wp90.idName,
0108                              'ac4fdc160eefe9eae7338601c02ed4bb')
0109 central_id_registry.register(mvaEleID_Spring15_25ns_nonTrig_V1_wp80.idName,
0110                              '113c47ceaea0fa687b8bd6d880eb4957')
0111 
0112 mvaEleID_Spring15_25ns_nonTrig_V1_wpLoose.isPOGApproved = cms.untracked.bool(True)
0113 mvaEleID_Spring15_25ns_nonTrig_V1_wp90.isPOGApproved    = cms.untracked.bool(True)
0114 mvaEleID_Spring15_25ns_nonTrig_V1_wp80.isPOGApproved    = cms.untracked.bool(True)