Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 from PhysicsTools.SelectorUtils.centralIDRegistry import central_id_registry
0002 
0003 import FWCore.ParameterSet.Config as cms
0004 
0005 # Common functions and classes for ID definition are imported here:
0006 from RecoEgamma.PhotonIdentification.Identification.cutBasedPhotonID_tools \
0007     import ( WorkingPoint_V2,
0008              IsolationCutInputs,
0009              configureVIDCutBasedPhoID_V5 )             
0010 
0011 # The cut values are taken from the twiki:
0012 #       https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedPhotonIdentificationRun2
0013 #       (where they may not stay, if a newer version of cuts becomes available for these
0014 #        conditions)
0015 
0016 # See also the presentation explaining these working points (this will not change):
0017 #     https://indico.cern.ch/event/732974/contributions/3072291/attachments/1685029/2709189/PhotonIDStudy.pdf
0018 
0019 
0020 #
0021 # First, define cut values
0022 #
0023 
0024 # Loose working point Barrel and Endcap
0025 idName = "cutBasedPhotonID-Fall17-94X-V2-loose"
0026 WP_Loose_EB = WorkingPoint_V2(
0027     idName    ,  # idName
0028     0.04596    ,  # hOverECut
0029     0.0106   ,  # full5x5_SigmaIEtaIEtaCut
0030 # Isolation cuts are generally absIso < C1 + pt*C2, except for NeuHad is < C1 + pt*C2 + pt*pt*C3
0031     1.694     ,  # absPFChaHadIsoWithEACut_C1
0032     0         ,  # absPFChaHadIsoWithEACut_C2
0033     24.032    ,  # absPFNeuHadIsoWithEACut_C1
0034     0.01512   ,  # absPFNeuHadIsoWithEACut_C2
0035     0.00002259 ,  # absPFNeuHadIsoWithEACut_C3
0036     2.876      ,  # absPFPhoIsoWithEACut_C1
0037     0.004017      # absPFPhoIsoWithEACut_C2
0038     )
0039 WP_Loose_EE = WorkingPoint_V2(
0040     idName    ,  #idName
0041     0.0590    ,  # hOverECut
0042     0.0272   ,  # full5x5_SigmaIEtaIEtaCut
0043 # Isolation cuts are generally absIso < C1 + pt*C2, except for NeuHad is < C1 + pt*C2 + pt*pt*C3
0044     2.089    ,  # absPFChaHadIsoWithEACut_C1
0045     0.00      ,  # absPFChaHadIsoWithEACut_C2
0046     19.722   ,  # absPFNeuHadIsoWithEACut_C1
0047     0.0117    ,  # absPFNeuHadIsoWithEACut_C2
0048     0.000023  ,  # absPFNeuHadIsoWithEACut_C3
0049     4.162     ,  # absPFPhoIsoWithEACut_C1
0050     0.0037       # absPFPhoIsoWithEACut_C2
0051     )
0052 
0053 # Medium working point Barrel and Endcap
0054 idName = "cutBasedPhotonID-Fall17-94X-V2-medium"
0055 WP_Medium_EB = WorkingPoint_V2(
0056     idName    ,  # idName
0057     0.02197      ,  # hOverECut
0058     0.01015      ,  # full5x5_SigmaIEtaIEtaCut
0059 # Isolation cuts are generally absIso < C1 + pt*C2, except for NeuHad is < C1 + pt*C2 + pt*pt*C3
0060     1.141    ,  # absPFChaHadIsoWithEACut_C1
0061     0.00      ,  # absPFChaHadIsoWithEACut_C2
0062     1.189    ,  # absPFNeuHadIsoWithEACut_C1
0063     0.01512   ,  # absPFNeuHadIsoWithEACut_C2
0064     0.00002259 ,  # absPFNeuHadIsowithEACut_C3 
0065     2.08     ,  # absPFPhoIsoWithEACut_C1
0066     0.004017      # absPFPhoIsoWithEACut_C2
0067     )
0068 
0069 WP_Medium_EE = WorkingPoint_V2(
0070     idName    ,  #idName
0071     0.0326    ,  # hOverECut
0072     0.0272    ,  # full5x5_SigmaIEtaIEtaCut
0073 # Isolation cuts are generally absIso < C1 + pt*C2, except for NeuHad is < C1 + pt*C2 + pt*pt*C3
0074     1.051    ,  # absPFChaHadIsoWithEACut_C1
0075     0.00      ,  # absPFChaHadIsoWithEACut_C2
0076     2.718    ,  # absPFNeuHadIsoWithEACut_C1
0077     0.0117    ,  # absPFNeuHadIsoWithEACut_C2
0078     0.000023  ,  # absPFNeuHadIsowithEACut_C3 
0079     3.867    ,  # absPFPhoIsoWithEACut_C1
0080     0.0037       # absPFPhoIsoWithEACut_C2
0081     )
0082 
0083 # Tight working point Barrel and Endcap
0084 idName = "cutBasedPhotonID-Fall17-94X-V2-tight"
0085 WP_Tight_EB = WorkingPoint_V2(
0086     idName    ,  # idName
0087     0.02148      ,  # hOverECut
0088     0.00996      ,  # full5x5_SigmaIEtaIEtaCut
0089 # Isolation cuts are generally absIso < C1 + pt*C2, except for NeuHad is < C1 + pt*C2 + pt*pt*C3
0090     0.65    ,  # absPFChaHadIsoWithEACut_C1
0091     0.00      ,  # absPFChaHadIsoWithEACut_C2
0092     0.317     ,  # absPFNeuHadIsoWithEACut_C1
0093     0.01512    ,  # absPFNeuHadIsoWithEACut_C2
0094     0.00002259 ,  # absPFNeuHadIsowithEACut_C3
0095     2.044     ,  # absPFPhoIsoWithEACut_C1
0096     0.004017      # absPFPhoIsoWithEACut_C2
0097     )
0098 
0099 WP_Tight_EE = WorkingPoint_V2(
0100     idName    ,  #idName
0101     0.0321    ,  # hOverECut
0102     0.0271   ,  # full5x5_SigmaIEtaIEtaCut
0103 # Isolation cuts are generally absIso < C1 + pt*C2, except for NeuHad is < C1 + pt*C2 + pt*pt*C3
0104     0.517    ,  # absPFChaHadIsoWithEACut_C1
0105     0.00      ,  # absPFChaHadIsoWithEACut_C2
0106     2.716    ,  # absPFNeuHadIsoWithEACut_C1
0107     0.0117    ,  # absPFNeuHadIsoWithEACut_C2
0108     0.000023  ,  # absPFNeuHadIsowithEACut_C3    
0109     3.032     ,  # absPFPhoIsoWithEACut_C1
0110     0.0037       # absPFPhoIsoWithEACut_C2
0111     )
0112 
0113 
0114 # Second, define where to find the precomputed isolations and what effective
0115 # areas to use for pile-up correction
0116 isoInputs = IsolationCutInputs(
0117     # chHadIsolationMapName  
0118     'photonIDValueMapProducer:phoChargedIsolation' ,
0119     # chHadIsolationEffAreas 
0120     "RecoEgamma/PhotonIdentification/data/Fall17/effAreaPhotons_cone03_pfChargedHadrons_90percentBased_V2.txt",
0121     # neuHadIsolationMapName
0122     'photonIDValueMapProducer:phoNeutralHadronIsolation' ,
0123     # neuHadIsolationEffAreas
0124     "RecoEgamma/PhotonIdentification/data/Fall17/effAreaPhotons_cone03_pfNeutralHadrons_90percentBased_V2.txt" ,
0125     # phoIsolationMapName  
0126     "photonIDValueMapProducer:phoPhotonIsolation" ,
0127     # phoIsolationEffAreas
0128     "RecoEgamma/PhotonIdentification/data/Fall17/effAreaPhotons_cone03_pfPhotons_90percentBased_V2.txt"
0129 )
0130 
0131 #
0132 # Finally, set up VID configuration for all cuts
0133 #
0134 cutBasedPhotonID_Fall17_94X_V2_loose  = configureVIDCutBasedPhoID_V5 ( WP_Loose_EB, WP_Loose_EE, isoInputs)
0135 cutBasedPhotonID_Fall17_94X_V2_medium = configureVIDCutBasedPhoID_V5 ( WP_Medium_EB, WP_Medium_EE, isoInputs)
0136 cutBasedPhotonID_Fall17_94X_V2_tight  = configureVIDCutBasedPhoID_V5 ( WP_Tight_EB, WP_Tight_EE, isoInputs)
0137 
0138 ## The MD5 sum numbers below reflect the exact set of cut variables
0139 # and values above. If anything changes, one has to 
0140 # 1) comment out the lines below about the registry, 
0141 # 2) run "calculateMD5 <this file name> <one of the VID config names just above>
0142 # 3) update the MD5 sum strings below and uncomment the lines again.
0143 #
0144 
0145 central_id_registry.register(cutBasedPhotonID_Fall17_94X_V2_loose.idName,
0146                              '4578dfcceb0bfd1ba5ac28973c843fd0')
0147 central_id_registry.register(cutBasedPhotonID_Fall17_94X_V2_medium.idName,
0148                              '28b186c301061395f394a81266c8d7de')
0149 central_id_registry.register(cutBasedPhotonID_Fall17_94X_V2_tight.idName,
0150                              '6f4f0ed6a8bf2de8dcf0bc3349b0546d')
0151 
0152 cutBasedPhotonID_Fall17_94X_V2_loose.isPOGApproved = cms.untracked.bool(True)
0153 cutBasedPhotonID_Fall17_94X_V2_medium.isPOGApproved = cms.untracked.bool(True)
0154 cutBasedPhotonID_Fall17_94X_V2_tight.isPOGApproved = cms.untracked.bool(True)