Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:34:37

0001 from RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_tools import *
0002 
0003 mvaVariablesFile        = "RecoEgamma/PhotonIdentification/data/PhotonMVAEstimatorRun2VariablesSpring15ValMaps.txt"
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 Spring15 MC samples for non-triggering photons.
0012 # See more documentation in this presentation:
0013 #    https://indico.cern.ch/event/369233/contribution/3/material/slides/0.pdf
0014 #
0015 
0016 # This MVA implementation class name
0017 mvaSpring15NonTrigClassName = "PhotonMVAEstimator"
0018 # The tag is an extra string attached to the names of the products
0019 # such as ValueMaps that needs to distinguish cases when the same MVA estimator
0020 # class is used with different tuning/weights
0021 mvaTag = "Run2Spring15NonTrig50nsV0"
0022 
0023 # There are 2 categories in this MVA. They have to be configured in this strict order
0024 # (cuts and weight files order):
0025 #   0    barrel photons
0026 #   1    endcap photons
0027 
0028 mvaSpring15NonTrigWeightFiles_V0 = cms.vstring(
0029     path.join(weightFileBaseDir, "Spring15/50ns_EB_V0.weights.xml.gz"),
0030     path.join(weightFileBaseDir, "Spring15/50ns_EE_V0.weights.xml.gz"),
0031     )
0032 
0033 # The locatoins of value maps with the actual MVA values and categories
0034 # for all particles.
0035 # The names for the maps are "<module name>:<MVA class name>Values"
0036 # and "<module name>:<MVA class name>Categories"
0037 mvaProducerModuleLabel = "photonMVAValueMapProducer"
0038 mvaValueMapName        = mvaProducerModuleLabel + ":" + mvaSpring15NonTrigClassName + mvaTag + "Values"
0039 mvaCategoriesMapName   = mvaProducerModuleLabel + ":" + mvaSpring15NonTrigClassName + mvaTag + "Categories"
0040 
0041 # The working point for this MVA that is expected to have about 90% signal
0042 # efficiency in each category for photons with pt>30 GeV (somewhat lower
0043 # for lower pt photons).
0044 idName = "mvaPhoID-Spring15-50ns-nonTrig-V0-wp90"
0045 MVA_WP90 = PhoMVA_2Categories_WP(
0046     idName = idName,
0047     mvaValueMapName = mvaValueMapName,           # map with MVA values for all particles
0048     mvaCategoriesMapName = mvaCategoriesMapName, # map with category index for all particles
0049     cutCategory0 = 0.224, # EB
0050     cutCategory1 = 0.355  # EE
0051     )
0052 
0053 #
0054 # Finally, set up VID configuration for all cuts
0055 #
0056 
0057 # Create the PSet that will be fed to the MVA value map producer
0058 mvaPhoID_Spring15_50ns_nonTrig_V0_producer_config = cms.PSet(
0059     mvaName            = cms.string(mvaSpring15NonTrigClassName),
0060     mvaTag             = cms.string(mvaTag),
0061     weightFileNames    = mvaSpring15NonTrigWeightFiles_V0,
0062     variableDefinition  = cms.string(mvaVariablesFile),
0063     # Category parameters
0064     nCategories         = cms.int32(2),
0065     categoryCuts        = category_cuts
0066     )
0067 # Create the VPset's for VID cuts
0068 mvaPhoID_Spring15_50ns_nonTrig_V0_wp90 = configureVIDMVAPhoID_V1( MVA_WP90 )
0069 
0070 # The MD5 sum numbers below reflect the exact set of cut variables
0071 # and values above. If anything changes, one has to
0072 # 1) comment out the lines below about the registry,
0073 # 2) run "calculateMD5 <this file name> <one of the VID config names just above>
0074 # 3) update the MD5 sum strings below and uncomment the lines again.
0075 #
0076 
0077 central_id_registry.register( mvaPhoID_Spring15_50ns_nonTrig_V0_wp90.idName,
0078                               'f7632ecc85a3b775335fd9bf78f468df')
0079 
0080 mvaPhoID_Spring15_50ns_nonTrig_V0_wp90.isPOGApproved = cms.untracked.bool(False)