Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:47:55

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 HLTPath = "HLT_Ele*"
0004 HLTProcessName = "HLT"
0005 
0006 ##    ____      __ _____ _           _                   
0007 ##   / ___|___ / _| ____| | ___  ___| |_ _ __ ___  _ __  
0008 ##  | |  _/ __| |_|  _| | |/ _ \/ __| __| '__/ _ \| '_ \ 
0009 ##  | |_| \__ \  _| |___| |  __/ (__| |_| | | (_) | | | |
0010 ##   \____|___/_| |_____|_|\___|\___|\__|_|  \___/|_| |_|
0011 ##  
0012 #  GsfElectron ################ 
0013 
0014 GsfMatchedPhotonCands = cms.EDProducer("ElectronMatchedCandidateProducer",
0015    src     = cms.InputTag("goodPhotons"),
0016    ReferenceElectronCollection = cms.untracked.InputTag("goodElectrons"),
0017    deltaR =  cms.untracked.double(0.3)
0018 )
0019 
0020 ##    _____ _           _                     ___    _ 
0021 ##   | ____| | ___  ___| |_ _ __ ___  _ __   |_ _|__| |
0022 ##   |  _| | |/ _ \/ __| __| '__/ _ \| '_ \   | |/ _` |
0023 ##   | |___| |  __/ (__| |_| | | (_) | | | |  | | (_| |
0024 ##   |_____|_|\___|\___|\__|_|  \___/|_| |_| |___\__,_|
0025 ##   
0026 # Electron ID  ######
0027 
0028 
0029                          
0030 ##    _____     _                         __  __       _       _     _             
0031 ##   |_   _| __(_) __ _  __ _  ___ _ __  |  \/  | __ _| |_ ___| |__ (_)_ __   __ _ 
0032 ##     | || '__| |/ _` |/ _` |/ _ \ '__| | |\/| |/ _` | __/ __| '_ \| | '_ \ / _` |
0033 ##     | || |  | | (_| | (_| |  __/ |    | |  | | (_| | || (__| | | | | | | | (_| |
0034 ##     |_||_|  |_|\__, |\__, |\___|_|    |_|  |_|\__,_|\__\___|_| |_|_|_| |_|\__, |
0035 ##                |___/ |___/                                                |___/ 
0036 ##   
0037 # Trigger  ##################
0038 PassingHLT = cms.EDProducer("trgMatchGsfElectronProducer",    
0039     InputProducer = cms.InputTag( 'gedGsfElectrons' ),                          
0040     hltTags = cms.untracked.string( HLTPath ),
0041     triggerEventTag = cms.untracked.InputTag("hltTriggerSummaryAOD","",HLTProcessName),
0042     triggerResultsTag = cms.untracked.InputTag("TriggerResults","",HLTProcessName)   
0043 )
0044 
0045 # WElecTagHLT = PassingHLT.clone(
0046 #     InputProducer = cms.InputTag( "PassingWP80" )
0047 #     )
0048 
0049 # ele_sequence = cms.Sequence(
0050 #     goodElectrons +
0051 #     PassingWP80 +
0052 #     WElecTagHLT
0053 #     )
0054 
0055 
0056 import HLTrigger.HLTfilters.hltHighLevel_cfi
0057 ZSCHltFilter = HLTrigger.HLTfilters.hltHighLevel_cfi.hltHighLevel.clone(
0058     throw = cms.bool(False),
0059     HLTPaths = ['HLT_Ele27_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_Ele15_CaloIdT_CaloIsoVL_trackless_v*']
0060     )
0061 
0062 # elecMetSeq = cms.Sequence( WEnuHltFilter * ele_sequence * elecMetFilter )
0063 
0064 
0065 selectedElectrons = cms.EDFilter("GsfElectronRefSelector",
0066                                  src = cms.InputTag( 'gedGsfElectrons' ),
0067                                  cut = cms.string(
0068 #    "(abs(superCluster.eta)<2.5) && (energy*sin(superClusterPosition.theta)> 15)")
0069     "(abs(superCluster.eta)<3) && (energy*sin(superClusterPosition.theta)> 15)")
0070                                          )
0071 
0072 selectedMuons = cms.EDFilter("MuonRefSelector",
0073                                  src = cms.InputTag( 'muons' ),
0074                                  cut = cms.string("")
0075                                          )
0076 
0077 selectedPhotons = cms.EDFilter("PhotonRefSelector",
0078                                  src = cms.InputTag( 'gedPhotons' ),
0079                                  cut = cms.string(
0080     "(abs(superCluster.eta)<3) && (pt> 10)")
0081                                          )
0082 
0083 # This are the cuts at trigger level except ecalIso
0084 PassingVeryLooseId = selectedElectrons.clone(
0085     cut = cms.string(
0086     selectedElectrons.cut.value() +
0087     " && (gsfTrack.trackerExpectedHitsInner.numberOfHits<=1)" #wrt std WP90 allowing 1 numberOfMissingExpectedHits
0088     " && ((isEB"
0089     " && ( dr03TkSumPt/p4.Pt <0.2 "#&& dr03EcalRecHitSumEt/p4.Pt < 0.3
0090     " && dr03HcalTowerSumEt/p4.Pt  < 0.2 )"
0091     " && (sigmaIetaIeta<0.01)"
0092     " && ( -0.15<deltaPhiSuperClusterTrackAtVtx<0.15 )"
0093     " && ( -0.007<deltaEtaSuperClusterTrackAtVtx<0.007 )"
0094     " && (hadronicOverEm<0.12)"
0095     ")"
0096     " || (isEE"
0097     " && ( dr03TkSumPt/p4.Pt <0.2"
0098     #&& dr03EcalRecHitSumEt/p4.Pt < 0.3
0099     " && dr03HcalTowerSumEt/p4.Pt  < 0.2 )"
0100     " && (sigmaIetaIeta<0.03)"
0101     " && ( -0.10<deltaPhiSuperClusterTrackAtVtx<0.10 )"
0102     " && ( -0.009<deltaEtaSuperClusterTrackAtVtx<0.009 )"
0103     " && (hadronicOverEm<0.10) "
0104     "))"
0105     )
0106     )
0107 PassingMediumId = selectedElectrons.clone(
0108     cut = cms.string(
0109     selectedElectrons.cut.value() +
0110     " && (gsfTrack.trackerExpectedHitsInner.numberOfHits<=1)" #wrt std WP90 allowing 1 numberOfMissingExpectedHits
0111     " && ((isEB"
0112     " && ( dr03TkSumPt/p4.Pt <0.2 "#&& dr03EcalRecHitSumEt/p4.Pt < 0.3
0113     " && dr03HcalTowerSumEt/p4.Pt  < 0.2 )"
0114     " && (sigmaIetaIeta<0.01)"
0115     " && ( -0.06<deltaPhiSuperClusterTrackAtVtx<0.06 )"
0116     " && ( -0.004<deltaEtaSuperClusterTrackAtVtx<0.004 )"
0117     " && (hadronicOverEm<0.12)"
0118     ")"
0119     " || (isEE"
0120     " && ( dr03TkSumPt/p4.Pt <0.2"
0121     #&& dr03EcalRecHitSumEt/p4.Pt < 0.3
0122     " && dr03HcalTowerSumEt/p4.Pt  < 0.2 )"
0123     " && (sigmaIetaIeta<0.03)"
0124     " && ( -0.03<deltaPhiSuperClusterTrackAtVtx<0.03 )"
0125     " && ( -0.007<deltaEtaSuperClusterTrackAtVtx<0.007 )"
0126     " && (hadronicOverEm<0.10) "
0127     "))"
0128     )
0129     )
0130 
0131 PassingTightId = selectedElectrons.clone(
0132     cut = cms.string(
0133     selectedElectrons.cut.value() +
0134     " && (gsfTrack.trackerExpectedHitsInner.numberOfHits<=0)" #wrt std WP90 allowing 1 numberOfMissingExpectedHits
0135     " && ((isEB"
0136     " && ( dr03TkSumPt/p4.Pt <0.2 "#&& dr03EcalRecHitSumEt/p4.Pt < 0.3
0137     " && dr03HcalTowerSumEt/p4.Pt  < 0.2 )"
0138     " && (sigmaIetaIeta<0.01)"
0139     " && ( -0.03<deltaPhiSuperClusterTrackAtVtx<0.03 )"
0140     " && ( -0.004<deltaEtaSuperClusterTrackAtVtx<0.004 )"
0141     " && (hadronicOverEm<0.12)"
0142     ")"
0143     " || (isEE"
0144     " && ( dr03TkSumPt/p4.Pt <0.2"
0145     #&& dr03EcalRecHitSumEt/p4.Pt < 0.3
0146     " && dr03HcalTowerSumEt/p4.Pt  < 0.2 )"
0147     " && (sigmaIetaIeta<0.03)"
0148     " && ( -0.02<deltaPhiSuperClusterTrackAtVtx<0.02 )"
0149     " && ( -0.007<deltaEtaSuperClusterTrackAtVtx<0.007 )"
0150     " && (hadronicOverEm<0.10) "
0151     "))"
0152     )
0153     )
0154 
0155 PassingMuonVeryLooseId = selectedMuons.clone(
0156     cut = cms.string(
0157     selectedMuons.cut.value() +
0158     "(isPFMuon) && (isGlobalMuon || isTrackerMuon)"
0159     )
0160     )
0161 
0162 PassingPhotonVeryLooseId = selectedPhotons.clone(
0163     cut = cms.string(
0164     selectedPhotons.cut.value() +
0165     "&& ( (eta<1.479 && sigmaIetaIeta<0.02 && hadronicOverEm<0.06 )"
0166     "||"
0167     "( eta>=1.479 && sigmaIetaIeta<0.04 && hadronicOverEm<0.06 ) )"
0168     )
0169     )
0170     
0171 MuFilter = cms.EDFilter("CandViewCountFilter",
0172                          src = cms.InputTag("PassingMuonVeryLooseId"),
0173                          minNumber = cms.uint32(2)
0174                          )
0175 PhoFilter = cms.EDFilter("CandViewCountFilter",
0176                          src = cms.InputTag("PassingPhotonVeryLooseId"),
0177                          minNumber = cms.uint32(1)
0178                          ) 
0179 
0180 #------------------------------ electronID producer
0181 from Calibration.EleSelectionProducers.eleselectionproducers_cfi import *
0182 # process.EleSelectionProducers
0183 
0184 SCselector = cms.EDFilter("SuperClusterSelector",
0185                           src = cms.InputTag('correctedMulti5x5SuperClustersWithPreshower'),
0186                           cut = cms.string('(eta>2.4 || eta<-2.4) && (energy*sin(position.theta)> 15)')
0187                           )
0188 
0189 ### Build candidates from all the merged superclusters
0190 eleSC = cms.EDProducer('ConcreteEcalCandidateProducer',
0191                   src = cms.InputTag('SCselector'),
0192                   particleType = cms.string('gamma')
0193                   )
0194 
0195 selectedCands = cms.EDFilter("AssociatedVariableMaxCutCandRefSelector",
0196                              src = cms.InputTag("eleSelectionProducers:loose"),
0197                              max = cms.double(0.5)
0198                              )
0199 
0200 eleSelSeq = cms.Sequence( selectedElectrons + PassingVeryLooseId + PassingTightId + 
0201                           (SCselector*eleSC)
0202                           )
0203 
0204 muSelSeq = cms.Sequence( selectedMuons + PassingMuonVeryLooseId + PassingPhotonVeryLooseId + MuFilter + PhoFilter +
0205                           (SCselector*eleSC)
0206                           )
0207 
0208 ############################################################
0209 # Selectors
0210 ##############################
0211 ZeeSelector =  cms.EDProducer("CandViewShallowCloneCombiner",
0212                               decay = cms.string("PassingVeryLooseId PassingVeryLooseId"),
0213                               checkCharge = cms.bool(False),
0214                               cut   = cms.string("mass > 40 && mass < 140")
0215                               )
0216 
0217 
0218 #met, mt cuts for W selection
0219 MT="sqrt(2*daughter(0).pt*daughter(1).pt*(1 - cos(daughter(0).phi - daughter(1).phi)))"
0220 MET_CUT_MIN = 25.
0221 W_ELECTRON_ET_CUT_MIN = 30.0
0222 MT_CUT_MIN = 50.
0223 
0224 WenuSelector = cms.EDProducer("CandViewShallowCloneCombiner",
0225     decay = cms.string("pfMet PassingTightId"), # charge coniugate states are implied
0226     checkCharge = cms.bool(False),                           
0227     cut   = cms.string(("daughter(0).pt > %f && daughter(1).pt > %f && "+MT+" > %f") % (MET_CUT_MIN, W_ELECTRON_ET_CUT_MIN, MT_CUT_MIN))
0228 )
0229 
0230 
0231 EleSCSelector = cms.EDProducer("CandViewShallowCloneCombiner",
0232                                decay = cms.string("PassingVeryLooseId eleSC"),
0233 #                               decay = cms.string("selectedElectrons eleSC"),
0234 #                               decay = cms.string("PassingVeryLooseId photons"),
0235                                checkCharge = cms.bool(False), 
0236 #                               cut   = cms.string("40 <mass < 140 && daughter(0).pt>27")
0237                                cut = cms.string("40 < mass < 140 ")
0238                                )
0239 WZSelector = cms.EDProducer("CandViewMerger",
0240                             src = cms.VInputTag("WenuSelector", "ZeeSelector", "EleSCSelector")
0241                             )
0242 
0243  
0244 
0245 ############################################################
0246 # Filters
0247 ##############################
0248 WenuFilter = cms.EDFilter("CandViewCountFilter",
0249                           src = cms.InputTag("WenuSelector"),
0250                           minNumber = cms.uint32(1)
0251                           )
0252 # filter events with at least one Zee candidate as identified by the ZeeSelector
0253 ZeeFilter = cms.EDFilter("CandViewCountFilter",
0254                          src = cms.InputTag("ZeeSelector"),
0255                          minNumber = cms.uint32(1)
0256                          )
0257 
0258 MinZSCNumberFilter = cms.EDFilter("CandViewCountFilter",
0259                                   #src = cms.InputTag('SCselector'),
0260                                   src = cms.InputTag('eleSC'),
0261                                   minNumber = cms.uint32(1)
0262                                   )
0263 ZSCFilter = cms.EDFilter("CandViewCountFilter",
0264                          src = cms.InputTag("EleSCSelector"),
0265                          minNumber = cms.uint32(1)
0266                          )
0267 
0268 WZFilter = cms.EDFilter("CandViewCountFilter",
0269                         src = cms.InputTag("WZSelector"),
0270                         minNumber = cms.uint32(1)
0271                         )
0272 
0273 FilterSeq = cms.Sequence(eleSelSeq * (ZeeSelector + WenuSelector + EleSCSelector) * WZSelector)
0274 ZSCSingleEleFilterSeq = cms.Sequence(~ZSCHltFilter * eleSelSeq * EleSCSelector * ZSCFilter)
0275 FilterMuSeq = cms.Sequence(muSelSeq * (ZeeSelector + WenuSelector + EleSCSelector) * WZSelector)