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