Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 
0002 import FWCore.ParameterSet.Config as cms
0003 
0004 # Barrel/endcap division in eta
0005 ebCutOff = 1.479
0006 
0007 # ===============================================
0008 # Define containers used by cut definitions
0009 # ===============================================
0010 
0011 
0012 class EleWorkingPoint_V2:
0013     """
0014     This is a container class to hold numerical cut values for either
0015     the barrel or endcap set of cuts for electron cut-based ID
0016     """
0017     def __init__(self, 
0018                  idName,
0019                  dEtaInCut,
0020                  dPhiInCut,
0021                  full5x5_sigmaIEtaIEtaCut,
0022                  hOverECut,
0023                  dxyCut,
0024                  dzCut,
0025                  absEInverseMinusPInverseCut,
0026                  relCombIsolationWithEALowPtCut,
0027                  relCombIsolationWithEAHighPtCut,
0028                  # conversion veto cut needs no parameters, so not mentioned
0029                  missingHitsCut
0030                  ):
0031         self.idName                       = idName                       
0032         self.dEtaInCut                    = dEtaInCut                   
0033         self.dPhiInCut                    = dPhiInCut                   
0034         self.full5x5_sigmaIEtaIEtaCut     = full5x5_sigmaIEtaIEtaCut    
0035         self.hOverECut                    = hOverECut                   
0036         self.dxyCut                       = dxyCut                      
0037         self.dzCut                        = dzCut                       
0038         self.absEInverseMinusPInverseCut  = absEInverseMinusPInverseCut 
0039         self.relCombIsolationWithEALowPtCut  = relCombIsolationWithEALowPtCut
0040         self.relCombIsolationWithEAHighPtCut = relCombIsolationWithEAHighPtCut
0041         # conversion veto cut needs no parameters, so not mentioned
0042         self.missingHitsCut               = missingHitsCut
0043 
0044 class EleWorkingPoint_V3:
0045     """
0046     This is a container class to hold numerical cut values for either
0047     the barrel or endcap set of cuts for electron cut-based ID
0048     With resepect to V2, the impact parameter cuts on dxy and dz are removed.
0049     """
0050     def __init__(self, 
0051                  idName,
0052                  dEtaInSeedCut,
0053                  dPhiInCut,
0054                  full5x5_sigmaIEtaIEtaCut,
0055                  hOverECut,
0056                  absEInverseMinusPInverseCut,
0057                  relCombIsolationWithEALowPtCut,
0058                  relCombIsolationWithEAHighPtCut,
0059                  # conversion veto cut needs no parameters, so not mentioned
0060                  missingHitsCut
0061                  ):
0062         self.idName                       = idName                       
0063         self.dEtaInSeedCut                = dEtaInSeedCut                   
0064         self.dPhiInCut                    = dPhiInCut                   
0065         self.full5x5_sigmaIEtaIEtaCut     = full5x5_sigmaIEtaIEtaCut    
0066         self.hOverECut                    = hOverECut                   
0067         self.absEInverseMinusPInverseCut  = absEInverseMinusPInverseCut 
0068         self.relCombIsolationWithEALowPtCut  = relCombIsolationWithEALowPtCut
0069         self.relCombIsolationWithEAHighPtCut = relCombIsolationWithEAHighPtCut
0070         # conversion veto cut needs no parameters, so not mentioned
0071         self.missingHitsCut               = missingHitsCut
0072 
0073 class EleWorkingPoint_V4:
0074     """
0075     This is a container class to hold numerical cut values for either
0076     the barrel or endcap set of cuts for electron cut-based ID
0077     With respect to V3, the hOverE cut is made energy and pileup dependent as presented in
0078     https://indico.cern.ch/event/662749/contributions/2763092/attachments/1545209/2425054/talk_electron_ID_2017.pdf
0079     """
0080     def __init__(self, 
0081                  idName,
0082                  dEtaInSeedCut,
0083                  dPhiInCut,
0084                  full5x5_sigmaIEtaIEtaCut,
0085                  hOverECut_C0,
0086                  hOverECut_CE,
0087                  hOverECut_Cr,
0088                  absEInverseMinusPInverseCut,
0089                  relCombIsolationWithEALowPtCut,
0090                  relCombIsolationWithEAHighPtCut,
0091                  # conversion veto cut needs no parameters, so not mentioned
0092                  missingHitsCut
0093                  ):
0094         self.idName                          = idName                       
0095         self.dEtaInSeedCut                   = dEtaInSeedCut                   
0096         self.dPhiInCut                       = dPhiInCut                   
0097         self.full5x5_sigmaIEtaIEtaCut        = full5x5_sigmaIEtaIEtaCut    
0098         self.hOverECut_C0                    = hOverECut_C0
0099         self.hOverECut_CE                    = hOverECut_CE
0100         self.hOverECut_Cr                    = hOverECut_Cr
0101         self.absEInverseMinusPInverseCut     = absEInverseMinusPInverseCut 
0102         self.relCombIsolationWithEALowPtCut  = relCombIsolationWithEALowPtCut
0103         self.relCombIsolationWithEAHighPtCut = relCombIsolationWithEAHighPtCut
0104         # conversion veto cut needs no parameters, so not mentioned
0105         self.missingHitsCut                  = missingHitsCut
0106 
0107 
0108 class EleWorkingPoint_V5:
0109     """
0110     This is a container class to hold numerical cut values for either
0111     the barrel or endcap set of cuts for electron cut-based ID
0112     With respect to V4, the isolation cut is made pt dependent as presented in the following meeting: https://indico.cern.ch/event/697079/
0113     """
0114     def __init__(self,
0115                  idName,
0116                  dEtaInSeedCut,
0117                  dPhiInCut,
0118                  full5x5_sigmaIEtaIEtaCut,
0119                  hOverECut_C0,
0120                  hOverECut_CE,
0121                  hOverECut_Cr,
0122                  absEInverseMinusPInverseCut,
0123                  relCombIsolationWithEACut_C0,
0124                  relCombIsolationWithEACut_Cpt,
0125                  # conversion veto cut needs no parameters, so not mentioned
0126                  missingHitsCut
0127                  ):
0128         self.idName                          = idName
0129         self.dEtaInSeedCut                   = dEtaInSeedCut
0130         self.dPhiInCut                       = dPhiInCut
0131         self.full5x5_sigmaIEtaIEtaCut        = full5x5_sigmaIEtaIEtaCut
0132         self.hOverECut_C0                    = hOverECut_C0
0133         self.hOverECut_CE                    = hOverECut_CE
0134         self.hOverECut_Cr                    = hOverECut_Cr
0135         self.absEInverseMinusPInverseCut     = absEInverseMinusPInverseCut
0136         self.relCombIsolationWithEACut_C0    = relCombIsolationWithEACut_C0
0137         self.relCombIsolationWithEACut_Cpt   = relCombIsolationWithEACut_Cpt
0138         # conversion veto cut needs no parameters, so not mentioned
0139         self.missingHitsCut                  = missingHitsCut
0140 
0141 
0142 
0143 
0144 class EleHLTSelection_V1:
0145     """
0146     This is a container class to hold numerical cut values for either
0147     the barrel or endcap set of cuts for electron cut-based HLT-safe preselection
0148     """
0149     def __init__(self, 
0150                  idName,
0151                  full5x5_sigmaIEtaIEtaCut,
0152                  dEtaInSeedCut,
0153                  dPhiInCut,
0154                  hOverECut,
0155                  absEInverseMinusPInverseCut,
0156                  # isolations
0157                  ecalPFClusterIsoLowPtCut,
0158                  ecalPFClusterIsoHighPtCut,
0159                  hcalPFClusterIsoLowPtCut,
0160                  hcalPFClusterIsoHighPtCut,
0161                  trkIsoSlopeTerm,
0162                  trkIsoSlopeStart,
0163                  trkIsoConstTerm,
0164                  #
0165                  normalizedGsfChi2Cut
0166                  ):
0167         self.idName                       = idName                       
0168         self.full5x5_sigmaIEtaIEtaCut     = full5x5_sigmaIEtaIEtaCut    
0169         self.dEtaInSeedCut                = dEtaInSeedCut                   
0170         self.dPhiInCut                    = dPhiInCut                   
0171         self.hOverECut                    = hOverECut                   
0172         self.absEInverseMinusPInverseCut  = absEInverseMinusPInverseCut 
0173         self.ecalPFClusterIsoLowPtCut     = ecalPFClusterIsoLowPtCut     
0174         self.ecalPFClusterIsoHighPtCut    = ecalPFClusterIsoHighPtCut    
0175         self.hcalPFClusterIsoLowPtCut     = hcalPFClusterIsoLowPtCut     
0176         self.hcalPFClusterIsoHighPtCut    = hcalPFClusterIsoHighPtCut    
0177         self.trkIsoSlopeTerm              = trkIsoSlopeTerm              
0178         self.trkIsoSlopeStart             = trkIsoSlopeStart             
0179         self.trkIsoConstTerm              = trkIsoConstTerm              
0180         #                                                                
0181         self.normalizedGsfChi2Cut       = normalizedGsfChi2Cut       
0182 
0183         
0184 # ==============================================================
0185 # Define individual cut configurations used by complete cut sets
0186 # ==============================================================
0187 
0188 
0189 # The mininum pt cut is set to 5 GeV
0190 def psetMinPtCut():
0191     return cms.PSet( 
0192         cutName = cms.string("MinPtCut"),
0193         minPt = cms.double(5.0),
0194         needsAdditionalProducts = cms.bool(False),
0195         isIgnored = cms.bool(False)                
0196         )
0197 
0198 # Take all particles in the eta ranges 0-ebCutOff and ebCutOff-2.5
0199 def psetPhoSCEtaMultiRangeCut():
0200     return cms.PSet( 
0201         cutName = cms.string("GsfEleSCEtaMultiRangeCut"),
0202         useAbsEta = cms.bool(True),
0203         allowedEtaRanges = cms.VPSet( 
0204             cms.PSet( minEta = cms.double(0.0), 
0205                       maxEta = cms.double(ebCutOff) ),
0206             cms.PSet( minEta = cms.double(ebCutOff), 
0207                       maxEta = cms.double(2.5) )
0208             ),
0209         needsAdditionalProducts = cms.bool(False),
0210         isIgnored = cms.bool(False)
0211         )
0212 
0213 # Configure the cut on full5x5 sigmaIEtaIEta
0214 def psetFull5x5SigmaIEtaIEtaCut(wpEB, wpEE):
0215     return cms.PSet( 
0216         cutName = cms.string('GsfEleEBEECut'),
0217         cutString = cms.string("full5x5_sigmaIetaIeta"),
0218         cutValueEB = cms.double( wpEB.full5x5_sigmaIEtaIEtaCut ),
0219         cutValueEE = cms.double( wpEE.full5x5_sigmaIEtaIEtaCut ),
0220         needsAdditionalProducts = cms.bool(False),
0221         isIgnored = cms.bool(False)
0222         )
0223 
0224 # Configure the cut on dEta seed
0225 def psetDEtaInSeedCut(wpEB, wpEE):
0226     valid_cut_condition = "? superCluster.isNonnull && superCluster.seed.isNonnull ?"
0227     actual_cut_string = "abs(deltaEtaSuperClusterTrackAtVtx - superCluster.eta + superCluster.seed.eta)"
0228     return cms.PSet( 
0229         cutName = cms.string('GsfEleEBEECut'),
0230         cutString = cms.string(valid_cut_condition + actual_cut_string + " : 999999."),
0231         cutValueEB = cms.double( wpEB.dEtaInSeedCut ),
0232         cutValueEE = cms.double( wpEE.dEtaInSeedCut ),
0233         needsAdditionalProducts = cms.bool(False),
0234         isIgnored = cms.bool(False)
0235         )
0236 
0237 # Configure dEtaIn cut
0238 def psetDEtaInCut(wpEB, wpEE):
0239     return cms.PSet( 
0240         cutName = cms.string('GsfEleEBEECut'),
0241         cutString = cms.string("abs(deltaEtaSuperClusterTrackAtVtx)"),
0242         cutValueEB = cms.double( wpEB.dEtaInCut ),
0243         cutValueEE = cms.double( wpEE.dEtaInCut ),
0244         needsAdditionalProducts = cms.bool(False),
0245         isIgnored = cms.bool(False)
0246         )
0247 
0248 # Configure dPhiIn cut
0249 def psetDPhiInCut(wpEB, wpEE):
0250     return cms.PSet( 
0251         cutName = cms.string('GsfEleEBEECut'),
0252         cutString = cms.string("abs(deltaPhiSuperClusterTrackAtVtx)"),
0253         cutValueEB = cms.double( wpEB.dPhiInCut ),
0254         cutValueEE = cms.double( wpEE.dPhiInCut ),
0255         needsAdditionalProducts = cms.bool(False),
0256         isIgnored = cms.bool(False)
0257         )
0258 
0259 # Configure H/E cut
0260 def psetHadronicOverEMCut(wpEB, wpEE):
0261     return cms.PSet( 
0262         cutName = cms.string('GsfEleEBEECut'),
0263         cutString = cms.string("hadronicOverEm"),
0264         cutValueEB = cms.double( wpEB.hOverECut ),
0265         cutValueEE = cms.double( wpEE.hOverECut ),
0266         needsAdditionalProducts = cms.bool(False),
0267         isIgnored = cms.bool(False)
0268         )
0269 
0270 # Configure energy and pileup dependent H/E cut
0271 def psetHadronicOverEMEnergyScaledCut(wpEB, wpEE):
0272     return cms.PSet( 
0273         cutName = cms.string('GsfEleHadronicOverEMEnergyScaledCut'),
0274         barrelC0 = cms.double( wpEB.hOverECut_C0 ),
0275         barrelCE = cms.double( wpEB.hOverECut_CE ),
0276         barrelCr = cms.double( wpEB.hOverECut_Cr ),
0277         endcapC0 = cms.double( wpEE.hOverECut_C0 ),
0278         endcapCE = cms.double( wpEE.hOverECut_CE ),
0279         endcapCr = cms.double( wpEE.hOverECut_Cr ),
0280         rho = cms.InputTag("fixedGridRhoFastjetAll"),
0281         barrelCutOff = cms.double(ebCutOff),
0282         needsAdditionalProducts = cms.bool(True),
0283         isIgnored = cms.bool(False)
0284         )
0285 
0286 
0287 # Configure |1/E-1/p| cut
0288 def psetEInerseMinusPInverseCut(wpEB, wpEE):
0289     return cms.PSet( 
0290         cutName = cms.string('GsfEleEBEECut'),
0291         cutString = cms.string("abs(1. - eSuperClusterOverP) / ecalEnergy"),
0292         cutValueEB = cms.double( wpEB.absEInverseMinusPInverseCut ),
0293         cutValueEE = cms.double( wpEE.absEInverseMinusPInverseCut ),
0294         needsAdditionalProducts = cms.bool(False),
0295         isIgnored = cms.bool(False)
0296         )
0297 
0298 # Configure ECAL PF Cluster isolation cut. Note that this cut requires
0299 # effective area constants file as input
0300 def psetEcalPFClusterIsoCut(wpEB, wpEE, ecalIsoInputs):
0301     return cms.PSet( 
0302         cutName = cms.string('GsfEleCalPFClusterIsoCut'),
0303         isoType = cms.int32( 0 ), # ECAL = 0, HCAL = 1, see cut class header for IsoType enum
0304         isoCutEBLowPt  = cms.double( wpEB.ecalPFClusterIsoLowPtCut  ),
0305         isoCutEBHighPt = cms.double( wpEB.ecalPFClusterIsoHighPtCut ),
0306         isoCutEELowPt  = cms.double( wpEE.ecalPFClusterIsoLowPtCut  ),
0307         isoCutEEHighPt = cms.double( wpEE.ecalPFClusterIsoHighPtCut ),
0308         isRelativeIso = cms.bool(True),
0309         ptCutOff = cms.double(20.0),          # high pT above this value, low pT below
0310         barrelCutOff = cms.double(ebCutOff),
0311         rho = cms.InputTag("fixedGridRhoFastjetCentralCalo"), # This rho is best for emulation 
0312         # while HLT uses ...AllCalo
0313         effAreasConfigFile = cms.FileInPath( ecalIsoInputs ),
0314         needsAdditionalProducts = cms.bool(True),
0315         isIgnored = cms.bool(False) 
0316         )
0317 
0318 # Configure HCAL PF Cluster isolation cut. Note that this cut requires
0319 # effective area constants file as input
0320 def psetHcalPFClusterIsoCut(wpEB, wpEE, hcalIsoInputs):
0321     return cms.PSet( 
0322         cutName = cms.string('GsfEleCalPFClusterIsoCut'),
0323         isoType = cms.int32( 1 ), # ECAL = 0, HCAL = 1, see cut class header for IsoType enum
0324         isoCutEBLowPt  = cms.double( wpEB.hcalPFClusterIsoLowPtCut  ),
0325         isoCutEBHighPt = cms.double( wpEB.hcalPFClusterIsoHighPtCut ),
0326         isoCutEELowPt  = cms.double( wpEE.hcalPFClusterIsoLowPtCut  ),
0327         isoCutEEHighPt = cms.double( wpEE.hcalPFClusterIsoHighPtCut ),
0328         isRelativeIso = cms.bool(True),
0329         ptCutOff = cms.double(20.0),          # high pT above this value, low pT below
0330         barrelCutOff = cms.double(ebCutOff),
0331         rho = cms.InputTag("fixedGridRhoFastjetCentralCalo"), # This rho is best for emulation
0332         # while HLT uses ...AllCalo
0333         effAreasConfigFile = cms.FileInPath( hcalIsoInputs ),
0334         needsAdditionalProducts = cms.bool(True),
0335         isIgnored = cms.bool(False) 
0336         )
0337 
0338 # Configure tracker isolation cut
0339 def psetTrkPtIsoCut(wpEB, wpEE):
0340     return cms.PSet( 
0341         cutName = cms.string('GsfEleTrkPtIsoCut'),
0342         # Three constants for the GsfEleTrkPtIsoCut
0343         #     cut = constTerm if Et < slopeStart
0344         #     cut = slopeTerm * (Et - slopeStart) + constTerm if Et >= slopeStart
0345         slopeTermEB = cms.double( wpEB.trkIsoSlopeTerm ),
0346         slopeTermEE = cms.double( wpEE.trkIsoSlopeTerm ),
0347         slopeStartEB = cms.double( wpEB.trkIsoSlopeStart ),
0348         slopeStartEE = cms.double( wpEE.trkIsoSlopeStart ),
0349         constTermEB = cms.double( wpEB.trkIsoConstTerm ),
0350         constTermEE = cms.double( wpEE.trkIsoConstTerm ),
0351         useHEEPIso = cms.bool(False),
0352         needsAdditionalProducts = cms.bool(False),
0353         isIgnored = cms.bool(False)
0354         )
0355 
0356 # Configure GsfTrack chi2/NDOF cut
0357 def psetNormalizedGsfChi2Cut(wpEB, wpEE):
0358     return cms.PSet( 
0359         cutName = cms.string('GsfEleEBEECut'),
0360         cutString = cms.string("? gsfTrack.isNonnull ? gsfTrack.normalizedChi2 : 999990."),
0361         cutValueEB = cms.double( wpEB.normalizedGsfChi2Cut ),
0362         cutValueEE = cms.double( wpEE.normalizedGsfChi2Cut ),
0363         needsAdditionalProducts = cms.bool(False),
0364         isIgnored = cms.bool(False)
0365         )
0366 
0367 def psetEffAreaPFIsoCut(wpEB, wpEE, isoInputs):
0368     return cms.PSet(
0369         cutName = cms.string('GsfEleEffAreaPFIsoCut'),
0370         isoCutEBLowPt  = cms.double( wpEB.relCombIsolationWithEALowPtCut  ),
0371         isoCutEBHighPt = cms.double( wpEB.relCombIsolationWithEAHighPtCut ),
0372         isoCutEELowPt  = cms.double( wpEE.relCombIsolationWithEALowPtCut  ),
0373         isoCutEEHighPt = cms.double( wpEE.relCombIsolationWithEAHighPtCut ),
0374         isRelativeIso = cms.bool(True),
0375         ptCutOff = cms.double(20.0),          # high pT above this value, low pT below
0376         barrelCutOff = cms.double(ebCutOff),
0377         rho = cms.InputTag("fixedGridRhoFastjetAll"),
0378         effAreasConfigFile = cms.FileInPath( isoInputs ),
0379         needsAdditionalProducts = cms.bool(True),
0380         isIgnored = cms.bool(False)
0381         )
0382 
0383 def psetRelPFIsoScaledCut(wpEB, wpEE, isoInputs):
0384     return cms.PSet(
0385         cutName                 = cms.string('GsfEleRelPFIsoScaledCut'),
0386         barrelC0                = cms.double(wpEB.relCombIsolationWithEACut_C0),
0387         endcapC0                = cms.double(wpEE.relCombIsolationWithEACut_C0),
0388         barrelCpt               = cms.double(wpEB.relCombIsolationWithEACut_Cpt),
0389         endcapCpt               = cms.double(wpEE.relCombIsolationWithEACut_Cpt),
0390         barrelCutOff            = cms.double(ebCutOff),
0391         rho                     = cms.InputTag("fixedGridRhoFastjetAll"),
0392         effAreasConfigFile      = cms.FileInPath( isoInputs ),
0393         needsAdditionalProducts = cms.bool(True),
0394         isIgnored               = cms.bool(False)
0395         )
0396 
0397 
0398 def psetConversionVetoCut():
0399     return cms.PSet(
0400         cutName = cms.string('GsfEleConversionVetoCut'),
0401         conversionSrc        = cms.InputTag('allConversions'),
0402         conversionSrcMiniAOD = cms.InputTag('reducedEgamma:reducedConversions'),
0403         beamspotSrc = cms.InputTag('offlineBeamSpot'),
0404         needsAdditionalProducts = cms.bool(True),
0405         isIgnored = cms.bool(False)
0406         )
0407 
0408 def psetMissingHitsCut(wpEB, wpEE):
0409     return cms.PSet(
0410         cutName = cms.string('GsfEleMissingHitsCut'),
0411         maxMissingHitsEB = cms.uint32( wpEB.missingHitsCut ),
0412         maxMissingHitsEE = cms.uint32( wpEE.missingHitsCut ),
0413         barrelCutOff = cms.double(ebCutOff),
0414         needsAdditionalProducts = cms.bool(False),
0415         isIgnored = cms.bool(False) 
0416         )
0417 
0418 def psetGsfEleDxyCut(wpEB, wpEE):
0419     return cms.PSet( cutName = cms.string('GsfEleDxyCut'),
0420         dxyCutValueEB = cms.double( wpEB.dxyCut ),
0421         dxyCutValueEE = cms.double( wpEE.dxyCut ),
0422         vertexSrc        = cms.InputTag("offlinePrimaryVertices"),
0423         vertexSrcMiniAOD = cms.InputTag("offlineSlimmedPrimaryVertices"),
0424         barrelCutOff = cms.double(ebCutOff),
0425         needsAdditionalProducts = cms.bool(True),
0426         isIgnored = cms.bool(False))
0427 
0428 def psetGsfEleDzCut(wpEB, wpEE):
0429     return cms.PSet( cutName = cms.string('GsfEleDzCut'),
0430         dzCutValueEB = cms.double( wpEB.dzCut ),
0431         dzCutValueEE = cms.double( wpEE.dzCut ),
0432         vertexSrc        = cms.InputTag("offlinePrimaryVertices"),
0433         vertexSrcMiniAOD = cms.InputTag("offlineSlimmedPrimaryVertices"),
0434         barrelCutOff = cms.double(ebCutOff),
0435         needsAdditionalProducts = cms.bool(True),
0436         isIgnored = cms.bool(False))
0437 
0438 # -----------------------------
0439 # Version V2 common definitions
0440 # -----------------------------
0441 
0442 # This cut set definition is in the old style, with everything configured
0443 # in one go. It is kept to minimize changes. New definitions should use
0444 # PSets defined above instead.
0445 def configureVIDCutBasedEleID_V2( wpEB, wpEE, isoInputs ):
0446     """
0447     This function configures the full cms.PSet for a VID ID and returns it.
0448     The inputs: two objects of the type WorkingPoint_V2, one
0449     containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
0450     The third argument is an object that contains information necessary
0451     for isolation calculations.
0452     """
0453     # print "VID: Configuring cut set %s" % wpEB.idName
0454     parameterSet =  cms.PSet(
0455         #
0456         idName = cms.string( wpEB.idName ), # same name stored in the _EB and _EE objects
0457         cutFlow = cms.VPSet(
0458             psetMinPtCut(),
0459             psetPhoSCEtaMultiRangeCut(),
0460             psetDEtaInCut(wpEB, wpEE),
0461             psetDPhiInCut(wpEB, wpEE),
0462             psetFull5x5SigmaIEtaIEtaCut(wpEB, wpEE),
0463             psetHadronicOverEMCut(wpEB, wpEE),
0464             psetGsfEleDxyCut(wpEB, wpEE),
0465             psetGsfEleDzCut(wpEB, wpEE),
0466             psetEInerseMinusPInverseCut(wpEB, wpEE),
0467             psetEffAreaPFIsoCut(wpEB, wpEE, isoInputs),
0468             psetConversionVetoCut(),
0469             psetMissingHitsCut(wpEB, wpEE)
0470         )
0471     )
0472     #
0473     return parameterSet
0474 
0475 
0476 # ==============================================================
0477 # Define the complete cut sets
0478 # ==============================================================
0479 
0480 def configureVIDCutBasedEleID_V3( wpEB, wpEE, isoInputs ):
0481     """
0482     This function configures the full cms.PSet for a VID ID and returns it.
0483     The inputs: two objects of the type WorkingPoint_V3, one
0484     containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
0485     The third argument is an object that contains information necessary
0486     for isolation calculations.
0487         In this version, the impact parameter cuts dxy and dz are not present
0488     """
0489     # print "VID: Configuring cut set %s" % wpEB.idName
0490     parameterSet =  cms.PSet(
0491         #
0492         idName = cms.string( wpEB.idName ), # same name stored in the _EB and _EE objects
0493         cutFlow = cms.VPSet(
0494             psetMinPtCut(),
0495             psetPhoSCEtaMultiRangeCut(),                        # eta cut
0496             psetDEtaInSeedCut(wpEB, wpEE),                      # dEtaIn seed cut
0497             psetDPhiInCut(wpEB, wpEE),                          # dPhiIn cut
0498             psetFull5x5SigmaIEtaIEtaCut(wpEB, wpEE),         # full 5x5 sigmaIEtaIEta cut
0499             psetHadronicOverEMCut(wpEB, wpEE),                  # H/E cut
0500             psetEInerseMinusPInverseCut(wpEB, wpEE),            # |1/e-1/p| cut
0501             psetEffAreaPFIsoCut(wpEB, wpEE, isoInputs),         # rel. comb. PF isolation cut
0502             psetConversionVetoCut(),
0503             psetMissingHitsCut(wpEB, wpEE)
0504             )
0505         )
0506     #
0507     return parameterSet
0508 
0509 def configureVIDCutBasedEleID_V4( wpEB, wpEE, isoInputs ):
0510     """
0511     This function configures the full cms.PSet for a VID ID and returns it.
0512     The inputs: two objects of the type WorkingPoint_V3, one
0513     containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
0514     The third argument is an object that contains information necessary
0515     for isolation calculations.
0516         In this version, the energy and pileup dependent hOverE is introduced
0517     """
0518     # print "VID: Configuring cut set %s" % wpEB.idName
0519     parameterSet =  cms.PSet(
0520         #
0521         idName = cms.string( wpEB.idName ), # same name stored in the _EB and _EE objects
0522         cutFlow = cms.VPSet(
0523             psetMinPtCut(),
0524             psetPhoSCEtaMultiRangeCut(),                        # eta cut
0525             psetDEtaInSeedCut(wpEB, wpEE),                      # dEtaIn seed cut
0526             psetDPhiInCut(wpEB, wpEE),                          # dPhiIn cut
0527             psetFull5x5SigmaIEtaIEtaCut(wpEB, wpEE),         # full 5x5 sigmaIEtaIEta cut
0528             psetHadronicOverEMEnergyScaledCut(wpEB, wpEE),      # H/E cut
0529             psetEInerseMinusPInverseCut(wpEB, wpEE),            # |1/e-1/p| cut
0530             psetEffAreaPFIsoCut(wpEB, wpEE, isoInputs),         # rel. comb. PF isolation cut
0531             psetConversionVetoCut(),
0532             psetMissingHitsCut(wpEB, wpEE)
0533             )
0534         )
0535     #
0536     return parameterSet
0537 
0538 def configureVIDCutBasedEleID_V5( wpEB, wpEE, isoInputs ):
0539     """
0540     This function configures the full cms.PSet for a VID ID and returns it.
0541     The inputs: two objects of the type WorkingPoint_V3, one
0542     containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
0543     The third argument is an object that contains information necessary
0544     for isolation calculations.
0545         In this version, the pt dependent isolation is introduced
0546     """
0547     # print "VID: Configuring cut set %s" % wpEB.idName
0548     parameterSet =  cms.PSet(
0549         #
0550         idName = cms.string( wpEB.idName ), # same name stored in the _EB and _EE objects
0551         cutFlow = cms.VPSet(
0552             psetMinPtCut(),
0553             psetPhoSCEtaMultiRangeCut(),                        # eta cut
0554             psetDEtaInSeedCut(wpEB, wpEE),                      # dEtaIn seed cut
0555             psetDPhiInCut(wpEB, wpEE),                          # dPhiIn cut
0556             psetFull5x5SigmaIEtaIEtaCut(wpEB, wpEE),         # full 5x5 sigmaIEtaIEta cut
0557             psetHadronicOverEMEnergyScaledCut(wpEB, wpEE),      # H/E cut
0558             psetEInerseMinusPInverseCut(wpEB, wpEE),            # |1/e-1/p| cut
0559             psetRelPFIsoScaledCut(wpEB, wpEE, isoInputs),       # rel. comb. PF isolation cut
0560             psetConversionVetoCut(),
0561             psetMissingHitsCut(wpEB, wpEE)
0562             )
0563         )
0564     #
0565     return parameterSet
0566 
0567 
0568 # -----------------------------
0569 # HLT-safe common definitions
0570 # -----------------------------
0571 
0572 
0573 def configureVIDCutBasedEleHLTPreselection_V1( wpEB, wpEE, ecalIsoInputs, hcalIsoInputs ):
0574     """
0575     This function configures the full cms.PSet for a VID ID and returns it.
0576     The inputs: two objects of the type EleHLTSelection_V1, one
0577     containing the cuts for the Barrel (EB) and the other one for the Endcap (EE).
0578     The third and fourth arguments are objects that contain information necessary
0579     for isolation calculations for ECAL and HCAL.
0580     """
0581     # print "VID: Configuring cut set %s" % wpEB.idName
0582     parameterSet = cms.PSet(
0583         idName = cms.string( wpEB.idName ), # same name stored in the _EB and _EE objects
0584         cutFlow = cms.VPSet(
0585             psetMinPtCut(),                                     # min pt cut
0586             psetPhoSCEtaMultiRangeCut(),                        # eta cut
0587             psetFull5x5SigmaIEtaIEtaCut(wpEB, wpEE),         # full 5x5 sigmaIEtaIEta cut
0588             psetDEtaInSeedCut(wpEB, wpEE),                      # dEtaIn seed cut
0589             psetDPhiInCut(wpEB, wpEE),                          # dPhiIn cut
0590             psetHadronicOverEMCut(wpEB, wpEE),                  # H/E cut
0591             psetEInerseMinusPInverseCut(wpEB, wpEE),            # |1/e-1/p| cut
0592             psetEcalPFClusterIsoCut(wpEB, wpEE, ecalIsoInputs),  # ECAL PF Cluster isolation
0593             psetHcalPFClusterIsoCut(wpEB, wpEE, hcalIsoInputs),  # HCAL PF Cluster isolation
0594             psetTrkPtIsoCut(wpEB, wpEE),                        # tracker isolation cut
0595             psetNormalizedGsfChi2Cut(wpEB, wpEE)                # GsfTrack chi2/NDOF cut
0596             )
0597         )
0598     #
0599     return parameterSet
0600