Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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