Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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 :
0020 #     https://indico.cern.ch/event/662751/contributions/2778043/attachments/1562017/2459674/EGamma_WorkShop_21.11.17_Debabrata.pdf
0021 
0022 #
0023 # First, define cut values
0024 #
0025 
0026 # Loose working point Barrel and Endcap
0027 idName = "cutBasedPhotonID-Fall17-94X-V1-loose"
0028 WP_Loose_EB = WorkingPoint_V2(
0029     idName    ,  # idName
0030     0.105    ,  # hOverECut
0031     0.0103   ,  # full5x5_SigmaIEtaIEtaCut
0032 # Isolation cuts are generally absIso < C1 + pt*C2, except for NeuHad is < C1 + pt*C2 + pt*pt*C3
0033     2.839     ,  # absPFChaHadIsoWithEACut_C1
0034     0         ,  # absPFChaHadIsoWithEACut_C2
0035     9.188    ,  # absPFNeuHadIsoWithEACut_C1
0036     0.0126    ,  # absPFNeuHadIsoWithEACut_C2 #################check for AllPV
0037     0.000026  ,  # absPFNeuHadIsoWithEACut_C3
0038     2.956     ,  # absPFPhoIsoWithEACut_C1
0039     0.0035       # absPFPhoIsoWithEACut_C2
0040     )
0041 WP_Loose_EE = WorkingPoint_V2(
0042     idName    ,  #idName
0043     0.029    ,  # hOverECut
0044     0.0276   ,  # full5x5_SigmaIEtaIEtaCut
0045 # Isolation cuts are generally absIso < C1 + pt*C2, except for NeuHad is < C1 + pt*C2 + pt*pt*C3
0046     2.150     ,  # absPFChaHadIsoWithEACut_C1
0047     0.00      ,  # absPFChaHadIsoWithEACut_C2
0048     10.471     ,  # absPFNeuHadIsoWithEACut_C1
0049     0.0119    ,  # absPFNeuHadIsoWithEACut_C2
0050     0.000025  ,  # absPFNeuHadIsoWithEACut_C3
0051     4.895     ,  # absPFPhoIsoWithEACut_C1
0052     0.0040       # absPFPhoIsoWithEACut_C2
0053     )
0054 
0055 # Medium working point Barrel and Endcap
0056 idName = "cutBasedPhotonID-Fall17-94X-V1-medium"
0057 WP_Medium_EB = WorkingPoint_V2(
0058     idName    ,  # idName
0059     0.035    ,  # hOverECut
0060     0.0103   ,  # full5x5_SigmaIEtaIEtaCut
0061 # Isolation cuts are generally absIso < C1 + pt*C2, except for NeuHad is < C1 + pt*C2 + pt*pt*C3
0062     1.416     ,  # absPFChaHadIsoWithEACut_C1
0063     0.00      ,  # absPFChaHadIsoWithEACut_C2
0064     2.491     ,  # absPFNeuHadIsoWithEACut_C1
0065     0.0126    ,  # absPFNeuHadIsoWithEACut_C2 
0066     0.000026  ,  # absPFNeuHadIsowithEACut_C3 
0067     2.952     ,  # absPFPhoIsoWithEACut_C1
0068     0.0040       # absPFPhoIsoWithEACut_C2
0069     )
0070 
0071 WP_Medium_EE = WorkingPoint_V2( #################check for AllPV
0072     idName    ,  #idName
0073     0.027    ,  # hOverECut  
0074     0.0271   ,  # full5x5_SigmaIEtaIEtaCut
0075 # Isolation cuts are generally absIso < C1 + pt*C2, except for NeuHad is < C1 + pt*C2 + pt*pt*C3
0076     1.012     ,  # absPFChaHadIsoWithEACut_C1
0077     0.00      ,  # absPFChaHadIsoWithEACut_C2
0078     9.131     ,  # absPFNeuHadIsoWithEACut_C1
0079     0.0119    ,  # absPFNeuHadIsoWithEACut_C2
0080     0.000025  ,  # absPFNeuHadIsowithEACut_C3 
0081     4.095     ,  # absPFPhoIsoWithEACut_C1
0082     0.0040       # absPFPhoIsoWithEACut_C2
0083     )
0084 
0085 # Tight working point Barrel and Endcap
0086 idName = "cutBasedPhotonID-Fall17-94X-V1-tight"
0087 WP_Tight_EB = WorkingPoint_V2(
0088     idName    ,  # idName
0089     0.020    ,  # hOverECut  
0090     0.0103   ,  # full5x5_SigmaIEtaIEtaCut
0091 # Isolation cuts are generally absIso < C1 + pt*C2, except for NeuHad is < C1 + pt*C2 + pt*pt*C3
0092     1.158     ,  # absPFChaHadIsoWithEACut_C1
0093     0.00      ,  # absPFChaHadIsoWithEACut_C2
0094     1.267     ,  # absPFNeuHadIsoWithEACut_C1
0095     0.0126    ,  # absPFNeuHadIsoWithEACut_C2
0096     0.000026  ,  # absPFNeuHadIsoWithEACut_C3
0097     2.065     ,  # absPFPhoIsoWithEACut_C1
0098     0.0035       # absPFPhoIsoWithEACut_C2
0099     )
0100 
0101 WP_Tight_EE = WorkingPoint_V2(
0102     idName    ,  #idName
0103     0.025    ,  # hOverECut 
0104     0.0271   ,  # full5x5_SigmaIEtaIEtaCut
0105 # Isolation cuts are generally absIso < C1 + pt*C2, except for NeuHad is < C1 + pt*C2 + pt*pt*C3
0106     0.575     ,  # absPFChaHadIsoWithEACut_C1
0107     0.00      ,  # absPFChaHadIsoWithEACut_C2
0108     8.916     ,  # absPFNeuHadIsoWithEACut_C1
0109     0.0119    ,  # absPFNeuHadIsoWithEACut_C2
0110     0.000025  ,  # absPFNeuHadIsowithEACut_C3    
0111     3.272     ,  # absPFPhoIsoWithEACut_C1
0112     0.0040       # 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/Fall17/effAreaPhotons_cone03_pfChargedHadrons_90percentBased_TrueVtx.txt",
0123     # neuHadIsolationMapName
0124     'photonIDValueMapProducer:phoNeutralHadronIsolation' ,
0125     # neuHadIsolationEffAreas
0126     "RecoEgamma/PhotonIdentification/data/Fall17/effAreaPhotons_cone03_pfNeutralHadrons_90percentBased_TrueVtx.txt" ,
0127     # phoIsolationMapName  
0128     "photonIDValueMapProducer:phoPhotonIsolation" ,
0129     # phoIsolationEffAreas
0130     "RecoEgamma/PhotonIdentification/data/Fall17/effAreaPhotons_cone03_pfPhotons_90percentBased_TrueVtx.txt"
0131 )
0132 
0133 #
0134 # Finally, set up VID configuration for all cuts
0135 #
0136 cutBasedPhotonID_Fall17_94X_V1_loose  = configureVIDCutBasedPhoID_V5 ( WP_Loose_EB, WP_Loose_EE, isoInputs)
0137 cutBasedPhotonID_Fall17_94X_V1_medium = configureVIDCutBasedPhoID_V5 ( WP_Medium_EB, WP_Medium_EE, isoInputs)
0138 cutBasedPhotonID_Fall17_94X_V1_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_Fall17_94X_V1_loose.idName,
0148                              '45515ee95e01fa36972ff7ba69186c97')
0149 central_id_registry.register(cutBasedPhotonID_Fall17_94X_V1_medium.idName,
0150                              '772f7921fa146b630e4dbe79e475a421')
0151 central_id_registry.register(cutBasedPhotonID_Fall17_94X_V1_tight.idName,
0152                              'e260fee6f9011fb13ff56d45cccd21c5')
0153 
0154 cutBasedPhotonID_Fall17_94X_V1_loose.isPOGApproved = cms.untracked.bool(True)
0155 cutBasedPhotonID_Fall17_94X_V1_medium.isPOGApproved = cms.untracked.bool(True)
0156 cutBasedPhotonID_Fall17_94X_V1_tight.isPOGApproved = cms.untracked.bool(True)