Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 
0002 from PhysicsTools.SelectorUtils.centralIDRegistry import central_id_registry
0003 
0004 import FWCore.ParameterSet.Config as cms
0005 
0006 # Common functions and classes for ID definition are imported here:
0007 from RecoEgamma.PhotonIdentification.Identification.cutBasedPhotonID_tools \
0008     import ( WorkingPoint_V2,
0009              IsolationCutInputs,
0010              configureVIDCutBasedPhoID_V5 )             
0011 
0012 #
0013 # This is the first version of Spring16 cuts for 80X samples
0014 #
0015 # The cut values are taken from the twiki:
0016 #       https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedPhotonIdentificationRun2
0017 #       (where they may not stay, if a newer version of cuts becomes available for these
0018 #        conditions)
0019 # See also the presentation explaining these working points (this will not change):
0020 #     https://indico.cern.ch/event/491548/contributions/2384977/attachments/1377936/2102914/CutBasedPhotonID_25-11-2016.pdf
0021 
0022 #
0023 # First, define cut values
0024 #
0025 
0026 # Loose working point Barrel and Endcap
0027 idName = "cutBasedPhotonID-Spring16-V2p2-loose"
0028 WP_Loose_EB = WorkingPoint_V2(
0029     idName    ,  # idName
0030     0.0597    ,  # hOverECut
0031     0.01031   ,  # full5x5_SigmaIEtaIEtaCut
0032 # Isolation cuts are generally absIso < C1 + pt*C2, except for NeuHad is < C1 + pt*C2 + pt*pt*C3
0033     1.295     ,  # absPFChaHadIsoWithEACut_C1
0034     0         ,  # absPFChaHadIsoWithEACut_C2
0035     10.910    ,  # absPFNeuHadIsoWithEACut_C1
0036     0.0148    ,  # absPFNeuHadIsoWithEACut_C2
0037     0.000017  ,  # absPFNeuHadIsoWithEACut_C3
0038     3.630     ,  # absPFPhoIsoWithEACut_C1
0039     0.0047       # absPFPhoIsoWithEACut_C2
0040     )
0041 WP_Loose_EE = WorkingPoint_V2(
0042     idName    ,  #idName
0043     0.0481    ,  # hOverECut
0044     0.03013   ,  # full5x5_SigmaIEtaIEtaCut
0045 # Isolation cuts are generally absIso < C1 + pt*C2, except for NeuHad is < C1 + pt*C2 + pt*pt*C3
0046     1.011     ,  # absPFChaHadIsoWithEACut_C1
0047     0.00      ,  # absPFChaHadIsoWithEACut_C2
0048     5.931     ,  # absPFNeuHadIsoWithEACut_C1
0049     0.0163    ,  # absPFNeuHadIsoWithEACut_C2
0050     0.000014  ,  # absPFNeuHadIsoWithEACut_C3
0051     6.641     ,  # absPFPhoIsoWithEACut_C1
0052     0.0034       # absPFPhoIsoWithEACut_C2
0053     )
0054 
0055 # Medium working point Barrel and Endcap
0056 idName = "cutBasedPhotonID-Spring16-V2p2-medium"
0057 WP_Medium_EB = WorkingPoint_V2(
0058     idName    ,  # idName
0059     0.0396    ,  # hOverECut
0060     0.01022   ,  # full5x5_SigmaIEtaIEtaCut
0061 # Isolation cuts are generally absIso < C1 + pt*C2, except for NeuHad is < C1 + pt*C2 + pt*pt*C3
0062     0.441     ,  # absPFChaHadIsoWithEACut_C1
0063     0.00      ,  # absPFChaHadIsoWithEACut_C2
0064     2.725     ,  # absPFNeuHadIsoWithEACut_C1
0065     0.0148    ,  # absPFNeuHadIsoWithEACut_C2
0066     0.000017  ,  # absPFNeuHadIsowithEACut_C3 
0067     2.571     ,  # absPFPhoIsoWithEACut_C1
0068     0.0047       # absPFPhoIsoWithEACut_C2
0069     )
0070 
0071 WP_Medium_EE = WorkingPoint_V2(
0072     idName    ,  #idName
0073     0.0219    ,  # hOverECut
0074     0.03001   ,  # full5x5_SigmaIEtaIEtaCut
0075 # Isolation cuts are generally absIso < C1 + pt*C2, except for NeuHad is < C1 + pt*C2 + pt*pt*C3
0076     0.442     ,  # absPFChaHadIsoWithEACut_C1
0077     0.00      ,  # absPFChaHadIsoWithEACut_C2
0078     1.715     ,  # absPFNeuHadIsoWithEACut_C1
0079     0.0163    ,  # absPFNeuHadIsoWithEACut_C2
0080     0.000014  ,  # absPFNeuHadIsowithEACut_C3 
0081     3.863     ,  # absPFPhoIsoWithEACut_C1
0082     0.0034       # absPFPhoIsoWithEACut_C2
0083     )
0084 
0085 # Tight working point Barrel and Endcap
0086 idName = "cutBasedPhotonID-Spring16-V2p2-tight"
0087 WP_Tight_EB = WorkingPoint_V2(
0088     idName    ,  # idName
0089     0.0269    ,  # hOverECut
0090     0.00994   ,  # full5x5_SigmaIEtaIEtaCut
0091 # Isolation cuts are generally absIso < C1 + pt*C2, except for NeuHad is < C1 + pt*C2 + pt*pt*C3
0092     0.202     ,  # absPFChaHadIsoWithEACut_C1
0093     0.00      ,  # absPFChaHadIsoWithEACut_C2
0094     0.264     ,  # absPFNeuHadIsoWithEACut_C1
0095     0.0148    ,  # absPFNeuHadIsoWithEACut_C2
0096     0.000017  ,  # absPFNeuHadIsowithEACut_C3
0097     2.362     ,  # absPFPhoIsoWithEACut_C1
0098     0.0047       # absPFPhoIsoWithEACut_C2
0099     )
0100 
0101 WP_Tight_EE = WorkingPoint_V2(
0102     idName    ,  #idName
0103     0.0213    ,  # hOverECut
0104     0.03000   ,  # full5x5_SigmaIEtaIEtaCut
0105 # Isolation cuts are generally absIso < C1 + pt*C2, except for NeuHad is < C1 + pt*C2 + pt*pt*C3
0106     0.034     ,  # absPFChaHadIsoWithEACut_C1
0107     0.00      ,  # absPFChaHadIsoWithEACut_C2
0108     0.586     ,  # absPFNeuHadIsoWithEACut_C1
0109     0.0163    ,  # absPFNeuHadIsoWithEACut_C2
0110     0.000014  ,  # absPFNeuHadIsowithEACut_C3    
0111     2.617     ,  # absPFPhoIsoWithEACut_C1
0112     0.0034       # absPFPhoIsoWithEACut_C2
0113     )
0114 
0115 
0116 # Second, define where to find the precomputed isolations and what effective
0117 # areas to use for pile-up correction
0118 isoInputs = IsolationCutInputs(
0119     # chHadIsolationMapName  
0120     'photonIDValueMapProducer:phoChargedIsolation' ,
0121     # chHadIsolationEffAreas 
0122     "RecoEgamma/PhotonIdentification/data/Spring16/effAreaPhotons_cone03_pfChargedHadrons_90percentBased.txt",
0123     # neuHadIsolationMapName
0124     'photonIDValueMapProducer:phoNeutralHadronIsolation' ,
0125     # neuHadIsolationEffAreas
0126     "RecoEgamma/PhotonIdentification/data/Spring16/effAreaPhotons_cone03_pfNeutralHadrons_90percentBased.txt" ,
0127     # phoIsolationMapName  
0128     "photonIDValueMapProducer:phoPhotonIsolation" ,
0129     # phoIsolationEffAreas
0130     "RecoEgamma/PhotonIdentification/data/Spring16/effAreaPhotons_cone03_pfPhotons_90percentBased.txt"
0131 )
0132 
0133 #
0134 # Finally, set up VID configuration for all cuts
0135 #
0136 cutBasedPhotonID_Spring16_V2p2_loose  = configureVIDCutBasedPhoID_V5 ( WP_Loose_EB, WP_Loose_EE, isoInputs)
0137 cutBasedPhotonID_Spring16_V2p2_medium = configureVIDCutBasedPhoID_V5 ( WP_Medium_EB, WP_Medium_EE, isoInputs)
0138 cutBasedPhotonID_Spring16_V2p2_tight  = configureVIDCutBasedPhoID_V5 ( WP_Tight_EB, WP_Tight_EE, isoInputs)
0139 
0140 ## The MD5 sum numbers below reflect the exact set of cut variables
0141 # and values above. If anything changes, one has to 
0142 # 1) comment out the lines below about the registry, 
0143 # 2) run "calculateMD5 <this file name> <one of the VID config names just above>
0144 # 3) update the MD5 sum strings below and uncomment the lines again.
0145 #
0146 
0147 central_id_registry.register(cutBasedPhotonID_Spring16_V2p2_loose.idName,
0148                              'd6ce6a4f3476294bf0a3261e00170daf')
0149 central_id_registry.register(cutBasedPhotonID_Spring16_V2p2_medium.idName,
0150                              'c739cfd0b6287b8586da187c06d4053f')
0151 central_id_registry.register(cutBasedPhotonID_Spring16_V2p2_tight.idName,
0152                              'bdb623bdb1a15c13545020a919dd9530')
0153 
0154 cutBasedPhotonID_Spring16_V2p2_loose.isPOGApproved = cms.untracked.bool(True)
0155 cutBasedPhotonID_Spring16_V2p2_medium.isPOGApproved = cms.untracked.bool(True)
0156 cutBasedPhotonID_Spring16_V2p2_tight.isPOGApproved = cms.untracked.bool(True)